PageSourceSearch

https://aonsoku.vercel.app/assets/home-Di9kp0Ir.js

js aonsoku.vercel.app collected 2026-10-03 06:06:34 UTC 6,631 bytes, 1 lines download raw bytes

1import{r as e,j as s,z as t,w as a,v as l}from"./vendor-CB8aRiQb.js";import{A as r}from"./embla-CPQ8C8Vw.js";import{d as i,l as n,au as o,B as d,R as c,P as m,c as u,q as x,O as g,bk as h,aT as f}from"./index-DIInGoXD.js";import{L as j}from"./vendor-dom-Cy37woXv.js";import{E as p}from"./equalizer-bars-DULk0sl9.js";import{I as b}from"./image-loader-Bv8y544k.js";import{c as y,b as v}from"./convertSecondsToTime-C2I0dKwy.js";import{k as N,l as A}from"./lucide-Baf6G6lW.js";import{a as w,b as L,c as q,d as z,e as E,P as R}from"./preview-list-_YCEOJUZ.js";import{u as I}from"./tanstack-DnVwJE41.js";import{u as k}from"./i18n-B9NIix0Q.js";import"./lodash-5wnDK8zY.js";import"./crypto-CxPwrja9.js";import"./date-time-DF0UKTVy.js";import"./tailwind-84t1un2J.js";import"./radix-Ba6gAkaf.js";import"./forms-C7wX05ML.js";import"./formatters-8CKGHcJj.js";import"./markdown-W3r5aBu3.js";import"./album-grid-card-CEpxNXrG.js";import"./card-XEV2vW09.js";function P({src:t,blur:a=16,className:l}){const r=e.useRef(null);return e.useEffect((()=>{const e=r.current;if(!e||!t)return;const s=e.getContext("2d");if(!s)return;const l=new Image;l.crossOrigin="anonymous",l.src=t,l.onload=()=>{const t=l.width,r=l.height;e.width=t,e.height=r,s.clearRect(0,0,t,r),s.filter=`blur(${a/4}px)`,s.drawImage(l,0,0,t,r),s.fillStyle="rgba(0, 0, 0, 0.5)",s.filter="none",s.fillRect(0,0,t,r)}}),[t,a]),s.jsx("canvas",{ref:r,className:i("w-full h-full object-cover",l),style:{imageRendering:"auto"}})}function S({song:e}){const{setSongList:r,togglePlayPause:i}=n(),{isAlbumActive:x,isAlbumPlaying:g}=o(e.albumId);function h(){x?i():async function(){const s=await u.albums.getOne(e.albumId);if(!s)return;const t=s.song.findIndex((s=>s.id===e.id));r(s.song,t,!1,{id:s.id,name:s.name,type:"album"})}()}const f=g?"header-pause-button":"header-play-button";return s.jsx("div",{className:a("w-full h-[250px] 2xl:h-[300px] relative",l.isFirefox&&"bg-black/60"),children:s.jsx(b,{id:e.coverArt,type:"song",size:400,children:a=>s.jsxs(s.Fragment,{children:[s.jsx("div",{"data-testid":"header-bg",className:"absolute inset-0 z-0",children:s.jsx(P,{src:a,blur:16,className:"scale-110"})}),s.jsx("div",{className:"w-full h-full absolute z-10 bg-gradient-to-b from-transparent to-background-foreground",children:s.jsxs("div",{className:"flex h-full px-8 py-6 gap-4",children:[s.jsxs("div",{className:"h-full aspect-square relative group bg-skeleton rounded-lg","data-testid":"header-image-container",children:[s.jsx(t.LazyLoadImage,{src:a,alt:e.title,effect:"opacity",width:"100%",height:"100%",className:"aspect-square rounded-lg object-cover bg-center absolute inset-0 z-0","data-testid":"header-image"}),s.jsx("div",{className:"w-full h-full flex items-center justify-center rounded-lg bg-black bg-opacity-0 group-hover:bg-opacity-50 transition-colors duration-300 absolute inset-0 z-10",children:s.jsx(d,{className:"opacity-0 group-hover:opacity-100 transition-opacity duration-300 rounded-full w-14 h-14",variant:"outline",onClick:h,"data-testid":f,children:g?s.jsx(N,{className:"fill-foreground"}):s.jsx(A,{className:"fill-foreground"})})})]}),s.jsxs("div",{className:"flex flex-1 h-full flex-col justify-end",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[g&&s.jsx(p,{size:24,className:"text-foreground mb-1"}),s.jsx(j,{to:c.ALBUM.PAGE(e.albumId),className:"w-fit",children:s.jsx("h1",{"data-testid":"header-title",className:"w-full scroll-m-20 text-3xl 2xl:text-4xl font-bold tracking-tight mb-0 2xl:mb-1 hover:underline",children:e.title})})]}),e.artistId?s.jsx(j,{to:c.ARTIST.PAGE(e.artistId),className:"w-fit",children:s.jsx("h4",{"data-testid":"header-artist",className:"scroll-m-20 text-lg 2xl:text-xl font-semibold tracking-tight opacity-70 hover:underline",children:e.artist})}):s.jsx("h4",{"data-testid":"header-artist",className:"scroll-m-20 text-lg 2xl:text-xl font-semibold tracking-tight opacity-70",children:e.artist}),s.jsxs("div",{className:"flex gap-2 mt-1 2xl:mt-2",children:[void 0!==e.genre&&s.jsx(j,{to:c.ALBUMS.GENRE(e.genre),className:"flex",children:s.jsx(m,{variant:"neutral",className:"border","data-testid":"header-genre",children:e.genre})}),e.year&&s.jsx(m,{variant:"neutral",className:"border","data-testid":"header-year",children:e.year}),s.jsx(m,{variant:"neutral",className:"border","data-testid":"header-duration",children:y(e.duration)})]})]})]})})]})})})}function F(){const{data:e,isLoading:t,isFetching:a}=I({queryKey:[x.song.random],queryFn:()=>u.songs.getRandomSongs({size:10})}
1),l=g().pages.homeAutoScrollEnabled,i=g().pages.homeLoopEnabled;return t||a?s.jsx(h,{}):e&&0!==e.length?s.jsxs(w,{className:"w-full overflow-hidden z-10",opts:{loop:i},plugins:[r({delay:1e4,active:l})],"data-testid":"header-carousel",children:[s.jsx(L,{className:"ml-0 flex",children:e.map(((e,t)=>s.jsx(q,{className:"pl-0 basis-full maskImage-carousel-item transform-gpu","data-testid":`carousel-header-song-${t}`,children:s.jsx(S,{song:e})},e.id)))}),s.jsxs("div",{className:"absolute right-8 bottom-6 flex items-center gap-2",children:[s.jsx(z,{"data-testid":"header-carousel-previous",className:"relative inset-0 translate-x-0 translate-y-0 shadow-sm"}),s.jsx(E,{"data-testid":"header-carousel-next",className:"relative inset-0 translate-x-0 translate-y-0 shadow-sm"})]})]}):null}function M(){const{t:e}=k(),{data:t,isLoading:a}=I({queryKey:[x.album.random],queryFn:()=>u.albums.getAlbumList({size:16,type:"random"})});return a?s.jsx(f,{}):t&&t.list&&0!==t.list.length?s.jsx(R,{title:e("home.explore"),moreRoute:c.ALBUMS.RANDOM,list:t.list}):null}function T(){const{t:e}=k(),{data:t,isLoading:a}=I({queryKey:[x.album.mostPlayed],queryFn:()=>u.albums.getAlbumList({size:16,type:"frequent"})});return a?s.jsx(f,{}):t&&t.list&&0!==t.list.length?s.jsx(R,{title:e("home.mostPlayed"),moreRoute:c.ALBUMS.MOST_PLAYED,list:t.list}):null}function B(){const{t:e}=k(),{data:t,isLoading:a}=I({queryKey:[x.album.recentlyAdded],queryFn:()=>u.albums.getAlbumList({size:16,type:"newest"})});return a?s.jsx(f,{}):t&&t.list&&0!==t.list.length?s.jsx(R,{title:e("home.recentlyAdded"),moreRoute:c.ALBUMS.RECENTLY_ADDED,list:t.list}):null}function D(){const{t:e}=k(),{data:t,isLoading:a}=I({queryKey:[x.album.recentlyPlayed],queryFn:()=>u.albums.getAlbumList({size:16,type:"recent"}),refetchInterval:v(2)});return a?s.jsx(f,{}):t&&t.list&&0!==t.list.length?s.jsx(R,{title:e("home.recentlyPlayed"),moreRoute:c.ALBUMS.RECENTLY_PLAYED,list:t.list}):null}function U(){return s.jsxs("div",{className:"w-full",children:[s.jsx(F,{}),s.jsxs("div",{className:"px-8 pb-6",children:[s.jsx(D,{}),s.jsx(T,{}),s.jsx(B,{}),s.jsx(M,{})]})]})}export{U as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.