Repository navigation
docs: publish the 0.2.0 site showcase #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }" | ||
| :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> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.