-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
115 lines (107 loc) · 4.89 KB
/
index.html
File metadata and controls
115 lines (107 loc) · 4.89 KB
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
<!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="positioning.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="index.css">
<title>Our new site</title>
<script>
let isDark = false;
function changeTheme(){
if(isDark){
isDark = false;
document.documentElement.style.setProperty('--main-bg-color', 'lightblue');
document.documentElement.style.setProperty('--aside-bg-color', 'darkblue')
}
else {
isDark = true;
document.documentElement.style.setProperty('--main-bg-color', 'darkcyan');
document.documentElement.style.setProperty('--aside-bg-color', 'cadetblue')
}
}
function runCanvas(){
const canvas = document.getElementById('myCanvas');
// Get the 2D drawing context
const ctx = canvas.getContext('2d');
// Draw a red rectangle
ctx.fillStyle = 'red';
ctx.fillRect(50, 50, 100, 50);
// Draw a blue circle
ctx.beginPath();
ctx.arc(300, 100, 30, 0, Math.PI * 2);
ctx.fillStyle = 'blue';
ctx.fill();
// Draw text
ctx.font = '20px Arial';
ctx.fillStyle = 'black';
ctx.fillText('Hello, Canvas!', 50, 150);
}
</script>
</head>
<body>
<button class="darkmode-btn" onclick="changeTheme()">Byt Tema</button>
<div class="hero">
<h2>NU FUNKAR DET</h2>
<img class="hero-img" src="https://loveincorporated.blob.core.windows.net/contentimages/gallery/08afbe0f-350d-480d-9421-57274208714e-Black_forest_germany.jpg">
</div>
<nav>
<span><strong>LOLO</strong>GOGO</span>
<input type="checkbox" name="" id="nav-button">
<ul id="links" class="links" >
<li><a class="navLinks" href="#">HOME</a></li>
<li><a class="navLinks" href="/flexbox.html">FLEXBOX</a></li>
<li><a class="navLinks" href="/grid.html">GRID</a></li>
<li><a class="navLinks" href="/tables.html">TABLES</a></li>
</ul>
<label id="nav-button-label" for="nav-button">☰</label>
</nav>
<header>
<h1><span>We are talking about positioning!</span></h1>
</header>
<main>
<article class="introduction">
<h2 class="introduction-title">New things on our site</h2>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Cupiditate eius ipsam recusandae temporibus veniam amet optio totam nulla odio obcaecati voluptatum quisquam non, ea atque suscipit. Voluptas ipsam doloribus officia!</p>
<p>Placeat iure reprehenderit, consequuntur accusamus repellat quidem repudiandae facere quam illo nostrum optio asperiores officia quibusdam voluptatibus neque? Numquam ea, itaque quidem rerum praesentium autem hic culpa adipisci fuga aliquam.</p>
<p>Optio magnam voluptate ducimus error, accusantium consequuntur eveniet! Ipsum accusantium reiciendis officia expedita rerum odit, natus reprehenderit? Nam repellendus saepe numquam incidunt cupiditate soluta enim facilis provident recusandae, magni illum?</p>
<button class="goOnBtn">Go on</button>
<!-- <div class="family">
<label for="checkin">☰</label>
<input style="display: none;" type="checkbox" name="" id="checkin">
<span id="heyhey">HeyHeyHey</span>
</div> -->
</article>
<aside>
<h2>Older things</h2>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatum officiis asperiores non eos eligendi blanditiis quia magni sapiente iure sint.</p>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatum officiis asperiores non eos eligendi blanditiis quia magni sapiente iure sint.</p>
<div class="slideshow">
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
</div>
</aside>
</main>
<iframe width="100%" height="515" allowfullscreen
src="https://www.youtube.com/embed/tgbNymZ7vqY">
</iframe>
<canvas id="myCanvas" width="400" height="200"></canvas>
<button onclick="runCanvas()">RUN</button>
<footer>
FOOT
</footer>
<script>
const fadeInElement = document.querySelector('.family');
const observer = new IntersectionObserver(entries => {
const [entry] = entries;
if (entry.isIntersecting) {
console.log("IN VIEW")
entry.target.classList.add('tada');
}
});
observer.observe(fadeInElement);
</script>
</body>
</html>