2020-12-09 14:33:29 +01:00
|
|
|
<template>
|
2022-01-12 12:27:08 +01:00
|
|
|
<div class="w-full min-h-screen px-1vw reset" :class="[theme]">
|
2022-01-13 06:12:06 +01:00
|
|
|
<NavBar />
|
2021-07-07 16:18:09 +02:00
|
|
|
<router-view v-slot="{ Component }">
|
|
|
|
<keep-alive :max="5">
|
2021-10-08 20:52:51 +02:00
|
|
|
<component :is="Component" :key="$route.fullPath" />
|
2021-07-07 16:18:09 +02:00
|
|
|
</keep-alive>
|
|
|
|
</router-view>
|
2021-03-29 08:38:29 +02:00
|
|
|
|
2022-07-20 22:20:10 +02:00
|
|
|
<footer class="text-center my-2">
|
2021-05-10 20:14:28 +02:00
|
|
|
<a aria-label="GitHub" href="https://github.com/TeamPiped/Piped">
|
2021-12-27 23:33:55 +01:00
|
|
|
<font-awesome-icon :icon="['fab', 'github']" />
|
2021-03-29 08:38:29 +02:00
|
|
|
</a>
|
2021-12-27 15:46:39 +01:00
|
|
|
<a class="ml-2" href="https://github.com/TeamPiped/Piped#donations">
|
2021-12-27 23:33:55 +01:00
|
|
|
<font-awesome-icon :icon="['fab', 'bitcoin']" />
|
2022-07-20 22:20:10 +02:00
|
|
|
<span class="ml-1" v-t="'actions.donations'" />
|
2021-03-29 08:38:29 +02:00
|
|
|
</a>
|
2021-12-27 15:46:30 +01:00
|
|
|
</footer>
|
2020-12-09 14:33:29 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-04-08 17:46:49 +02:00
|
|
|
import NavBar from "./components/NavBar.vue";
|
2020-12-09 14:33:29 +01:00
|
|
|
export default {
|
2021-04-01 00:09:39 +02:00
|
|
|
components: {
|
2022-01-13 06:12:06 +01:00
|
|
|
NavBar,
|
2021-05-10 20:14:28 +02:00
|
|
|
},
|
2021-07-18 22:20:35 +02:00
|
|
|
mounted() {
|
2021-08-22 12:27:09 +02:00
|
|
|
if (this.getPreferenceBoolean("watchHistory", false))
|
|
|
|
if ("indexedDB" in window) {
|
|
|
|
const request = indexedDB.open("piped-db", 1);
|
2022-01-01 15:53:55 +01:00
|
|
|
request.onupgradeneeded = function () {
|
2021-08-22 12:27:09 +02:00
|
|
|
const db = request.result;
|
|
|
|
console.log("Upgrading object store.");
|
|
|
|
if (!db.objectStoreNames.contains("watch_history")) {
|
|
|
|
const store = db.createObjectStore("watch_history", { keyPath: "videoId" });
|
|
|
|
store.createIndex("video_id_idx", "videoId", { unique: true });
|
|
|
|
store.createIndex("id_idx", "id", { unique: true, autoIncrement: true });
|
|
|
|
}
|
|
|
|
};
|
|
|
|
request.onsuccess = e => {
|
|
|
|
window.db = e.target.result;
|
|
|
|
};
|
|
|
|
} else console.log("This browser doesn't support IndexedDB");
|
2021-08-25 18:30:21 +02:00
|
|
|
|
|
|
|
const App = this;
|
|
|
|
|
2022-01-01 15:53:55 +01:00
|
|
|
(async function () {
|
2022-06-26 03:53:06 +02:00
|
|
|
const defaultLang = await App.defaultLangage;
|
|
|
|
const locale = App.getPreferenceString("hl", defaultLang);
|
2021-10-27 02:59:03 +02:00
|
|
|
if (locale !== App.TimeAgoConfig.locale) {
|
2022-01-12 06:39:36 +01:00
|
|
|
const localeTime = await import(
|
|
|
|
"./../node_modules/javascript-time-ago/locale/" + locale + ".json"
|
|
|
|
).then(module => module.default);
|
2021-10-27 02:59:03 +02:00
|
|
|
App.TimeAgo.addLocale(localeTime);
|
|
|
|
App.TimeAgoConfig.locale = locale;
|
|
|
|
}
|
2021-08-25 18:30:21 +02:00
|
|
|
if (window.i18n.global.locale.value !== locale) {
|
|
|
|
if (!window.i18n.global.availableLocales.includes(locale)) {
|
2021-12-28 15:39:20 +01:00
|
|
|
const messages = await import(`./locales/${locale}.json`).then(module => module.default);
|
2021-08-25 18:30:21 +02:00
|
|
|
window.i18n.global.setLocaleMessage(locale, messages);
|
|
|
|
}
|
|
|
|
window.i18n.global.locale.value = locale;
|
|
|
|
}
|
|
|
|
})();
|
2021-07-18 22:20:35 +02:00
|
|
|
},
|
2020-12-09 14:33:29 +01:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
2021-06-28 18:23:24 +02:00
|
|
|
h1,
|
|
|
|
p,
|
|
|
|
a,
|
|
|
|
b {
|
|
|
|
unicode-bidi: plaintext;
|
|
|
|
text-align: start;
|
|
|
|
}
|
|
|
|
|
2020-12-09 14:33:29 +01:00
|
|
|
::-webkit-scrollbar {
|
|
|
|
background-color: #15191a;
|
|
|
|
}
|
|
|
|
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
|
|
background-color: #4b4f52;
|
|
|
|
}
|
|
|
|
|
|
|
|
::-webkit-scrollbar-thumb:hover {
|
|
|
|
background-color: #5b6469;
|
|
|
|
}
|
|
|
|
|
|
|
|
::-webkit-scrollbar-thumb:active {
|
|
|
|
background-color: #485053;
|
|
|
|
}
|
|
|
|
|
|
|
|
::-webkit-scrollbar-corner {
|
|
|
|
background-color: #0b0e0f;
|
|
|
|
}
|
|
|
|
|
2021-02-24 10:35:41 +01:00
|
|
|
* {
|
|
|
|
scrollbar-color: #15191a #444a4e;
|
2021-12-27 15:46:36 +01:00
|
|
|
@apply font-sans;
|
2021-02-24 10:35:41 +01:00
|
|
|
}
|
2021-10-31 18:44:36 +01:00
|
|
|
|
2021-12-27 15:46:22 +01:00
|
|
|
.video-grid {
|
2022-08-17 15:34:57 +02:00
|
|
|
@apply grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 col-auto lt-md:gap-x-2.5 md:gap-x-1vw gap-y-1.5;
|
2021-10-31 18:44:36 +01:00
|
|
|
}
|
2021-10-31 19:36:47 +01:00
|
|
|
|
2021-12-27 15:46:26 +01:00
|
|
|
.btn {
|
2022-08-17 15:34:57 +02:00
|
|
|
@apply h-full py-2 lt-md:px-2 md:px-4 rounded cursor-pointer;
|
2021-12-27 15:46:26 +01:00
|
|
|
}
|
|
|
|
|
2021-12-27 15:46:34 +01:00
|
|
|
.reset {
|
|
|
|
@apply text-black bg-white;
|
|
|
|
}
|
|
|
|
|
2021-12-27 15:46:36 +01:00
|
|
|
.auto {
|
2022-08-17 15:34:57 +02:00
|
|
|
@apply @dark:(text-white bg-dark-900);
|
2021-12-27 15:46:36 +01:00
|
|
|
}
|
|
|
|
|
2021-12-27 15:46:26 +01:00
|
|
|
.dark {
|
2021-12-27 15:46:34 +01:00
|
|
|
@apply text-white bg-dark-900;
|
2021-12-27 15:46:26 +01:00
|
|
|
}
|
|
|
|
|
2021-12-28 01:04:20 +01:00
|
|
|
.input,
|
|
|
|
.select,
|
|
|
|
.btn {
|
2022-01-12 12:59:50 +01:00
|
|
|
@apply w-auto text-gray-600 bg-gray-300;
|
|
|
|
}
|
|
|
|
|
|
|
|
.input,
|
|
|
|
.select {
|
|
|
|
@apply h-8;
|
|
|
|
}
|
|
|
|
|
2022-01-12 12:27:08 +01:00
|
|
|
.checkbox {
|
|
|
|
@apply h-4 w-4;
|
2021-12-28 01:04:20 +01:00
|
|
|
}
|
|
|
|
|
2021-12-27 15:46:29 +01:00
|
|
|
.dark .input,
|
|
|
|
.dark .select,
|
|
|
|
.dark .btn {
|
2021-12-28 01:04:20 +01:00
|
|
|
@apply text-gray-400 bg-dark-400;
|
|
|
|
}
|
|
|
|
|
|
|
|
.auto .input,
|
|
|
|
.auto .select,
|
|
|
|
.auto .btn {
|
2022-08-17 15:34:57 +02:00
|
|
|
@apply @dark:(text-gray-400 bg-dark-400);
|
2021-12-27 15:46:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.input {
|
|
|
|
@apply pl-2.5;
|
2021-12-27 15:46:29 +01:00
|
|
|
}
|
|
|
|
|
2021-12-28 01:04:20 +01:00
|
|
|
hr {
|
|
|
|
@apply !mt-2 !mb-3 border-gray-300;
|
|
|
|
}
|
|
|
|
|
2021-12-27 15:46:29 +01:00
|
|
|
.dark hr {
|
|
|
|
@apply border-dark-100;
|
|
|
|
}
|
|
|
|
|
2021-12-28 01:04:20 +01:00
|
|
|
.auto hr {
|
2022-08-17 15:34:57 +02:00
|
|
|
@apply @dark:border-dark-100;
|
2021-12-27 15:46:29 +01:00
|
|
|
}
|
|
|
|
|
2022-01-12 12:27:08 +01:00
|
|
|
h1,
|
|
|
|
h2 {
|
|
|
|
@apply m-0 font-bold;
|
|
|
|
}
|
|
|
|
|
2021-12-28 01:04:20 +01:00
|
|
|
h1 {
|
2022-01-12 12:27:08 +01:00
|
|
|
@apply !text-5xl;
|
|
|
|
}
|
|
|
|
|
|
|
|
h2 {
|
|
|
|
@apply !text-3xl;
|
|
|
|
}
|
|
|
|
|
|
|
|
.table {
|
|
|
|
@apply w-full text-lg text-left font-light border;
|
2021-10-31 19:36:47 +01:00
|
|
|
}
|
2021-12-27 15:46:30 +01:00
|
|
|
|
|
|
|
.link {
|
2021-12-27 15:46:34 +01:00
|
|
|
@apply hover:(text-dark-300 underline underline-dark-300);
|
|
|
|
}
|
|
|
|
|
2021-12-28 01:04:20 +01:00
|
|
|
.link-secondary {
|
|
|
|
@apply hover:(text-dark-400 underline underline-dark-400);
|
|
|
|
}
|
|
|
|
|
2021-12-27 15:46:34 +01:00
|
|
|
.dark .link {
|
2021-12-27 15:46:30 +01:00
|
|
|
@apply hover:(text-gray-300 underline underline-gray-300);
|
|
|
|
}
|
2021-12-28 01:04:20 +01:00
|
|
|
|
|
|
|
.auto .link {
|
2022-08-17 15:34:57 +02:00
|
|
|
@apply @dark:hover:(text-gray-300 underline underline-gray-300);
|
2021-12-28 01:04:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.dark .link-secondary {
|
|
|
|
@apply text-gray-300 hover:(text-gray-400 underline underline-gray-400);
|
|
|
|
}
|
|
|
|
|
|
|
|
.auto .link-secondary {
|
2022-08-17 15:34:57 +02:00
|
|
|
@apply @dark:(text-gray-300 hover:(text-gray-400 underline underline-gray-400));
|
2021-12-28 01:04:20 +01:00
|
|
|
}
|
2022-07-22 18:08:52 +02:00
|
|
|
|
|
|
|
.line {
|
2022-08-18 13:53:22 +02:00
|
|
|
@apply px-2.5 py-0.25 my-0.45 rounded-xl bg-dark-900;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dark .line {
|
|
|
|
@apply bg-white;
|
2022-07-22 18:08:52 +02:00
|
|
|
}
|
2021-02-24 10:35:41 +01:00
|
|
|
</style>
|