Bonjour
je viens de réaliser cette page
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
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 <body> <main class="content"> <div class="pic first"> <div class="text"> <span>chiot</span> </div> <div class="overlay" style="--i:0;"> </div> </div> <div class="pic two"> <div class="text"> <span>husky</span> </div> <div class="overlay" style="--i:1;"> </div> </div> <div class="pic three"> <div class="text"> <span>berger</span> </div> <div class="overlay" style="--i:2;" > </div> </div> </main>
Code CSS : Sélectionner tout - Visualiser dans une fenêtre à part
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 body{ height: 100svh; } .content{ width: 100%; height: 100%; display: flex; } .content> *{ flex: 1; } .text{ width: 80%; height: 8%; overflow: hidden; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); mix-blend-mode:difference; } span{ font-family: verdana; font-size: 3.5rem; color: darkgray; font-weight: bold; text-transform: capitalize; display: block; letter-spacing: 8px; text-align: center; line-height:1.2; transform: translateY(100%); transition: .5s cubic-bezier(.06,1,.21,.95); animation: up 2.5s forwards; } .first{ background-image: url("img/two.jpg"); background-position: center; background-size: cover; } .two{ background-image: url("img/husky.jpg"); background-position: center; background-size: cover; } .three{ background-image: url("img/berger.jpg"); background-position: center; background-size: cover; } .pic{ position: relative; } .overlay{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: black; z-index: 2; animation: fade-in 1.5s forwards 300ms; animation-delay: calc(var(--i)* 1s); } @keyframes up{ 0%{ transform: translateY(100%); } 100%{ transform: translateY(0); } } @keyframes fade-in{ 0%{ transform: translateY(0); } 100%{ transform: translateY(-100%); } }
Je souhaite que l'animation sur l'apparition des textes se déclenche quand le rideau est levé puis-je avoir une suggestion ou des pistes ?
Merci.





Répondre avec citation







Partager