Show title
This commit is contained in:
		@@ -53,8 +53,9 @@
 | 
			
		||||
			aspect-ratio: 16/9;
 | 
			
		||||
			width: 20vw;
 | 
			
		||||
			transition: width 0.3s ease, box-shadow 0.3s ease, left 0.3s ease;
 | 
			
		||||
			transform: translate(-50%, -50%);
 | 
			
		||||
			transform: translate(-50%, 0);
 | 
			
		||||
			position: fixed;
 | 
			
		||||
			overflow: hidden; /* Ensure content fits within rounded corners */
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.video-thumbnail.focussed {
 | 
			
		||||
@@ -70,6 +71,28 @@
 | 
			
		||||
			z-index: 1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.video-title {
 | 
			
		||||
			position: absolute;
 | 
			
		||||
			bottom: 0;
 | 
			
		||||
			left: 0;
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			background-color: rgba(0, 0, 0, 0.7);
 | 
			
		||||
			color: white;
 | 
			
		||||
			padding: 8px;
 | 
			
		||||
			box-sizing: border-box;
 | 
			
		||||
			text-align: center;
 | 
			
		||||
			font-size: 1rem;
 | 
			
		||||
			opacity: 0;
 | 
			
		||||
			transition: opacity 0.3s ease-in-out;
 | 
			
		||||
			border-bottom-left-radius: 8px;
 | 
			
		||||
			border-bottom-right-radius: 8px;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.video-thumbnail:hover .video-title,
 | 
			
		||||
		.video-thumbnail.focussed .video-title {
 | 
			
		||||
			opacity: 1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.play-button {
 | 
			
		||||
			position: absolute;
 | 
			
		||||
			top: 50%;
 | 
			
		||||
@@ -313,30 +336,32 @@
 | 
			
		||||
         * @param append Set to true if this thumbnail should be appended to the video container, false if it should be prepended.
 | 
			
		||||
         */
 | 
			
		||||
        function createVideoThumbnailElement(data, selected, append) {
 | 
			
		||||
            let container = $(`<span></span>`);
 | 
			
		||||
			let thumbnail = $(`<img src="${data.thumbnail}" class="video-thumbnail" alt="Video Thumbnail" tabindex="0">`)[0];
 | 
			
		||||
            container.append(thumbnail)
 | 
			
		||||
            let index;
 | 
			
		||||
            if (append) {
 | 
			
		||||
                $("#video-container").append(container);
 | 
			
		||||
			let container = $(`<div class="video-thumbnail" tabindex="0" role="button" aria-label="${data.title}"></div>`);
 | 
			
		||||
			let thumbnailImg = $(`<img src="${data.thumbnail}" alt="" style="width: 100%; height: 100%; object-fit: cover;">`);
 | 
			
		||||
			let title = $(`<div class="video-title">${data.title}</div>`);
 | 
			
		||||
			container.append(thumbnailImg).append(title);
 | 
			
		||||
 | 
			
		||||
			let index;
 | 
			
		||||
			if (append) {
 | 
			
		||||
				$("#video-container").append(container);
 | 
			
		||||
				index = videoInfo.length;
 | 
			
		||||
                videoInfo.push({
 | 
			
		||||
					thumbnail,
 | 
			
		||||
				videoInfo.push({
 | 
			
		||||
					thumbnail: container[0],
 | 
			
		||||
					data
 | 
			
		||||
                })
 | 
			
		||||
            } else {
 | 
			
		||||
				})
 | 
			
		||||
			} else {
 | 
			
		||||
				$("#video-container").prepend(container);
 | 
			
		||||
				index = 0;
 | 
			
		||||
				videoInfo.unshift({
 | 
			
		||||
					thumbnail,
 | 
			
		||||
					thumbnail: container[0],
 | 
			
		||||
					data
 | 
			
		||||
				});
 | 
			
		||||
                selectedThumbnailIndex++;
 | 
			
		||||
				selectedThumbnailIndex++;
 | 
			
		||||
			}
 | 
			
		||||
			if (selected) {
 | 
			
		||||
				container[0].classList.add("focussed");
 | 
			
		||||
				selectedThumbnailIndex = index;
 | 
			
		||||
			}
 | 
			
		||||
            if (selected) {
 | 
			
		||||
                thumbnail.classList.add("focussed");
 | 
			
		||||
                selectedThumbnailIndex = index;
 | 
			
		||||
            }
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user