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

@ -419,3 +419,7 @@ pre {
padding: 5px; padding: 5px;
text-align: center; 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) { if (window.matchMedia('(max-device-width: 768px)').matches) {
new Masonry('.grid', { document.getElementById("nav-menu").open = false;
itemSelector: '.grid-item', }
columnWidth: '.grid-sizer',
fitWidth: true,
gutter: 10,
});
});

View file

@ -13,5 +13,11 @@
</article> </article>
</div> </div>
<footer>{{- partial "footer.html" . -}}</footer> <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> </body>
</html> </html>

View file

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

View file

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

View file

@ -2,7 +2,7 @@
<div class="generic-con year-con"> <div class="generic-con year-con">
{{ range $.Param "years" }} {{ range $.Param "years" }}
{{ $year := . }} {{ $year := . }}
<a href="/art/{{ . }}"> <a class="no-decoration" href="/art/{{ . }}">
{{ $thumbp := printf "/year-thumbs/%d.webp" . }} {{ $thumbp := printf "/year-thumbs/%d.webp" . }}
{{ with resources.Get $thumbp }} {{ with resources.Get $thumbp }}
<img width="256" height="128" alt="{{ $year }}" class="gallery-img article-img" src="{{ .RelPermalink }}"> <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}} {{ $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 }} {{ $title := .title }}
{{ with resources.Get (printf "art/%s" .filename) }} {{ with resources.Get (printf "art/%s" .filename) }}
{{ $image := .Resize "500x" }} {{ $image := .Resize "500x" }}

View file

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

View file

@ -1,4 +1,6 @@
<nav> <nav>
<details id="nav-menu" open="true">
<summary>Navigation</summary>
{{ $icon := resources.Get "external-link.svg" }} {{ $icon := resources.Get "external-link.svg" }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
@ -6,4 +8,5 @@
<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> <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> </div>
{{ end }} {{ end }}
</details>
</nav> </nav>