add fancy-box

This commit is contained in:
FarseaSH 2021-08-30 18:38:17 +08:00
parent f8803b75b9
commit d3b9e6880f
4 changed files with 10 additions and 4 deletions

View file

@ -9,4 +9,7 @@
$(this).attr("red", true); $(this).attr("red", true);
} }
}); });
</script> </script>
<!-- fancybox -->
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script>

View file

@ -31,5 +31,8 @@
<!-- the Moments style css file --> <!-- the Moments style css file -->
<link rel="stylesheet" type="text/css" href="{{.Site.BaseURL}}/css/style.css"> <link rel="stylesheet" type="text/css" href="{{.Site.BaseURL}}/css/style.css">
<!-- fancybox css (js in the end before the body closing tag) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css"/>
<!-- website title --> <!-- website title -->
<title>{{ .Site.Params.title }}</title> <title>{{ .Site.Params.title }}</title>

View file

@ -13,11 +13,11 @@
{{range $num,$a := .pic_set}} {{range $num,$a := .pic_set}}
{{if eq $num 0 }} {{if eq $num 0 }}
<div class="carousel-item active"> <div class="carousel-item active">
<img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}"> <img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}" data-fancybox="gallery">
</div> </div>
{{else}} {{else}}
<div class="carousel-item"> <div class="carousel-item">
<img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}"> <img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}" data-fancybox="gallery">
</div> </div>
{{end}} {{end}}
{{end}} {{end}}

View file

@ -53,7 +53,7 @@
<!-- 图片 --> <!-- 图片 -->
{{ with .Params.pic }} {{ with .Params.pic }}
<img src="{{ . }}" class="img-fluid pic1" alt="Responsive image"></img> <img src="{{ . }}" class="img-fluid pic1" alt="Responsive image" data-fancybox="gallery"></img>
{{ end }} {{ end }}
<!-- 图片集 --> <!-- 图片集 -->