PageSourceSearch

https://www.tribute.co/static/v3/dist/creator/RainbowHeartsBackground-ncd8cg0q.js

js tribute.co collected 2026-09-24 20:00:32 UTC 4,706 bytes, 1 lines download raw bytes

1import{zj as F}from"./main-creator-hgv1jep8.js";import{Aj as H}from"./main-creator-rwdj6j5t.js";import"./main-creator-kydzhv9p.js";class I{container;isLoaded=!1;isInitialized=!1;svg=null;heartsArray=[];animationFrame=null;isDarkMode=!0;constructor(q,z=!0){this.container=q,this.isDarkMode=z,this.initHearts()}async initHearts(){if(this.isLoaded||this.isInitialized)return;try{await this.loadHeartsLibrary(),this.isLoaded=!0,this.createHearts()}catch(q){F.error("Failed to load rainbow hearts library:",q)}}loadHeartsLibrary(){return new Promise((q)=>{if(window.RainbowHearts){q();return}F.themeDebug("RainbowHearts","Rainbow hearts library ready for implementation"),q()})}createHearts(){if(this.isInitialized){F.themeDebug("RainbowHearts","Hearts already initialized, skipping");return}try{let q=document.createElement("div");q.id="rainbow-hearts-background",q.style.position="fixed",q.style.top="0",q.style.left="0",q.style.width="100%",q.style.height="100%",q.style.overflow="hidden",q.style.pointerEvents="none",H(q);let z=document.createComment(" Theme Background ");document.body.insertBefore(z,q),this.createSVGHearts(),F.themeDebug("RainbowHearts","Hearts initialization completed")}catch(q){F.error("Failed to initialize rainbow hearts:",q)}}createSVGHearts(){let q=document.createElementNS("http://www.w3.org/2000/svg","svg");q.setAttribute("id","hearts"),q.setAttribute("viewBox","-600 -400 1200 800"),q.setAttribute("preserveAspectRatio","xMidYMid slice"),q.style.width="100vw",q.style.height="100vh";let z=document.createElementNS("http://www.w3.org/2000/svg","defs"),w=document.createElementNS("http://www.w3.org/2000/svg","symbol");w.setAttribute("id","heart"),w.setAttribute("viewBox","-69 -16 138 138");let G=document.createElementNS("http://www.w3.org/2000/svg","path");G.setAttribute("d","M0,12 C 50,-30 110,50  0,120 C-110,50 -50,-30 0,12z"),w.appendChild(G),z.appendChild(w),q.appendChild(z);let C=document.getElementById("rainbow-hearts-background");if(C)C.appendChild(q),this.addOverlay(C);this.svg=q,this.heartsArray=[],this.initializeHearts(),this.isInitialized=!0,this.startAnimation()}addOverlay(q){let z=q.querySelector(".rainbow-hearts-overlay");if(z)z.remove();let w=document.createElement("div");if(w.className="rainbow-hearts-overlay",w.style.position="absolute",w.style.top="0",w.style.left="0",w.style.width="100%",w.style.height="100%",w.style.pointerEvents="none",w.style.zIndex="1",this.isDarkMode)w.style.backgroundColor="rgba(0, 0, 0, 0.50)";else w.style.backgroundColor="rgba(255, 255, 255, 0.50)";q.appendChild(w)}updateMode(q){this.isDarkMode=q;let z=document.getElementById("rainbow-hearts-background");if(z)this.addOverlay(z)}updateTheme(q){let z=q.isDark!==void 0?q.isDark:!0;if(this.isDarkMode!==z)this.updateMode(z)}initializeHearts(){let q=["#e03776","#8f3e98","#4687bf","#3bab6f","#f9c25e","#f47274"],z="http://www.w3.org/2000/svg",w="http://www.w3.org/1999/xlink";for(let G=18;G>=0;G--){let C=document.createElementNS("http://www.w3.org/2000/svg","use");if(C.n=G,C.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#heart"),C.setAttributeNS(null,"transform",`scale(${C.n})`),C.setAttributeNS(null,"fill",q[G%q.length]),C.setAttributeNS(null,"x","-69"),C.setAttributeNS(null,"y","-69"),C.setAttributeNS(null,"width","138"),C.setAttributeNS(null,"height","138"),this.heartsArray.push(C),this.svg)this.svg.appendChild(C)}}startAnimation(){if(this.animationFrame)return;let q=()=>{if(!this.isInitialized||!this.svg)return;for(let z=0;z<this.heartsArray.length;z++){let w=this.heartsArray[z];if(w.n<18)w.n+=0.01;else w.n=0,this.svg.appendChild(w);w.setAttributeNS(null,"transform",`scale(${w.n})`)}this.animationFrame=requestAnimationFrame(q)};this.animationFrame=requestAnimationFrame(q)}start(){if(this.isInitialized&&!this.animationFrame)this.startAnimation(),F.themeDebug("RainbowHearts","Starting rainbow hearts animation")}stop(){if(this.animationFrame)cancelAnimationFrame(this.animationFrame),this.animationFrame=null,F.themeDebug("RainbowHearts","Stopping rainbow hearts animation")}pause(){if(this.animationFrame)this.stop();else this.start();F.themeDebug("RainbowHearts","Pausing rainbow hearts animation")}clear(){if(this.svg)this.svg.innerHTML="";this.heartsArray=[],F.themeDebug("RainbowHearts","Clearing rainbow hearts")}destroy(){this.stop(),this.clear();let q=document.getElementById("rainbow-hearts-background");if(q&&q.parentNode)q.parentNode.removeChild(q);this.svg=null,this.isInitialized=!1,this.isLoaded=!1,document.querySelectorAll("style").forEach((w)=>{if(w.textContent&&w.textContent.includes("#rainbow-hearts-bg"))w.remove()}),F.themeDebug("RainbowHearts","Rainbow hearts destroyed")}}
1export{I as RainbowHeartsBackground};

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.