Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,46 +33,48 @@ export default defineConfig({
})],
},
themeConfig: {
logo: { src: '/media/logo-small.svg', alt: 'Among Terminal' },
logo: {
light: '/media/logo-small.svg',
dark: '/media/logo-small-cream.svg',
alt: 'Among Terminal',
},
nav: [
{ text: 'Features', link: '/features/' },
{ text: 'Panes', link: '/panes/' },
{ text: 'Plugins', link: '/plugins/' },
{ text: 'Install', link: '/install/' },
],
sidebar: [
{
text: 'Using Among Terminal',
items: [
{ text: 'Start here', link: '/' },
{ text: 'Features', link: '/features/' },
{ text: 'Panes and workspaces', link: '/panes/' },
{ text: 'Terminal notifications', link: '/notifications/' },
{ text: 'Sessions', link: '/sessions/' },
{ text: 'Using plugins', link: '/plugins/' },
{ text: 'Keyboard shortcuts', link: '/shortcuts/' },
{ text: 'Preferences', link: '/preferences/' },
{ text: 'Using plugins', link: '/plugins/' },
],
},
{
text: 'Resources',
items: [
{ text: 'Video overview', link: '/overview/' },
{ text: 'Installation', link: '/install/' },
{ text: 'Licensing', link: '/licensing/' },
],
},
{
text: 'Development resources',
text: 'For contributors',
items: [
{ text: 'Plugin author guide and API', link: 'https://github.com/Among-Terminal/among-plugin-template' },
{ text: 'Contributing to Among', link: 'https://github.com/Among-Terminal/among/blob/main/CONTRIBUTING.md' },
{ text: 'Plugin development', link: '/plugin-development/' },
{ text: 'Building and contributing', link: '/build/' },
],
},
],
search: { provider: 'local' },
outline: [2, 3],
socialLinks: [{ icon: 'github', link: 'https://github.com/Among-Terminal/among' }],
footer: {
message: 'Apache-2.0 · <a href="/llms.txt">llms.txt</a> · <a href="/llms-full.txt">Full documentation for LLMs</a>',
message: 'Apache-2.0 · <a href="/licensing/">Licensing</a> · <a href="https://github.com/Among-Terminal/among">Source code</a>',
},
},
})
126 changes: 126 additions & 0 deletions .vitepress/theme/InstallCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<script setup>
import { computed, ref } from 'vue'

const packages = [
{
id: 'deb',
label: 'Debian / Ubuntu',
file: (arch) => `among-terminal-ubuntu24.04-${arch}.deb`,
command: (file) => `sudo apt install ./${file}`,
note: 'Ubuntu 24.04. Debian 13 uses the debian13 package.',
},
{
id: 'rpm',
label: 'Fedora',
file: (arch) => `among-terminal-fedora44-${arch}.rpm`,
command: (file) => `sudo dnf install ./${file}`,
note: 'Fedora 44. Fedora 43 uses the fedora43 package.',
},
{
id: 'appimage',
label: 'AppImage',
file: (arch) => `among-terminal-${arch}.AppImage`,
command: (file) => `chmod +x ${file} && ./${file}`,
note: 'Needs glibc 2.39 or newer. The host libraries are listed in the guide.',
},
{
id: 'archive',
label: 'Archive',
file: (arch) => `among-terminal-ubuntu24.04-${arch}.tar.gz`,
command: (file) =>
`mkdir -p ~/among && tar -xzf ${file} -C ~/among && ~/among/bin/among`,
note: 'Ubuntu 24.04 archive. Debian 13 uses the debian13 archive.',
},
]

const arch = ref('amd64')
const selected = ref('deb')
const copied = ref('')

const active = computed(() => packages.find((item) => item.id === selected.value))
const fileName = computed(() => active.value.file(arch.value))
const command = computed(() => active.value.command(fileName.value))
const download = computed(
() => `https://github.com/Among-Terminal/among/releases/latest/download/${fileName.value}`,
)
const checksum =
'sha256sum --check --ignore-missing SHA256SUMS'

async function copy(text, key) {
try {
await navigator.clipboard.writeText(text)
copied.value = key
window.setTimeout(() => {
if (copied.value === key) copied.value = ''
}, 1600)
} catch {
copied.value = ''
}
}
</script>

<template>
<section class="install-card" aria-labelledby="install-heading">
<div class="install-head">
<div>
<p class="install-eyebrow">Linux · 0.2.0</p>
<h2 id="install-heading">Install Among Terminal</h2>
</div>
<div class="install-arch" role="group" aria-label="Processor">
<button
v-for="value in ['amd64', 'arm64']"
:key="value"
type="button"
class="install-chip"
:class="{ active: arch === value }"
:aria-pressed="arch === value"
@click="arch = value"
>
{{ value === 'amd64' ? 'x86-64' : 'ARM64' }}
</button>
</div>
</div>

<div class="install-tabs" role="tablist" aria-label="Package type">
<button
v-for="item in packages"
:key="item.id"
type="button"
class="install-tab"
:class="{ active: selected === item.id }"
role="tab"
:aria-selected="selected === item.id"
@click="selected = item.id"
>
{{ item.label }}
</button>
</div>

