hash links

This commit is contained in:
Mateusz Pstrucha committed 2020-11-20 19:19:35 +01:00
1 parent db58732d6b
commit 86e063f4c7
3 files changed
+12 -12

No files matched your search

+3 -3
View File
@@ -20,9 +20,9 @@
<span id="logoText"><span>M</span>a<span>t</span>eusz <span>P</span><span>s</span>trucha</span>
<div id="butts">
<div data-target="about" title="About Me" class="button active">About Me</div>
<div data-target="projects" title="Projects" class="button">Projects</div>
<div data-target="more" title="Index" class="button">Index</div>
<a href="#about" data-target="about" title="About Me" class="button active">About Me</a>
<a href="#projects" data-target="projects" title="Projects" class="button">Projects</a>
<a href="#index" data-target="more" title="Index" class="button">Index</a>
<div style="clear: both"></div>
</div>
+6
View File
@@ -19,6 +19,7 @@ const Panes = {
window.onload = function () {
// nav buttons handler
document.querySelector('#nav').onclick = function (e) {
e.preventDefault()
let target = e.target.getAttribute('data-target')
if (target) {
Panes.scrollTo(target)
@@ -37,6 +38,11 @@ window.onload = function () {
});
// window.onhashchange = e => {
// e.preventDefault()
// console.log(e, location.hash)
// }
// initial typewriter animation
document.querySelectorAll('.typein').forEach(typein => {
var target = typein.getAttribute('data-content')
+3 -9
View File
@@ -113,6 +113,8 @@ body {
padding: .5rem 1rem;
cursor: pointer;
text-align: center;
color: inherit;
text-decoration: none;
}
.button.active {
@@ -161,10 +163,6 @@ body {
font-size: 1.4rem;
}
#logoText>span {
/* color: hsl(38 40% 85% / 1); */
}
/* about */
#about {
@@ -256,14 +254,10 @@ body {
height: 0%;
background: var(--color-main);
/* transition-property: height; */
transition-duration: .1s;
transition: width .2s, height .1s;
}
.socials > a:hover:before{
height: 100%;
width: 100%;
}
.socials > a:hover {
/* border-bottom: 2px solid var(--color-main) */
}