-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.html
116 lines (107 loc) · 2.94 KB
/
contact.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
margin: 0;
height: 100vh;
overflow: hidden;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
.parallax-wrap {
position: relative;
width: min-content;
/* height: 100vh; */
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.parallax-wrap h2 {
position: relative;
font-size: 100px;
color: white;
z-index: 2;
text-align: center;
}
.parallax-wrap span {
position: absolute;
height: 1.6%;
width: 1.6%;
border-radius: 100%;
}
.parallax-wrap span:nth-child(3) {
top: 20%;
left: 56.2%;
background: black;
z-index: 3;
}
.parallax-wrap span:nth-child(4) {
top: 20%;
left: 61%;
background: black;
z-index: 3;
}
.parallax-wrap span:nth-child(1) {
top: 18.5%;
left: 59.5%;
width: 5%;
height: 0;
background-image: url("contact_back2.png");
z-index: 4;
}
.parallax-wrap span:nth-child(2) {
top: 18.5%;
left: 55%;
width: 5%;
height: 0;
background-image: url("contact_back1.png");
z-index: 4;
}
.cucumber {
width: 50vw;
}
.blink {
animation-name: blinks;
animation-duration: 5s;
animation-iteration-count: infinite;
}
@keyframes blinks {
95% {height: 0%;}
99% {height: 5%;}
100% {height: 0;}
}
</style>
</head>
<body>
<div class="parallax-wrap">
<span class="blink"></span>
<span class="blink"></span>
<span value="2"></span>
<span value="2"></span>
<img src="contact_header4.png" class="cucumber" alt="cucumber">
</div>
</body>
<script>
document.addEventListener("mousemove", parallax);
function parallax(event) {
this.querySelectorAll(".parallax-wrap span").forEach((shift) => {
const position = shift.getAttribute("value");
if (position) {
const x = -(window.innerWidth - event.pageX * position) / 98;
const y = -(window.innerHeight - event.pageY * position) / 98;
shift.style.transform = `translateX(${x}px) translateY(${y}px)`;
}
});
}
</script>
</html>