mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Improve Margins and add Theater Mode
This commit is contained in:
parent
998b9f2174
commit
45c5632d81
7 changed files with 66 additions and 10 deletions
20
src/App.vue
20
src/App.vue
|
@ -63,6 +63,21 @@ export default {
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
$route: {
|
||||||
|
handler(to) {
|
||||||
|
console.log(to.name);
|
||||||
|
// Pages that should be displayed without margin at the sides
|
||||||
|
if (
|
||||||
|
["Trending", "SearchResults", "Playlist", "Channel", "Feed", "Watch History", "Playlists"].includes(
|
||||||
|
to.name,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
document.body.classList.add("wide");
|
||||||
|
else document.body.classList.remove("wide");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -207,4 +222,9 @@ h2 {
|
||||||
.auto .link-secondary {
|
.auto .link-secondary {
|
||||||
@apply dark:(text-gray-300 hover:(text-gray-400 underline underline-gray-400));
|
@apply dark:(text-gray-300 hover:(text-gray-400 underline underline-gray-400));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body:not(.wide) {
|
||||||
|
max-width: 1250px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="comment flex mt-1.5">
|
<div class="comment flex mb-5">
|
||||||
<img
|
<img
|
||||||
:src="comment.thumbnail"
|
:src="comment.thumbnail"
|
||||||
class="comment-avatar rounded-full w-12 h-12"
|
class="comment-avatar rounded-full w-12 h-12 mr-1 lg:mr-3"
|
||||||
height="48"
|
height="48"
|
||||||
width="48"
|
width="48"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="showingReplies">
|
<template v-if="showingReplies">
|
||||||
<div @click="hideReplies" class="cursor-pointer">
|
<div @click="hideReplies" class="cursor-pointer mb-3">
|
||||||
<a v-t="'actions.hide_replies'" />
|
<a v-t="'actions.hide_replies'" />
|
||||||
<font-awesome-icon class="ml-1.5" icon="level-up-alt" />
|
<font-awesome-icon class="ml-1.5" icon="level-up-alt" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -124,6 +124,16 @@
|
||||||
@change="onChange($event)"
|
@change="onChange($event)"
|
||||||
/>
|
/>
|
||||||
<br />
|
<br />
|
||||||
|
<label for="chkDefaultTheaterMode"><strong v-t="'actions.default_theater_mode'" /></label>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
id="chkDefaultTheaterMode"
|
||||||
|
v-model="defaultTheaterMode"
|
||||||
|
class="checkbox"
|
||||||
|
type="checkbox"
|
||||||
|
@change="onChange($event)"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
<label for="chkStoreWatchHistory"><strong v-t="'actions.store_watch_history'" /></label>
|
<label for="chkStoreWatchHistory"><strong v-t="'actions.store_watch_history'" /></label>
|
||||||
<br />
|
<br />
|
||||||
<input
|
<input
|
||||||
|
@ -227,6 +237,7 @@ export default {
|
||||||
defaultHomepage: "trending",
|
defaultHomepage: "trending",
|
||||||
showComments: true,
|
showComments: true,
|
||||||
minimizeDescription: false,
|
minimizeDescription: false,
|
||||||
|
defaultTheaterMode: false,
|
||||||
watchHistory: false,
|
watchHistory: false,
|
||||||
selectedLanguage: "en",
|
selectedLanguage: "en",
|
||||||
languages: [
|
languages: [
|
||||||
|
@ -356,6 +367,7 @@ export default {
|
||||||
this.defaultHomepage = this.getPreferenceString("homepage", "trending");
|
this.defaultHomepage = this.getPreferenceString("homepage", "trending");
|
||||||
this.showComments = this.getPreferenceBoolean("comments", true);
|
this.showComments = this.getPreferenceBoolean("comments", true);
|
||||||
this.minimizeDescription = this.getPreferenceBoolean("minimizeDescription", false);
|
this.minimizeDescription = this.getPreferenceBoolean("minimizeDescription", false);
|
||||||
|
this.defaultTheaterMode = this.getPreferenceBoolean("defaultTheaterMode", false);
|
||||||
this.watchHistory = this.getPreferenceBoolean("watchHistory", false);
|
this.watchHistory = this.getPreferenceBoolean("watchHistory", false);
|
||||||
this.selectedLanguage = this.getPreferenceString("hl", this.defaultLangage);
|
this.selectedLanguage = this.getPreferenceString("hl", this.defaultLangage);
|
||||||
this.enabledCodecs = this.getPreferenceString("enabledCodecs", "vp9,avc").split(",");
|
this.enabledCodecs = this.getPreferenceString("enabledCodecs", "vp9,avc").split(",");
|
||||||
|
@ -410,6 +422,7 @@ export default {
|
||||||
localStorage.setItem("homepage", this.defaultHomepage);
|
localStorage.setItem("homepage", this.defaultHomepage);
|
||||||
localStorage.setItem("comments", this.showComments);
|
localStorage.setItem("comments", this.showComments);
|
||||||
localStorage.setItem("minimizeDescription", this.minimizeDescription);
|
localStorage.setItem("minimizeDescription", this.minimizeDescription);
|
||||||
|
localStorage.setItem("defaultTheaterMode", this.defaultTheaterMode);
|
||||||
localStorage.setItem("watchHistory", this.watchHistory);
|
localStorage.setItem("watchHistory", this.watchHistory);
|
||||||
localStorage.setItem("hl", this.selectedLanguage);
|
localStorage.setItem("hl", this.selectedLanguage);
|
||||||
localStorage.setItem("enabledCodecs", this.enabledCodecs.join(","));
|
localStorage.setItem("enabledCodecs", this.enabledCodecs.join(","));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="mb-6">
|
||||||
<router-link
|
<router-link
|
||||||
:to="{
|
:to="{
|
||||||
path: '/watch',
|
path: '/watch',
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
<div>
|
<div>
|
||||||
<p
|
<p
|
||||||
style="display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical"
|
style="display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical"
|
||||||
class="my-2 overflow-hidden flex link"
|
class="my-1 overflow-hidden flex link"
|
||||||
:title="video.title"
|
:title="video.title"
|
||||||
v-text="video.title"
|
v-text="video.title"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -63,6 +63,15 @@
|
||||||
>
|
>
|
||||||
<font-awesome-icon :icon="isListening ? 'tv' : 'headphones'" />
|
<font-awesome-icon :icon="isListening ? 'tv' : 'headphones'" />
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<button
|
||||||
|
class="btn"
|
||||||
|
:title="
|
||||||
|
theaterMode ? this.$t('actions.exit_theater_mode') : this.$t('actions.enter_theater_mode')
|
||||||
|
"
|
||||||
|
v-on:click="theaterMode = !theaterMode"
|
||||||
|
>
|
||||||
|
<font-awesome-icon icon="panorama" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -117,14 +126,14 @@
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div class="grid xl:grid-cols-5 sm:grid-cols-4 grid-cols-1">
|
<div class="grid sm:grid-cols-4 grid-cols-1 gap-6">
|
||||||
<div v-if="!comments" class="xl:col-span-4 sm:col-span-3">
|
<div v-if="!comments" class="col-span-3">
|
||||||
<p class="text-center mt-8">Comments are loading...</p>
|
<p class="text-center mt-8">Comments are loading...</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="comments.disabled" class="xl:col-span-4 sm:col-span-3">
|
<div v-else-if="comments.disabled" class="col-span-3">
|
||||||
<p class="text-center mt-8">Comments are turned off.</p>
|
<p class="text-center mt-8">Comments are turned off.</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else ref="comments" class="xl:col-span-4 sm:col-span-3">
|
<div v-else ref="comments" class="col-span-3">
|
||||||
<CommentItem
|
<CommentItem
|
||||||
v-for="comment in comments.comments"
|
v-for="comment in comments.comments"
|
||||||
:key="comment.commentId"
|
:key="comment.commentId"
|
||||||
|
@ -203,6 +212,7 @@ export default {
|
||||||
smallViewQuery: smallViewQuery,
|
smallViewQuery: smallViewQuery,
|
||||||
smallView: smallViewQuery.matches,
|
smallView: smallViewQuery.matches,
|
||||||
showModal: false,
|
showModal: false,
|
||||||
|
theaterMode: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -268,6 +278,7 @@ export default {
|
||||||
this.active = true;
|
this.active = true;
|
||||||
this.selectedAutoPlay = this.getPreferenceBoolean("autoplay", false);
|
this.selectedAutoPlay = this.getPreferenceBoolean("autoplay", false);
|
||||||
this.showDesc = !this.getPreferenceBoolean("minimizeDescription", false);
|
this.showDesc = !this.getPreferenceBoolean("minimizeDescription", false);
|
||||||
|
this.theaterMode = this.getPreferenceBoolean("defaultTheaterMode", false);
|
||||||
if (this.video.duration) {
|
if (this.video.duration) {
|
||||||
document.title = this.video.title + " - Piped";
|
document.title = this.video.title + " - Piped";
|
||||||
this.$refs.videoPlayer.loadVideo();
|
this.$refs.videoPlayer.loadVideo();
|
||||||
|
@ -276,6 +287,7 @@ export default {
|
||||||
},
|
},
|
||||||
deactivated() {
|
deactivated() {
|
||||||
this.active = false;
|
this.active = false;
|
||||||
|
document.body.classList.remove("theater-mode");
|
||||||
window.removeEventListener("scroll", this.handleScroll);
|
window.removeEventListener("scroll", this.handleScroll);
|
||||||
},
|
},
|
||||||
unmounted() {
|
unmounted() {
|
||||||
|
@ -415,5 +427,11 @@ export default {
|
||||||
this.$refs.videoPlayer.seek(time);
|
this.$refs.videoPlayer.seek(time);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
theaterMode() {
|
||||||
|
if (this.theaterMode) document.body.classList.add("wide");
|
||||||
|
else document.body.classList.remove("wide");
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -80,7 +80,10 @@
|
||||||
"delete_playlist": "Delete Playlist",
|
"delete_playlist": "Delete Playlist",
|
||||||
"select_playlist": "Select a Playlist",
|
"select_playlist": "Select a Playlist",
|
||||||
"delete_playlist_confirm": "Are you sure you want to delete this playlist?",
|
"delete_playlist_confirm": "Are you sure you want to delete this playlist?",
|
||||||
"please_select_playlist": "Please select a playlist"
|
"please_select_playlist": "Please select a playlist",
|
||||||
|
"enter_theater_mode": "Enter Theater Mode",
|
||||||
|
"exit_theater_mode": "Exit Theater Mode",
|
||||||
|
"default_theater_mode": "Use the Theater Mode by default"
|
||||||
},
|
},
|
||||||
"comment": {
|
"comment": {
|
||||||
"pinned_by": "Pinned by"
|
"pinned_by": "Pinned by"
|
||||||
|
|
|
@ -17,6 +17,7 @@ import {
|
||||||
faCirclePlus,
|
faCirclePlus,
|
||||||
faCircleMinus,
|
faCircleMinus,
|
||||||
faXmark,
|
faXmark,
|
||||||
|
faPanorama,
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { faGithub, faBitcoin, faYoutube } from "@fortawesome/free-brands-svg-icons";
|
import { faGithub, faBitcoin, faYoutube } from "@fortawesome/free-brands-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||||
|
@ -40,6 +41,7 @@ library.add(
|
||||||
faCirclePlus,
|
faCirclePlus,
|
||||||
faCircleMinus,
|
faCircleMinus,
|
||||||
faXmark,
|
faXmark,
|
||||||
|
faPanorama,
|
||||||
);
|
);
|
||||||
|
|
||||||
import router from "@/router/router.js";
|
import router from "@/router/router.js";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue