Footer mobile

This commit is contained in:
Hazem Krimi
2023-11-07 01:47:59 +01:00
parent 2ccb68d1b6
commit de4bd80df8
8 changed files with 99 additions and 63 deletions
+15
View File
@@ -53,6 +53,21 @@ body {
isolation: isolate;
}
#links .linkedin,
#links .github,
#links .cv-paper-flip,
#links .mail,
#nav-toggler svg path {
stroke: var(--text);
}
#links .twitter,
#links .rss,
#links .cv,
#links .moon > path {
fill: var(--text);
}
main {
width: 85%;
min-height: 70vh;
+19 -7
View File
@@ -1,22 +1,34 @@
:root {
--footer-light-background: #ECECEC;
--footer-light-background: #ececec;
--footer-dark-background: #131212;
}
footer {
width: 100%;
min-height: 25rem;
padding: 3rem 5rem;
padding: 3rem 8rem;
margin-top: 2.5rem;
display: flex;
align-items: start;
column-gap: 6rem;
align-items: center;
flex-direction: column;
row-gap: 5rem;
background-color: var(--footer-background);
color: var(--text);
}
footer div {
width: 20rem;
footer #footer-face {
display: flex;
align-items: center;
column-gap: 0.625rem;
}
footer #links {
display: flex;
align-items: center;
column-gap: 1.5rem;
}
footer #copyright {
font-size: 0.875rem;
}
-14
View File
@@ -81,20 +81,6 @@ nav #links .theme-toggler {
margin-right: auto;
}
#links .linkedin,
#links .github,
#links .cv-paper-flip,
#nav-toggler svg path {
stroke: var(--text);
}
#links .twitter,
#links .rss,
#links .cv,
#links .moon > path {
fill: var(--text);
}
header #nav-toggler {
display: none;
}
+2 -2
View File
@@ -1,4 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 4H20C21.1 4 22 4.9 22 6V18C22 19.1 21.1 20 20 20H4C2.9 20 2 19.1 2 18V6C2 4.9 2.9 4 4 4Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M22 6L12 13L2 6" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path class='mail' d="M4 4H20C21.1 4 22 4.9 22 6V18C22 19.1 21.1 20 20 20H4C2.9 20 2 19.1 2 18V6C2 4.9 2.9 4 4 4Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path class='mail' d="M22 6L12 13L2 6" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 393 B

After

Width:  |  Height:  |  Size: 419 B

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

