-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
304 lines (273 loc) · 9.15 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>EspressoEcke</title>
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="index.css" />
<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=Noto+Sans:wght@600&display=swap"
rel="stylesheet"
/>
</head>
<body>
<section class="header-section">
<header>
<a href="index.html">EspressoEcke</a>
<a class="hamburger" onclick="openNav()">☰</a>
</header>
<div id="myNav" class="overlay">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()"
>×</a
>
<div class="overlay-content">
<a
href="index.html"
style="
color: #232323;
text-decoration: #232323 solid underline 3px;
text-underline-offset: 10px;
"
>Home</a
>
<a href="pages/ueber-uns/ueber-uns.html">Über uns</a>
<a href="pages/gerichte/gerichte.html">Gerichte</a>
<a href="pages/newsletter/newsletter.html">Newsletter</a>
<a href="pages/kontakt/kontakt.html">Kontakt</a>
</div>
</div>
<button class="btn-kontakt" onclick="window.location.href='pages/kontakt/kontakt.html'">Contact</button>
</section>
<section class="main-content">
<article id="slideshoww" class="landing-page">
<div class="landingpage-main-text">
<h1>
Willkommen <br />
im Kaffee <br />
<span style="color: #d3a87a; text-shadow: 3px 3px 2px black"
>EspressoEcke</span
>
</h1>
<p>
Entdecken Sie Ihren neuen Lieblingsort mitten im Herzen der Stadt.
Bei uns trifft Tradition auf Moderne, und jeder Schluck <br />
erzählt eine Geschichte.
</p>
</div>
<button
class="btn-ueberuns"
onclick="window.location.href='pages/ueber-uns/ueber-uns.html'"
>
Über uns
</button>
<button
class="btn-kontakt"
onclick="window.location.href='pages/kontakt/kontakt.html'"
>
Kontakt
</button>
<div class="sliderdots">
<div
class="circle"
id="circle0"
onclick="clearTimeout(timeOutId); currentImageId=0; changePicture()"
></div>
<div
class="circle"
id="circle1"
onclick="clearTimeout(timeOutId); currentImageId=1; changePicture()"
></div>
<div
class="circle"
id="circle2"
onclick="clearTimeout(timeOutId); currentImageId=2; changePicture()"
></div>
<div
class="circle"
id="circle3"
onclick="clearTimeout(timeOutId); currentImageId=3; changePicture()"
></div>
</div>
</article>
<h2 style="text-align: center">Spezialitäten</h2>
<article class="spezialitaten">
<div class="spezialitat">
<img alt="Unsere coffee" src="images/handmade-coffee.png" />
<p>Handgefertigter Kaffee</p>
</div>
<div class="spezialitat">
<img alt="Unsere pastries" src="images/pastries.png" />
<p>Frisches Gebäck</p>
</div>
<div class="spezialitat">
<img alt="Unsere Atomosphere" src="images/coffee-atmosphere2.png" />
<p>Gemütliche Atmosphäre</p>
</div>
</article>
<article id="counter" class="zahlen number-counter">
<div>
<p class="zahl count" data-target="2570">0</p>
<p>Kaffees serviert</p>
</div>
<div>
<p class="zahl count" data-target="1200">0</p>
<p>Glückliche Kunden</p>
</div>
</article>
</section>
<footer>
<section class="socialmedia">
<a
href="https://facebook.com"
target="_blank"
class="facebook sm-icon"
></a>
<a
href="https://twitter.com"
target="_blank"
class="twitter sm-icon"
></a>
<a
href="https://youtube.com"
target="_blank"
class="youtube sm-icon"
></a>
<a
href="https://whatsapp.com"
target="_blank"
class="whatsapp sm-icon"
></a>
</section>
<section class="bottomfoot">
<a href="pages/impressum/impressum.html">Impressum</a>
<a class="modalBtn">AGB</a>
<a class="modalBtn">Datenschutz</a>
<a class="modalBtn">Kontakt</a>
</section>
<!-- Trigger/Open The Modal -->
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<span class="close">×</span>
<p>Coming soon</p>
</div>
</div>
</footer>
<script>
//Nav
function openNav() {
document.getElementById("myNav").style.left = "0";
}
function closeNav() {
document.getElementById("myNav").style.left = "100%";
}
//Slideshow
var currentImageId = 0;
var images = [];
var slideTime = 5000; // 5 seconds
var timeOutId;
var lastScreenWidth = 0;
window.addEventListener("resize", function () {
if (lastScreenWidth < 1050 && screen.width >= 1050) {
clearTimeout(timeOutId);
currentImageId = 0;
changePicture();
}
lastScreenWidth = window.screen.width;
});
async function changePicture() {
if (screen.width > 1050) {
images[0] = "images/bg-image-wide1.png";
images[1] = "images/bg-image-wide2.png";
images[2] = "images/bg-image-wide3.png";
images[3] = "images/homepage-bg-wide-dalle4.png";
} else {
images[0] = "images/homepage-bg-dalle1.png";
images[1] = "images/homepage-bg-dalle2.png";
images[2] = "images/homepage-bg-dalle3.png";
images[3] = "images/homepage-bg-dalle4.png";
}
renderImage(images[currentImageId]);
}
async function renderImage(url) {
const img = new Image();
img.src = url;
await img
.decode()
.then(() => {
document.getElementById("slideshoww").style.backgroundImage =
"url(" + img.src + ")";
document.getElementById("slideshoww").style.opacity = "1";
for (i = 0; i < images.length; i++) {
document.getElementById("circle" + i).style.backgroundColor =
"rgba(0,0,0,0.37)";
}
document.getElementById(
"circle" + currentImageId
).style.backgroundColor = "black";
if (currentImageId < images.length - 1) {
currentImageId++;
} else {
currentImageId = 0;
}
timeOutId = setTimeout(changePicture, slideTime);
})
.catch((e) => {
console.log("Error while im decoding");
console.log(e);
});
}
window.onload = changePicture;
//Count up animation
document.addEventListener("scroll", function () {
const counter = document.getElementById("counter");
const counts = counter.querySelectorAll(".count");
counts.forEach((count) => {
const target = parseInt(count.getAttribute("data-target"), 10);
const rect = counter.getBoundingClientRect();
if (rect.top >= 0 && rect.bottom <= window.innerHeight) {
// Element is in view
startCounting(count, target);
}
});
});
function startCounting(element, target) {
const current = parseInt(element.innerText, 10);
const increment = target / 150;
if (current < target) {
element.innerText = Math.ceil(current + increment);
setTimeout(() => startCounting(element, target), 30);
} else {
element.innerText = target;
}
}
// Get the modal
var modal = document.getElementById("myModal");
// Get the button that opens the modal
const btns = document.getElementsByClassName("modalBtn");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks the button, open the modal
for (let i = 0; i < btns.length; i++) {
btns[i].onclick = function() {
modal.style.display = "block";
}
}
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target === modal) {
modal.style.display = "none";
}
}
</script>
</body>
</html>