<div class="install-rows">
<div class="install-row">
<span class="install-label">Package</span>
<code class="install-value">{{ fileName }}</code>
<a class="install-download" :href="download">Download</a>
</div>
<div class="install-row">
<span class="install-label">Command</span>
<code class="install-value">{{ command }}</code>
<button type="button" class="install-copy" @click="copy(command, 'command')">
{{ copied === 'command' ? 'Copied' : 'Copy' }}
</button>
</div>
<div class="install-row">
<span class="install-label">Verify</span>
<code class="install-value">{{ checksum }}</code>
<button type="button" class="install-copy" @click="copy(checksum, 'checksum')">
{{ copied === 'checksum' ? 'Copied' : 'Copy' }}
</button>
</div>
</div>
<p class="install-note">{{ active.note }}</p>
<p class="install-more">
<a href="/install/">Full installation guide</a> ·
<a href="https://github.com/Among-Terminal/among/releases/latest/download/SHA256SUMS">SHA256SUMS</a>
</p>
</section>
</template>
52 changes: 52 additions & 0 deletions .vitepress/theme/LandingVideo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<script setup>
import { ref } from 'vue'

const video = ref(null)
const started = ref(false)

async function play() {
if (!video.value) return
video.value.muted = false
video.value.volume = 1
started.value = true
try {
await video.value.play()
video.value.focus()
} catch {
started.value = false
}
}

function reset() {
started.value = false
if (video.value) {
video.value.pause()
video.value.currentTime = 0
}
}
</script>

<template>
<div class="landing-player" :class="{ started }">
<video
ref="video"
class="landing-player-video"
src="/media/app/overview.mp4"
poster="/media/app/overview-poster.png"
preload="metadata"
playsinline
:controls="started"
@ended="reset"
></video>
<button
v-if="!started"
type="button"
class="landing-play"
aria-label="Play the Among Terminal overview with sound"
@click="play"
>
<span class="landing-play-icon" aria-hidden="true"></span>
<span class="landing-play-label">Watch the overview</span>
</button>
</div>
</template>
11 changes: 11 additions & 0 deletions .vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup>
import DefaultTheme from 'vitepress/theme'
import MediaPreview from './MediaPreview.vue'

const { Layout } = DefaultTheme
</script>

<template>
<Layout />
<MediaPreview />
</template>
71 changes: 71 additions & 0 deletions .vitepress/theme/MediaPreview.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<script setup>
import { nextTick, onBeforeUnmount, onMounted, ref } from 'vue'

const dialog = ref(null)
const closeButton = ref(null)
const source = ref('')
const alt = ref('')
let trigger = null

function open(event) {
if (event.defaultPrevented || event.button !== 0) return
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return
const target = event.target
if (!(target instanceof Element)) return
const anchor = target.closest('a')
if (!anchor || !anchor.closest('.vp-doc, .showcase')) return
const image = anchor.querySelector('img')
if (!image) return
const href = anchor.getAttribute('href') || ''
if (!/\.(?:png|jpe?g|gif|webp|svg|avif)(?:[?#]|$)/i.test(href)) return
event.preventDefault()
source.value = image.currentSrc || image.src
alt.value = image.alt || ''
trigger = anchor
dialog.value.showModal()
document.body.classList.add('media-preview-open')
nextTick(() => closeButton.value?.focus())
}

function close() {
dialog.value?.close()
}

function onClose() {
document.body.classList.remove('media-preview-open')
trigger?.focus({ preventScroll: true })
trigger = null
}

function onBackdrop(event) {
if (event.target === dialog.value) close()
}

onMounted(() => document.addEventListener('click', open, true))
onBeforeUnmount(() => {
document.removeEventListener('click', open, true)
document.body.classList.remove('media-preview-open')
})
</script>

<template>
<dialog
ref="dialog"
class="media-preview"
aria-label="Image preview"
@close="onClose"
@click="onBackdrop"
>
<button
ref="closeButton"
type="button"
class="media-preview-close"
aria-label="Close image preview"
@click="close"
>
×
</button>
<img v-if="source" :src="source" :alt="alt">
<p v-if="alt" class="media-preview-caption">{{ alt }}</p>
</dialog>
</template>
75 changes: 75 additions & 0 deletions .vitepress/theme/PluginComparison.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<script setup>
import { onBeforeUnmount, onMounted, ref } from 'vue'

const props = defineProps({
before: { type: String, required: true },
after: { type: String, required: true },
beforeAlt: { type: String, default: 'Without the plugin' },
afterAlt: { type: String, default: 'With the plugin' },
caption: { type: String, default: '' },
})

const showAfter = ref(false)
const playing = ref(false)
let timer = null

function schedule() {
if (timer) clearInterval(timer)
timer = null
if (!playing.value) return
timer = setInterval(() => {
showAfter.value = !showAfter.value
}, 2000)
}

function toggle() {
playing.value = !playing.value
schedule()
}

onMounted(() => {
if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
playing.value = true
schedule()
}
})

onBeforeUnmount(() => {
if (timer) clearInterval(timer)
})
</script>

<template>
<figure class="plugin-comparison">
<div class="comparison-frame">
<div
class="comparison-layer comparison-before"
:class="{ hidden: showAfter }"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
:inert="showAfter"
:aria-hidden="showAfter"
>
<a :href="props.before"><img class="comparison-image" :src="props.before" :alt="props.beforeAlt"></a>
</div>
<div
class="comparison-layer comparison-after"
:class="{ visible: showAfter }"
:inert="!showAfter"
:aria-hidden="!showAfter"
>
<a :href="props.after"><img class="comparison-image" :src="props.after" :alt="props.afterAlt"></a>
</div>
<span class="comparison-tag" aria-live="polite">
{{ showAfter ? 'With plugin' : 'Without plugin' }}
</span>
<button
type="button"
class="comparison-toggle"
:aria-label="playing ? 'Pause the plugin comparison' : 'Play the plugin comparison'"
@click="toggle"
>
{{ playing ? 'Pause' : 'Play' }}
</button>
</div>
<figcaption v-if="props.caption">{{ props.caption }}</figcaption>
</figure>
</template>
Loading