-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs_random2.html
218 lines (192 loc) · 5.38 KB
/
js_random2.html
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Panel Switch Interaction</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@700&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Ubuntu&display=swap" rel="stylesheet">
<style>
*{
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
font-weight: 300;
}
body{
background-color: #002E37;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
header{
width: 100%;
}
header img{
width: 4%;
height: 4%;
padding: 10px;
}
.box-content{
width: 80%;
background-color: white;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: flex-start;
margin: 3%;
height: 90vh;
overflow: hidden;
}
.bg-btn{
background-color: #107373;
width: 600px;
display: flex;
align-items: last baseline;
justify-content: center;
height: 90vh;
padding: 50px;
z-index: 2;
}
#btn{
width: 60%;
height: 40px;
font-size: 20px;
padding: 4px;
background-color: #14a0a0;
border: none;
}
.material-symbols-outlined{
font-size: 30px;
color: white;
}
#btn:hover{
background-color: #025f5f;
cursor: pointer;
}
#box-txt{
padding: 20px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
width: 900%;
height: 90vh;
}
#box-txt p{
width: 70%;
}
#box-txt-1{
padding: 20px;
display: flex;
align-items: flex-end;
justify-content: flex-end;
flex-direction: column;
}
#box-txt-1 p{
width: 70%;
text-align: right;
}
#box-txt-1.open{
width: 200%;
display: flex;
transition: all 0.3s ease-out;
}
#box-txt-1.open h2{
display: block;
}
#box-txt-1.open p{
display: block;
}
#box-txt-1.close{
display: flex;
width: 0%;
padding: 0px;
transition: all 0.3s ease-out;
}
#box-txt-1.close h2{
display: none;
}
#box-txt-1.close p{
display: none;
}
#box-txt.open{
width: 200%;
display: flex;
transition: all 0.3s ease-out;
}
#box-txt.open h2{
display: block;
}
#box-txt.open p{
display: block;
}
#box-txt.close{
display: flex;
width: 0%;
padding: 0px;
transition: all 0.3s ease-out;
}
#box-txt.close h2{
display: none;
}
#box-txt.close p{
display: none;
}
/*transform: rotate(-900deg);*/
/*transform: rotate(0deg); */
</style>
</head>
<body>
<header>
<a href="index.html"><img src="immagini/icon/js_blank.svg" alt="logo"></a>
</header>
<div class="box-content">
<div id="box-txt" class="open">
<h2>Benvenuto,</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.
Provident fugit aperiam eveniet optio amet incidunt voluptate quas at facilis sapiente nam
perspiciatis asperiores dolor necessitatibus consectetur qui, modi reiciendis praesentium.</p>
</div>
<div class="bg-btn">
<button id="btn"><div class="material-symbols-outlined" id="arrow">arrow_right_alt</div></button>
</div>
<div id="box-txt-1" class="close">
<h2>Benvenuto,</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.
Provident fugit aperiam eveniet optio amet incidunt voluptate quas at facilis sapiente nam
perspiciatis asperiores dolor necessitatibus consectetur qui, modi reiciendis praesentium.</p>
</div>
</div>
<script>
var btn = document.getElementById('btn');
var box_2 = document.getElementById('box-txt-1');
var box_1 = document.getElementById('box-txt');
var arrow = document.getElementById('arrow');
btn.onclick = function(){
// box_1.className = 'open';
//box_2.style.display = 'none';
var validation = box_1.className !== 'close';
if (validation) {
box_2.setAttribute('class', 'open');
box_1.setAttribute('class', 'close');
arrow.style.transform = 'rotate(-900deg)';
arrow.style.transition = 'all 0.3s ease-out';
box_1.style.transition = 'all 0.3s ease-out';
box_2.style.transition = 'all 0.3s ease-out';
} else {
box_1.setAttribute('class', 'open');
box_2.setAttribute('class', 'close');
arrow.style.transform = 'rotate(0deg)';
arrow.style.transition = 'all 0.3s ease-out';
box_1.style.transition = 'all 0.3s ease-out';
box_2.style.transition = 'all 0.3s ease-out';
}
}
</script>
</body>
</html>