aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Sipma <felix.sipma@no-log.org>2018-02-07 18:38:17 +0100
committerFélix Sipma <felix.sipma@no-log.org>2018-02-07 18:38:17 +0100
commitdedae11a00f5377bac446d5e0b16792830734f69 (patch)
tree71a4432dca8a16562c7cb5512d0fb904331baa0a
parent7cbf3b7bf517cb18c41bf8b332ff341af6ebb2bd (diff)
homepage: put logo on navbar based on header size
-rw-r--r--layouts/index.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/layouts/index.html b/layouts/index.html
index 14b1d91..74c4d99 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -5,10 +5,11 @@
{{ define "footer" }}
<script>
var fournilNav = document.getElementById('fournil-nav');
+ var fournilHeader = document.getElementById('fournil-header');
window.addEventListener('scroll', function (e) {
var nav = document.getElementById('fournil-nav');
- if (nav.offsetTop > 400) {
+ if (nav.offsetTop > fournilHeader.clientHeight) {
nav.classList.remove('fournil-nologo-nav');
} else {
nav.classList.add('fournil-nologo-nav');
@@ -22,7 +23,7 @@
{{ define "fournil-nav-classes" }} fournil-nologo-nav{{ end }}
{{ define "header" }}
-<div class="header">
+<div id="fournil-header" class="header">
<div class="fournil-logo-bio">
<span>
<img src="{{ .Site.BaseURL }}img/AB.svg" alt="logo AB" onerror="this.src='{{ .Site.BaseURL }}img/AB.png'">