diff --git a/themes/default/public/dist/css/index.css b/themes/default/public/dist/css/index.css index 87c0190..d36581e 100644 --- a/themes/default/public/dist/css/index.css +++ b/themes/default/public/dist/css/index.css @@ -44,7 +44,7 @@ a:hover,a:focus { border: 1px solid black; } -#close-and-reset-video-container:hover,#close-and-reset-video-container:focus { +#close-and-reset-video-container:hover:#close-and-reset-video-container:focus { background: black; color: white; } diff --git a/themes/new_look_default/public/dist/css/index.css b/themes/new_look_default/public/dist/css/index.css index 2ddd890..40ef2fe 100644 --- a/themes/new_look_default/public/dist/css/index.css +++ b/themes/new_look_default/public/dist/css/index.css @@ -74,15 +74,6 @@ body { display: flex; } -#poping-notice { - position: absolute; - display: none; - padding: 3rem; - border-radius: 0.3rem; - background-color: #374151; - color: white; -} - #poping-notice-content a { text-decoration: none; color: #10b981; @@ -110,17 +101,29 @@ body { background-color: #059; } -#modal-video-container { - position: absolute; - display: none; +.modal { + position: absolute; + display: none; + color: white; +} - height: 100vh; - width: 100%; +#poping-notice { + padding: 3rem; + border-radius: 0.3rem; + background-color: #374151; + color: white; + overflow-y: scroll; + width: 94%; +} - flex-flow: column; - align-items: center; +#modal-video-container,#modal-format-selector { + height: 100%; + width: 100%; - background-color: #111827; + flex-flow: column; + align-items: center; + + background-color: #111827; } .video-container-bar { @@ -192,24 +195,23 @@ body { align-items: center; } -#modal-loading, -#modal-format-selector { - display: none; +#modal-loading { + display: none; } -#poping-notice.active, -#modal-video-container.active { +.modal { --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); + overflow-y: scroll; } #poping-notice.active { display: block; } -#modal-video-container.active { +.modal.active { display: flex; } @@ -245,6 +247,58 @@ body { justify-content: center; } +.format-list > div { + display: grid; + grid-column-gap: 10px; + grid-row-gap: 10px; + grid-template-areas: "a"; + grid-auto-columns: 99%; + margin: 1rem; +} + +.format-list > div > a { + border: 1px solid black; + display: flex; + align-items: center; + justify-content: center; + font-size: 1.5rem; + padding-right: 5%; + padding-left: 5%; + text-decoration: none; + border-radius: 0.5rem; + background-color: #059669; + overflow-wrap: anywhere; +} + +.format-list > div > a:focus,.format-list > div > a:hover { + background-color: #059; +} + +.format-list > div > a:after { + padding-bottom: 100%; + display: block; + content: ""; +} + +.scale { + height: 1em; + width; 1em; +} + +@media (min-width: 600px) { + .format-list > div { + grid-template-areas: "a a"; + grid-auto-columns: 49.75%; + } +} + +@media (min-width: 805px) { + .format-list > div { + grid-template-areas: "a a a"; + grid-auto-columns: 33%; + } +} + @media (min-width: 812px) { #poping-notice { width: 40%; diff --git a/themes/new_look_default/public/dist/img/audio_muted.svg b/themes/new_look_default/public/dist/img/audio_muted.svg new file mode 100644 index 0000000..119d23f --- /dev/null +++ b/themes/new_look_default/public/dist/img/audio_muted.svg @@ -0,0 +1,18 @@ + diff --git a/themes/new_look_default/public/dist/index.html b/themes/new_look_default/public/dist/index.html index 1c8cd43..70834ed 100644 --- a/themes/new_look_default/public/dist/index.html +++ b/themes/new_look_default/public/dist/index.html @@ -20,7 +20,7 @@ -
This webpage is free as in freedom software, it is offered to you with the hope it will be useful, but without any warranty, you can find the source code at my gitea with docs to setup your own diff --git a/themes/new_look_default/public/src/view/format_selector.js b/themes/new_look_default/public/src/view/format_selector.js index c9e9665..fb51107 100644 --- a/themes/new_look_default/public/src/view/format_selector.js +++ b/themes/new_look_default/public/src/view/format_selector.js @@ -8,25 +8,58 @@ class FormatSelector { appendFormat(container, object, is_video, callback) { let a = document.createElement('a'); + let br = function() { return document.createElement('br') }; + let inner_text = []; + let muted_video = false; if ( is_video ) { - a.innerText = 'Id: ' + object.id + "\n" - + 'Format: ' + object.mimeType + "\n" - + 'QualityLabel: ' + object.qualityLabel + "p\n" - + 'Bitrate: ' + object.bitrate + "\n" - + ( - ( object.audioSampleRate !== undefined ) ? - 'AudioSampleRate: ' + object.audioSampleRate + ".\n" : - "No audio." - ); + if ( object.audioSampleRate === undefined ) { + muted_video = true; + } + inner_text.push('Id: ' + object.id); + inner_text.push(br()); + inner_text.push('Format: ' + object.mimeType); + inner_text.push(br()); + inner_text.push('QualityLabel: ' + object.qualityLabel + "p"); + inner_text.push(br()); + inner_text.push('Bitrate: ' + object.bitrate); + inner_text.push(br()); + inner_text.push( ( muted_video) ? + "No audio. " : + 'AudioSampleRate: ' + object.audioSampleRate + ); } else { - a.innerText = 'Id: ' + object.id + "\n" - + 'Format: ' + object.mimeType + "\n" - + 'AudioSampleRate: ' + object.audioSampleRate + "\n" - + 'Bitrate: ' + object.bitrate + ".\n"; + inner_text.push('Id: ' + object.id + "\n"); + inner_text.push(br()); + inner_text.push('Format: ' + object.mimeType); + inner_text.push(br()); + inner_text.push('AudioSampleRate: ' + object.audioSampleRate); + inner_text.push(br()); + inner_text.push('Bitrate: ' + object.bitrate); } + a.addEventListener( 'click', (event) => { callback(object.id); }); + if (muted_video) { + let img_muted_video = document.createElement('img'); + img_muted_video.classList.add('mute_img'); + img_muted_video.classList.add('scale'); + img_muted_video.src = 'img/audio_muted.svg'; + inner_text.push(img_muted_video); + } + + for (let text of inner_text) { + if (typeof text === "string" + || text instanceof String) { + text = document.createTextNode(text); + a.appendChild(text); + } else if ( text instanceof Node) { + a.appendChild(text); + } else { + throw ('Text is not a instance of Node nor a String'); + } + } + container.appendChild(a); }