-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanimationJs.py
More file actions
134 lines (102 loc) · 4.32 KB
/
Copy pathanimationJs.py
File metadata and controls
134 lines (102 loc) · 4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
from nicegui import ui
# fait apparaitre une alerte
def alert():
ui.run_javascript('alert("Hello!")')
# fait une animation de slide vers la gauche
def slide_left(element):
ui.run_javascript(f'gsap.from("{element}", {{ opacity: 0, x: "50%", duration: 0.5 }});')
# fait une animation de slide vers la droite
def slide_right(element):
ui.run_javascript(f'gsap.from("{element}", {{ opacity: 0, x: "-50%", duration: 0.5 }});')
# fait une animation de slide vers le haut
def slide_up(element):
ui.run_javascript(f'gsap.from("{element}", {{ opacity: 0, y: "16%", duration: 1.2 }});')
# fait une animation de slide vers le bas
def slide_down(element):
ui.run_javascript(f'gsap.from("{element}", {{ opacity: 0, y: "-10%", duration: 1.2 }});')
# c'est quoi fade in et fade out ?
def fadeIn(element):
ui.run_javascript(f'gsap.from("{element}", {{ opacity: 0, duration: 4.5, ease: "power2.out" }});')
def fadeOut(element):
ui.run_javascript(f'gsap.to("{element}", {{ opacity: 0, duration: 0.5, ease: "power2.out" }});')
def slideLeftOut(element):
ui.run_javascript(f'gsap.to("{element}", {{ opacity: 0, x: "-50%", duration: 0.5, ease: "power2.out" }});')
def slideLeftOut(element):
ui.run_javascript(f'gsap.to("{element}", {{ opacity: 0, x: "-50%", duration: 0.5, ease: "power2.out" }});')
def slideRightOut(element):
ui.run_javascript(f'gsap.to("{element}", {{ opacity: 0, x: "50%", duration: 0.5, ease: "power2.out" }});')
def slideUpOut(element):
ui.run_javascript(f'gsap.to("{element}", {{ opacity: 0, y: "-66%", duration: 0.5, ease: "power2.out" }});')
def slideDownOut(element):
ui.run_javascript(f'gsap.to("{element}", {{ opacity: 0, y: "66%", duration: 0.5, ease: "power2.out" }});')
#class_list = ["animate_slideInUp", "animate_slideInDown", "animate_slideInLeft", "animate_slideInRight"]
def all_gsap():
ui.run_javascript("""
var parallax = gsap.timeline({
scrollTrigger: {
trigger: ".parallax_group",
start: "top top",
end: "+=200%",
scrub: true
}
});
parallax.to('.montains2', {
scale:1.1,
duration: 1,
ease: "none",
y : '-20vh',
});
parallax.to('.montains4', {
scale: 1.1,
duration: 1,
ease: "none",
y: '-5vh'
}, "-=1");
parallax.to('.dune1', {
scale: 1.1,
duration: 1,
ease: "none",
y: '-5vh'
}, "-=1");
parallax.to('.moon', {
scale: 1.2,
duration: .3,
ease: "none",
y: '20vh'
}, "-=1");
parallax.to('.parallax_group h1', {
opacity: 0,
duration: 0.5,
ease: "none",
y: '-50vh'
}, "-=1");
gsap.from('.star1', {
duration: 2.5,
x: '106%',
y: '-150%',
opacity: 0,
ease: "power1.inOut"
});
gsap.from('.star2', {
duration: 3.5,
x: '106%',
y: '-100%',
opacity: 0,
ease: "power1.inOut",
delay: 0.3
});
parallax.to('.star1', {
scale: 1.2,
duration: .3,
ease: "none",
y: '50vh'
}, "-=1");
parallax.to('.star2', {
scale: 1.2,
duration: .3,
ease: "none",
y: '50vh'
}, "-=1");
""")
#https://bepatrickdavid.com/
#https://brittanychiang.com/