Playlist Art, Minor Fixes

This commit is contained in:
Shiny Nematoda 2022-05-29 14:18:37 -05:00
parent abcd8eb7b5
commit a88c9081f1
8 changed files with 60 additions and 18 deletions

View file

@ -6,11 +6,13 @@ const c = [
'linear-gradient(45deg, #d08770, #bf616a)',
];
export function useColors() {
return c;
}
export function useRand() {
const i = Math.floor(Math.random() * c.length);
return c[i];
}
export function useRandColor() {
const r = Math.random().toString(16)
return '#' + r.substr(r.length - 6)
}

View file

@ -1,3 +1,5 @@
import { useStore } from './util.js'
export function getPipedQuery() {
const papi = new URLSearchParams(location.search).get('pipedapi');
@ -31,7 +33,7 @@ export async function getJson(url) {
export async function getJsonPiped(path) {
const root =
new URLSearchParams(location.search).get('pipedapi') ||
localStorage.getItem('pipedapi') ||
useStore().getItem('pipedapi') ||
'pipedapi.kavin.rocks';
return await getJson('https://' + root + path);