From 27439a364f45b1acdb342f467a8dabe457c35c06 Mon Sep 17 00:00:00 2001 From: Scott Tolinski Date: Mon, 11 Dec 2023 10:26:56 -0700 Subject: [PATCH] adds header icons --- package.json | 2 +- pnpm-lock.yaml | 16 +- src/lib/Icon.svelte | 84 +++++++-- src/lib/player/Player.svelte | 171 +++++++++--------- .../[slug]/embed/+page.server.ts | 47 +++++ .../[show_number]/[slug]/embed/+page.svelte | 69 +++++++ src/routes/(site)/+layout.svelte | 2 +- src/state/player.ts | 12 +- 8 files changed, 299 insertions(+), 104 deletions(-) create mode 100644 src/routes/(blank)/show/[show_number]/[slug]/embed/+page.server.ts create mode 100644 src/routes/(blank)/show/[show_number]/[slug]/embed/+page.svelte diff --git a/package.json b/package.json index 33788f307..693ac264d 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "gpt-3-encoder": "^1.1.4", "gray-matter": "^4.0.3", "js-cookie": "^3.0.5", - "media-chrome": "^1.4.4", + "media-chrome": "^2.0.0", "npm-run-all": "^4.1.5", "openai": "^3.3.0", "puppeteer-core": "^21.4.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5cf65034f..166424240 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + dependencies: '@anthropic-ai/sdk': specifier: ^0.6.2 @@ -56,8 +60,8 @@ dependencies: specifier: ^3.0.5 version: 3.0.5 media-chrome: - specifier: ^1.4.4 - version: 1.4.4 + specifier: ^2.0.0 + version: 2.0.0 npm-run-all: specifier: ^4.1.5 version: 4.1.5 @@ -4059,8 +4063,8 @@ packages: /mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} - /media-chrome@1.4.4: - resolution: {integrity: sha512-L3EImWE2ft3dEXnku7mwEl71L8GWFvsnqQQsmtlbuLqekCkIACjL1KjLErReALB9JmrY19ffB4GeGZjLZDwALg==} + /media-chrome@2.0.0: + resolution: {integrity: sha512-UIeBzZ3QQFoSLjz6SR1EXAX1nVbUWKDVXyNZRnb6HXQw19prk/MVWgBflDUx+IRR9UzRuJTHwYk/fbxwMgMg4g==} dev: false /memorystream@0.3.1: @@ -6899,7 +6903,3 @@ packages: which: 3.0.1 yaml: 2.3.2 dev: false - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false diff --git a/src/lib/Icon.svelte b/src/lib/Icon.svelte index 723195f54..302787659 100644 --- a/src/lib/Icon.svelte +++ b/src/lib/Icon.svelte @@ -18,6 +18,10 @@ | 'edit' | 'spotify' | 'apple-podcasts' + | 'minimize' + | 'back-30' + | 'forward-30' + | 'share' | 'download'; @@ -25,24 +29,25 @@ import { capitalize } from '$utilities/capitalize'; export let name: IconName; - export let title: string | boolean; + export let title: string | boolean = ''; export let ariaHidden = true; if (!title && title !== false) title = capitalize(name); {#if name === 'play'} {title} + /> + {/if} {#if name === 'playing'} {title} + d="M1 0C0.734784 0 0.48043 0.105357 0.292893 0.292893C0.105357 0.48043 0 0.734784 0 1V9C0 9.26522 0.105357 9.51957 0.292893 9.70711C0.48043 9.89464 0.734784 10 1 10H2C2.26522 10 2.51957 9.89464 2.70711 9.70711C2.89464 9.51957 3 9.26522 3 9V1C3 0.734784 2.89464 0.48043 2.70711 0.292893C2.51957 0.105357 2.26522 0 2 0H1ZM6 0C5.73478 0 5.48043 0.105357 5.29289 0.292893C5.10536 0.48043 5 0.734784 5 1V9C5 9.26522 5.10536 9.51957 5.29289 9.70711C5.48043 9.89464 5.73478 10 6 10H7C7.26522 10 7.51957 9.89464 7.70711 9.70711C7.89464 9.51957 8 9.26522 8 9V1C8 0.734784 7.89464 0.48043 7.70711 0.292893C7.51957 0.105357 7.26522 0 7 0H6Z" + /> + {/if} {#if name === 'sort'} @@ -299,6 +305,62 @@ /> {/if} +{#if name === 'back-30'} + + + + + +{/if} +{#if name === 'forward-30'} + + + + + +{/if} +{#if name === 'share'} + +{/if} +{#if name === 'minimize'} + +{/if} diff --git a/src/routes/(site)/+layout.svelte b/src/routes/(site)/+layout.svelte index 215fea491..c52f01af4 100644 --- a/src/routes/(site)/+layout.svelte +++ b/src/routes/(site)/+layout.svelte @@ -15,7 +15,7 @@ import ThemeMaker from '../../params/ThemeMaker.svelte'; import { page } from '$app/stores'; import PageLoadingIndicator from '$lib/page_loading_indicator.svelte'; - import UnderConstruction from '$lib/UnderConstruction.svelte'; + export let data; $: ({ user, user_theme } = data); diff --git a/src/state/player.ts b/src/state/player.ts index f9fc43b99..d88c18510 100644 --- a/src/state/player.ts +++ b/src/state/player.ts @@ -38,7 +38,7 @@ function loadMediaSession(show: Show) { const new_player_state = () => { const { subscribe, update, set } = writable<{ - status: 'HIDDEN' | 'ACTIVE' | 'EXPANDED'; + status: 'HIDDEN' | 'ACTIVE' | 'EXPANDED' | 'MINI'; current_show: null | Show; playing: boolean; audio?: HTMLAudioElement; @@ -113,6 +113,13 @@ const new_player_state = () => { }); } + function minimize() { + update((state) => { + state.status = 'MINI'; + return state; + }); + } + return { subscribe, update, @@ -120,7 +127,8 @@ const new_player_state = () => { toggle_expand, close, update_time, - set + set, + minimize }; };