Header tweaks, guidelines link

This commit is contained in:
Ben Visness 2024-07-05 12:35:01 -05:00
parent 352a102a6a
commit b5a34e3ab1
5 changed files with 36 additions and 11 deletions

View File

@ -8298,6 +8298,8 @@ header .hmn-logo {
font-size: 1.6rem; font-size: 1.6rem;
padding: 0.6rem 0.8rem; padding: 0.6rem 0.8rem;
line-height: 1; line-height: 1;
display: flex;
align-items: center;
} }
header .menu-chevron { header .menu-chevron {
display: inline-block; display: inline-block;
@ -8309,7 +8311,7 @@ header .avatar {
} }
header .header-nav { header .header-nav {
position: absolute; position: absolute;
top: calc(100% + 1px); top: calc(100% + var(--border-header));
left: 0; left: 0;
width: 100%; width: 100%;
background-color: var(--bg-header); background-color: var(--bg-header);
@ -8323,7 +8325,7 @@ header .header-nav {
width: auto; width: auto;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
background-color: none; background-color: transparent;
} }
} }
header .header-nav > a, header .header-nav > a,
@ -8379,13 +8381,20 @@ header .root-item:not(:hover):not(.clicked) .submenu {
header .root-item.clicked .svgicon { header .root-item.clicked .svgicon {
transform: rotate(180deg); transform: rotate(180deg);
} }
header.mobile-open {
--bg-header: var(--c3) !important;
--border-header: 1px !important;
}
header.mobile-open .header-nav {
display: block;
}
header:not(.clicked) .root-item:not(:hover) > .submenu, header:not(.clicked) .root-item:not(:hover) > .submenu,
header.clicked .root-item:not(.clicked) > .submenu { header.clicked .root-item:not(.clicked) > .submenu {
display: none; display: none;
} }
.header-transparent header { .header-transparent header {
--bg-header: rgba(0, 0, 0, 0.4); --bg-header: rgba(0, 0, 0, 0.4);
--border-header: 0; --border-header: 0px;
--color: #fff; --color: #fff;
} }

View File

@ -128,6 +128,8 @@ header {
font-size: 1.6rem; font-size: 1.6rem;
padding: 0.6rem 0.8rem; padding: 0.6rem 0.8rem;
line-height: 1; line-height: 1;
display: flex;
align-items: center;
} }
.menu-chevron { .menu-chevron {
@ -143,7 +145,7 @@ header {
.header-nav { .header-nav {
position: absolute; position: absolute;
top: calc(100% + 1px); top: calc(100% + var(--border-header));
left: 0; left: 0;
width: 100%; width: 100%;
background-color: var(--bg-header); background-color: var(--bg-header);
@ -156,7 +158,7 @@ header {
width: auto; width: auto;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
background-color: none; background-color: transparent;
} }
>a, >a,
@ -217,6 +219,19 @@ header {
} }
} }
&.mobile-open {
/*
A bit of a hack, but the transparency we use for the
header doesn't work great for an open menu.
*/
--bg-header: var(--c3) !important;
--border-header: 1px !important;
.header-nav {
display: block;
}
}
&:not(.clicked) .root-item:not(:hover), &:not(.clicked) .root-item:not(:hover),
&.clicked .root-item:not(.clicked) { &.clicked .root-item:not(.clicked) {
>.submenu { >.submenu {
@ -228,7 +243,8 @@ header {
.header-transparent { .header-transparent {
header { header {
--bg-header: rgba(0, 0, 0, 0.4); --bg-header: rgba(0, 0, 0, 0.4);
--border-header: 0; /* The units are important; it makes `calc` work. */
--border-header: 0px;
--color: #fff; --color: #fff;
} }
} }

View File

@ -100,7 +100,6 @@ July 19-21, 2024.
<script type="text/javascript"> <script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
const header = document.querySelector("#site-header"); const header = document.querySelector("#site-header");
const headerNav = document.querySelector("#header_nav");
const mobileMenuButton = document.querySelector("#mobile_menu"); const mobileMenuButton = document.querySelector("#mobile_menu");
// set up dropdown stuff for mobile / touch // set up dropdown stuff for mobile / touch
@ -159,7 +158,7 @@ July 19-21, 2024.
mobileMenuButton.addEventListener("click", e => { mobileMenuButton.addEventListener("click", e => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
headerNav.classList.toggle("dn"); header.classList.toggle("mobile-open");
}); });
}); });
</script> </script>

View File

@ -134,7 +134,8 @@
</div> </div>
{{ end }} {{ end }}
<div class="f7 tc link-normal"> <div class="f7 tc link-normal">
<a href="{{ .ManifestoUrl }}">Manifesto</a> - <a href="{{ .AboutUrl }}">Our Team</a> - TODO: HISTORY <!-- TODO(redesign): Add history link -->
<a href="{{ .ManifestoUrl }}">Manifesto</a> - <a href="{{ .AboutUrl }}">Our Team</a> - <a href="{{ .GuidelinesUrl }}">Guidelines</a>
</div> </div>
</div> </div>

View File

@ -33,7 +33,7 @@ func Index(c *RequestContext) ResponseData {
ManifestoUrl string ManifestoUrl string
AboutUrl string AboutUrl string
PodcastUrl string GuidelinesUrl string
AtomFeedUrl string AtomFeedUrl string
MarkAllReadUrl string MarkAllReadUrl string
NewProjectUrl string NewProjectUrl string
@ -144,7 +144,7 @@ func Index(c *RequestContext) ResponseData {
ManifestoUrl: hmnurl.BuildManifesto(), ManifestoUrl: hmnurl.BuildManifesto(),
AboutUrl: hmnurl.BuildAbout(), AboutUrl: hmnurl.BuildAbout(),
PodcastUrl: hmnurl.BuildPodcast(), GuidelinesUrl: hmnurl.BuildCommunicationGuidelines(),
AtomFeedUrl: hmnurl.BuildAtomFeed(), AtomFeedUrl: hmnurl.BuildAtomFeed(),
MarkAllReadUrl: hmnurl.HMNProjectContext.BuildForumMarkRead(0), MarkAllReadUrl: hmnurl.HMNProjectContext.BuildForumMarkRead(0),
NewProjectUrl: hmnurl.BuildProjectNew(), NewProjectUrl: hmnurl.BuildProjectNew(),