-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
88 lines (83 loc) · 3.21 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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Einfache Webseite</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css">
<style>
.button-container {
text-align: center;
margin-top: 20px;
}
button {
padding: 5px 10px;
font-size: 1rem;
margin: 10px;
line-height: 1;
width: 100px;
height: 40px;
display: inline-block; /* Stellt sicher, dass die Buttons nebeneinander angezeigt werden */
}
#image {
text-align: center; /* Zentriert den Inhalt des <figure> Elements */
display: none;
margin-top: 20px;
}
#image img {
max-width: 50%; /* Responsives Design mit 50% Breite */
height: auto; /* Beibehaltung des Seitenverhältnisses */
}
html, body {
height: 100%; /* Stellt sicher, dass der gesamte Bildschirm abgedeckt ist */
margin: 0; /* Entfernt Standard-Margins */
padding: 0; /* Entfernt Standard-Paddings */
}
body {
background-image: url('pexels-secret-garden-931177.jpg'); /* Setzt das Hintergrundbild */
background-size: cover; /* Skaliert das Bild, um den Bereich abzudecken */
background-position: center; /* Zentriert das Bild */
background-repeat: no-repeat; /* Keine Wiederholung des Bildes */
}
h2{
color: black;
text-shadow:
-1px -1px 0 aliceblue,
1px -1px 0 aliceblue,
-1px 1px 0 aliceblue,
1px 1px 0 aliceblue;
}
</style>
</head>
<body>
<main class="container">
<div class="grid">
<section>
<h2 id="questionText" style="text-align: center;">Willst du mein Valentine sein??</h2>
<div class="button-container">
<button id="changeTextButton">Ja</button>
<button id="fakeButton">Nein</button>
</div>
<figure id="image">
<img src="1704314824927 (1)-denoised_sharpened_upscaled_x2.jpg">
</figure>
</section>
</div>
</main>
<script>
document.getElementById('changeTextButton').addEventListener('click', function() {
document.getElementById('image').style.display = 'block';
document.querySelector('.button-container').style.display = 'none';
document.getElementById('questionText').textContent = 'Dachte ich mir, wir sehen uns am 14.02';
});
document.getElementById('fakeButton').addEventListener('click', function(event) {
var fakeButton = event.target;
var newX = Math.random() * window.innerWidth - fakeButton.clientWidth;
var newY = Math.random() * window.innerHeight - fakeButton.clientHeight;
fakeButton.style.position = 'absolute';
fakeButton.style.left = newX + 'px';
fakeButton.style.top = newY + 'px';
});
</script>
</body>
</html>