From b07307b365f5be03ec3f1df141346a739e204f88 Mon Sep 17 00:00:00 2001 From: Yoone Date: Sun, 14 Dec 2025 23:31:18 +0800 Subject: [PATCH] chore --- dist/assets/SnowAnimator-Dem4j_A7.js | 1 - dist/index.js | 2 +- dist/snow.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 dist/assets/SnowAnimator-Dem4j_A7.js diff --git a/dist/assets/SnowAnimator-Dem4j_A7.js b/dist/assets/SnowAnimator-Dem4j_A7.js deleted file mode 100644 index 5eecf81..0000000 --- a/dist/assets/SnowAnimator-Dem4j_A7.js +++ /dev/null @@ -1 +0,0 @@ -function g(){return window.YooneSnowShapeRenderers||(window.YooneSnowShapeRenderers={}),window.YooneSnowShapeRenderers}function p(t){if(!t)return{img:null,ready:!1};const o=window.YooneSnowImageCache=window.YooneSnowImageCache||{},n=o[t];if(n&&n.ready||n&&!n.ready)return n;const e=new Image,i={img:e,ready:!1};o[t]=i;try{e.decoding="async"}catch{}try{e.fetchPriority="low"}catch{}return e.onload=function(){i.ready=!0},e.onerror=function(){delete o[t]},e.src=t,i}function X(t,o){if(!t){o(!1);return}const n=window.YooneSnowImageCache=window.YooneSnowImageCache||{},e=n[t];if(e&&e.ready){o(!0);return}if(e||(n[t]={img:null,ready:!1}),typeof fetch=="function"&&typeof window.createImageBitmap=="function")fetch(t,{cache:"force-cache"}).then(i=>i.blob()).then(i=>window.createImageBitmap(i)).then(i=>{n[t]={img:i,ready:!0},o(!0)}).catch(()=>{const i=p(t);let s=!1;if(i&&i.img instanceof HTMLImageElement){const a=()=>{i.ready=!0};i.img.onload=function(){s||(s=!0,a(),o(!0))},i.img.onerror=function(){s||(s=!0,o(!1))}}else o(!1)});else{const i=p(t);let s=!1;if(i&&i.img instanceof HTMLImageElement){const a=()=>{i.ready=!0};i.img.onload=function(){s||(s=!0,a(),o(!0))},i.img.onerror=function(){s||(s=!0,o(!1))}}else o(!1)}}function M(t,o,n,e,i,s){const a=n-i/2,c=e-s/2;t.drawImage(o,a,c,i,s)}window.YooneSnowGetOrLoadImage=p;window.YooneSnowLoadAssetViaFetch=X;window.YooneSnowDrawCenteredImage=M;const D=g();D.dot=function(t,o,n,e){t.beginPath(),t.arc(o,n,e,0,Math.PI*2),t.fillStyle="rgba(255,255,255,0.9)",t.fill()};const H=g();H.flake=function(t,o,n,e){const i=e*3;t.save(),t.translate(o,n),t.fillStyle="rgba(255,255,255,0.9)",t.strokeStyle="rgba(255,255,255,0.9)",t.lineWidth=i*.15;for(let s=0;s<6;s++)t.rotate(Math.PI/3),t.beginPath(),t.moveTo(0,0),t.lineTo(0,i),t.stroke(),t.beginPath(),t.moveTo(0,i*.3),t.lineTo(i*.3,i*.5),t.stroke(),t.beginPath(),t.moveTo(0,i*.5),t.lineTo(-i*.3,i*.7),t.stroke(),t.beginPath(),t.moveTo(0,i*.7),t.lineTo(i*.3,i*.9),t.stroke();t.restore()};const z=g();z.yuanbao=function(t,o,n,e){t.save(),t.translate(o,n),t.scale(e*.08,e*.08),t.fillStyle="rgba(255,215,0,0.9)",t.beginPath(),t.moveTo(-20,0),t.quadraticCurveTo(0,-12,20,0),t.quadraticCurveTo(0,12,-20,0),t.fill(),t.beginPath(),t.arc(0,0,6,0,Math.PI*2),t.fill(),t.restore()};const E=g();E.coin=function(t,o,n,e){const i=t.createRadialGradient(o,n,e*.2,o,n,e);i.addColorStop(0,"rgba(255,230,120,0.95)"),i.addColorStop(1,"rgba(240,180,60,0.85)"),t.fillStyle=i,t.beginPath(),t.arc(o,n,e*2.5,0,Math.PI*2),t.fill()};const U=g();U.santa_hat=function(t,o,n,e){const s=(window.YooneSnowSettings&&window.YooneSnowSettings.assetsMap?window.YooneSnowSettings.assetsMap:{}).santa_hat||"",a=p(s);if(!a||!a.ready||!a.img)return;const c=e*8,m=c;M(t,a.img,o,n,m,c)};const q=g();q.candy_cane=function(t,o,n,e){const s=(window.YooneSnowSettings&&window.YooneSnowSettings.assetsMap?window.YooneSnowSettings.assetsMap:{}).candy_cane||"",a=p(s);if(!a||!a.ready||!a.img)return;const c=e*8,m=c;M(t,a.img,o,n,m,c)};const B=g();B.christmas_sock=function(t,o,n,e){const s=(window.YooneSnowSettings&&window.YooneSnowSettings.assetsMap?window.YooneSnowSettings.assetsMap:{}).christmas_sock||"",a=p(s);if(!a||!a.ready||!a.img)return;const c=e*8,m=c;M(t,a.img,o,n,m,c)};const G=g();G.christmas_tree=function(t,o,n,e){const s=(window.YooneSnowSettings&&window.YooneSnowSettings.assetsMap?window.YooneSnowSettings.assetsMap:{}).christmas_tree||"",a=p(s);if(!a||!a.ready||!a.img)return;const c=e*8,m=c;M(t,a.img,o,n,m,c)};const N=g();N.reindeer=function(t,o,n,e){const s=(window.YooneSnowSettings&&window.YooneSnowSettings.assetsMap?window.YooneSnowSettings.assetsMap:{}).reindeer||"",a=p(s);if(!a||!a.ready||!a.img)return;const c=e*8,m=c;M(t,a.img,o,n,m,c)};const J=g();J.christmas_berry=function(t,o,n,e){const s=(window.YooneSnowSettings&&window.YooneSnowSettings.assetsMap?window.YooneSnowSettings.assetsMap:{}).christmas_berry||"",a=p(s);if(!a||!a.ready||!a.img)return;const c=e*8,m=c;M(t,a.img,o,n,m,c)};class K{constructor(o,n,e){this.onFrame=o,this.isDone=n,this.onStopped=e,this.lastTs=performance.now(),this.rafId=null,this.running=!1,this.loop=()=>{if(!this.running)return;const i=performance.now(),s=Math.max(0,(i-this.lastTs)/1e3);if(this.lastTs=i,this.onFrame(s),this.isDone()){this.stop(),this.onStopped&&this.onStopped();return}this.rafId=requestAnimationFrame(this.loop)}}init(){this.lastTs=performance.now(),this.running=!1}update(){this.running=!0,this.rafId=requestAnimationFrame(this.loop)}stop(){if(this.rafId!==null&&typeof cancelAnimationFrame=="function"){try{cancelAnimationFrame(this.rafId)}catch{}this.rafId=null}this.running=!1}}class I{init(o,n){}update(o,n,e){}}class Q{constructor(o){this.outOfView=!1,this.components=[],this.positionX=o.positionX,this.positionY=o.positionY,this.radius=o.radius,this.driftSpeed=o.driftSpeed,this.swingAmplitude=o.swingAmplitude,this.shapeType=o.shapeType,this.imageUrl=o.imageUrl||null,this.emojiText=o.emojiText||null}addComponent(o){this.components.push(o)}init(o){for(let n=0;no.getViewportHeight()+5&&(n.outOfView=!0)}}function ie(t,o,n,e){let i=o(),s=n();const a={getViewportWidth:()=>i,getViewportHeight:()=>s,context:t},c=[];let m=0,S=Math.random();const x=.61803398875,_=performance.now();let Y=!1;function C(){const r=Math.min(i,s),l=u=>{const h=i*s;return Math.floor(u==="small"?Math.min(80,Math.max(40,h/36e3)):u==="medium"?Math.min(200,Math.max(100,h/18e3)):Math.min(300,Math.max(140,h/12e3)))};let d=0;return r<=480?d=e.maxCountSmall>0?e.maxCountSmall:l("small"):r<=960?d=e.maxCountMedium>0?e.maxCountMedium:l("medium"):d=e.maxCountLarge>0?e.maxCountLarge:l("large"),d<=0&&(d=e.maxCount>0?e.maxCount:l(r<=480?"small":r<=960?"medium":"large")),Math.max(1,d)}let y=C();function P(){const r=[];for(let h=0;h0&&r.push({kind:"shape",key:f,weight:w})}for(let h=0;h0&&r.push({kind:"emoji",text:f,weight:w})}for(let h=0;h0&&r.push({kind:"text",text:f,weight:w})}for(let h=0;h0&&r.push({kind:"media",url:f,weight:w})}if(r.length===0)return null;let l=0;for(let h=0;h0)return l/r;const d=(e.driftMin+e.driftMax)*.5,u=(e.radiusMin+e.radiusMax)*.5*e.radiusMin;return(d*2+u*.25)*60}function j(){const r=b(),l=(s+5)/Math.max(.001,r),d=y/Math.max(.001,l),u=Math.min(1.2,Math.max(.6,l*.2)),h=Math.floor(d*u),f=Math.floor(y*.45);return Math.max(8,Math.min(f,h))}function k(r,l){const d=A(r,l);return d?(c.push(d),!0):!1}function V(){if(Y||c.length>0)return;const r=j();for(let l=0;ls+5&&(d.outOfView=!0)}}}function W(){t.clearRect(0,0,i,s);for(let r=0;r=0;l--)c[l].outOfView&&c.splice(l,1);if(!Y){const l=b(),d=(s+5)/Math.max(.001,l),u=y/Math.max(.001,d);m+=u*Math.max(0,r);const h=Math.max(0,y-c.length);let f=Math.min(h,Math.floor(m));f===0&&h>0&&(f=1);const w=Math.max(1,Math.floor(y*.05));f>w&&(f=w);let T=0;for(let v=0;v0&&(m=Math.max(0,m-T))}$(r)}function F(){W()}function O(){return e.displayDurationSeconds>0&&!Y&&(performance.now()-_)/1e3>=e.displayDurationSeconds&&(Y=!0),Y?c.every(r=>r.outOfView):!1}return{engine:a,recomputeTarget(){y=C()},updateSystem:L,renderSystem:F,shouldStop:O,setViewport(r,l){i=r,s=l}}}function oe(t,o){const n=t.getContext("2d");let e=window.innerWidth,i=window.innerHeight;const s=window.devicePixelRatio||1;function a(){e=window.innerWidth,i=window.innerHeight,t.style.width=`${e}px`,t.style.height=`${i}px`,t.width=Math.floor(e*s),t.height=Math.floor(i*s),n.setTransform(s,0,0,s,0,0),c.setViewport(e,i),c.recomputeTarget()}a();const c=ie(n,()=>e,()=>i,o),m=new K(x=>{c.updateSystem(x),c.renderSystem()},()=>c.shouldStop(),()=>{n.clearRect(0,0,e,i),t.style.display="none"});function S(){a()}return window.addEventListener("resize",S),m.init(),m.update(),{stop(){m.stop(),window.removeEventListener("resize",S)}}}export{oe as r}; diff --git a/dist/index.js b/dist/index.js index 912d5c3..fe94a93 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1 +1 @@ -import{r as a}from"./assets/SnowAnimator-Dem4j_A7.js";function i(){const t=document.getElementById("effectiveAppsSnow");if(!t)return;if(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){t.style.display="none";return}const e=window.YooneSnowSettings||{},n={selectedShapes:Array.isArray(e.selectedShapes)?e.selectedShapes:[],mediaItems:Array.isArray(e.mediaItems)?e.mediaItems:[],emojiItems:Array.isArray(e.emojiItems)?e.emojiItems:[],textItems:Array.isArray(e.textItems)?e.textItems:[],shapeWeights:e.shapeWeights||{},mediaWeights:e.mediaWeights||{},emojiWeights:e.emojiWeights||{},textWeights:e.textWeights||{},radiusMin:typeof e.radiusMin=="number"?e.radiusMin:1,radiusMax:typeof e.radiusMax=="number"?e.radiusMax:3,driftMin:typeof e.driftMin=="number"?e.driftMin:.4,driftMax:typeof e.driftMax=="number"?e.driftMax:1,swingMin:typeof e.swingMin=="number"?e.swingMin:.2,swingMax:typeof e.swingMax=="number"?e.swingMax:1,displayDurationSeconds:typeof e.displayDurationSeconds=="number"?e.displayDurationSeconds:0,maxCount:typeof e.maxCount=="number"?e.maxCount:0,maxCountSmall:typeof e.maxCountSmall=="number"?e.maxCountSmall:0,maxCountMedium:typeof e.maxCountMedium=="number"?e.maxCountMedium:0,maxCountLarge:typeof e.maxCountLarge=="number"?e.maxCountLarge:0,assetsMap:e.assetsMap||{}};a(t,n)}document.readyState==="complete"?i():window.addEventListener("load",i); +import{r as a}from"./assets/SnowAnimator-DHgISMxV.js";function i(){const t=document.getElementById("effectiveAppsSnow");if(!t)return;if(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){t.style.display="none";return}const e=window.YooneSnowSettings||{},n={selectedShapes:Array.isArray(e.selectedShapes)?e.selectedShapes:[],mediaItems:Array.isArray(e.mediaItems)?e.mediaItems:[],emojiItems:Array.isArray(e.emojiItems)?e.emojiItems:[],textItems:Array.isArray(e.textItems)?e.textItems:[],shapeWeights:e.shapeWeights||{},mediaWeights:e.mediaWeights||{},emojiWeights:e.emojiWeights||{},textWeights:e.textWeights||{},radiusMin:typeof e.radiusMin=="number"?e.radiusMin:1,radiusMax:typeof e.radiusMax=="number"?e.radiusMax:3,driftMin:typeof e.driftMin=="number"?e.driftMin:.4,driftMax:typeof e.driftMax=="number"?e.driftMax:1,swingMin:typeof e.swingMin=="number"?e.swingMin:.2,swingMax:typeof e.swingMax=="number"?e.swingMax:1,displayDurationSeconds:typeof e.displayDurationSeconds=="number"?e.displayDurationSeconds:0,maxCount:typeof e.maxCount=="number"?e.maxCount:0,maxCountSmall:typeof e.maxCountSmall=="number"?e.maxCountSmall:0,maxCountMedium:typeof e.maxCountMedium=="number"?e.maxCountMedium:0,maxCountLarge:typeof e.maxCountLarge=="number"?e.maxCountLarge:0,assetsMap:e.assetsMap||{}};a(t,n)}document.readyState==="complete"?i():window.addEventListener("load",i); diff --git a/dist/snow.js b/dist/snow.js index 912d5c3..fe94a93 100644 --- a/dist/snow.js +++ b/dist/snow.js @@ -1 +1 @@ -import{r as a}from"./assets/SnowAnimator-Dem4j_A7.js";function i(){const t=document.getElementById("effectiveAppsSnow");if(!t)return;if(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){t.style.display="none";return}const e=window.YooneSnowSettings||{},n={selectedShapes:Array.isArray(e.selectedShapes)?e.selectedShapes:[],mediaItems:Array.isArray(e.mediaItems)?e.mediaItems:[],emojiItems:Array.isArray(e.emojiItems)?e.emojiItems:[],textItems:Array.isArray(e.textItems)?e.textItems:[],shapeWeights:e.shapeWeights||{},mediaWeights:e.mediaWeights||{},emojiWeights:e.emojiWeights||{},textWeights:e.textWeights||{},radiusMin:typeof e.radiusMin=="number"?e.radiusMin:1,radiusMax:typeof e.radiusMax=="number"?e.radiusMax:3,driftMin:typeof e.driftMin=="number"?e.driftMin:.4,driftMax:typeof e.driftMax=="number"?e.driftMax:1,swingMin:typeof e.swingMin=="number"?e.swingMin:.2,swingMax:typeof e.swingMax=="number"?e.swingMax:1,displayDurationSeconds:typeof e.displayDurationSeconds=="number"?e.displayDurationSeconds:0,maxCount:typeof e.maxCount=="number"?e.maxCount:0,maxCountSmall:typeof e.maxCountSmall=="number"?e.maxCountSmall:0,maxCountMedium:typeof e.maxCountMedium=="number"?e.maxCountMedium:0,maxCountLarge:typeof e.maxCountLarge=="number"?e.maxCountLarge:0,assetsMap:e.assetsMap||{}};a(t,n)}document.readyState==="complete"?i():window.addEventListener("load",i); +import{r as a}from"./assets/SnowAnimator-DHgISMxV.js";function i(){const t=document.getElementById("effectiveAppsSnow");if(!t)return;if(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){t.style.display="none";return}const e=window.YooneSnowSettings||{},n={selectedShapes:Array.isArray(e.selectedShapes)?e.selectedShapes:[],mediaItems:Array.isArray(e.mediaItems)?e.mediaItems:[],emojiItems:Array.isArray(e.emojiItems)?e.emojiItems:[],textItems:Array.isArray(e.textItems)?e.textItems:[],shapeWeights:e.shapeWeights||{},mediaWeights:e.mediaWeights||{},emojiWeights:e.emojiWeights||{},textWeights:e.textWeights||{},radiusMin:typeof e.radiusMin=="number"?e.radiusMin:1,radiusMax:typeof e.radiusMax=="number"?e.radiusMax:3,driftMin:typeof e.driftMin=="number"?e.driftMin:.4,driftMax:typeof e.driftMax=="number"?e.driftMax:1,swingMin:typeof e.swingMin=="number"?e.swingMin:.2,swingMax:typeof e.swingMax=="number"?e.swingMax:1,displayDurationSeconds:typeof e.displayDurationSeconds=="number"?e.displayDurationSeconds:0,maxCount:typeof e.maxCount=="number"?e.maxCount:0,maxCountSmall:typeof e.maxCountSmall=="number"?e.maxCountSmall:0,maxCountMedium:typeof e.maxCountMedium=="number"?e.maxCountMedium:0,maxCountLarge:typeof e.maxCountLarge=="number"?e.maxCountLarge:0,assetsMap:e.assetsMap||{}};a(t,n)}document.readyState==="complete"?i():window.addEventListener("load",i);