start back button, other random fixes
This commit is contained in:
@@ -17,6 +17,7 @@ unicodePoints=(
|
|||||||
"e01f" # fast_forward
|
"e01f" # fast_forward
|
||||||
"e83a" # star_border
|
"e83a" # star_border
|
||||||
"e838" # star
|
"e838" # star
|
||||||
|
"e31b" # keyboard_return
|
||||||
)
|
)
|
||||||
unicodeStr=$(
|
unicodeStr=$(
|
||||||
IFS=,
|
IFS=,
|
||||||
|
|||||||
@@ -12,18 +12,6 @@ if (browser) {
|
|||||||
favoritedStreams.subscribe((val) => {
|
favoritedStreams.subscribe((val) => {
|
||||||
localStorage.setItem('favoritedStreams', JSON.stringify(Array.from(val)));
|
localStorage.setItem('favoritedStreams', JSON.stringify(Array.from(val)));
|
||||||
});
|
});
|
||||||
|
|
||||||
if ('mediaSession' in navigator) {
|
|
||||||
currentSongIndex.subscribe((val) => {
|
|
||||||
if (val != null) {
|
|
||||||
const song = get(currentStream).tracks[val];
|
|
||||||
navigator.mediaSession.metadata = new MediaMetadata({
|
|
||||||
artist: song[1],
|
|
||||||
title: song[2]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const tagList = [
|
export const tagList = [
|
||||||
|
|||||||
@@ -50,8 +50,6 @@
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<title>apt-get's auditorium</title>
|
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -6,3 +6,7 @@
|
|||||||
goto('/streams/');
|
goto('/streams/');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>apt-get's auditorium</title>
|
||||||
|
</svelte:head>
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
import WelcomePage from './WelcomePage.svelte';
|
import WelcomePage from './WelcomePage.svelte';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>apt-get's auditorium</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
<div id="welcome-page" class="panel"><WelcomePage /></div>
|
<div id="welcome-page" class="panel"><WelcomePage /></div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="description-bubble">
|
<div class="description-bubble">
|
||||||
<p>Hello, there, welcome to V1.</p>
|
<p>Hello, there, welcome to V1.5.</p>
|
||||||
<p>
|
<p>
|
||||||
Still in construction. No responsive design yet, so phones will be hard to use, but that's
|
Still in construction. The design is responsive now, so phones should work well enough!
|
||||||
coming, too!
|
Needs touch events though.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
There's gonna be an update feed soon (with RSS, too), but for now, just check the most
|
There's gonna be an update feed soon (with RSS, too), but for now, just check the most
|
||||||
@@ -15,6 +15,12 @@
|
|||||||
in the back-catalog.
|
in the back-catalog.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Also, event sets of mine are available <a href="https://apt-get.xyz/music/">right here</a>.
|
||||||
|
They've got visuals alongside and are proper DJ mixes, which makes them rather different
|
||||||
|
from the usual streams. They should live under this subdomain soon enough too!
|
||||||
|
</p>
|
||||||
|
|
||||||
<p style="font-size: smaller">
|
<p style="font-size: smaller">
|
||||||
Mascot drawn by <a href="https://twitter.com/yuuybee/">yuuybee</a>.
|
Mascot drawn by <a href="https://twitter.com/yuuybee/">yuuybee</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte';
|
import { onMount, onDestroy } from 'svelte';
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
import {
|
import {
|
||||||
currentSongIndex,
|
currentSongIndex,
|
||||||
@@ -58,9 +58,19 @@
|
|||||||
let innerHeight;
|
let innerHeight;
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
// default volume
|
||||||
const volumeData = localStorage.getItem('volume');
|
const volumeData = localStorage.getItem('volume');
|
||||||
volume = volumeData ? parseFloat(volumeData) : 0.67;
|
volume = volumeData ? parseFloat(volumeData) : 0.67;
|
||||||
setVolume(volume);
|
setVolume(volume);
|
||||||
|
|
||||||
|
// update browser metadata on track changes
|
||||||
|
if ('mediaSession' in navigator) {
|
||||||
|
currentSongIndex.subscribe((val) => {
|
||||||
|
if (val != null && !paused) {
|
||||||
|
setMediaMetadata($currentStream.tracks[val]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$: updateCurrentSong(currentTime, $currentSongIndex);
|
$: updateCurrentSong(currentTime, $currentSongIndex);
|
||||||
@@ -81,6 +91,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setMediaMetadata(track) {
|
||||||
|
navigator.mediaSession.metadata = new MediaMetadata({
|
||||||
|
artist: track[1],
|
||||||
|
title: track[2]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// browsers don't like if you update this while no media is playing
|
||||||
|
function setMediaMetadataOnPlay() {
|
||||||
|
if ('mediaSession' in navigator) {
|
||||||
|
setMediaMetadata($currentStream.tracks[$currentSongIndex]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// workaround for bug https://github.com/sveltejs/svelte/issues/5347
|
// workaround for bug https://github.com/sveltejs/svelte/issues/5347
|
||||||
// need to init duration & volume after SSR first load
|
// need to init duration & volume after SSR first load
|
||||||
function updateAudioAttributes(audio) {
|
function updateAudioAttributes(audio) {
|
||||||
@@ -229,7 +253,7 @@
|
|||||||
bind:currentTime
|
bind:currentTime
|
||||||
{muted}
|
{muted}
|
||||||
{volume}
|
{volume}
|
||||||
on:play
|
on:play={setMediaMetadataOnPlay}
|
||||||
on:ended
|
on:ended
|
||||||
{src}
|
{src}
|
||||||
{preload}
|
{preload}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import { shorthandCode, formatTrackTime, formatDate } from '$lib/utils.js';
|
import { shorthandCode, formatTrackTime, formatDate } from '$lib/utils.js';
|
||||||
import { jumpToTrack } from './Player.svelte';
|
import { jumpToTrack } from './Player.svelte';
|
||||||
import { Carta } from 'carta-md';
|
import { Carta } from 'carta-md';
|
||||||
|
import { goto } from '$app/navigation';
|
||||||
import DOMPurify from 'isomorphic-dompurify';
|
import DOMPurify from 'isomorphic-dompurify';
|
||||||
|
|
||||||
const carta = new Carta({
|
const carta = new Carta({
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="stream-information">
|
<div class="stream-information">
|
||||||
|
<!-- <div class="back-button material-icons" on:click={() => goto('/streams/')}>keyboard_return</div> -->
|
||||||
<div class="stream-information-flexbox">
|
<div class="stream-information-flexbox">
|
||||||
<h3 class="stream-id">ID: {shorthandCode($currentStream.id)}</h3>
|
<h3 class="stream-id">ID: {shorthandCode($currentStream.id)}</h3>
|
||||||
<h1 class="stream-date">{formattedStreamDate}</h1>
|
<h1 class="stream-date">{formattedStreamDate}</h1>
|
||||||
@@ -179,6 +181,17 @@
|
|||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.back-button {
|
||||||
|
opacity: 0.75;
|
||||||
|
border: 1px solid white;
|
||||||
|
transform: rotateX(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-button:hover {
|
||||||
|
opacity: 1;
|
||||||
|
border: 1px solid white;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 575px) {
|
@media (max-width: 575px) {
|
||||||
.material-icons {
|
.material-icons {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user