summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authormms <michal@sapka.me>2024-05-07 14:58:56 +0200
committermms <michal@sapka.me>2024-05-07 14:58:56 +0200
commit60621d0e0995284c65bcf4ba05b59b1dbe784a4f (patch)
treead19aa101f396249563b5d458b16a3e9bb4fa6e4 /layouts
parentc4eac50c4680998f4df990c45628b2a2f798ee55 (diff)
feat: gungame
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/homepage/nav.html47
1 files changed, 41 insertions, 6 deletions
diff --git a/layouts/partials/homepage/nav.html b/layouts/partials/homepage/nav.html
index 829323e..b0e500f 100644
--- a/layouts/partials/homepage/nav.html
+++ b/layouts/partials/homepage/nav.html
@@ -18,7 +18,9 @@
<img
alt="Michal"
- style="float: right; max-width: 20%;"
+ style="float: right;
+ max-width: 20%;
+ cursor: crosshair"
id="me-normal"
src="{{ $img1x.Permalink }}"
srcset="
@@ -46,6 +48,24 @@
width="{{ $img1x.Width }}"
height="{{ $img1x.Height }}"
>
+
+{{- $file := "me-pain.png" }}
+{{- $path := printf "content_images/%s" $file}}
+{{- $img := resources.Get $path }}
+{{- $img1x := $img.Resize "150x webp" }}
+{{- $img2x := $img.Resize "300x webp" }}
+ <img
+ alt="Michal full of pain"
+ style="float: right; max-width: 20%; display: none"
+ id="me-pain"
+ src="{{ $img1x.Permalink }}"
+ srcset="
+ {{ $img1x.Permalink }} 1x,
+ {{ $img2x.Permalink }} 2x
+ "
+ width="{{ $img1x.Width }}"
+ height="{{ $img1x.Height }}"
+ >
{{ partial "menu.html" (dict "menuID" "main-nav" "page" .) }}
@@ -53,15 +73,30 @@
var kofiLink = document.getElementById('ko-fi');
var meNormal = document.getElementById('me-normal');
var meGrim = document.getElementById('me-grim');
+ var mePain = document.getElementById('me-pain');
+
+ var out = false;
+
+ meNormal.addEventListener( 'click', function() {
+ meNormal.style.display="none";
+ mePain.style.display="inline";
+
+ setTimeout(() => {
+ meNormal.style.display="inline";
+ mePain.style.display="none";
+ }, 300)
+ })
- kofiLink.addEventListener( 'mouseover', function() {
- meNormal.style.display="none"
+ kofiLink.addEventListener( 'mouseenter', function() {
+ meNormal.style.display="none";
meGrim.style.display="inline"
});
- kofiLink.addEventListener( 'mouseout', function() {
- meNormal.style.display="inline"
- meGrim.style.display="none"
+ kofiLink.addEventListener( 'mouseleave', function() {
+ setTimeout(() => {
+ meNormal.style.display="inline";
+ meGrim.style.display="none";
+ }, 700)
});
</script>