Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ include:
- _headers
- _redirects
- js/accordion-screensaver.js
- js/mobile-nav.js
exclude:
- .editorconfig
- .gitignore
Expand Down
1 change: 1 addition & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<title>{{page.title}}</title>
<link rel="stylesheet" href="/assets/classless.css" />
<link rel="stylesheet" href="/assets/custom.css" />
<script src="/js/mobile-nav.js"></script>

<!-- Generated via https://realfavicongenerator.net/ -->
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png?v=3">
Expand Down
1 change: 1 addition & 0 deletions _layouts/icalendar.ics.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
METHOD:PUBLISH
PRODID:blr.today{{page.slug}}
CALSCALE:GREGORIAN
NAME:{{page.title | strip_newlines}}
X-WR-CALNAME:{{page.title | strip_newlines}}
X-ORIGINAL-URL:{{page.url | absolute_url}}
X-WR-CALDESC:{{page.description | strip_newlines}}
Expand Down
12 changes: 12 additions & 0 deletions assets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@
--pink-glamour: #fab1a0;
}

/* Fix mobile navigation to stay open on tap */
@media (max-width: 40rem) {
nav ul:first-child.mobile-menu-open > li:not(:first-child):not(.sticky) {
display: block;
float: none !important;
padding: .3rem .6rem;
}
nav ul:first-child > li:first-child {
cursor: pointer;
}
}

a.fake-button {
font: var(--font-h);
border-radius: 4px;
Expand Down
52 changes: 52 additions & 0 deletions js/mobile-nav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Fix for mobile navigation - keep menu open on tap
(function() {
'use strict';

// Only run on mobile screens
function isMobile() {
return window.innerWidth <= 640; // 40rem at 16px base
}

let menuOpen = false;

function setupMobileNav() {
if (!isMobile()) return;

const nav = document.querySelector('nav ul:first-child');
if (!nav) return;

const firstLi = nav.querySelector('li:first-child');
if (!firstLi) return;

// Toggle menu on click
firstLi.addEventListener('click', function(e) {
menuOpen = !menuOpen;
nav.classList.toggle('mobile-menu-open', menuOpen);
e.stopPropagation();
});

// Close menu when clicking outside
document.addEventListener('click', function(e) {
if (menuOpen && !nav.contains(e.target)) {
menuOpen = false;
nav.classList.remove('mobile-menu-open');
}
});

// Close menu when clicking a link
const links = nav.querySelectorAll('li:not(:first-child) a');
links.forEach(link => {
link.addEventListener('click', function() {
menuOpen = false;
nav.classList.remove('mobile-menu-open');
});
});
}

// Run on load and resize
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', setupMobileNav);
} else {
setupMobileNav();
}
})();