diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 96430d1..687882b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,9 @@ - - + + + + + android:banner="@drawable/tv_banner" + android:usesCleartextTraffic="true" + android:networkSecurityConfig="@xml/network_security_config"> - diff --git a/android/app/src/main/res/drawable/drawable-xhdpi/tv_banner.png b/android/app/src/main/res/drawable/drawable-xhdpi/tv_banner.png new file mode 100644 index 0000000..b962089 Binary files /dev/null and b/android/app/src/main/res/drawable/drawable-xhdpi/tv_banner.png differ diff --git a/android/app/src/main/res/drawable/splash.png b/android/app/src/main/res/drawable/splash.png index f7a6492..34efc6d 100644 Binary files a/android/app/src/main/res/drawable/splash.png and b/android/app/src/main/res/drawable/splash.png differ diff --git a/android/app/src/main/res/xml/network_security_config.xml b/android/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000..bb6ab93 --- /dev/null +++ b/android/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/css/base.css b/css/base.css index 3fa8652..1e25c73 100644 --- a/css/base.css +++ b/css/base.css @@ -21,7 +21,19 @@ body { font-family: "Inter", "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; - cursor: default + cursor: default; + overscroll-behavior: none; + touch-action: pan-x pan-y; +} + +.card, +.sc, +.pe, +.tr, +.ep { + transform: translateZ(0); + backface-visibility: hidden; + -webkit-backface-visibility: hidden; } ::-webkit-scrollbar { diff --git a/css/detail.css b/css/detail.css index 7a26f22..79bb42d 100644 --- a/css/detail.css +++ b/css/detail.css @@ -65,6 +65,21 @@ filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .6)) } +#dback { + position: fixed; + top: 3.5vh; + left: 3.5vw; + z-index: 12; + background: rgba(255, 255, 255, .12); + backdrop-filter: blur(12px); +} + +#dback.on { + background: #fff; + color: #000; + transform: scale(1.08); +} + .dh h1 { font-size: clamp(30px, 4.4vw, 76px); font-weight: 700; diff --git a/css/player.css b/css/player.css index c69008c..4b6b378 100644 --- a/css/player.css +++ b/css/player.css @@ -24,7 +24,7 @@ height: 100%; object-fit: contain; background: #000; - z-index: 1; + z-index: 0; } #pl.cover #pv { @@ -702,14 +702,4 @@ video::cue { #pl.cover #pbg { opacity: 0; visibility: hidden; -} - -#pv { - position: absolute; - inset: 0; - width: 100%; - height: 100%; - object-fit: contain; - background: transparent; - z-index: 1; } \ No newline at end of file diff --git a/css/search.css b/css/search.css index 33d5178..c272fa2 100644 --- a/css/search.css +++ b/css/search.css @@ -215,10 +215,15 @@ .sc { flex: 0 0 var(--cw); - transition: transform .32s cubic-bezier(.22, .9, .3, 1) + width: var(--cw); + max-width: var(--cw); + min-width: 0; + transition: transform .32s cubic-bezier(.22, .9, .3, 1); } .sc .po { + width: 100%; + height: calc(var(--cw) * 1.5); aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; diff --git a/index.html b/index.html index 60f5dc1..f23edb4 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,8 @@ - + Vyla diff --git a/js/detail.js b/js/detail.js index 9d95c43..7ba0a69 100644 --- a/js/detail.js +++ b/js/detail.js @@ -2,7 +2,7 @@ let dgen = 0; async function openDetail(it) { const t = it._t; if (!ov.classList.contains('show')) ov._prev = cur; - ov.classList.add('show'); side.classList.remove('open'); const my = ++dgen; ov.innerHTML = SK.detail(it); ov.scrollTop = 0; + ov.classList.add('show'); side.classList.remove('open'); const my = ++dgen; ov.innerHTML = `
${ic('')}
` + SK.detail(it); $('#dback')._a = closeDetail; ov.scrollTop = 0; const d = await api(`/${t}/${it.id}`, `&append_to_response=videos,credits,recommendations,images,${t === 'movie' ? 'release_dates' : 'content_ratings'}&include_image_language=en,null`); if (my !== dgen || !ov.classList.contains('show')) return; if (!d.id) { closeDetail(); return } @@ -11,8 +11,8 @@ async function openDetail(it) { const rt = t === 'movie' ? (d.runtime ? `${Math.floor(d.runtime / 60)}h ${d.runtime % 60}m` : '') : (d.number_of_seasons ? `${d.number_of_seasons} Season${d.number_of_seasons > 1 ? 's' : ''}` : ''); const lg = ((d.images || {}).logos || []).find(x => x.iso_639_1 === 'en') || ((d.images || {}).logos || [])[0]; const bp = d.backdrop_path || d.poster_path; - ov.innerHTML = `
${(d.vote_average || 0).toFixed(1)}${year}${cert ? `${cert}` : ''}${rt}${(d.genres || []).slice(0, 3).map(g => g.name).join(', ')}
⋮

${d.overview || ''}

MORE
`; - const secs = $('#dsecs'); + ov.innerHTML = `
${ic('')}
${(d.vote_average || 0).toFixed(1)}${year}${cert ? `${cert}` : ''}${rt}${(d.genres || []).slice(0, 3).map(g => g.name).join(', ')}
⋮

${d.overview || ''}

MORE
`; + $('#dback')._a = closeDetail; const secs = $('#dsecs'); const rowOf = (name, kids) => { if (!kids.length) return; const s = document.createElement('section'); s.className = 'ds'; s.innerHTML = `

${name}

`; s.lastChild.append(...kids); secs.appendChild(s) }; const el = (c, h) => { const e = document.createElement('div'); e.className = c + ' f'; e.tabIndex = -1; e.innerHTML = h; e._a = () => { }; return e }; if (t === 'tv') { diff --git a/js/input.js b/js/input.js index fb95ac5..5bb2959 100644 --- a/js/input.js +++ b/js/input.js @@ -1,3 +1,10 @@ +if (window.tizen && window.tizen.tvinputdevice) { + try { + ['MediaPlay', 'MediaPause', 'MediaPlayPause', 'MediaStop', 'MediaFastForward', 'MediaRewind', '10009'] + .forEach(k => tizen.tvinputdevice.registerKey(k)); + } catch (_) { } +} + const KM = { 37: 'l', 21: 'l', 38: 'u', 19: 'u', @@ -11,7 +18,7 @@ document.addEventListener('keydown', e => { fast = e.repeat; document.body.classList.add('kbm'); - if (e.keyCode === 85 || e.keyCode === 179) { + if (e.keyCode === 85 || e.keyCode === 179 || e.keyCode === 10252 || e.keyCode === 415) { e.preventDefault(); tgl(); return; @@ -21,17 +28,17 @@ document.addEventListener('keydown', e => { vd.play(); return; } - if (e.keyCode === 127) { + if (e.keyCode === 127 || e.keyCode === 413) { e.preventDefault(); vd.pause(); return; } - if (e.keyCode === 89 || e.keyCode === 227) { + if (e.keyCode === 89 || e.keyCode === 227 || e.keyCode === 412) { e.preventDefault(); vd.currentTime = Math.max(0, vd.currentTime - 10); return; } - if (e.keyCode === 90 || e.keyCode === 228) { + if (e.keyCode === 90 || e.keyCode === 228 || e.keyCode === 417) { e.preventDefault(); vd.currentTime = Math.min(vd.duration || Infinity, vd.currentTime + 10); return; diff --git a/www/css/base.css b/www/css/base.css index 3fa8652..1e25c73 100644 --- a/www/css/base.css +++ b/www/css/base.css @@ -21,7 +21,19 @@ body { font-family: "Inter", "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; - cursor: default + cursor: default; + overscroll-behavior: none; + touch-action: pan-x pan-y; +} + +.card, +.sc, +.pe, +.tr, +.ep { + transform: translateZ(0); + backface-visibility: hidden; + -webkit-backface-visibility: hidden; } ::-webkit-scrollbar { diff --git a/www/css/player.css b/www/css/player.css index c69008c..522cbee 100644 --- a/www/css/player.css +++ b/www/css/player.css @@ -24,7 +24,7 @@ height: 100%; object-fit: contain; background: #000; - z-index: 1; + z-index: 0; } #pl.cover #pv { @@ -710,6 +710,6 @@ video::cue { width: 100%; height: 100%; object-fit: contain; - background: transparent; - z-index: 1; + background: #000; + z-index: 0; } \ No newline at end of file diff --git a/www/css/search.css b/www/css/search.css index 33d5178..c272fa2 100644 --- a/www/css/search.css +++ b/www/css/search.css @@ -215,10 +215,15 @@ .sc { flex: 0 0 var(--cw); - transition: transform .32s cubic-bezier(.22, .9, .3, 1) + width: var(--cw); + max-width: var(--cw); + min-width: 0; + transition: transform .32s cubic-bezier(.22, .9, .3, 1); } .sc .po { + width: 100%; + height: calc(var(--cw) * 1.5); aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; diff --git a/www/js/input.js b/www/js/input.js index fb95ac5..a251fcb 100644 --- a/www/js/input.js +++ b/www/js/input.js @@ -11,7 +11,7 @@ document.addEventListener('keydown', e => { fast = e.repeat; document.body.classList.add('kbm'); - if (e.keyCode === 85 || e.keyCode === 179) { + if (e.keyCode === 85 || e.keyCode === 179 || e.keyCode === 10252 || e.keyCode === 415) { e.preventDefault(); tgl(); return; @@ -21,17 +21,17 @@ document.addEventListener('keydown', e => { vd.play(); return; } - if (e.keyCode === 127) { + if (e.keyCode === 127 || e.keyCode === 413) { e.preventDefault(); vd.pause(); return; } - if (e.keyCode === 89 || e.keyCode === 227) { + if (e.keyCode === 89 || e.keyCode === 227 || e.keyCode === 412) { e.preventDefault(); vd.currentTime = Math.max(0, vd.currentTime - 10); return; } - if (e.keyCode === 90 || e.keyCode === 228) { + if (e.keyCode === 90 || e.keyCode === 228 || e.keyCode === 417) { e.preventDefault(); vd.currentTime = Math.min(vd.duration || Infinity, vd.currentTime + 10); return;