2020-12-09 13:33:29 +00:00
|
|
|
<template>
|
2021-12-27 14:46:26 +00:00
|
|
|
<div class="w-full" :style="[{ background: backgroundColor, colour: foregroundColor }]" :class="{ dark: darkMode }">
|
2021-03-31 22:09:39 +00:00
|
|
|
<Navigation />
|
2021-07-07 14:18:09 +00:00
|
|
|
<router-view v-slot="{ Component }">
|
|
|
|
<keep-alive :max="5">
|
2021-10-08 18:52:51 +00:00
|
|
|
<component :is="Component" :key="$route.fullPath" />
|
2021-07-07 14:18:09 +00:00
|
|
|
</keep-alive>
|
|
|
|
</router-view>
|
2021-03-29 06:38:29 +00:00
|
|
|
|
2021-12-27 14:46:30 +00:00
|
|
|
<footer class="text-center">
|
2021-05-10 18:14:28 +00:00
|
|
|
<a aria-label="GitHub" href="https://github.com/TeamPiped/Piped">
|
2021-04-07 11:45:40 +00:00
|
|
|
<font-awesome-icon :icon="['fab', 'github']"></font-awesome-icon>
|
2021-03-29 06:38:29 +00:00
|
|
|
</a>
|
|
|
|
|
2021-07-18 17:36:59 +00:00
|
|
|
<a href="https://github.com/TeamPiped/Piped#donations">
|
2021-04-07 11:45:40 +00:00
|
|
|
<font-awesome-icon :icon="['fab', 'bitcoin']"></font-awesome-icon>
|
2021-09-05 13:08:26 +00:00
|
|
|
{{ $t("actions.donations") }}
|
2021-03-29 06:38:29 +00:00
|
|
|
</a>
|
2021-12-27 14:46:30 +00:00
|
|
|
</footer>
|
2020-12-09 13:33:29 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-03-31 22:09:39 +00:00
|
|
|
import Navigation from "@/components/Navigation";
|
2020-12-09 13:33:29 +00:00
|
|
|
export default {
|
2021-03-31 22:09:39 +00:00
|
|
|
components: {
|
2021-05-10 18:14:28 +00:00
|
|
|
Navigation,
|
|
|
|
},
|
2021-07-18 20:20:35 +00:00
|
|
|
mounted() {
|
|
|
|
if (window.location.pathname === "/" || window.location.pathname.length == 0)
|
|
|
|
switch (this.getPreferenceString("homepage", "trending")) {
|
|
|
|
case "trending":
|
|
|
|
break;
|
|
|
|
case "feed":
|
|
|
|
this.$router.push("/feed");
|
|
|
|
return;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2021-08-22 10:27:09 +00:00
|
|
|
|
|
|
|
if (this.getPreferenceBoolean("watchHistory", false))
|
|
|
|
if ("indexedDB" in window) {
|
|
|
|
const request = indexedDB.open("piped-db", 1);
|
|
|
|
request.onupgradeneeded = function() {
|
|
|
|
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 16:30:21 +00:00
|
|
|
|
|
|
|
const App = this;
|
|
|
|
|
|
|
|
(async function() {
|
2021-09-23 22:57:26 +00:00
|
|
|
const locale = App.getPreferenceString("hl", App.defaultLangage);
|
2021-10-27 00:59:03 +00:00
|
|
|
if (locale !== App.TimeAgoConfig.locale) {
|
|
|
|
const localeTime = await import("javascript-time-ago/locale/" + locale + ".json").then(
|
|
|
|
module => module.default,
|
|
|
|
);
|
|
|
|
App.TimeAgo.addLocale(localeTime);
|
|
|
|
App.TimeAgoConfig.locale = locale;
|
|
|
|
}
|
2021-08-25 16:30:21 +00:00
|
|
|
if (window.i18n.global.locale.value !== locale) {
|
|
|
|
if (!window.i18n.global.availableLocales.includes(locale)) {
|
|
|
|
const messages = await import("@/locales/" + locale + ".json").then(module => module.default);
|
|
|
|
window.i18n.global.setLocaleMessage(locale, messages);
|
|
|
|
}
|
|
|
|
window.i18n.global.locale.value = locale;
|
|
|
|
}
|
|
|
|
})();
|
2021-07-18 20:20:35 +00:00
|
|
|
},
|
2020-12-09 13:33:29 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
2021-06-28 16:23:24 +00:00
|
|
|
h1,
|
|
|
|
p,
|
|
|
|
a,
|
|
|
|
b {
|
|
|
|
unicode-bidi: plaintext;
|
|
|
|
text-align: start;
|
|
|
|
}
|
|
|
|
|
2020-12-09 13:33:29 +00:00
|
|
|
::-webkit-scrollbar {
|
|
|
|
background-color: #15191a;
|
|
|
|
color: #c5bcae;
|
|
|
|
}
|
|
|
|
|
|
|
|
::-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 09:35:41 +00:00
|
|
|
* {
|
|
|
|
scrollbar-color: #15191a #444a4e;
|
|
|
|
}
|
2021-10-31 17:44:36 +00:00
|
|
|
|
2021-12-27 14:46:22 +00:00
|
|
|
.video-grid {
|
2021-12-27 14:46:30 +00:00
|
|
|
@apply grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 col-auto gap-x-1vw gap-y-1.5 mx-3;
|
2021-10-31 17:44:36 +00:00
|
|
|
}
|
2021-10-31 18:36:47 +00:00
|
|
|
|
2021-12-27 14:46:26 +00:00
|
|
|
.btn {
|
2021-12-27 14:46:29 +00:00
|
|
|
@apply py-2 px-4 rounded;
|
2021-12-27 14:46:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.dark {
|
2021-12-27 14:46:30 +00:00
|
|
|
@apply text-white bg-dark-800 bg-opacity-70;
|
2021-12-27 14:46:26 +00:00
|
|
|
}
|
|
|
|
|
2021-12-27 14:46:29 +00:00
|
|
|
.dark .input,
|
|
|
|
.dark .select,
|
|
|
|
.dark .btn {
|
|
|
|
@apply text-gray-400 bg-dark-400 w-auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dark hr {
|
|
|
|
@apply border-dark-100;
|
|
|
|
}
|
|
|
|
|
2021-12-27 14:46:26 +00:00
|
|
|
h1 {
|
2021-12-27 14:46:29 +00:00
|
|
|
@apply m-0 !text-5xl font-bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr {
|
|
|
|
@apply !mt-2 !mb-3;
|
2021-10-31 18:36:47 +00:00
|
|
|
}
|
2021-12-27 14:46:30 +00:00
|
|
|
|
|
|
|
.link {
|
|
|
|
@apply hover:(text-gray-300 underline underline-gray-300);
|
|
|
|
}
|
2021-02-24 09:35:41 +00:00
|
|
|
</style>
|