-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
155 lines (155 loc) · 3.67 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap">
<title>Scroll Animation</title>
<style>
*{
box-sizing: border-box;
}
body{
background-color: #153448;
font-family: "Roboto", sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin: 0;
overflow-x: hidden;
}
h1{
margin: 36px;
font-size: 50px;
color: #DFD0B8;
font-weight: 600;
}
.box{
background-color: #948979;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
width: 70%;
height: 100px;
margin: 10px;
border-radius: 10px;
box-shadow: 0px 3px 12px #3C5B6F;
transform: translateX(-400%);
transition: transform 0.8s ease;
}
h1:hover{
text-decoration: underline;
}
a{
text-decoration: none;
color: #3C5B6F;
}
.box:after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 5px solid transparent;
transition: border-color 250ms ease-in-out;
pointer-events: none;
}
.box:hover:after {
border-color: rgb(253, 253, 253);
}
.box:nth-of-type(even){
transform: translateX(-400%);
}
.box.show{
transform: translateX(0);
}
.box h2{
font-size: 45px;
}
</style>
</head>
<body>
<h1>My Frontend Projects</h1>
<div class="box">
<a href="admin_dashboard/index.html" target="_blank">
<h2>Admin Dashboard</h2>
</a>
</div>
<div class="box">
<a href="Ajax_type_ahead/index.html" target="_blank">
<h2>Cool Ajax</h2>
</a>
</div>
<div class="box">
<a href="check_multiple_checkboxes/index.html" target="_blank">
<h2>Check Boxes</h2>
</a>
</div>
<div class="box">
<a href="cloud_raining/index.html" target="_blank">
<h2>It's Raining</h2>
</a>
</div>
<div class="box">
<a href="flex_panel/index.html" target="_blank">
<h2>Flex Panel</h2>
</a>
</div>
<div class="box">
<a href="Fun_with_HTML5_canvas/index.html" target="_blank">
<h2>Draw Something</h2>
</a>
</div>
<div class="box">
<a href="html_video_player/index.html" target="_blank">
<h2>Watch a Video!</h2>
</a>
</div>
<div class="box">
<a href="js_clock/index.html" target="_blank">
<h2>See the Time!!</h2>
</a>
</div>
<div class="box">
<a href="modifying_css_variables/index.html" target="_blank">
<h2>Modify a Picture</h2>
</a>
</div>
<div class="box">
<a href="Eye/index.html" target="_blank">
<h2>Play with this Eye</h2>
</a>
</div>
<div class="box">
<a href="Stars/index.html" target="_blank">
<h2>Beautiful Star Animation</h2>
</a>
</div>
<div class="box">
<a href="Animated-Menu/index.html" target="_blank">
<h2>Animated Menu</h2>
</a>
</div>
<div class="box">
<a href="Download/index.html" target="_blank">
<h2>Download Animation</h2>
</a>
</div>
<script>
const boxes = document.querySelectorAll(".box");
const checkBoxes = () => {
const triggerButton = (window.innerHeight / 5) * 4;
boxes.forEach((box) => {
const boxTop = box.getBoundingClientRect().top;
if (boxTop < triggerButton) box.classList.add("show");
else box.classList.remove("show");
});
};
window.addEventListener("scroll", checkBoxes);
checkBoxes();
</script>
</body>
</html>