Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rainbow-line

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rainbow-line - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

CHANGELOG.md

4

bundle.js
/*!
@file rainbow-line - A custom element that displays a cut line animated with rainbow colors
@author Wolfger Schramm <wolfger@spearwolf.de>
@version 0.2.0+vanilla.20240228
@version 0.2.1+vanilla.20240512

@@ -43,3 +43,3 @@ Copyright 2024 Wolfger Schramm

</div>
`;#e=0;#t=0;#i=0;constructor(e=c.InitialHTML){super(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=e}queryCanvasElement(){return this.shadow.querySelector("canvas")}createWorker(){throw new Error("createWorker() must be implemented by subclass")}getContextAttributes(){return this.hasAttribute("no-alpha")?{alpha:!1}:{alpha:!0}}#r(){let e=this.canvas.getBoundingClientRect();return this.#e=e.width,this.#t=e.height,{width:e.width,height:e.height}}#n(e){let t=this.canvas.getBoundingClientRect();(this.#e!==t.width||this.#t!==t.height)&&(this.#e=t.width,this.#t=t.height,e(t.width,t.height))}#a=()=>{this.#n((e,t)=>{this.worker.postMessage({resize:{width:e,height:t}})}),this.#s()};#s(){this.#i=requestAnimationFrame(this.#a)}#l(){cancelAnimationFrame(this.#i)}#h(){this.canvas=this.queryCanvasElement();let e=this.canvas.transferControlToOffscreen();this.worker=this.createWorker(),this.worker.postMessage({canvas:e,contextAttributes:this.getContextAttributes(),...this.getInitialWorkerAttributes()},[e])}getInitialWorkerAttributes(){return{}}asNumberValue(e,t){if(this.hasAttribute(e)){let i=parseFloat(this.getAttribute(e));return isNaN(i)?t:i}return t}connectedCallback(){this.worker||this.#h(),this.worker.postMessage({isConnected:!0,resize:this.#r()}),this.#s()}disconnectedCallback(){this.worker.postMessage({isConnected:!1}),this.#l()}};var u=s=>s==="left"?1:-1,r=class extends o{static observedAttributes=["color-slice-width","slice-cycle-time","cycle-direction"];constructor(){super(`
`;#e=0;#t=0;#i=0;constructor(e=c.InitialHTML){super(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=e,this.worker=void 0}queryCanvasElement(){return this.shadow.querySelector("canvas")}createWorker(){throw new Error("createWorker() must be implemented by subclass")}getContextAttributes(){return this.hasAttribute("no-alpha")?{alpha:!1}:{alpha:!0}}#r(){let e=this.canvas.getBoundingClientRect();return this.#e=e.width,this.#t=e.height,{width:e.width,height:e.height}}#n(e){let t=this.canvas.getBoundingClientRect();(this.#e!==t.width||this.#t!==t.height)&&(this.#e=t.width,this.#t=t.height,e(t.width,t.height))}#a=()=>{this.#n((e,t)=>{this.worker.postMessage({resize:{width:e,height:t}})}),this.#s()};#s(){this.#i=requestAnimationFrame(this.#a)}#l(){cancelAnimationFrame(this.#i)}#h(){this.canvas=this.queryCanvasElement();let e=this.canvas.transferControlToOffscreen();this.worker=this.createWorker(),this.worker.postMessage({canvas:e,contextAttributes:this.getContextAttributes(),...this.getInitialWorkerAttributes()},[e])}getInitialWorkerAttributes(){return{}}asNumberValue(e,t){if(this.hasAttribute(e)){let i=parseFloat(this.getAttribute(e));return isNaN(i)?t:i}return t}connectedCallback(){this.worker||this.#h(),this.worker.postMessage({isConnected:!0,resize:this.#r()}),this.#s()}disconnectedCallback(){this.worker.postMessage({isConnected:!1}),this.#l()}};var u=s=>s==="left"?1:-1,r=class extends o{static observedAttributes=["color-slice-width","slice-cycle-time","cycle-direction"];constructor(){super(`
<style>

@@ -46,0 +46,0 @@ :host {

{
"name": "rainbow-line",
"description": "A custom element that displays a cut line animated with rainbow colors",
"version": "0.2.0",
"version": "0.2.1",
"type": "module",

@@ -36,5 +36,5 @@ "license": "Apache-2.0",

"@spearwolf/eventize": "^3.4.1",
"@spearwolf/offscreen-display": "^0.2.0",
"@spearwolf/offscreen-display": "^0.1.2",
"@spearwolf/signalize": "^0.13.0"
}
}
/*!
@file rainbow-line - A custom element that displays a cut line animated with rainbow colors
@author Wolfger Schramm <wolfger@spearwolf.de>
@version 0.2.0+vanilla.20240228
@version 0.2.1+vanilla.20240512

@@ -43,3 +43,3 @@ Copyright 2024 Wolfger Schramm

</div>
`;#t=0;#e=0;#i=0;constructor(t=o.InitialHTML){super(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=t}queryCanvasElement(){return this.shadow.querySelector("canvas")}createWorker(){throw new Error("createWorker() must be implemented by subclass")}getContextAttributes(){return this.hasAttribute("no-alpha")?{alpha:!1}:{alpha:!0}}#r(){let t=this.canvas.getBoundingClientRect();return this.#t=t.width,this.#e=t.height,{width:t.width,height:t.height}}#a(t){let e=this.canvas.getBoundingClientRect();(this.#t!==e.width||this.#e!==e.height)&&(this.#t=e.width,this.#e=e.height,t(e.width,e.height))}#n=()=>{this.#a((t,e)=>{this.worker.postMessage({resize:{width:t,height:e}})}),this.#s()};#s(){this.#i=requestAnimationFrame(this.#n)}#o(){cancelAnimationFrame(this.#i)}#h(){this.canvas=this.queryCanvasElement();let t=this.canvas.transferControlToOffscreen();this.worker=this.createWorker(),this.worker.postMessage({canvas:t,contextAttributes:this.getContextAttributes(),...this.getInitialWorkerAttributes()},[t])}getInitialWorkerAttributes(){return{}}asNumberValue(t,e){if(this.hasAttribute(t)){let i=parseFloat(this.getAttribute(t));return isNaN(i)?e:i}return e}connectedCallback(){this.worker||this.#h(),this.worker.postMessage({isConnected:!0,resize:this.#r()}),this.#s()}disconnectedCallback(){this.worker.postMessage({isConnected:!1}),this.#o()}};var h=a=>a==="left"?1:-1,s=class extends n{static observedAttributes=["color-slice-width","slice-cycle-time","cycle-direction"];constructor(){super(`
`;#t=0;#e=0;#i=0;constructor(t=o.InitialHTML){super(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=t,this.worker=void 0}queryCanvasElement(){return this.shadow.querySelector("canvas")}createWorker(){throw new Error("createWorker() must be implemented by subclass")}getContextAttributes(){return this.hasAttribute("no-alpha")?{alpha:!1}:{alpha:!0}}#r(){let t=this.canvas.getBoundingClientRect();return this.#t=t.width,this.#e=t.height,{width:t.width,height:t.height}}#a(t){let e=this.canvas.getBoundingClientRect();(this.#t!==e.width||this.#e!==e.height)&&(this.#t=e.width,this.#e=e.height,t(e.width,e.height))}#n=()=>{this.#a((t,e)=>{this.worker.postMessage({resize:{width:t,height:e}})}),this.#s()};#s(){this.#i=requestAnimationFrame(this.#n)}#o(){cancelAnimationFrame(this.#i)}#h(){this.canvas=this.queryCanvasElement();let t=this.canvas.transferControlToOffscreen();this.worker=this.createWorker(),this.worker.postMessage({canvas:t,contextAttributes:this.getContextAttributes(),...this.getInitialWorkerAttributes()},[t])}getInitialWorkerAttributes(){return{}}asNumberValue(t,e){if(this.hasAttribute(t)){let i=parseFloat(this.getAttribute(t));return isNaN(i)?e:i}return e}connectedCallback(){this.worker||this.#h(),this.worker.postMessage({isConnected:!0,resize:this.#r()}),this.#s()}disconnectedCallback(){this.worker.postMessage({isConnected:!1}),this.#o()}};var h=a=>a==="left"?1:-1,s=class extends n{static observedAttributes=["color-slice-width","slice-cycle-time","cycle-direction"];constructor(){super(`
<style>

@@ -46,0 +46,0 @@ :host {

/*!
@file rainbow-line - A custom element that displays a cut line animated with rainbow colors
@author Wolfger Schramm <wolfger@spearwolf.de>
@version 0.2.0+vanilla.20240228
@version 0.2.1+vanilla.20240512

@@ -6,0 +6,0 @@ Copyright 2024 Wolfger Schramm

@@ -14,3 +14,3 @@ ### rainbow-line

<script type="module" src="https://www.unpkg.com/rainbow-line@latest/bundle.js"></script>
<script type="module" src="https://www.unpkg.com/rainbow-line@latest"></script>
```

@@ -17,0 +17,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc