Hide menu navigation on mobile, disable text decoration on links
This commit is contained in:
parent
ce8120c9f8
commit
63478685e8
10 changed files with 36 additions and 20 deletions
|
@ -419,3 +419,7 @@ pre {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.no-decoration {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
8
themes/red/assets/js/gallery.js
Normal file
8
themes/red/assets/js/gallery.js
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
imagesLoaded(document.querySelector('.grid'), function(instance) {
|
||||||
|
new Masonry('.grid', {
|
||||||
|
itemSelector: '.grid-item',
|
||||||
|
columnWidth: '.grid-sizer',
|
||||||
|
fitWidth: true,
|
||||||
|
gutter: 10,
|
||||||
|
});
|
||||||
|
});
|
|
@ -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,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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 }}
|
||||||
|
|
|
@ -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 }}
|
||||||
|
|
|
@ -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 }}">
|
||||||
|
|
|
@ -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" }}
|
||||||
|
|
|
@ -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" }}
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<nav>
|
<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 }}
|
{{ range .Site.Menus.main }}
|
||||||
<div class="site-menu">
|
<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>
|
<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>
|
||||||
|
|
Loading…
Add table
Reference in a new issue