feat: add lightweight SQLite showcase streaming edition
This commit is contained in:
20 files changed
+918
-11
No files matched your search
@@ -9,6 +9,7 @@ import { useSpatialNavigation } from '@/composables/spatial-navigation'
|
||||
|
||||
const appRoot = ref<HTMLElement | null>(null)
|
||||
const router = useRouter()
|
||||
const showcase = import.meta.env.VITE_APP_EDITION === 'showcase'
|
||||
useSpatialNavigation(appRoot, { onBack: () => router.back() })
|
||||
</script>
|
||||
|
||||
@@ -23,8 +24,10 @@ useSpatialNavigation(appRoot, { onBack: () => router.back() })
|
||||
<BrandMark />
|
||||
<span>Easy Stream</span>
|
||||
</span>
|
||||
<span class="footer-dot" aria-hidden="true">•</span>
|
||||
<RouterLink to="/admin">Admin</RouterLink>
|
||||
<template v-if="!showcase">
|
||||
<span class="footer-dot" aria-hidden="true">•</span>
|
||||
<RouterLink to="/admin">Admin</RouterLink>
|
||||
</template>
|
||||
</footer>
|
||||
<PlayerShell />
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,7 @@ const ui = useUiStore()
|
||||
const router = useRouter()
|
||||
const { language, t } = useI18n()
|
||||
const searchTerm = ref('')
|
||||
const showcase = import.meta.env.VITE_APP_EDITION === 'showcase'
|
||||
|
||||
function submitSearch() {
|
||||
const query = searchTerm.value.trim()
|
||||
@@ -34,12 +35,12 @@ function toggleLanguage() {
|
||||
<RouterLink class="nav-link focus-ring" data-tv-focus data-focus-id="nav-catalog" to="/">
|
||||
{{ t('home') }}
|
||||
</RouterLink>
|
||||
<RouterLink class="nav-link focus-ring" data-tv-focus data-focus-id="nav-search" to="/search">
|
||||
<RouterLink v-if="!showcase" class="nav-link focus-ring" data-tv-focus data-focus-id="nav-search" to="/search">
|
||||
{{ t('search') }}
|
||||
</RouterLink>
|
||||
</nav>
|
||||
|
||||
<form class="header-search" role="search" @submit.prevent="submitSearch">
|
||||
<form v-if="!showcase" class="header-search" role="search" @submit.prevent="submitSearch">
|
||||
<svg aria-hidden="true" viewBox="0 0 24 24"><path d="m21 21-4.35-4.35m2.35-5.65a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z" /></svg>
|
||||
<input
|
||||
v-model="searchTerm"
|
||||
|
||||
Vendored
+1
@@ -1,6 +1,7 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_APP_EDITION?: 'production' | 'showcase'
|
||||
readonly VITE_API_BASE_URL?: string
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
|
||||
import AdminView from '@/views/AdminView.vue'
|
||||
import CatalogView from '@/views/CatalogView.vue'
|
||||
import BrowseView from '@/views/BrowseView.vue'
|
||||
import SearchView from '@/views/SearchView.vue'
|
||||
import TitleView from '@/views/TitleView.vue'
|
||||
|
||||
const showcase = import.meta.env.VITE_APP_EDITION === 'showcase'
|
||||
|
||||
export const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
scrollBehavior: (_to, _from, savedPosition) => savedPosition ?? { top: 0 },
|
||||
routes: [
|
||||
{ path: '/', name: 'catalog', component: CatalogView },
|
||||
{ path: '/search', name: 'search', component: SearchView },
|
||||
{ path: '/browse/:category', name: 'browse', component: BrowseView },
|
||||
...(!showcase ? [
|
||||
{ path: '/search', name: 'search', component: () => import('@/views/SearchView.vue') },
|
||||
{ path: '/browse/:category', name: 'browse', component: () => import('@/views/BrowseView.vue') },
|
||||
] : []),
|
||||
{ path: '/title/:slug', name: 'title', component: TitleView },
|
||||
{ path: '/admin', name: 'admin', component: AdminView },
|
||||
...(!showcase ? [{ path: '/admin', name: 'admin', component: () => import('@/views/AdminView.vue') }] : []),
|
||||
{ path: '/:pathMatch(.*)*', redirect: '/' },
|
||||
],
|
||||
})
|
||||
@@ -17,6 +17,7 @@ const loading = ref(true)
|
||||
const error = ref('')
|
||||
const { localize, t } = useI18n()
|
||||
const player = usePlayerStore()
|
||||
const showcase = import.meta.env.VITE_APP_EDITION === 'showcase'
|
||||
const items = computed(() => sections.value.flatMap((section) => section.items))
|
||||
const featured = computed(() => items.value.find((item) => item.playable) ?? items.value[0])
|
||||
const { restoreFocus } = useSpatialNavigation(root, { restoreKey: 'catalog-focus' })
|
||||
@@ -101,7 +102,7 @@ onMounted(() => void load())
|
||||
<section v-for="section in sections" :key="section.slug" class="catalog-section">
|
||||
<div class="section-heading">
|
||||
<h2>{{ section.name }}</h2>
|
||||
<RouterLink class="secondary-button focus-ring" data-tv-focus :to="{ name: 'browse', params: { category: section.slug } }">
|
||||
<RouterLink v-if="!showcase" class="secondary-button focus-ring" data-tv-focus :to="{ name: 'browse', params: { category: section.slug } }">
|
||||
{{ t('browseAll') }}
|
||||
</RouterLink>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user