canvas-reveal
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -7,10 +7,4 @@ type RevealConfig = { | ||
}; | ||
declare function createReveal(configuration: Partial<RevealConfig>): { | ||
pause: () => void; | ||
play: () => void; | ||
restart: () => void; | ||
reverse: () => void; | ||
seek: (time: number) => void; | ||
}; | ||
declare function createReveal(configuration: Partial<RevealConfig>): gsap.core.Timeline; | ||
export { createReveal }; |
@@ -28,4 +28,10 @@ "use strict"; | ||
function createReveal(configuration) { | ||
const fallbackCanvas = document.createElement("canvas"); | ||
fallbackCanvas.width = window.innerWidth; | ||
fallbackCanvas.height = window.innerHeight; | ||
fallbackCanvas.style.position = "absolute"; | ||
fallbackCanvas.style.inset = "0"; | ||
fallbackCanvas.style.pointerEvents = "none"; | ||
let defaultConfig = { | ||
canvasElement: document.createElement("canvas"), | ||
canvasElement: fallbackCanvas, | ||
svgBase64: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTM0IiBoZWlnaHQ9IjgwMCIgdmlld0JveD0iMCAwIDUzNCA4MDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0wLjMzMzI1MiAwSDUzMy42NjdWMjY2LjY2N0gyNjdMMC4zMzMyNTIgMFpNMC4zMzMyNTIgMjY2LjY2N0gyNjdMNTMzLjY2NyA1MzMuMzMzSDAuMzMzMjUyVjI2Ni42NjdaTTAuMzMzMjUyIDUzMy4zMzNIMjY3VjgwMEwwLjMzMzI1MiA1MzMuMzMzWiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==", | ||
@@ -81,3 +87,3 @@ animationDuration: 2.2, | ||
opacity: 0, | ||
duration: 1.2, | ||
duration: 0.8, | ||
ease: import_gsap.Power1.easeInOut, | ||
@@ -112,9 +118,3 @@ onUpdate: draw | ||
} | ||
return { | ||
pause: () => tl.pause(), | ||
play: () => tl.play(), | ||
reverse: () => tl.reverse(), | ||
restart: () => tl.restart(), | ||
seek: (time) => tl.seek(time) | ||
}; | ||
return tl; | ||
} | ||
@@ -121,0 +121,0 @@ // Annotate the CommonJS export names for ESM import in node: |
{ | ||
"name": "canvas-reveal", | ||
"author": "", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A canvas reveal intro animation", | ||
@@ -6,0 +6,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
20484
226