Skip to content

Commit d102929

Browse files
committed
just some bugfixes nothing special like eastereggs
1 parent 362ae6c commit d102929

5 files changed

Lines changed: 163 additions & 20 deletions

File tree

index.html

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ <h2 class="sectionHeading">Über Mich</h2>
5050
<h2>Programmiersprachen und andere Technologien</h2>
5151
<div class="technologies">
5252
<div class="technology">
53-
<img class="logo scratch" src="./img/logos/scratch.png" />
53+
<img
54+
id="scratch"
55+
class="logo scratch"
56+
src="./img/logos/scratch.png"
57+
/>
5458
<div class="line"></div>
5559
<p>Scratch<br /><span>seit 2020</span></p>
5660
</div>
@@ -70,7 +74,7 @@ <h2>Programmiersprachen und andere Technologien</h2>
7074
<p>SCSS<br /><span>seit 2025</span></p>
7175
</div>
7276
<div class="technology">
73-
<img class="logo" src="./img/logos/js.svg" />
77+
<img class="logo js" src="./img/logos/js.svg" />
7478
<div class="line"></div>
7579
<p>JavaScript<br /><span>seit 2024</span></p>
7680
</div>
@@ -118,6 +122,13 @@ <h3>Verschlüsselungs Programm</h3>
118122
</div>
119123
</div>
120124
</section>
125+
126+
<dialog id="newRecord" class="newRecord">
127+
<h1>Neuer Rekord:</h1>
128+
<div><h1 id="recordField"></h1></div>
129+
<p>Versuche: <span id="trysField"></span></p>
130+
<button onclick="newRecord.close()">Fertig</button>
131+
</dialog>
121132
<script src="./script.js"></script>
122133
</body>
123134
</html>

script.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ const navbar = document.querySelector(".navbar");
33
const body = document.querySelector("body");
44
const linkContainer = document.getElementById("linkContainer");
55