+13 -7
View File
@@ -1,10 +1,13 @@
function loadBurger() {
navToggler.querySelector(
burgerOpen ? '#burger' : '#close'
).style.display = 'none';
navToggler.querySelector(
burgerOpen ? '#close' : '#burger'
).style.display = 'block';
const headerInitialLeftPosition = header.getBoundingClientRect().x;
navToggler.querySelector(burgerOpen ? '#burger' : '#close').style.display =
'none';
navToggler.querySelector(burgerOpen ? '#close' : '#burger').style.display =
'block';
header.style.position = burgerOpen ? 'fixed' : 'initial';
header.style.top = burgerOpen ? '0px' : 'initial';
header.style.left = burgerOpen ? `${headerInitialLeftPosition}px` : 'initial';
mobileNavigation.style.display = burgerOpen ? 'flex' : 'none';
mobileNavigation.style.top = burgerOpen
? `calc(${header.getBoundingClientRect().y}px + ${
@@ -12,8 +15,11 @@ function loadBurger() {
}px + 0.625rem)`
: 'initial';
mobileNavigation.style.left = burgerOpen
? `${header.getBoundingClientRect().x}px`
? `${headerInitialLeftPosition}px`
: 'initial';
document.querySelector('main').style.marginTop = burgerOpen
? `calc(${header.getBoundingClientRect().height}px + 5rem)`
: '0px';
}
function updateBurger() {
+32 -11
View File
@@ -1,18 +1,39 @@
{{ $styles := resources.Get "css/partials/footer.css" | toCSS | minify }}
<link rel="stylesheet" href="{{ $styles.Permalink }}">
<link rel="stylesheet" href="{{ $styles.Permalink }}" />
{{ $faceImage := resources.Get "images/small-face.png" }}
{{ $cv :=resources.Get "cv.pdf" }}
<footer>
<div>
<h3>Recent Blogs</h3>
<div id="footer-face">
<img src="{{ $faceImage.Permalink }}" alt="Hazem Krimi" />
<h3>Hazem Krimi</h3>
</div>
<div>
<h3>Recent Projects</h3>
</div>
<div>
<h3>About</h3>
</div>
<div>
<h3>Contact</h3>
<div id="links">
<a href="https://www.linkedin.com/in/hazemkrimi" target="_blank">
{{ readFile "assets/icons/linkedin.svg" | safeHTML }}
</a>
<a href="https://twitter.com/HazemKrimi" target="_blank">
{{ readFile "assets/icons/twitter.svg" | safeHTML }}
</a>
<a href="https://github.com/hazemKrimi" target="_blank">
{{ readFile "assets/icons/github.svg" | safeHTML }}
</a>
<a href="/" target="_blank">
{{ readFile "assets/icons/rss.svg" | safeHTML }}
</a>
<a href="mailto:me@hazemkrimi.tech" target="_blank">
{{ readFile "assets/icons/mail.svg" | safeHTML }}
</a>
<a href="{{ $cv.Permalink }}" target="_blank">
{{ readFile "assets/icons/cv.svg" | safeHTML }}
</a>
</div>
<p id="copyright"></p>
<script>
const copyright = (document.querySelector(
'#copyright'
).innerHTML = `&copy ${new Date().getFullYear()} Hazem Krimi`);
</script>
</footer>
+5 -9
View File
@@ -1,21 +1,15 @@
{{ define "styles" }}
{{ $styles := resources.Get "css/partials/header.css" | toCSS | minify }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" />
{{ end }}
{{ define "scripts" }}
{{ $scripts := resources.Get "js/partials/header.js" | js.Build | minify }}
<link rel="stylesheet" href="{{ $styles.Permalink }}">
<script defer src="{{ $scripts.Permalink }}"></script>
{{ end }}
{{ $headerFaceImage := resources.Get "images/header-face.png" }}
{{ $faceImage := resources.Get "images/small-face.png" }}
{{ $cv := resources.Get "cv.pdf" }}
<header>
<div id="header-face">
<img src="{{ $headerFaceImage.Permalink }}" alt="Hazem Krimi" />
<img src="{{ $faceImage.Permalink }}" alt="Hazem Krimi" />
<h3>Hazem Krimi</h3>
</div>
<div id="menus">
@@ -28,6 +22,7 @@
<a href="https://twitter.com/HazemKrimi" target="_blank"> {{ readFile "assets/icons/twitter.svg" | safeHTML }} </a>
<a href="https://github.com/hazemKrimi" target="_blank"> {{ readFile "assets/icons/github.svg" | safeHTML }} </a>
<a href="/" target="_blank"> {{ readFile "assets/icons/rss.svg" | safeHTML }} </a>
<a href="mailto:me@hazemkrimi.tech" target="_blank"> {{ readFile "assets/icons/mail.svg" | safeHTML }} </a>
<a href="{{ $cv.Permalink }}" target="_blank"> {{ readFile "assets/icons/cv.svg" | safeHTML }} </a>
<div class="vertical-separator"></div>
<span
@@ -62,6 +57,7 @@
{{ readFile "assets/icons/sun.svg" | safeHTML }}
</span>
<a href="{{ $cv.Permalink }}" target="_blank"> {{ readFile "assets/icons/cv.svg" | safeHTML }} </a>
<a href="mailto:me@hazemkrimi.tech" target="_blank"> {{ readFile "assets/icons/mail.svg" | safeHTML }} </a>
<a href="/" target="_blank"> {{ readFile "assets/icons/rss.svg" | safeHTML }} </a>
<a href="https://github.com/hazemKrimi" target="_blank"> {{ readFile "assets/icons/github.svg" | safeHTML }} </a>
<a href="https://twitter.com/HazemKrimi" target="_blank"> {{ readFile "assets/icons/twitter.svg" | safeHTML }} </a>