-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
75 lines (64 loc) · 2.7 KB
/
test.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hardlight Electronics Ltd.</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/general.css">
<link rel="stylesheet" href="css/test.css">
<link rel="icon" type=image/png href="images/favicon-32x32.png" sizes="32x32">
</head>
<body>
<header>
<a href="index.html" class="logo"><img src="images/logo.png" alt="Main page."></a>
<ul>
<li><a href="index.html">Index</a></li>
<li><a href="test.html" class="active">True/False</a></li>
</ul>
</header>
<section>
<img src="images/stars.png" id="stars">
<img src="images/moon.png" id="moon">
<img src="images/mountains_behind.png" id="mountains_behind">
<h2 id="text">A quick test</h2>
<a href="#sec" id="btn">Fill out</a>
<img src="images/mountains_front.png" id="mountains_front">
</section>
<div class="sec" id="sec">
<h2>True or false</h2>
</div>
<div class="img">
<img src="images/tutel.jpeg">
</div>
<div class="text">
Turtle or no?
</div>
<div class="buttons">
<a href="https://youtu.be/oxzEdm29JLw" target="_blank"><button>True</button></a>
<a href="https://youtu.be/xvFZjo5PgG0" target="_blank"><button>False</button></a>
</div>
<script>
let stars=document.getElementById("stars");
let moon=document.getElementById("moon");
let mountains_behind=document.getElementById("mountains_behind");
let text=document.getElementById("text");
let btn=document.getElementById("btn");
let mountains_front=document.getElementById("mountains_front");
let header=document.querySelector("header");
window.addEventListener("scroll",function(){
let value=window.scrollY;
stars.style.left=value*0.25+"px";
moon.style.top=value*1.05+"px";
mountains_behind.style.top=value*0.5+"px";
mountains_front.style.top=value*0+"px";
text.style.marginRight=value*4+"px";
text.style.marginTop=value*1.5+"px";
btn.style.marginTop=value*1.5+"px";
header.style.top=value*0.5+"px";
})
</script>
<footer id="footer">
<p>Copyright © Hardlight Electronics Ltd., all rights reserved.</p>
</footer>
</body>
</html>