feat: smooth scroll setting

temp: more accessible trailers
This commit is contained in:
ThaUnknown 2023-07-10 17:33:20 +02:00
parent 3266e152e2
commit eebb8128d3
4 changed files with 25 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"name": "Miru",
"version": "4.1.9",
"version": "4.1.10",
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
"description": "Stream anime torrents, real-time with no waiting for downloads.",
"main": "build/main.js",

View file

@ -51,8 +51,9 @@
<img src={media.bannerImage || ' '} alt='banner' class='img-cover w-full h-full' />
{#if media.trailer?.id}
<!-- for now we use some invidious instance, would be nice to somehow get these links outselves, this redirects straight to some google endpoint -->
<!-- `https://yewtu.be/latest_version?id=${media.trailer.id}&itag=18` -->
<!-- eslint-disable-next-line svelte/valid-compile -->
<video src={`https://yewtu.be/latest_version?id=${media.trailer.id}&itag=18`}
<video src={`https://proxy2.vnxservers.com/youtube/${media.trailer.id}`}
class='w-full position-absolute left-0'
class:d-none={hide}
playsinline

View file

@ -1,4 +1,7 @@
import { set } from '@/views/Settings.svelte'
export default function scroll (t, { speed = 120, smooth = 10 } = {}) {
if (!set.smoothScroll) return
let moving = false
let pos = 0
let scrollTop = 0

View file

@ -21,9 +21,10 @@
disableSubtitleBlur: false,
toshoURL: decodeURIComponent(atob('aHR0cHM6Ly9mZWVkLmFuaW1ldG9zaG8ub3JnLw==')),
showDetailsInRPC: true,
smoothScroll: true,
cards: 'small'
}
localStorage.removeItem('relations') // TODO: remove
export const set = { ...defaults, ...(JSON.parse(localStorage.getItem('settings')) || {}) }
if (set.enableDoH) window.IPC.emit('doh', set.doHURL)
window.addEventListener('paste', ({ clipboardData }) => {
@ -118,6 +119,11 @@
icon: 'settings',
desc: 'Discord Rich Presence settings.'
},
interface: {
name: 'Interface',
icon: 'settings',
desc: 'Interface settings.'
},
changelog: {
name: 'Changelog',
icon: 'list',
@ -481,6 +487,18 @@
</div>
</div>
</Tab>
<Tab>
<div class='root p-20 m-20'>
<div
class='custom-switch mb-10 pl-10 font-size-16 w-300'
data-toggle='tooltip'
data-placement='bottom'
data-title='Enables smooth scrolling for long vertical containers. Impacts performance.'>
<input type='checkbox' id='smooth-scroll' bind:checked={settings.smoothScroll} />
<label for='smooth-scroll'>Enable smooth scrolling</label>
</div>
</div>
</Tab>
<Tab>
<div class='root m-20 px-20 pre-wrap'>
{#await changeLog}