barbican-reset 1.6.9 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/animations/confirm.js +62 -0
- package/animations/index.js +8 -0
- package/package.json +2 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import gsap from 'gsap'
|
|
2
|
+
import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin'
|
|
3
|
+
|
|
4
|
+
gsap.registerPlugin(DrawSVGPlugin);
|
|
5
|
+
|
|
6
|
+
const fadeIn = {
|
|
7
|
+
duration: 0.3,
|
|
8
|
+
opacity: 0,
|
|
9
|
+
delay: 0.3,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const explode = {
|
|
13
|
+
ease: "power1.out",
|
|
14
|
+
opacity: 0,
|
|
15
|
+
scale: 1.5,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const defaults = {
|
|
19
|
+
duration: 0.6,
|
|
20
|
+
ease: "power1.in",
|
|
21
|
+
transformOrigin: "center"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const animateEmail = () => {
|
|
25
|
+
const query = target => document.querySelector(`.card[email] ${target}`);
|
|
26
|
+
const title = query(".card-title");
|
|
27
|
+
const outline = query(".outline");
|
|
28
|
+
const arrow = query(".arrow");
|
|
29
|
+
const fold = query(".fold");
|
|
30
|
+
const tl = gsap.timeline({ defaults });
|
|
31
|
+
|
|
32
|
+
const clone = title.cloneNode(true);
|
|
33
|
+
clone.classList.add("clone");
|
|
34
|
+
title.after(clone);
|
|
35
|
+
|
|
36
|
+
tl.set(arrow, { opacity: 0 })
|
|
37
|
+
.from(title, fadeIn)
|
|
38
|
+
.set(clone, { opacity: 0.4 })
|
|
39
|
+
.from(outline, { drawSVG: "0%" }, "start")
|
|
40
|
+
.from(fold, { drawSVG: "0%", duration: 0.3 }, "start")
|
|
41
|
+
.to(clone, explode, "start")
|
|
42
|
+
.set(arrow, { opacity: 1 })
|
|
43
|
+
.from(arrow, { x: -6, ease: "power1.out" });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const animateDone = () => {
|
|
47
|
+
const query = target => document.querySelector(`.card[done] ${target}`);
|
|
48
|
+
const title = query(".card-title");
|
|
49
|
+
const outline = query(".outline");
|
|
50
|
+
const tick = query(".tick");
|
|
51
|
+
const tl = gsap.timeline({ defaults });
|
|
52
|
+
|
|
53
|
+
const clone = title.cloneNode(true);
|
|
54
|
+
clone.classList.add("clone");
|
|
55
|
+
title.after(clone);
|
|
56
|
+
|
|
57
|
+
tl.from(title, fadeIn)
|
|
58
|
+
.set(clone, { opacity: 0.4 })
|
|
59
|
+
.from(outline, { drawSVG: "0%" }, "start")
|
|
60
|
+
.from(tick, { drawSVG: "0%", duration: 0.3 }, "start+=0.3")
|
|
61
|
+
.to(clone, explode, "start");
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "barbican-reset",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "A collection of useful scss imports and js scripts, that provide consistent styling and functionality across barbican projects.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"fonts/*.{woff,woff2}",
|
|
17
17
|
"focus-visible.min.js",
|
|
18
|
+
"animations/**/*",
|
|
18
19
|
"components/**/*",
|
|
19
20
|
"helpers/**/*",
|
|
20
21
|
"icons/**/*",
|