Hide menu navigation on mobile, disable text decoration on links

This commit is contained in:
Joshua Goins 2023-04-03 17:20:42 -04:00
parent ce8120c9f8
commit 63478685e8
10 changed files with 36 additions and 20 deletions

View file

@ -418,4 +418,8 @@ pre {
border-radius: 5px;
padding: 5px;
text-align: center;
}
}
.no-decoration {
text-decoration: none;
}

View file

@ -0,0 +1,8 @@
imagesLoaded(document.querySelector('.grid'), function(instance) {
new Masonry('.grid', {
itemSelector: '.grid-item',
columnWidth: '.grid-sizer',
fitWidth: true,
gutter: 10,
});
});

View file

@ -1,8 +1,3 @@
imagesLoaded(document.querySelector('.grid'), function(instance) {
new Masonry('.grid', {
itemSelector: '.grid-item',
columnWidth: '.grid-sizer',
fitWidth: true,
gutter: 10,
});
});
if (window.matchMedia('(max-device-width: 768px)').matches) {
document.getElementById("nav-menu").open = false;
}

View file

@ -13,5 +13,11 @@
</article>
</div>
<footer>{{- partial "footer.html" . -}}</footer>
{{ $site := resources.Get "js/site.js" }}
{{ if hugo.IsProduction }}
{{ $site = $site | minify | fingerprint | resources.PostProcess }}
{{ end }}
<script src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script>
</body>
</html>

View file

@ -14,7 +14,7 @@
</div>
{{ $site := resources.Get "js/site.js" }}
{{ $site := resources.Get "js/gallery.js" }}
{{ if hugo.IsProduction }}
{{ $site = $site | minify | fingerprint | resources.PostProcess }}
{{ end }}

View file

@ -26,7 +26,7 @@
</div>
{{ $site := resources.Get "js/site.js" }}
{{ $site := resources.Get "js/gallery.js" }}
{{ if hugo.IsProduction }}
{{ $site = $site | minify | fingerprint | resources.PostProcess }}
{{ end }}

View file

@ -2,7 +2,7 @@
<div class="generic-con year-con">
{{ range $.Param "years" }}
{{ $year := . }}
<a href="/art/{{ . }}">
<a class="no-decoration" href="/art/{{ . }}">
{{ $thumbp := printf "/year-thumbs/%d.webp" . }}
{{ with resources.Get $thumbp }}
<img width="256" height="128" alt="{{ $year }}" class="gallery-img article-img" src="{{ .RelPermalink }}">

View file

@ -18,7 +18,7 @@
{{ $path := printf "/art/%d/%.2d/%s" (int $year) (int $month) $filename_without_ext}}
<a href="{{ $path }}" aria-label="Click to view details">
<a href="{{ $path }}" aria-label="Click to view details" class="no-decoration">
{{ $title := .title }}
{{ with resources.Get (printf "art/%s" .filename) }}
{{ $image := .Resize "500x" }}

View file

@ -12,7 +12,7 @@
{{ $year = index $split 3 }}
{{ end }}
<a href="{{ .Permalink }}">
<a class="no-decoration" href="{{ .Permalink }}">
{{ $path := printf "/art/%d/%.2d/%s" (int $year) (int $month) $filename_without_ext}}
{{ $title := .Params.title }}
{{ $image := (resources.Get (printf "art/%s.webp" .Params.slug)).Resize "400x" }}

View file

@ -1,9 +1,12 @@
<nav>
{{ $icon := resources.Get "external-link.svg" }}
<details id="nav-menu" open="true">
<summary>Navigation</summary>
{{ $icon := resources.Get "external-link.svg" }}
{{ range .Site.Menus.main }}
<div class="site-menu">
<a href="{{ .URL }}">{{ .Name }}{{ if strings.HasPrefix .URL "http" }}<img class="external-link" aria-hidden="true" alt="External link" width="16" height="16" src="{{ $icon.Permalink }}"/>{{- end -}}</a>
</div>
{{ end }}
{{ range .Site.Menus.main }}
<div class="site-menu">
<a href="{{ .URL }}">{{ .Name }}{{ if strings.HasPrefix .URL "http" }}<img class="external-link" aria-hidden="true" alt="External link" width="16" height="16" src="{{ $icon.Permalink }}"/>{{- end -}}</a>
</div>
{{ end }}
</details>
</nav>