6+
const scratch = document.getElementById("scratch");
7+
const scratchStartRect = scratch.getBoundingClientRect();
8+
if (localStorage.getItem("scratchRecordHeight") == null) {
9+
localStorage.setItem("scratchRecordHeight", 0);
10+
localStorage.setItem("scratchTrys", 0);
11+
}
612
// const ha = document.getElementById("ha");
713
// if (localStorage.getItem("openHA") == null) {
814
// ha.showModal();
@@ -15,8 +21,6 @@ window.addEventListener("scroll", function () {
1521
const scrollHeight = window.pageYOffset;
1622
const navbarHeight = navbar.getBoundingClientRect().height;
1723
const bodyHeight = body.getBoundingClientRect().height;
18-
console.log(bodyHeight);
19-
console.log(scrollHeight);
2024

2125
if (scrollHeight > navbarHeight) {
2226
navbar.classList.add("navbarFixed");
@@ -41,3 +45,23 @@ function navbarToggle() {
4145
linkContainer.classList.toggle("showLinks");
4246
navbar.classList.toggle("showLinks");
4347
}
48+
49+
scratch.addEventListener("mouseout", () => {
50+
const scratchRect = scratch.getBoundingClientRect();
51+
const scratchHeight = Math.abs(scratchRect.top - scratchStartRect.top);
52+
const scratchRecordHeight = localStorage.getItem("scratchRecordHeight");
53+
let scratchTrys = localStorage.getItem("scratchTrys");
54+
scratchTrys++;
55+
console.log("scratchHeight: " + scratchHeight);
56+
57+
//Versuche counter
58+
localStorage.setItem("scratchTrys", scratchTrys);
59+
trysField.innerHTML = scratchTrys;
60+
61+
if (scratchHeight > scratchRecordHeight) {
62+
localStorage.setItem("scratchRecordHeight", scratchHeight);
63+
console.log("NEUER REKORD");
64+
recordField.innerHTML = parseInt(scratchHeight);
65+
newRecord.showModal();
66+
}
67+
});

style.css

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,18 @@ h6 {
281281
margin: 10px;
282282
margin-right: 0px;
283283
}
284+
.technology .js {
285+
border-radius: 8px;
286+
}
284287
.technology .scratch {
285-
transition: ease-out all 60s;
288+
transition: ease-out all 600s;
286289
}
287290
.technology .scratch:hover {
288-
transform: translateY(-3000px);
291+
transform: translateY(-30000px);
289292
}
290293
.technology .react {
291294
transform: rotate(var(--angle));
292-
animation: 30s linear rotation infinite;
295+
animation: 60s linear rotation infinite;
293296
}
294297

295298
@media (max-width: 900px) {
@@ -376,4 +379,56 @@ h6 {
376379
.projektContainer .projekt:hover a {
377380
z-index: 10;
378381
transition: 500ms;
382+
}
383+
384+
dialog.newRecord {
385+
padding: 40px;
386+
margin: auto;
387+
display: flex;
388+
flex-direction: column;
389+
align-content: center;
390+
background: linear-gradient(0deg, hsl(0, 0%, 10%), hsl(0, 0%, 15%));
391+
box-shadow: inset 0 2px 4px hsl(0, 0%, 30%);
392+
border-radius: 20px;
393+
border: none;
394+
}
395+
dialog.newRecord:not([open]) {
396+
display: none;
397+
}
398+
dialog.newRecord::backdrop {
399+
background: rgba(0, 0, 0, 0.5);
400+
-webkit-backdrop-filter: blur(4px);
401+
backdrop-filter: blur(4px);
402+
}
403+
dialog.newRecord div {
404+
min-width: 120px;
405+
height: 60px;
406+
padding: 10px;
407+
margin: auto;
408+
margin-top: 20px;
409+
background: linear-gradient(0deg, hsl(120, 100%, 30%), hsl(120, 100%, 40%));
410+
box-shadow: inset 0 2px 4px hsl(120, 100%, 50%);
411+
border-radius: 20px;
412+
}
413+
dialog.newRecord div h1 {
414+
line-height: 60px;
415+
font-size: 60px;
416+
}
417+
dialog.newRecord p {
418+
padding: 8px;
419+
margin-top: 20px;
420+
text-align: center;
421+
color: red;
422+
}
423+
dialog.newRecord p span {
424+
color: red;
425+
}
426+
dialog.newRecord button {
427+
height: 40px;
428+
width: 200px;
429+
margin: auto;
430+
background: linear-gradient(0deg, hsl(0, 0%, 20%), hsl(0, 0%, 25%));
431+
box-shadow: inset 0 1px 2px hsl(0, 0%, 40%);
432+
border: none;
433+
border-radius: 20px;
379434
}/*# sourceMappingURL=style.css.map */

style.css.map

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

style.scss

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,18 @@ h6 {
343343
margin: 10px;
344344
margin-right: 0px;
345345
}
346+
.js {
347+
border-radius: 8px;
348+
}
346349
.scratch {
347-
transition: ease-out all 60s;
350+
transition: ease-out all 600s;
348351
&:hover {
349-
transform: translateY(-3000px);
352+
transform: translateY(-30000px);
350353
}
351354
}
352355
.react {
353356
transform: rotate(var(--angle));
354-
animation: 30s linear rotation infinite;
357+
animation: 60s linear rotation infinite;
355358
}
356359
}
357360
@media (max-width: 900px) {
@@ -454,3 +457,62 @@ h6 {
454457
}
455458
}
456459
}
460+
461+
dialog.newRecord {
462+
// height: 200px;
463+
// width: 320px;
464+
padding: 40px;
465+
margin: auto;
466+
display: flex;
467+
flex-direction: column;
468+
align-content: center;
469+
470+
&:not([open]) {
471+
display: none;
472+
}
473+
474+
background: linear-gradient(0deg, hsl(0, 0%, 10%), hsl(0, 0%, 15%));
475+
box-shadow: inset 0 2px 4px hsl(0, 0%, 30%);
476+
border-radius: 20px;
477+
border: none;
478+
&::backdrop {
479+
background: rgba(0, 0, 0, 0.5);
480+
backdrop-filter: blur(4px);
481+
}
482+
483+
div {
484+
min-width: 120px;
485+
height: 60px;
486+
padding: 10px;
487+
margin: auto;
488+
margin-top: 20px;
489+
490+
background: linear-gradient(0deg, hsl(120, 100%, 30%), hsl(120, 100%, 40%));
491+
box-shadow: inset 0 2px 4px hsl(120, 100%, 50%);
492+
border-radius: 20px;
493+
494+
h1 {
495+
line-height: 60px;
496+
font-size: 60px;
497+
}
498+
}
499+
p {
500+
padding: 8px;
501+
margin-top: 20px;
502+
text-align: center;
503+
color: red;
504+
span {
505+
color: red;
506+
}
507+
}
508+
button {
509+
height: 40px;
510+
width: 200px;
511+
margin: auto;
512+
513+
background: linear-gradient(0deg, hsl(0, 0%, 20%), hsl(0, 0%, 25%));
514+
box-shadow: inset 0 1px 2px hsl(0, 0%, 40%);
515+
border: none;
516+
border-radius: 20px;
517+
}
518+
}

0 commit comments

Comments
 (0)