mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-18 20:19:30 -07:00
separate overlay.html
This commit is contained in:
@@ -3,19 +3,14 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||||
{{- partial "head.html" . -}}
|
{{ partial "head.html" . }}
|
||||||
<title>{{ .Title }}</title>
|
<title>{{ .Title }}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
{{- partial "header.html" . -}}
|
{{ partial "header.html" . }}
|
||||||
</header>
|
</header>
|
||||||
<div class="overlay">
|
{{ partial "overlay.html" . }}
|
||||||
<section class="prev_section"></section>
|
|
||||||
<section class="close_section"></section>
|
|
||||||
<section class="next_section"></section>
|
|
||||||
<div class="overlay_cursor"></div>
|
|
||||||
</div>
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
{{ $sourcePath := "images" }}
|
{{ $sourcePath := "images" }}
|
||||||
{{ $gallery := site.GetPage $sourcePath }}
|
{{ $gallery := site.GetPage $sourcePath }}
|
||||||
@@ -24,7 +19,19 @@
|
|||||||
{{ $.Scratch.Add "img" slice }}
|
{{ $.Scratch.Add "img" slice }}
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
{{ $index = sub $index 1}}
|
{{ $index = sub $index 1}}
|
||||||
{{ $.Scratch.Add "img" (dict "index" (string $index) "url" (string .RelPermalink) "imgH" (string .Height) "imgW" (string .Width)) }}
|
{{ $colors := .Colors }}
|
||||||
|
{{ $pColor := index $colors 0 }}
|
||||||
|
{{ $sColor := "#ccc" }}
|
||||||
|
{{ if gt (len $colors) 1 }}
|
||||||
|
{{ $sColor = index $colors 1 }}
|
||||||
|
{{ end }}
|
||||||
|
{{ $.Scratch.Add "img" (dict
|
||||||
|
"index" (string $index)
|
||||||
|
"url" (string .RelPermalink)
|
||||||
|
"imgH" (string .Height)
|
||||||
|
"imgW" (string .Width)
|
||||||
|
"pColor" (string $pColor)
|
||||||
|
"sColor" (string $sColor)) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<script id="images_array" type="application/json">{{ $.Scratch.Get "img" | jsonify | safeJS }}</script>
|
<script id="images_array" type="application/json">{{ $.Scratch.Get "img" | jsonify | safeJS }}</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
6
layouts/partials/overlay.html
Normal file
6
layouts/partials/overlay.html
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<div class="overlay">
|
||||||
|
<section class="prev_section"></section>
|
||||||
|
<section class="close_section"></section>
|
||||||
|
<section class="next_section"></section>
|
||||||
|
<div class="overlay_cursor"></div>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user