-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
170 lines (169 loc) · 5.06 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!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>Fractals in nature</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=News+Cycle&display=swap"
rel="stylesheet"
/>
<style>
body {
background-image: url(/images/fractal-pattern.svg);
background-repeat: repeat;
background-size: 10%;
}
.container {
background: rgba(255, 255, 255, 0.97);
max-width: 600px;
margin: 10px auto;
padding: 20px;
border-radius: 20px;
border: 2px solid black;
border-color: black;
}
h1 {
font-family: "Amatic SC", cursive;
text-align: center;
font-size: 48px;
font-weight: 700;
margin: 0;
padding-bottom: 20px;
}
p {
text-align: center;
font-size: 18px;
font-weight: 400;
font-family: "News Cycle", sans-serif;
}
img {
width: 100%;
border-radius: 10px;
}
a {
text-decoration: none;
color: brown;
}
button {
display: block;
margin: 10px auto;
font-size: 36px;
border: none;
padding: 5px 10px;
border-radius: 86px;
background: black;
color: white;
border: 1px solid white;
font-family: "Amatic SC", cursive;
}
button:hover {
cursor: pointer;
background: white;
color: black;
border: 1px solid black;
}
.theme-button {
display: block;
margin: 0 auto;
font-size: 28px;
font-weight: 700;
}
.river-fractal-image {
transition: transform 150ms ease-in-out;
}
.river-fractal-image:hover {
filter: contrast(80%);
transform: scale(1.3);
}
.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 10px;
margin: 20px;
}
footer {
text-align: center;
display: block;
margin: 0 auto;
font-size: 16px;
font-weight: 500;
background: rgba(255, 255, 255, 0.97);
max-width: 640px;
border-radius: 8px;
border: 1px solid black;
font-family: "News Cycle", sans-serif;
}
.dark {
background-image: url(/images/fractal-pattern-invert.svg);
color: white;
}
.dark .container {
background: rgba(0, 0, 0, 0.9);
border: 1px solid white;
}
.dark footer {
background: rgba(0, 0, 0, 0.9);
border: 1px solid white;
}
.dark a {
color: darkkhaki;
}
</style>
</head>
<body>
<button class="theme-button">Change theme</button>
<div class="container">
<h1>Fractals in nature</h1>
<a href="http://paulbourke.net/fractals/googleearth/" target="_blank"
><img
src="/images/egypt2.jpg"
alt="Fractal river"
class="river-fractal-image"
/></a>
<p>
The mathematician Benoit Mandelbrot defined fractals simply as follows:
"A fractal is a rough or fragmented geometric shape that can be split
into parts, each of which is (at least approximately) a reduced-size
copy of the whole".
<br />
<br />
Approximate fractals found in nature display self-similarity over
extended, but finite, scale ranges. Fractal-like patterns occur widely
in nature, in phenomena as diverse as clouds, river networks, geologic
fault lines, mountains, coastlines, animal coloration, snow flakes,
crystals, blood vessel branching, actin cytoskeleton, and ocean waves.
</p>
<div class="grid">
<img src="/images/Mountain_fractal.jpg" alt="Fractal mountain" />
<img src="/images/Lightning_fractal.jpg" alt="Fractal lightning" />
<img src="/images/Leaf_fractal.jpg" alt="Fractal leaf" />
<img src="/images/branches_fractal.jpg" alt="Fractal copper crystals" />
</div>
<a href="https://en.wikipedia.org/wiki/Fractal" target="_blank"
><button class="learn-more-button">
Want to learn more about fractals?
</button></a
>
</div>
<footer>
Coded by Grishma V. (<a
href="https://github.com/grishmav87/Fractal-project"
target="_blank"
>open-sourced</a
>)
</footer>
<script>
function changeTheme() {
let body = document.querySelector("body");
body.classList.toggle("dark");
// if (body.classList.contains("dark")) {body.classList.remove("dark");} else {body.classList.add("dark");}
}
let themeButton = document.querySelector(".theme-button");
themeButton.addEventListener("click", changeTheme);
</script>
</body>
</html>