Skip to content

Instantly share code, notes, and snippets.

View snuffyDev's full-sized avatar
😮‍💨
nice

snuffy snuffyDev

😮‍💨
nice
View GitHub Profile
{
"mix": [
{
"thumbnails": [
{
"url": "https://i.ytimg.com/vi/TpAVV9-CnMw/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3kSqWebw-HEkw_iRxwZ_4upN1pGCQ",
"width": 400,
"height": 225
},
{
export function draggable(node: HTMLElement): SvelteActionReturnType {
let dy = 0;
let parentTop = 0;
const pos: { y?: number; } = {};
const initialNodeRect: { height?: number, top?: number; } = {};
// const lastPointerPos: { y?: number; } = {};
const dispatch = <T>(type: "dragstart" | "dragend" | "drag", detail: T) => node.dispatchEvent(new CustomEvent(type, { detail }));
/// get the rects for the nodes
@use "./mixins";
@include mixins.keyframe(fade-in-slide) {
0% {
transform: translate(0, -100%);
opacity: 0;
}
100% {
transform: translate(0, 0);
// transform-origin: left top;
opacity: 1;
import { browser } from "$app/env";
import type { FileEntry, FolderEntry } from "$lib/types/core";
import { forEach } from "$lib/utils/array";
export class IDBStore {
private $$: Promise<IDBDatabase> | undefined;
/**
* Creates an instance of IDBStore.
* @param {string} DB_NAME - Name of the database to be used as a VFS
* @param {string} DB_STORE_NAME - Name of the `objectStore` used by IndexedDB
import type { Config } from "./types/config";
import type { $File, FileEntry, FolderEntry } from "./types/core";
import { BaseAdapter } from "./adapters";
import type { FSMethods } from "./types/structs";
import type { Maybe } from "./types/util";
export class FS implements FSMethods {
private _adapter: BaseAdapter;
constructor(private config: Config) {
this._adapter = new BaseAdapter(config);
const list = {
"mix": [
{
"thumbnails": [
{
"url": "https://lh3.googleusercontent.com/YoQ-A-GOpgeE8tgdF3Rcf5z9V8NIIKjLH6_7X3QphIQUwVHioLu7Ik2wQzU0oCkyNm1TeLDLDYvomJ8=w60-h60-l90-rj",
"width": 60,
"height": 60
},
{
import { sortObj } from "./collections/objects";
import { Encoder } from "./strings";
const ChunkSizes = {
8: 8150,
16: 16300,
32: 32600,
} as const;
function normalizeObject<T = Record<string, unknown>>(data: T) {
<picture>
{#each headerThumbnail as thumbnail, i}
{#if i === 0}
<source media={`(max-width: ${thumbnail?.width}px)`} srcset={thumbnail.url} />
{:else}
<source
media={`(min-width: ${headerThumbnail[i - 1].width + 1}px) and (max-width: ${thumbnail?.width}px)`}
srcset={thumbnail.url}
/>
{/if}
// ____________________________________________________________________________
//
// Unit Conversion v.2.1.1
// ____________________________________________________________________________
//
// Function Input units
//
// Absolute length
// px(input); px, pt, pc, in, mm, cm, em, rem, number
// pt(input); px, pt, pc, in, mm, cm, em, rem, number
import { parseNextItem } from '$lib/parsers';
import type { Item, Song } from '$lib/types';
import { splice } from '$lib/utils/collections';
import { addToQueue, getSrc, notify, queryParams, type ResponseBody } from '$lib/utils/utils';
import { writable, get, type Writable } from 'svelte/store';
import { currentTitle, filterAutoPlay, key as mixListIndex, playerLoading } from './stores';
import { groupSession } from './_sessions';
export interface ISessionListProvider {