1725 功能大改
This commit is contained in:
1 parent
fa52190830
commit
f73bf33bce
10 files changed
+1743
-10
No files matched your search
@@ -170,8 +170,9 @@
|
||||
{{/* ====== 5. 延迟加载的非关键JS ====== */}}
|
||||
{{ $toast := resources.Get "js/modules/toast.js" }}
|
||||
{{ $easylazyload := resources.Get "js/modules/lazyload.js" }}
|
||||
{{ $shortcodesJs := resources.Get "js/shortcodes.js" }}
|
||||
|
||||
{{ $deferredScripts := slice $toast $easylazyload | resources.Concat "js/deferred.js" | resources.Minify | resources.Fingerprint }}
|
||||
{{ $deferredScripts := slice $toast $easylazyload $shortcodesJs | resources.Concat "js/deferred.js" | resources.Minify | resources.Fingerprint }}
|
||||
|
||||
<script>
|
||||
// 使用requestIdleCallback在浏览器空闲时加载
|
||||
|
||||
@@ -131,8 +131,9 @@
|
||||
{{ $nprogress := resources.Get "css/libs/nprogress.min.css" }}
|
||||
{{ $message := resources.Get "css/libs/message.min.css" }}
|
||||
{{ $main := resources.Get "css/main.css" }}
|
||||
{{ $shortcodes := resources.Get "css/shortcodes.css" }}
|
||||
|
||||
{{ $style := slice $normalize $remixicon $uikit $nprogress $message $main | resources.Concat "css/style.css" | resources.Minify | resources.Fingerprint }}
|
||||
{{ $style := slice $normalize $remixicon $uikit $nprogress $message $main $shortcodes | resources.Concat "css/style.css" | resources.Minify | resources.Fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||
|
||||
{{- if and .Site.Params.style.enableBackgroundImage .Site.Params.style.backgroundImageUrl -}}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
{{- $imageRaw := .Get "image" | default (.Get "src") -}}
|
||||
{{- $alt := .Get "alt" | default "Live Photo" -}}
|
||||
{{- $videoRaw := .Get "video" | default (replaceRE "\\.(avif|webp|jpg|jpeg|png|gif)$" ".mp4" $imageRaw) -}}
|
||||
{{- $image := $imageRaw -}}
|
||||
{{- $video := $videoRaw -}}
|
||||
|
||||
{{- if and $imageRaw (not (findRE "^(https?://|/)" $imageRaw)) -}}
|
||||
{{- with .Page.Resources.GetMatch $imageRaw -}}
|
||||
{{- $image = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if and $videoRaw (not (findRE "^(https?://|/)" $videoRaw)) -}}
|
||||
{{- with .Page.Resources.GetMatch $videoRaw -}}
|
||||
{{- $video = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $style := .Get "style" -}}
|
||||
|
||||
<div class="live-photo"{{ with $style }}{{ printf " style=%q" (. | safeCSS) | safeHTMLAttr }}{{ end }}>
|
||||
<img class="live-photo-poster" src="{{ $image }}" alt="{{ $alt }}" loading="lazy" data-keep="1" no-view>
|
||||
<video class="live-photo-video" data-src="{{ $video }}" poster="{{ $image }}" muted playsinline loop preload="metadata" aria-label="{{ $alt }}"></video>
|
||||
<div class="live-photo-controls-group">
|
||||
<button type="button" class="live-photo-control-btn live-photo-toggle-btn" data-state="static" aria-label="Toggle Live Photo">
|
||||
<i class="icon-live" aria-hidden="true"></i>
|
||||
<span class="live-photo-live-label">实况</span>
|
||||
</button>
|
||||
<button type="button" class="live-photo-control-btn live-photo-mute-btn" data-muted="true" aria-label="Toggle Mute">
|
||||
<i class="ri-volume-up-line live-photo-mute-icon icon-unmuted" aria-hidden="true"></i>
|
||||
<i class="ri-volume-mute-line live-photo-mute-icon icon-muted" aria-hidden="true"></i>
|
||||
<span class="live-photo-mute-label">静音</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="warning" style="opacity: 0;"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,33 @@
|
||||
{{ $src := .Get "src" | default "" }}
|
||||
{{ $cover := .Get "cover" | default "/images/default-cover.jpg" }}
|
||||
{{ $name := .Get "name" | default "未知歌曲" }}
|
||||
{{ $artist := .Get "artist" | default "未知艺术家" }}
|
||||
{{ $accent := .Get "accent" | default "#d43c33" }}
|
||||
{{ $isApi := strings.HasPrefix $src "https://open.motues.top/music" }}
|
||||
|
||||
<div class="amigo-music-card-mark amigo-music-card" data-amigo-music-card="1" data-src="{{ $src }}" data-name="{{ $name }}" data-artist="{{ $artist }}" data-is-api="{{ if $isApi }}true{{ else }}false{{ end }}" style="--music-accent:{{ $accent }}">
|
||||
<div class="amigo-music-card__hero">
|
||||
<div class="amigo-music-card__art">
|
||||
<img class="amigo-music-card__cover amigo-music-card__cover--image" src="{{ $cover }}" alt="{{ $name }} cover" loading="lazy" data-keep="1">
|
||||
<button type="button" class="amigo-music-card__play" aria-label="播放《{{ $name }}》" aria-pressed="false">
|
||||
<span class="amigo-music-card__play-icon" aria-hidden="true"></span>
|
||||
</button>
|
||||
<span class="amigo-music-card__equalizer" aria-hidden="true"><span></span><span></span><span></span></span>
|
||||
</div>
|
||||
<div class="amigo-music-card__meta">
|
||||
<strong class="amigo-music-card__title">{{ $name }}</strong>
|
||||
<span class="amigo-music-card__subtitle">
|
||||
<span class="amigo-music-card__artist">{{ $artist }}</span>
|
||||
</span>
|
||||
<div class="amigo-music-card__timeline">
|
||||
<span class="amigo-music-card__time amigo-music-card__time--current">0:00</span>
|
||||
<label class="amigo-music-card__seek-wrap">
|
||||
<span class="sr-only">调整《{{ $name }}》的播放进度</span>
|
||||
<input class="amigo-music-card__seek" type="range" min="0" max="1000" step="1" value="0" aria-label="调整《{{ $name }}》的播放进度">
|
||||
<span class="amigo-music-card__seek-thumb" aria-hidden="true"></span>
|
||||
</label>
|
||||
<span class="amigo-music-card__time amigo-music-card__time--duration">--:--</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
{{- $src := .Get "src" | default "" -}}
|
||||
|
||||
{{- if and $src (not (findRE "^(https?://|/)" $src)) -}}
|
||||
{{- with .Page.Resources.GetMatch $src -}}
|
||||
{{- $src = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $isToday := eq (.Page.Date.Format "2006-01-02") (now.Format "2006-01-02") -}}
|
||||
|
||||
<div class="amigo-voice-bubble" data-src="{{ $src }}">
|
||||
<div class="amigo-voice-icon">
|
||||
<span></span><span></span><span></span>
|
||||
</div>
|
||||
<span class="amigo-voice-duration">″</span>
|
||||
{{ if $isToday }}<i class="amigo-voice-unread"></i>{{ end }}
|
||||
</div>
|
||||
Reference in new issue
Block a user