From 4fb79a1d6826854a14548eb63bb2f091c667881f Mon Sep 17 00:00:00 2001 From: zyqunix <117040076+zyqunix@users.noreply.github.com> Date: Thu, 10 Apr 2025 21:18:20 +0200 Subject: [PATCH] change some stuff --- portfolio/index.html | 14 +++++++++++--- portfolio/index.js | 33 ++++++++++++++++++++++++++++++++- portfolio/style.css | 24 +++++++++++++++--------- 3 files changed, 58 insertions(+), 13 deletions(-) diff --git a/portfolio/index.html b/portfolio/index.html index 9d332b3..aa2af71 100644 --- a/portfolio/index.html +++ b/portfolio/index.html @@ -15,9 +15,9 @@ alt="Profile Picture" id="profile-picture" /> -

zyqunix / Fabio

+

zyqunix

-
+
Coding, Listening to Music, Reverse Engineering, Playing Counter-Strike
@@ -42,7 +42,7 @@

Coding Stats

Since January 5th, 2025

- +
@@ -83,6 +83,14 @@ Windows 10 + + + Floorp + + + + LibreWolf + IntelliJ IDEA diff --git a/portfolio/index.js b/portfolio/index.js index a9f366a..7a1c161 100644 --- a/portfolio/index.js +++ b/portfolio/index.js @@ -152,4 +152,35 @@ fetch('lang.json') fetch('skills.json') .then(response => response.json()) .then(generateSkillCards) - .catch(error => console.error('Error fetching skills.json', error)) + .catch(error => console.error('Error fetching skills.json', error)); + +document.querySelectorAll('.tooltip').forEach(elem => { + elem.addEventListener('mouseenter', () => { + const tooltipText = elem.getAttribute('data-tooltip'); + if (!tooltipText) return; + + const dummy = document.createElement('div'); + dummy.style.position = 'absolute'; + dummy.style.visibility = 'hidden'; + dummy.style.whiteSpace = 'nowrap'; + dummy.style.padding = '5px 10px'; + dummy.style.fontSize = '14px'; + dummy.innerText = tooltipText; + document.body.appendChild(dummy); + + const elemRect = elem.getBoundingClientRect(); + const tipRect = dummy.getBoundingClientRect(); + const leftEdge = elemRect.left + (elemRect.width / 2) - (tipRect.width / 2); + const rightEdge = elemRect.left + (elemRect.width / 2) + (tipRect.width / 2); + + elem.classList.remove('slide-left', 'slide-right'); + + if (rightEdge > window.innerWidth) { + elem.classList.add('slide-left'); + } else if (leftEdge < 0) { + elem.classList.add('slide-right'); + } + + dummy.remove(); + }); +}); diff --git a/portfolio/style.css b/portfolio/style.css index 065b6fe..2a030c1 100644 --- a/portfolio/style.css +++ b/portfolio/style.css @@ -251,6 +251,14 @@ a[class^="software-item tooltip"]::after { visibility: visible; } +.tooltip.slide-left::after { + transform: translateX(-100%); +} + +.tooltip.slide-right::after { + transform: translateX(0%); +} + @keyframes shimmer { 0% { background-position: 100% 0; @@ -323,6 +331,10 @@ a[class^="software-item tooltip"]::after { margin: 10px; } +.software > .software-item:last-child { + grid-column: 1 / -1; +} + .skill-item:hover, .software-item:hover { background-color: #4d4d4d; @@ -422,7 +434,6 @@ a[class^="software-item tooltip"]::after { @media (max-width: 768px) { .language-item { - width: 150px; margin: 10px; } @@ -460,19 +471,13 @@ a[class^="software-item tooltip"]::after { height: 120px; } - #skills-div:not(#skills-div > h2), - .software:not(.software > h2) { - grid-template-columns: repeat(1, minmax(0, 1fr)); - } - - .language-item { + .stat-img { width: 100%; } - .skill-item, + .skill-item, .contact-item, .software-item { - margin: 0 10px; padding: 10px; } } @@ -515,3 +520,4 @@ div[class="stats cards"] > p { text-align: left; color: #AAAAAA; } +