mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-14 05:20:22 +00:00
chore: update deps
feat(web): error route, loader font size clamp, download page looping errors
This commit is contained in:
parent
1f8a13bd22
commit
4f797de139
11 changed files with 1615 additions and 1166 deletions
|
|
@ -22,11 +22,11 @@
|
|||
</script>
|
||||
|
||||
<img src={media.bannerImage || ''} alt='banner' class='img-cover w-full h-full position-absolute' />
|
||||
<div class='pl-20 pb-20 justify-content-end d-flex flex-column h-full w-600 mw-full banner'>
|
||||
<div class='text-white font-weight-bold font-size-40 title overflow-hidden'>
|
||||
<div class='pl-20 pb-20 justify-content-end d-flex flex-column h-full banner mw-full '>
|
||||
<div class='text-white font-weight-bold font-size-40 title w-700 mw-full overflow-hidden'>
|
||||
{media.title.userPreferred}
|
||||
</div>
|
||||
<div class='details text-white text-capitalize pt-15 pb-10 d-flex'>
|
||||
<div class='details text-white text-capitalize pt-15 pb-10 d-flex w-600 mw-full'>
|
||||
<span class='text-nowrap d-flex align-items-center'>
|
||||
{#if media.format}
|
||||
{formatMap[media.format]}
|
||||
|
|
@ -51,17 +51,17 @@
|
|||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class='text-muted description overflow-hidden'>
|
||||
<div class='text-muted description overflow-hidden w-600 mw-full'>
|
||||
{media.description?.replace(/<[^>]*>/g, '')}
|
||||
</div>
|
||||
<div class='details text-white text-capitalize pt-15 pb-10 d-flex'>
|
||||
<div class='details text-white text-capitalize pt-15 pb-10 d-flex w-600 mw-full'>
|
||||
{#each media.genres as genre}
|
||||
<span class='text-nowrap d-flex align-items-center'>
|
||||
{genre}
|
||||
</span>
|
||||
{/each}
|
||||
</div>
|
||||
<div class='d-flex flex-row pb-20'>
|
||||
<div class='d-flex flex-row pb-20 w-600 mw-full'>
|
||||
<button class='btn bg-dark-light px-20 shadow-none border-0'
|
||||
use:click={() => playMedia(media)}>
|
||||
Watch Now
|
||||
|
|
@ -76,6 +76,9 @@
|
|||
</div>
|
||||
|
||||
<style>
|
||||
.w-700 {
|
||||
width: 70rem
|
||||
}
|
||||
.details span + span::before {
|
||||
content: '•';
|
||||
padding: 0 .5rem;
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
"name": "common",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@fontsource-variable/material-symbols-outlined": "latest",
|
||||
"@fontsource-variable/nunito": "latest",
|
||||
"@fontsource/roboto": "latest",
|
||||
"@fontsource-variable/material-symbols-outlined": "^5.0.24",
|
||||
"@fontsource-variable/nunito": "^5.0.18",
|
||||
"@fontsource/roboto": "^5.0.12",
|
||||
"anitomyscript": "github:ThaUnknown/anitomyscript#42290c4b3f256893be08a4e89051f448ff5e9d00",
|
||||
"bottleneck": "^2.19.5",
|
||||
"browser-event-target-emitter": "^1.0.1",
|
||||
|
|
@ -15,11 +15,11 @@
|
|||
"quartermoon": "^1.2.3",
|
||||
"simple-font-select": "^1.0.1",
|
||||
"simple-store-svelte": "^1.0.6",
|
||||
"svelte": "^4.2.7",
|
||||
"svelte": "^4.2.12",
|
||||
"svelte-keybinds": "^1.0.6",
|
||||
"svelte-loader": "^3.1.9",
|
||||
"svelte-miniplayer": "^1.0.5",
|
||||
"svelte-sonner": "^0.3.9",
|
||||
"svelte-sonner": "^0.3.19",
|
||||
"video-deband": "^1.0.5",
|
||||
"webpack-merge": "^5.10.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@
|
|||
"publish": "npm run web:build && electron-builder -p always"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron/notarize": "^2.2.0",
|
||||
"@electron/notarize": "^2.3.0",
|
||||
"common": "workspace:*",
|
||||
"discord-rpc": "4.0.1",
|
||||
"electron": "25.1.0",
|
||||
"electron-builder": "^24.6.4",
|
||||
"electron-log": "^5.0.1",
|
||||
"electron-updater": "^6.1.4",
|
||||
"electron-builder": "^24.13.3",
|
||||
"electron-log": "^5.1.1",
|
||||
"electron-updater": "^6.1.8",
|
||||
"webpack-merge": "^5.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -81,7 +81,10 @@
|
|||
},
|
||||
"win": {
|
||||
"artifactName": "${os}-${name}-${version}.${ext}",
|
||||
"target": ["nsis", "portable"]
|
||||
"target": [
|
||||
"nsis",
|
||||
"portable"
|
||||
]
|
||||
},
|
||||
"linux": {
|
||||
"artifactName": "${os}-${name}-${version}.${ext}",
|
||||
|
|
|
|||
22
package.json
22
package.json
|
|
@ -16,24 +16,24 @@
|
|||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/parser": "^6.12.0",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
"concurrently": "^8.2.2",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"copy-webpack-plugin": "^12.0.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^6.8.1",
|
||||
"eslint": "^8.54.0",
|
||||
"css-loader": "^6.10.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-plugin-svelte": "^2.35.1",
|
||||
"html-webpack-plugin": "^5.5.3",
|
||||
"matroska-metadata": "^1.0.4",
|
||||
"mini-css-extract-plugin": "^2.7.6",
|
||||
"webpack": "^5.89.0",
|
||||
"html-webpack-plugin": "^5.6.0",
|
||||
"matroska-metadata": "^1.0.5",
|
||||
"mini-css-extract-plugin": "^2.8.1",
|
||||
"webpack": "^5.90.3",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^4.15.1",
|
||||
"webtorrent": "^2.1.29"
|
||||
"webpack-dev-server": "^5.0.2",
|
||||
"webtorrent": "^2.1.37"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20231121.0",
|
||||
"@cloudflare/workers-types": "^4.20240222.0",
|
||||
"npm-run-all": "^4.1.5"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2648
pnpm-lock.yaml
2648
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
|
@ -10,20 +10,21 @@
|
|||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-auto": "^2.1.1",
|
||||
"@sveltejs/adapter-static": "^2.0.3",
|
||||
"@sveltejs/kit": "^1.27.6",
|
||||
"svelte": "^4.2.7",
|
||||
"svelte-check": "^3.6.2",
|
||||
"typescript": "^5.3.2",
|
||||
"vite": "^5.0.4"
|
||||
"@sveltejs/adapter-auto": "^3.1.1",
|
||||
"@sveltejs/adapter-static": "^3.0.1",
|
||||
"@sveltejs/kit": "^2.5.2",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.2",
|
||||
"svelte": "^4.2.12",
|
||||
"svelte-check": "^3.6.6",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource-variable/material-symbols-outlined": "^5.0.16",
|
||||
"@fontsource-variable/nunito": "^5.0.16",
|
||||
"@fontsource/roboto": "^5.0.8",
|
||||
"@fontsource-variable/material-symbols-outlined": "^5.0.24",
|
||||
"@fontsource-variable/nunito": "^5.0.18",
|
||||
"@fontsource/roboto": "^5.0.12",
|
||||
"quartermoon": "^1.2.3",
|
||||
"simple-store-svelte": "^1.0.1"
|
||||
"simple-store-svelte": "^1.0.6"
|
||||
},
|
||||
"type": "module"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
animation: 2s transition ease forwards;
|
||||
}
|
||||
.text {
|
||||
font-size: 10rem;
|
||||
font-size: clamp(0px, 10rem, 15vw);
|
||||
color: transparent;
|
||||
font-family: Verdana, sans-serif;
|
||||
width: 100vw;
|
||||
|
|
|
|||
24
web/src/routes/+error.svelte
Normal file
24
web/src/routes/+error.svelte
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<script>
|
||||
import { page } from '$app/stores'
|
||||
|
||||
console.log($page)
|
||||
</script>
|
||||
<div class='overflow-x-hidden content-wrapper h-full overflow-y-scroll position-relative d-flex justify-content-center align-items-center text-white font-weight-lighter line-height-11 px-15'>
|
||||
<div class='w-600 d-sm-flex justify-content-center align-items-center flex-row d-none'>
|
||||
<div class='fs-80 border-right pr-20'>{$page.status}</div>
|
||||
<div class='font-size-24 pl-20 text-wrap mw-full'>{$page.error?.message || 'Error'}</div>
|
||||
</div>
|
||||
<div class='w-600 d-flex justify-content-center align-items-center flex-column d-sm-none'>
|
||||
<div class='fs-80 pb-15 border-bottom'>{$page.status}</div>
|
||||
<div class='font-size-24 pt-20 text-wrap mw-full'>{$page.error?.message || 'Error'}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.fs-80 {
|
||||
font-size: 8rem;
|
||||
}
|
||||
.line-height-11 {
|
||||
line-height: 1.1;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -16,8 +16,9 @@ export function load ({ fetch }) {
|
|||
releases: (async () => {
|
||||
try {
|
||||
const res = await fetch('https://api.github.com/repos/ThaUnknown/miru/releases')
|
||||
/** @type {any[]} */
|
||||
const json = await res.json()
|
||||
return json.map(({ body, tag_name: version, published_at: date, assets }) => ({ body, version, date, assets }))
|
||||
return json.map(({ body, tag_name: version, published_at: date, assets }) => /** @type {{ body: string, version: string, date: string, assets: {name: string, browser_download_url: string}[] }} */({ body, version, date, assets }))
|
||||
} catch (e) {
|
||||
return []
|
||||
}
|
||||
|
|
@ -25,6 +26,7 @@ export function load ({ fetch }) {
|
|||
stargazers: (async () => {
|
||||
try {
|
||||
const res = await fetch('https://api.github.com/repos/ThaUnknown/miru/stargazers?per_page=100&page=' + (Math.round(Math.random() * 10) + 1))
|
||||
/** @type {any[]} */
|
||||
const json = await res.json()
|
||||
return json.map(({ html_url: htmlUrl, avatar_url: avatarUrl, login }) => ({ htmlUrl, avatarUrl, login }))
|
||||
} catch (e) {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
export let data
|
||||
|
||||
function getOS () {
|
||||
// @ts-ignore
|
||||
const platform = navigator.userAgentData?.platform || navigator.platform
|
||||
const macosPlatforms = ['macOS', 'Macintosh', 'MacIntel', 'MacPPC', 'Mac68K']
|
||||
const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE']
|
||||
|
|
@ -39,12 +40,12 @@
|
|||
|
||||
const { assets } = releases[0]
|
||||
downloads = {
|
||||
iOS: '',
|
||||
Android: 'https://play.google.com',
|
||||
Windows: assets.find(({ name }) => name.endsWith('installer.exe')).browser_download_url,
|
||||
'Mac OS': assets.find(({ name }) => name.endsWith('.dmg')).browser_download_url,
|
||||
Linux: assets.find(({ name }) => name.endsWith('.AppImage')).browser_download_url,
|
||||
Debian: assets.find(({ name }) => name.endsWith('.deb')).browser_download_url
|
||||
iOS: 'https://www.android.com',
|
||||
Android: '',
|
||||
Windows: assets.find(({ name }) => name.endsWith('installer.exe'))?.browser_download_url || '',
|
||||
'Mac OS': assets.find(({ name }) => name.endsWith('.dmg'))?.browser_download_url || '',
|
||||
Linux: assets.find(({ name }) => name.endsWith('.AppImage'))?.browser_download_url || '',
|
||||
Debian: assets.find(({ name }) => name.endsWith('.deb'))?.browser_download_url || ''
|
||||
}
|
||||
return downloads
|
||||
}
|
||||
|
|
@ -55,6 +56,7 @@
|
|||
|
||||
setTimeout(async () => {
|
||||
const downloads = await downloadForOS()
|
||||
if (!downloads) return
|
||||
location.href = downloads[userOS]
|
||||
}, 2000)
|
||||
</script>
|
||||
|
|
@ -101,7 +103,7 @@
|
|||
<div class='d-flex w-500 mw-full gap-2'>
|
||||
<a class='text-reset card pointer col-2 m-0 mb-20 mw-full pb-20 w-250 flex-grow-1' href={downloads.Android || releases}>
|
||||
<AndroidSVG />
|
||||
<div class='font-size-18 font-weight-semi-bold mt-5'>Android</div>
|
||||
<div class='font-size-18 font-weight-semi-bold mt-5'>Android Soon™️</div>
|
||||
<div class='text-muted'>apk</div>
|
||||
</a>
|
||||
<a class='text-reset card pointer col-2 m-0 mb-20 mw-full pb-20 w-250 flex-grow-1' href={downloads.Android || releases}>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import adapter from '@sveltejs/adapter-static'
|
||||
import { vitePreprocess } from '@sveltejs/kit/vite'
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
preprocess: vitePreprocess(),
|
||||
preprocess: vitePreprocess({}),
|
||||
kit: {
|
||||
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
||||
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
|
||||
|
|
|
|||
Loading…
Reference in a new issue