diff --git a/.eleventy.js b/.eleventy.js index 9a0dad8..35ff8d2 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -24,6 +24,7 @@ module.exports = function (eleventyConfig) { eleventyConfig.setUseGitIgnore(false); eleventyConfig.addPassthroughCopy({ + "src/js": "js", "src/img": "img", "src/font": "font", "src/favicon.*": "", diff --git a/src/index.html b/src/index.html index 6b311cd..28d57e8 100644 --- a/src/index.html +++ b/src/index.html @@ -38,53 +38,58 @@ title: {{site.title}} src="https://umami.sp-codes.de/umami.js"> -
-
-
-
-
-
- -
- Samuel Philipp -

{{site.title}}

-

{{site.subtitle}}

- - -
-
@@ -339,16 +344,6 @@ title: {{site.title}}
^ - + diff --git a/src/js/main.js b/src/js/main.js index aa96b13..f495cbf 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -1,29 +1,9 @@ -const developer = document.getElementById('developer'); -const magician = document.getElementById('magician'); -const links = document.getElementById('links'); +document.querySelectorAll('a[href^="#"]').forEach(anchor => { + anchor.addEventListener('click', function (e) { + e.preventDefault(); -document.addEventListener('touchmove', function (event) { - event.preventDefault(); - var e = event.touches[0]; - move(e); -}); -document.addEventListener('mousemove', function (event) { - event.preventDefault(); - move(event); -}); - -function move(event) { - let body = document.getElementsByTagName('body')[0]; - const width = window.innerWidth || document.documentElement.clientWidth || body.clientWidth; - const height= window.innerHeight|| document.documentElement.clientHeight|| body.clientHeight; - const traX = (((50 * event.pageX) / width)) - 50; - const traY = (((50 * event.pageY) / height)) - 50; - const traX2 = (50 + traX) * -1; - const traY2 = (50 + traY) * -1; - magician.style.left = traX + 'px'; - magician.style.top = traY + 'px'; - links.style.left = traX + 'px'; - links.style.top = traY + 'px'; - developer.style.left = traX2 + 'px'; - developer.style.top = traY2 + 'px'; -} \ No newline at end of file + document.querySelector(this.getAttribute('href')).scrollIntoView({ + behavior: 'smooth' + }); + }); +}); \ No newline at end of file diff --git a/src/scss/main.scss b/src/scss/main.scss index cdb4c42..0e435d9 100644 --- a/src/scss/main.scss +++ b/src/scss/main.scss @@ -18,7 +18,6 @@ body { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding: 0; margin: 0; - //overflow-anchor: none; } header { @@ -34,11 +33,6 @@ header { z-index: 1; .overlay { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; background-color: rgba($secondary, 0.9); }