Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/spech66/flex-bp-hugo-cv.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pech <windows@spech.de>2020-11-07 21:38:11 +0300
committerSebastian Pech <windows@spech.de>2020-11-07 21:38:11 +0300
commite1f14d7d0fc5eea0b2d12493f8b86995cba39d58 (patch)
treeb1f65305e1f82b17c8b82a178c72ca7f54dde626
parentb197a272abf60c1d1e22a1900e994853ba07558a (diff)
ScrollSpy, dummy content, nav
-rw-r--r--assets/css/main.css45
-rw-r--r--assets/js/main.js51
-rw-r--r--layouts/partials/_header.html49
-rw-r--r--layouts/partials/sidebar.html17
4 files changed, 152 insertions, 10 deletions
diff --git a/assets/css/main.css b/assets/css/main.css
index 786b258..a8b4cbc 100644
--- a/assets/css/main.css
+++ b/assets/css/main.css
@@ -8,6 +8,10 @@
margin: 0;
}
+html {
+ scroll-behavior: smooth;
+}
+
/*******************************************************************************
* Flexbox and base colors
******************************************************************************/
@@ -33,19 +37,19 @@ body.dark-theme {
}
.sidebar {
- background: green;
+ background: #eeeeee;
}
body.dark-theme .sidebar {
- background: red;
+ background: #333333;
}
main {
- background: green;
+ background: #ffffff;
}
body.dark-theme main {
- background: red;
+ background: #444;
}
/*******************************************************************************
@@ -82,3 +86,36 @@ a {
body.dark-theme a {
color: #ff0000;
}
+
+img {
+ width: 100%;
+ object-fit: cover;
+}
+
+/*******************************************************************************
+ * Navigaton
+ ******************************************************************************/
+
+nav {
+ position: sticky;
+ top: 2rem;
+ white-space: nowrap;
+}
+
+nav ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+
+nav ul li a {
+ display: block;
+ padding: 0.5rem 1rem;
+ color: red;
+ text-decoration: none;
+}
+
+nav ul li.active {
+ background: black;
+ transition: all 200ms ease-in-out;
+}
diff --git a/assets/js/main.js b/assets/js/main.js
index 1f1cda5..a03a9c7 100644
--- a/assets/js/main.js
+++ b/assets/js/main.js
@@ -1,5 +1,48 @@
-const btn = document.querySelector('.btn-toggle');
+// -----------------------------------------------------------------------------
+// Dark Theme handling based on https://css-tricks.com/a-complete-guide-to-dark-theme-on-the-web/
+// -----------------------------------------------------------------------------
+const btn = document.querySelector('.btn-toggle-theme');
+const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)');
+const currentTheme = localStorage.getItem("theme");
-btn.addEventListener('click', function() {
- document.body.classList.toggle('dark-theme');
-})
+// Set to dark if stored in local storage or no current theme and user prefers darkness
+if (currentTheme == "dark") {
+ document.body.classList.toggle("dark-theme");
+} else if (currentTheme != "light" || currentTheme == null) {
+ if(prefersDarkScheme.matches) {
+ document.body.classList.toggle("dark-theme");
+ }
+}
+
+// Theme toggle button handler
+btn.addEventListener("click", function() {
+ document.body.classList.toggle("dark-theme");
+ var theme = document.body.classList.contains("dark-theme") ? "dark" : "light";
+ localStorage.setItem("theme", theme);
+});
+
+// -----------------------------------------------------------------------------
+// ScrollSpy https://www.bram.us/2020/01/10/smooth-scrolling-sticky-scrollspy-navigation/
+// -----------------------------------------------------------------------------
+
+window.addEventListener('DOMContentLoaded', () => {
+ const observer = new IntersectionObserver(entries => {
+ entries.forEach(entry => {
+ const id = entry.target.getAttribute('id');
+ if (entry.intersectionRatio > 0) {
+ document.querySelector(`nav li a[href="#${id}"]`).parentElement.classList.add('active');
+ } else {
+ document.querySelector(`nav li a[href="#${id}"]`).parentElement.classList.remove('active');
+ }
+ });
+ });
+
+ // Track all sections that have an `id` applied
+ document.querySelectorAll('section[id]').forEach((section) => {
+ observer.observe(section);
+ });
+});
+
+// -----------------------------------------------------------------------------
+// Misc
+// -----------------------------------------------------------------------------
diff --git a/layouts/partials/_header.html b/layouts/partials/_header.html
index 2599b3c..162893f 100644
--- a/layouts/partials/_header.html
+++ b/layouts/partials/_header.html
@@ -1,5 +1,50 @@
-<button class="btn-toggle">Toggle Dark Mode</button>
-
Header
<a href="/">Somewhere</a>
+
+<h1>Good Boy</h1>
+
+<h2>Zombie 1</h2>
+<p>Zombie ipsum reversus ab viral inferno, nam rick grimes malum cerebro. De carne lumbering animata corpora quaeritis. Summus brains sit​​, morbo vel maleficia? De apocalypsi gorger omero undead survivor dictum mauris. Hi mindless mortuis soulless creaturas, imo evil stalking monstra adventus resi dentevil vultus comedat cerebella viventium. Qui animated corpse, cricket bat max brucks terribilem incessu zomby. The voodoo sacerdos flesh eater, suscitat mortuos comedere carnem virus. Zonbi tattered for solum oculi eorum defunctis go lum cerebro. Nescio brains an Undead zombies. Sicut malus putrid voodoo horror. Nigh tofth eliv ingdead.</p>
+
+<section id="section-test-2">
+<h2>Zombie 2</h2>
+<p>Cum horribilem walking dead resurgere de crazed sepulcris creaturis, zombie sicut de grave feeding iride et serpens. Pestilentia, shaun ofthe dead scythe animated corpses ipsa screams. Pestilentia est plague haec decaying ambulabat mortuos. Sicut zeder apathetic malus voodoo. Aenean a dolor plan et terror soulless vulnerum contagium accedunt, mortui iam vivam unlife. Qui tardius moveri, brid eof reanimator sed in magna copia sint terribiles undeath legionis. Alii missing oculis aliorum sicut serpere crabs nostram. Putridi braindead odores kill and infect, aere implent left four dead.</p>
+<p>Lucio fulci tremor est dark vivos magna. Expansis creepy arm yof darkness ulnis witchcraft missing carnem armis Kirkman Moore and Adlard caeruleum in locis. Romero morbo Congress amarus in auras. Nihil horum sagittis tincidunt, zombie slack-jawed gelida survival portenta. The unleashed virus est, et iam zombie mortui ambulabunt super terram. Souless mortuum glassy-eyed oculos attonitos indifferent back zom bieapoc alypse. An hoc dead snow braaaiiiins sociopathic incipere Clairvius Narcisse, an ante? Is bello mundi z?</p>
+</section>
+
+<h2>Zombie 3</h2>
+<p>In Craven omni memoria patriae zombieland clairvius narcisse religionis sunt diri undead historiarum. Golums, zombies unrelenting et Raimi fascinati beheading. Maleficia! Vel cemetery man a modern bursting eyeballs perhsaps morbi. A terrenti flesh contagium. Forsitan deadgurl illud corpse Apocalypsi, vel staggering malum zomby poenae chainsaw zombi horrifying fecimus burial ground. Indeflexus shotgun coup de poudre monstra per plateas currere. Fit de decay nostra carne undead. Poenitentiam violent zom biehig hway agite RE:dead pœnitentiam! Vivens mortua sunt apud nos night of the living dead.</p>
+<p>In Craven omni memoria patriae zombieland clairvius narcisse religionis sunt diri undead historiarum. Golums, zombies unrelenting et Raimi fascinati beheading. Maleficia! Vel cemetery man a modern bursting eyeballs perhsaps morbi. A terrenti flesh contagium. Forsitan deadgurl illud corpse Apocalypsi, vel staggering malum zomby poenae chainsaw zombi horrifying fecimus burial ground. Indeflexus shotgun coup de poudre monstra per plateas currere. Fit de decay nostra carne undead. Poenitentiam violent zom biehig hway agite RE:dead pœnitentiam! Vivens mortua sunt apud nos night of the living dead.</p>
+<p>In Craven omni memoria patriae zombieland clairvius narcisse religionis sunt diri undead historiarum. Golums, zombies unrelenting et Raimi fascinati beheading. Maleficia! Vel cemetery man a modern bursting eyeballs perhsaps morbi. A terrenti flesh contagium. Forsitan deadgurl illud corpse Apocalypsi, vel staggering malum zomby poenae chainsaw zombi horrifying fecimus burial ground. Indeflexus shotgun coup de poudre monstra per plateas currere. Fit de decay nostra carne undead. Poenitentiam violent zom biehig hway agite RE:dead pœnitentiam! Vivens mortua sunt apud nos night of the living dead.</p>
+<p>In Craven omni memoria patriae zombieland clairvius narcisse religionis sunt diri undead historiarum. Golums, zombies unrelenting et Raimi fascinati beheading. Maleficia! Vel cemetery man a modern bursting eyeballs perhsaps morbi. A terrenti flesh contagium. Forsitan deadgurl illud corpse Apocalypsi, vel staggering malum zomby poenae chainsaw zombi horrifying fecimus burial ground. Indeflexus shotgun coup de poudre monstra per plateas currere. Fit de decay nostra carne undead. Poenitentiam violent zom biehig hway agite RE:dead pœnitentiam! Vivens mortua sunt apud nos night of the living dead.</p>
+<p>In Craven omni memoria patriae zombieland clairvius narcisse religionis sunt diri undead historiarum. Golums, zombies unrelenting et Raimi fascinati beheading. Maleficia! Vel cemetery man a modern bursting eyeballs perhsaps morbi. A terrenti flesh contagium. Forsitan deadgurl illud corpse Apocalypsi, vel staggering malum zomby poenae chainsaw zombi horrifying fecimus burial ground. Indeflexus shotgun coup de poudre monstra per plateas currere. Fit de decay nostra carne undead. Poenitentiam violent zom biehig hway agite RE:dead pœnitentiam! Vivens mortua sunt apud nos night of the living dead.</p>
+<p>In Craven omni memoria patriae zombieland clairvius narcisse religionis sunt diri undead historiarum. Golums, zombies unrelenting et Raimi fascinati beheading. Maleficia! Vel cemetery man a modern bursting eyeballs perhsaps morbi. A terrenti flesh contagium. Forsitan deadgurl illud corpse Apocalypsi, vel staggering malum zomby poenae chainsaw zombi horrifying fecimus burial ground. Indeflexus shotgun coup de poudre monstra per plateas currere. Fit de decay nostra carne undead. Poenitentiam violent zom biehig hway agite RE:dead pœnitentiam! Vivens mortua sunt apud nos night of the living dead.</p>
+<p>In Craven omni memoria patriae zombieland clairvius narcisse religionis sunt diri undead historiarum. Golums, zombies unrelenting et Raimi fascinati beheading. Maleficia! Vel cemetery man a modern bursting eyeballs perhsaps morbi. A terrenti flesh contagium. Forsitan deadgurl illud corpse Apocalypsi, vel staggering malum zomby poenae chainsaw zombi horrifying fecimus burial ground. Indeflexus shotgun coup de poudre monstra per plateas currere. Fit de decay nostra carne undead. Poenitentiam violent zom biehig hway agite RE:dead pœnitentiam! Vivens mortua sunt apud nos night of the living dead.</p>
+<p>In Craven omni memoria patriae zombieland clairvius narcisse religionis sunt diri undead historiarum. Golums, zombies unrelenting et Raimi fascinati beheading. Maleficia! Vel cemetery man a modern bursting eyeballs perhsaps morbi. A terrenti flesh contagium. Forsitan deadgurl illud corpse Apocalypsi, vel staggering malum zomby poenae chainsaw zombi horrifying fecimus burial ground. Indeflexus shotgun coup de poudre monstra per plateas currere. Fit de decay nostra carne undead. Poenitentiam violent zom biehig hway agite RE:dead pœnitentiam! Vivens mortua sunt apud nos night of the living dead.</p>
+<p>In Craven omni memoria patriae zombieland clairvius narcisse religionis sunt diri undead historiarum. Golums, zombies unrelenting et Raimi fascinati beheading. Maleficia! Vel cemetery man a modern bursting eyeballs perhsaps morbi. A terrenti flesh contagium. Forsitan deadgurl illud corpse Apocalypsi, vel staggering malum zomby poenae chainsaw zombi horrifying fecimus burial ground. Indeflexus shotgun coup de poudre monstra per plateas currere. Fit de decay nostra carne undead. Poenitentiam violent zom biehig hway agite RE:dead pœnitentiam! Vivens mortua sunt apud nos night of the living dead.</p>
+
+<h2>Zombie 4</h2>
+<p>Whyt zomby Ut fames after death cerebro virus enim carnis grusome, viscera et organa viventium. Sicut spargit virus ad impetum, qui supersumus flesh eating. Avium, brains guts, ghouls, unholy canum, fugere ferae et infecti horrenda monstra. Videmus twenty-eight deformis pale, horrenda daemonum. Panduntur brains portae rotting inferi. Finis accedens walking deadsentio terrore perterritus et twen tee ate daze leighter taedium wal kingdead. The horror, monstra epidemic significant finem. Terror brains sit unum viral superesse undead sentit, ut caro eaters maggots, caule nobis.</p>
+
+<h2>Zombie 5</h2>
+<p>Whyt zomby Ut fames after death cerebro virus enim carnis grusome, viscera et organa viventium. Sicut spargit virus ad impetum, qui supersumus flesh eating. Avium, brains guts, ghouls, unholy canum, fugere ferae et infecti horrenda monstra. Videmus twenty-eight deformis pale, horrenda daemonum. Panduntur brains portae rotting inferi. Finis accedens walking deadsentio terrore perterritus et twen tee ate daze leighter taedium wal kingdead. The horror, monstra epidemic significant finem. Terror brains sit unum viral superesse undead sentit, ut caro eaters maggots, caule nobis.</p>
+
+<h2>Zombie 6</h2>
+<p>Whyt zomby Ut fames after death cerebro virus enim carnis grusome, viscera et organa viventium. Sicut spargit virus ad impetum, qui supersumus flesh eating. Avium, brains guts, ghouls, unholy canum, fugere ferae et infecti horrenda monstra. Videmus twenty-eight deformis pale, horrenda daemonum. Panduntur brains portae rotting inferi. Finis accedens walking deadsentio terrore perterritus et twen tee ate daze leighter taedium wal kingdead. The horror, monstra epidemic significant finem. Terror brains sit unum viral superesse undead sentit, ut caro eaters maggots, caule nobis.</p>
+
+<section id="section-test-7">
+<h2>Zombie 7</h2>
+<p>Whyt zomby Ut fames after death cerebro virus enim carnis grusome, viscera et organa viventium. Sicut spargit virus ad impetum, qui supersumus flesh eating. Avium, brains guts, ghouls, unholy canum, fugere ferae et infecti horrenda monstra. Videmus twenty-eight deformis pale, horrenda daemonum. Panduntur brains portae rotting inferi. Finis accedens walking deadsentio terrore perterritus et twen tee ate daze leighter taedium wal kingdead. The horror, monstra epidemic significant finem. Terror brains sit unum viral superesse undead sentit, ut caro eaters maggots, caule nobis.</p>
+</section>
+
+<h2>Zombie 8</h2>
+<p>Whyt zomby Ut fames after death cerebro virus enim carnis grusome, viscera et organa viventium. Sicut spargit virus ad impetum, qui supersumus flesh eating. Avium, brains guts, ghouls, unholy canum, fugere ferae et infecti horrenda monstra. Videmus twenty-eight deformis pale, horrenda daemonum. Panduntur brains portae rotting inferi. Finis accedens walking deadsentio terrore perterritus et twen tee ate daze leighter taedium wal kingdead. The horror, monstra epidemic significant finem. Terror brains sit unum viral superesse undead sentit, ut caro eaters maggots, caule nobis.</p>
+
+<h2>Zombie 9</h2>
+<p>Whyt zomby Ut fames after death cerebro virus enim carnis grusome, viscera et organa viventium. Sicut spargit virus ad impetum, qui supersumus flesh eating. Avium, brains guts, ghouls, unholy canum, fugere ferae et infecti horrenda monstra. Videmus twenty-eight deformis pale, horrenda daemonum. Panduntur brains portae rotting inferi. Finis accedens walking deadsentio terrore perterritus et twen tee ate daze leighter taedium wal kingdead. The horror, monstra epidemic significant finem. Terror brains sit unum viral superesse undead sentit, ut caro eaters maggots, caule nobis.</p>
+
+<section id="section-test-10">
+<h2>Zombie 10</h2>
+<p>Whyt zomby Ut fames after death cerebro virus enim carnis grusome, viscera et organa viventium. Sicut spargit virus ad impetum, qui supersumus flesh eating. Avium, brains guts, ghouls, unholy canum, fugere ferae et infecti horrenda monstra. Videmus twenty-eight deformis pale, horrenda daemonum. Panduntur brains portae rotting inferi. Finis accedens walking deadsentio terrore perterritus et twen tee ate daze leighter taedium wal kingdead. The horror, monstra epidemic significant finem. Terror brains sit unum viral superesse undead sentit, ut caro eaters maggots, caule nobis.</p>
+</section>
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 25f1eb8..ad659bb 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -8,4 +8,21 @@
<img src="{{ $photoimg.RelPermalink }}" width="{{ $photoimg.Width }}" height="{{ $photoimg.Height }}" alt="{{ $alt }}" />
{{ end }}
+<button class="btn-toggle-theme">Toggle Dark Mode</button>
+
+{{ if .IsTranslated }}
+ <h5>{{ i18n "translations" }}</h5>
+ {{ range $.Site.Home.AllTranslations }}
+ <a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a>
+ {{ end }}
+{{ end }}
+
Sidebar
+
+<nav>
+ <ul>
+ <li><a href="#section-test-2">Zombie 2</a></li>
+ <li><a href="#section-test-7">Zombie 7</a></li>
+ <li><a href="#section-test-10">Zombie 10</a></li>
+ </ul>
+</nav>