Skip to content

Commit 4ba7e01

Browse files
committed
blog home alive by AOS
1 parent 44b8a89 commit 4ba7e01

File tree

2 files changed

+47
-39
lines changed

2 files changed

+47
-39
lines changed

themes/hugo-coder/layouts/_default/baseof.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@
127127
{{ if eq .RelPermalink "/" }}
128128
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css" integrity="sha384-LTIDeidl25h2dPxrB2Ekgc9c7sEC3CWGM6HeFmuDNUjX76Ert4Z4IY714dhZHPLd" crossorigin="anonymous">
129129
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/grids-responsive-min.css">
130+
<link href="https://unpkg.com/[email protected]/dist/aos.css" rel="stylesheet">
131+
<script src="https://unpkg.com/[email protected]/dist/aos.js"></script>
130132
{{ end }}
131133

132134
<!-- Clarity tracking code for https://www.bmpi.dev/ -->
@@ -172,7 +174,7 @@
172174
<script>(function(w,d, s, id) {w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('init','BHuwaXciWicBjh6HQS2tfudv6IYQD11K9u1NUj7nuaEV9NoDT7ns9JjgqyYTflUv-m3TlD7ELY84AHMfgmPXNgU');</script>
173175
<!-- end webpushr code -->
174176

175-
{{ if or (hasPrefix .RelPermalink "/dev/") (hasPrefix .RelPermalink "/en/dev/") (hasPrefix .RelPermalink "/self/") (hasPrefix .RelPermalink "/en/self/") (hasPrefix .RelPermalink "/money/") (hasPrefix .RelPermalink "/en/money/") }}
177+
{{ if or (eq .RelPermalink "/") (hasPrefix .RelPermalink "/dev/") (hasPrefix .RelPermalink "/en/dev/") (hasPrefix .RelPermalink "/self/") (hasPrefix .RelPermalink "/en/self/") (hasPrefix .RelPermalink "/money/") (hasPrefix .RelPermalink "/en/money/") }}
176178
<script>
177179
AOS.init({
178180
disable: 'mobile'
Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,56 @@
11
<section class="container centered">
22
<div class="about">
33
{{ with .Site.Params.avatarurl }}
4-
<div class="avatar"><img src="{{ . | relURL }}" alt="马大伟"></div>
4+
<div class="avatar" data-aos="fade-down" data-aos-offset="150" data-aos-delay="200" data-aos-duration="1000"><img src="{{ . | relURL }}" alt="马大伟"></div>
55
{{ end }}
6-
<h1>{{ .Site.Params.author }}</h1>
7-
<h2>{{ .Site.Params.info1 }}<br>{{ .Site.Params.info2 }}<br>{{ .Site.Params.info3 }}</h2>
8-
{{ with .Site.Params.social }}
9-
<ul class="about-social">
10-
{{ range sort .}}
11-
{{ if .icon }}
12-
<li>
13-
<a href="{{ .url }}" rel="nofollow" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }}>
14-
<i class="{{ .icon }}" aria-hidden="true"></i>
15-
</a>
16-
</li>
17-
{{ else }}
18-
<li>
19-
<a href="{{ .url }}" rel="nofollow" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }}>{{ .name }}</a>
20-
</li>
6+
<div data-aos="fade-right" data-aos-offset="200" data-aos-delay="200" data-aos-duration="2000">
7+
<h1>{{ .Site.Params.author }}</h1>
8+
</div>
9+
<div data-aos="fade-left" data-aos-offset="200" data-aos-delay="500" data-aos-duration="2000">
10+
<h2>{{ .Site.Params.info1 }}<br>{{ .Site.Params.info2 }}<br>{{ .Site.Params.info3 }}</h2>
11+
</div>
12+
<div data-aos="fade-up" data-aos-offset="100" data-aos-delay="200" data-aos-duration="1500">
13+
{{ with .Site.Params.social }}
14+
<ul class="about-social">
15+
{{ range sort .}}
16+
{{ if .icon }}
17+
<li>
18+
<a href="{{ .url }}" rel="nofollow" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }}>
19+
<i class="{{ .icon }}" aria-hidden="true"></i>
20+
</a>
21+
</li>
22+
{{ else }}
23+
<li>
24+
<a href="{{ .url }}" rel="nofollow" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }}>{{ .name }}</a>
25+
</li>
26+
{{ end }}
2127
{{ end }}
28+
</ul>
2229
{{ end }}
23-
</ul>
24-
{{ end }}
25-
{{ if eq .Site.Language.Lang "zh-cn" }}
26-
<div class="dashboard">
27-
<div class="pure-g">
28-
<div class="pure-u-1 pure-u-md-1-2 left">
29-
共 {{ len .Site.RegularPages }} 篇文章
30-
</div>
31-
<div class="pure-u-1 pure-u-md-1-2 right">
32-
{{$scratch := newScratch}}
33-
{{ range .Site.RegularPages }}
34-
{{$scratch.Add "total" (countwords .Content)}}
35-
{{ end }}
36-
总计 {{$scratch.Get "total" }} 字
37-
</div>
38-
</div>
39-
<div class="pure-g">
40-
<div class="pure-u-1 pure-u-md-1-2 left">
41-
<span>网站总 PV: </span><span id="all-page-views"></span>
30+
{{ if eq .Site.Language.Lang "zh-cn" }}
31+
<div class="dashboard">
32+
<div class="pure-g">
33+
<div class="pure-u-1 pure-u-md-1-2 left">
34+
共 {{ len .Site.RegularPages }} 篇文章
35+
</div>
36+
<div class="pure-u-1 pure-u-md-1-2 right">
37+
{{$scratch := newScratch}}
38+
{{ range .Site.RegularPages }}
39+
{{$scratch.Add "total" (countwords .Content)}}
40+
{{ end }}
41+
总计 {{$scratch.Get "total" }} 字
42+
</div>
4243
</div>
43-
<div class="pure-u-1 pure-u-md-1-2 right">
44-
网站运行时间: <span id="site-run-days"></span>
44+
<div class="pure-g">
45+
<div class="pure-u-1 pure-u-md-1-2 left">
46+
<span>网站总 PV: </span><span id="all-page-views"></span>
47+
</div>
48+
<div class="pure-u-1 pure-u-md-1-2 right">
49+
网站运行时间: <span id="site-run-days"></span>
50+
</div>
4551
</div>
4652
</div>
53+
{{ end }}
4754
</div>
48-
{{ end }}
4955
</div>
5056
</section>

0 commit comments

Comments
 (0)