add title option

This commit is contained in:
CodeDevMLH
2025-09-26 13:53:04 +02:00
parent 018f78a6df
commit 4323cdb367
2 changed files with 132 additions and 38 deletions

View File

@@ -5,7 +5,7 @@ let shuffleInterval = 15000; // Time in milliseconds before the next slide is sh
let useTrailers = true; // Set to false to disable trailers let useTrailers = true; // Set to false to disable trailers
let setRandomMovie = true; // Set to false to disable random movie selection from the list let setRandomMovie = true; // Set to false to disable random movie selection from the list
let showOnOtherPages = false; // Set to true to show the slideshow on all pages eg. favorites tab, requests tab, etc. let showOnOtherPages = false; // Set to true to show the slideshow on all pages eg. favorites tab, requests tab, etc.
//let showTitle = false; // Set to false to hide the title TBD let showTitle = false; // Set to true to place the slideshow title above the banner
let disableTrailerControls = false; // Set to false to enable trailer controls let disableTrailerControls = false; // Set to false to enable trailer controls
let setMutedHover = true; // Set to false to disable unmuting the video on hover let setMutedHover = true; // Set to false to disable unmuting the video on hover
let unmutedVolume = 20; // Set the volume level when the video is unmuted let unmutedVolume = 20; // Set the volume level when the video is unmuted
@@ -176,6 +176,7 @@ const createSlideElement = (movie, hasVideo = false) => {
cleanup(); cleanup();
isMuted = startTrailerMuted; isMuted = startTrailerMuted;
const container = document.getElementById('slides-container'); const container = document.getElementById('slides-container');
const slideWrapper = createElem('div', 'slide-wrapper');
const slide = createElem('div', 'slide'); const slide = createElem('div', 'slide');
if (movie && (!previousMovies.length || previousMovies[previousMovies.length - 1].Id !== movie.Id)) { if (movie && (!previousMovies.length || previousMovies[previousMovies.length - 1].Id !== movie.Id)) {
@@ -186,7 +187,13 @@ const createSlideElement = (movie, hasVideo = false) => {
previousMovies.shift(); previousMovies.shift();
} }
['backdrop', 'logo'].forEach(type => slide.appendChild(createElem('img', type, null, `/Items/${movie.Id}/Images/${type.charAt(0).toUpperCase() + type.slice(1)}${type === 'backdrop' ? '/0' : ''}`, type))); ['backdrop', 'logo'].forEach(type => slide.appendChild(createElem('img', type, null, `/Items/${movie.Id}/Images/${type.charAt(0).toUpperCase() + type.slice(1)}${type === 'backdrop' ? '/0' : ''}`, type)));
slide.appendChild(createElem('div', 'heading', title));
if (showTitle && title) {
const heading = createElem('div', 'heading', title);
heading.style.display = 'flex';
slideWrapper.classList.add('has-heading');
slideWrapper.appendChild(heading);
}
const textContainer = createElem('div', 'text-container'); const textContainer = createElem('div', 'text-container');
const premiereYear = movie.PremiereDate ? new Date(movie.PremiereDate).getFullYear() : unknownYearTerms[languageIndex]; const premiereYear = movie.PremiereDate ? new Date(movie.PremiereDate).getFullYear() : unknownYearTerms[languageIndex];
@@ -457,8 +464,10 @@ const createSlideElement = (movie, hasVideo = false) => {
} }
slideWrapper.appendChild(slide);
container.innerHTML = ''; container.innerHTML = '';
container.appendChild(slide); container.appendChild(slideWrapper);
}; };
function addSwipeListeners(slide) { function addSwipeListeners(slide) {
@@ -595,12 +604,27 @@ const readCustomList = () =>
const lines = text.split('\n').filter(Boolean); const lines = text.split('\n').filter(Boolean);
const firstLine = lines.shift().trim(); const firstLine = lines.shift().trim();
const [parsedTitle, muteSetting] = firstLine.split(/\s+/); const tokens = firstLine.split(/\s+/).filter(Boolean);
title = parsedTitle || title; let muteSetting = null;
if (tokens.length > 0) {
const lastToken = tokens[tokens.length - 1].toLowerCase();
if (lastToken === 'muteon' || lastToken === 'muteoff') {
muteSetting = lastToken;
tokens.pop();
}
}
// Check for mute const parsedTitle = tokens.join(' ').trim();
isMuted = muteSetting === "MuteOn"; if (parsedTitle) {
title = parsedTitle;
}
if (muteSetting) {
startTrailerMuted = muteSetting === 'muteon';
}
isMuted = startTrailerMuted;
// Remaining lines are media IDs // Remaining lines are media IDs
const mediaList = lines.map(line => line.trim().substring(0, 32)); const mediaList = lines.map(line => line.trim().substring(0, 32));

View File

@@ -1,11 +1,31 @@
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap');
:root {
--slide-heading-gap: 2.6em;
--slide-heading-accent: #38bdf8;
--slide-heading-accent-strong: #a855f7;
--slide-heading-bg: rgba(15, 23, 42, 0.45);
--slide-heading-border: rgba(148, 163, 184, 0.38);
--slide-heading-text: #f8fafc;
}
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
} }
.slide-wrapper {
position: relative;
width: 100vw;
max-width: 100%;
margin: 0 auto;
}
.slide-wrapper.has-heading {
padding-top: var(--slide-heading-gap);
}
.slide { .slide {
position: relative; position: relative;
width: 100vw; width: 100vw;
@@ -14,6 +34,10 @@ body {
border-radius: 2em; border-radius: 2em;
} }
.slide-wrapper.has-heading .slide {
height: calc(22em - var(--slide-heading-gap));
}
.slide:focus { .slide:focus {
outline: 2px solid #fff; outline: 2px solid #fff;
} }
@@ -47,36 +71,58 @@ body {
transition: transform 0.3s ease, max-height 0.3s ease, max-width 0.3s ease, left 0.5s ease; transition: transform 0.3s ease, max-height 0.3s ease, max-width 0.3s ease, left 0.5s ease;
} }
.heading {
position: absolute;
top: calc((var(--slide-heading-gap) - 2em) / 2);
left: 0em;
min-height: 2em;
padding: 0.25em 1.8em;
width: max-content;
font-family: "Titillium Web", sans-serif;
color: var(--slide-heading-text);
font-size: 1.3em;
font-weight: 620;
letter-spacing: 0.04em;
display: inline-flex;
align-items: center;
justify-content: flex-start;
gap: 0.5em;
z-index: 8;
background: linear-gradient(135deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.45) 100%);
border-radius: 0.75em;
border: 1px solid var(--slide-heading-border);
box-shadow: 0 16px 32px -18px rgba(15, 23, 42, 0.8), 0 0 32px -26px rgba(56, 189, 248, 0.6);
backdrop-filter: blur(18px) saturate(165%);
-webkit-backdrop-filter: blur(18px) saturate(165%);
text-shadow: 0 2px 10px rgba(15, 23, 42, 0.65);
box-sizing: border-box;
isolation: isolate;
overflow: hidden;
}
.heading::before { .heading::before {
content: ''; content: '';
position: absolute; position: absolute;
top: 2.27em; inset: -35% -20% 45% -35%;
left: 0; background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.75), transparent 60%);
width: 100%; opacity: 0.65;
height: 100vh; filter: blur(22px);
background: linear-gradient(0deg, rgb(0% 0% 0%) 0%, rgb(0% 0% 0% / 0.9990234375) 6.25%, rgba(0, 0, 0, 0.99) 12.5%, rgba(0, 0, 0, 0.97) 18.75%, rgba(0, 0, 0, 0.94) 25%, rgba(0, 0, 0, 0.88) 31.25%, rgba(0, 0, 0, 0.79) 37.5%, rgba(0, 0, 0, 0.67) 43.75%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.33) 56.25%, rgba(0, 0, 0, 0.21) 62.5%, rgba(0, 0, 0, 0.12) 68.75%, rgba(0, 0, 0, 0.06) 75%, rgba(0, 0, 0, 0.03) 81.25%, rgba(0, 0, 0, 0.01) 87.5%, rgba(0, 0, 0, 0) 93.75%, rgba(0, 0, 0, 0) 100%); z-index: -1;
z-index: 7; pointer-events: none;
opacity: 0;
} }
.heading { .heading::after {
content: '';
position: absolute; position: absolute;
top: 0; left: 1.6em;
left: 0; bottom: -0.45em;
width: 100%; width: 3.8em;
height: 2.3em; height: 0.26em;
background-color: transparent; border-radius: 999px;
font-family: "Titillium Web", sans-serif; background: linear-gradient(90deg, var(--slide-heading-accent) 0%, var(--slide-heading-accent-strong) 100%);
color: #D3D3D3; box-shadow: 0 8px 18px rgba(56, 189, 248, 0.55);
font-size: 22px; opacity: 0.95;
display: none; pointer-events: none;
align-items: center;
justify-content: flex-start;
z-index: 2;
padding: 10px;
padding-left: 0px;
box-sizing: border-box;
text-shadow: 1px 1px 4px rgba(0, 0, 0, 1);
} }
.back-button, .back-button,
@@ -333,6 +379,34 @@ body {
} }
@media (max-width: 1000px) { @media (max-width: 1000px) {
:root {
--slide-heading-gap: 2.2em;
}
.heading {
left: 0em;
font-size: 1.05em;
padding: 0.3em 1.1em;
border-radius: 0.65em;
gap: 0.4em;
box-shadow: 0 12px 22px -18px rgba(15, 23, 42, 0.72), 0 0 0 1px rgba(148, 163, 184, 0.18);
backdrop-filter: blur(14px) saturate(150%);
-webkit-backdrop-filter: blur(14px) saturate(150%);
}
.heading::before {
inset: -42% -26% 48% -38%;
filter: blur(16px);
opacity: 0.55;
}
.heading::after {
left: 1em;
bottom: -0.32em;
width: 2.6em;
height: 0.22em;
}
.age-rating { .age-rating {
position: absolute; position: absolute;
top: 1em; top: 1em;
@@ -447,11 +521,7 @@ body {
} }
.heading { .heading {
z-index: 0; z-index: 9;
}
.heading::before {
display: none;
} }
.video-container { .video-container {
@@ -551,8 +621,8 @@ body {
} }
@media (max-width:1000px) and (orientation:landscape) { @media (max-width:1000px) and (orientation:landscape) {
.slide { .slide-wrapper.has-heading .slide {
height: 22em; height: calc(22em - var(--slide-heading-gap));
} }
.community-rating { .community-rating {