修复EXIF
This commit is contained in:
@@ -5,9 +5,11 @@ import Icons from "unplugin-icons/vite";
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: "/themes/warm-island",
|
base: "/themes/warm-island",
|
||||||
|
compressHTML: true,
|
||||||
build: {
|
build: {
|
||||||
assets: "assets",
|
assets: "assets",
|
||||||
format: "file",
|
format: "file",
|
||||||
|
cssMinify: true,
|
||||||
},
|
},
|
||||||
outDir: "./templates",
|
outDir: "./templates",
|
||||||
integrations: [vue()],
|
integrations: [vue()],
|
||||||
|
|||||||
@@ -29,14 +29,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/mdx": "^5.0.3",
|
|
||||||
"@astrojs/rss": "^4.0.18",
|
|
||||||
"@astrojs/vue": "^6.0.1",
|
"@astrojs/vue": "^6.0.1",
|
||||||
"@halo-dev/api-client": "^2.23.0",
|
|
||||||
"astro": "^6.1.4",
|
"astro": "^6.1.4",
|
||||||
"ky": "^2.0.0",
|
|
||||||
"lightgallery": "^2.9.0",
|
"lightgallery": "^2.9.0",
|
||||||
"sharp": "^0.34.5",
|
|
||||||
"vue": "^3.5.32"
|
"vue": "^3.5.32"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
Generated
+5
-839
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 208 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 261 KiB |
@@ -189,6 +189,26 @@ spec:
|
|||||||
name: home_pinned_title
|
name: home_pinned_title
|
||||||
label: 置顶模块标题
|
label: 置顶模块标题
|
||||||
value: 置顶
|
value: 置顶
|
||||||
|
- $formkit: text
|
||||||
|
name: home_posts_title
|
||||||
|
label: 文章模块标题
|
||||||
|
value: 文章
|
||||||
|
- $formkit: switch
|
||||||
|
name: home_card_show_visit
|
||||||
|
label: 文章卡片显示阅读量
|
||||||
|
value: true
|
||||||
|
- $formkit: switch
|
||||||
|
name: home_card_show_wordcount
|
||||||
|
label: 文章卡片显示字数
|
||||||
|
value: true
|
||||||
|
- $formkit: switch
|
||||||
|
name: home_card_show_category
|
||||||
|
label: 文章卡片显示分类
|
||||||
|
value: true
|
||||||
|
- $formkit: switch
|
||||||
|
name: home_card_show_tags
|
||||||
|
label: 文章卡片显示标签
|
||||||
|
value: true
|
||||||
- $formkit: number
|
- $formkit: number
|
||||||
name: home_excerpt_lines
|
name: home_excerpt_lines
|
||||||
label: 文章简介显示行数
|
label: 文章简介显示行数
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted, onUnmounted } from "vue";
|
import { ref, onMounted, onUnmounted } from "vue";
|
||||||
|
|
||||||
const x = ref(0);
|
const glowEl = ref<HTMLElement | null>(null);
|
||||||
const y = ref(0);
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
|
var rafId = 0;
|
||||||
|
|
||||||
function handleMouseMove(e: MouseEvent) {
|
function handleMouseMove(e: MouseEvent) {
|
||||||
x.value = e.clientX;
|
if (rafId) return;
|
||||||
y.value = e.clientY;
|
rafId = requestAnimationFrame(() => {
|
||||||
|
if (glowEl.value) {
|
||||||
|
glowEl.value.style.transform = `translate(calc(${e.clientX}px - 50%), calc(${e.clientY}px - 50%))`;
|
||||||
|
}
|
||||||
|
rafId = 0;
|
||||||
|
});
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,21 +21,22 @@ function handleMouseLeave() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
document.addEventListener("mousemove", handleMouseMove);
|
document.addEventListener("mousemove", handleMouseMove, { passive: true });
|
||||||
document.addEventListener("mouseleave", handleMouseLeave);
|
document.addEventListener("mouseleave", handleMouseLeave);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
document.removeEventListener("mousemove", handleMouseMove);
|
document.removeEventListener("mousemove", handleMouseMove);
|
||||||
document.removeEventListener("mouseleave", handleMouseLeave);
|
document.removeEventListener("mouseleave", handleMouseLeave);
|
||||||
|
if (rafId) cancelAnimationFrame(rafId);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
|
ref="glowEl"
|
||||||
class="wi-cursor-glow"
|
class="wi-cursor-glow"
|
||||||
:class="{ 'wi-cursor-glow--visible': visible }"
|
:class="{ 'wi-cursor-glow--visible': visible }"
|
||||||
:style="{ transform: `translate(calc(${x}px - 50%), calc(${y}px - 50%))` }"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import 'lightgallery/css/lightgallery-bundle.css';
|
import 'lightgallery/css/lightgallery.css';
|
||||||
|
import 'lightgallery/css/lg-zoom.css';
|
||||||
|
import 'lightgallery/css/lg-thumbnail.css';
|
||||||
|
import 'lightgallery/css/lg-fullscreen.css';
|
||||||
|
import 'lightgallery/css/lg-rotate.css';
|
||||||
|
import 'lightgallery/css/lg-autoplay.css';
|
||||||
import lightGallery from 'lightgallery';
|
import lightGallery from 'lightgallery';
|
||||||
import lgZoom from 'lightgallery/plugins/zoom';
|
import lgZoom from 'lightgallery/plugins/zoom';
|
||||||
import lgThumbnail from 'lightgallery/plugins/thumbnail';
|
import lgThumbnail from 'lightgallery/plugins/thumbnail';
|
||||||
@@ -84,9 +89,12 @@
|
|||||||
showZoomInOutIcons: true,
|
showZoomInOutIcons: true,
|
||||||
toggleThumb: true,
|
toggleThumb: true,
|
||||||
allowMediaOverlap: true,
|
allowMediaOverlap: true,
|
||||||
autoplay: false,
|
autoplay: true,
|
||||||
slideDelay: 5000,
|
slideShowAutoplay: false,
|
||||||
|
slideShowInterval: 5000,
|
||||||
progressBar: true,
|
progressBar: true,
|
||||||
|
autoplayControls: true,
|
||||||
|
forceSlideShowAutoplay: false,
|
||||||
rotate: true,
|
rotate: true,
|
||||||
flipHorizontal: false,
|
flipHorizontal: false,
|
||||||
flipVertical: false,
|
flipVertical: false,
|
||||||
@@ -107,6 +115,10 @@
|
|||||||
markInitialized(el);
|
markInitialized(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isMobile() {
|
||||||
|
return window.innerWidth < 768;
|
||||||
|
}
|
||||||
|
|
||||||
function initLightGallery() {
|
function initLightGallery() {
|
||||||
initContentPages();
|
initContentPages();
|
||||||
initPhotosPage();
|
initPhotosPage();
|
||||||
@@ -122,6 +134,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
|
document.addEventListener('click', function(e) {
|
||||||
|
var link = e.target.closest('.wi-lightgallery-item');
|
||||||
|
if (link) {
|
||||||
|
setTimeout(function() {
|
||||||
|
var lgOuter = document.querySelector('.lg-outer');
|
||||||
|
if (lgOuter && !lgOuter.classList.contains('wi-thumb-shown') && !isMobile()) {
|
||||||
|
lgOuter.classList.add('wi-thumb-shown');
|
||||||
|
}
|
||||||
|
}, 350);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function initContentPages() {
|
function initContentPages() {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import ThemeSwitcher from "./ThemeSwitcher.vue";
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<th:block th:if="${theme.config?.navbar?.navbar_show_theme_switch != false}">
|
<th:block th:if="${theme.config?.navbar?.navbar_show_theme_switch != false}">
|
||||||
<ThemeSwitcher client:load />
|
<ThemeSwitcher client:idle />
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ const pageConfig = findPageBySlug("photos");
|
|||||||
th:alt="${photo.spec.displayName ?: ''}"
|
th:alt="${photo.spec.displayName ?: ''}"
|
||||||
class="wi-photos-section__image"
|
class="wi-photos-section__image"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ const { pageTitle, contentClass, wide, home } = Astro.props;
|
|||||||
</main>
|
</main>
|
||||||
<Footer />
|
<Footer />
|
||||||
<MobileMenu />
|
<MobileMenu />
|
||||||
<ScrollReveal client:load />
|
<ScrollReveal client:visible />
|
||||||
<CursorGlow th:if="${theme.config?.animation?.animation_cursor_glow}" client:load />
|
<CursorGlow th:if="${theme.config?.animation?.animation_cursor_glow}" client:idle />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Layout from "../layouts/Layout.astro";
|
|||||||
<header class="wi-archives__header">
|
<header class="wi-archives__header">
|
||||||
<h1 class="wi-archives__title">归档</h1>
|
<h1 class="wi-archives__title">归档</h1>
|
||||||
<span class="wi-page-accent"></span>
|
<span class="wi-page-accent"></span>
|
||||||
<p class="wi-archives__subtitle" th:text="${theme.config?.home?.home_label_post_count ?: '共 {total} 篇文章}'.replace('{total}', archives.total)}"></p>
|
<p class="wi-archives__subtitle" th:text="|共 ${archives.total} 篇文章|"></p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<section class="wi-archives__timeline" aria-label="Archive timeline">
|
<section class="wi-archives__timeline" aria-label="Archive timeline">
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import Layout from "../layouts/Layout.astro";
|
|||||||
th:text="${category.spec.displayName}"
|
th:text="${category.spec.displayName}"
|
||||||
></h1>
|
></h1>
|
||||||
<span class="wi-page-accent"></span>
|
<span class="wi-page-accent"></span>
|
||||||
<p class="wi-category__subtitle" th:text="${theme.config?.home?.home_label_post_count ?: '共 {total} 篇文章}'.replace('{total}', posts.total)}"></p>
|
<p class="wi-category__subtitle" th:text="|共 ${posts.total} 篇文章|"></p>
|
||||||
<p
|
<p
|
||||||
th:if="${not #strings.isEmpty(category.spec.description)}"
|
th:if="${not #strings.isEmpty(category.spec.description)}"
|
||||||
class="wi-category__description"
|
class="wi-category__description"
|
||||||
|
|||||||
+141
-17
@@ -60,36 +60,74 @@ import HeroSection from "../components/HeroSection.astro";
|
|||||||
|
|
||||||
<section class="wi-home-posts" id="wi-home-posts">
|
<section class="wi-home-posts" id="wi-home-posts">
|
||||||
<div class="wi-container">
|
<div class="wi-container">
|
||||||
|
<div class="wi-section__header">
|
||||||
|
<h2 class="wi-section__title" th:text="${theme.config?.home?.home_posts_title ?: '文章'}">文章</h2>
|
||||||
|
</div>
|
||||||
<div class="wi-flow" id="wi-post-grid">
|
<div class="wi-flow" id="wi-post-grid">
|
||||||
<a
|
<article
|
||||||
th:each="post : ${posts.items}"
|
th:each="post : ${posts.items}"
|
||||||
th:if="${!post.spec.pinned}"
|
th:if="${!post.spec.pinned}"
|
||||||
th:href="@{${post.status.permalink}}"
|
|
||||||
class="wi-flow__card"
|
class="wi-flow__card"
|
||||||
th:classappend="${!#strings.isEmpty(post.spec.cover)} ? 'wi-flow__card--with-cover' : ''"
|
th:classappend="${!#strings.isEmpty(post.spec.cover)} ? 'wi-flow__card--with-cover' : ''"
|
||||||
>
|
>
|
||||||
|
<a
|
||||||
|
class="wi-flow__stretched-link"
|
||||||
|
th:href="@{${post.status.permalink}}"
|
||||||
|
tabindex="-1"
|
||||||
|
aria-hidden="true"
|
||||||
|
></a>
|
||||||
<div class="wi-flow__body">
|
<div class="wi-flow__body">
|
||||||
<div class="wi-flow__meta">
|
<div class="wi-flow__meta">
|
||||||
<span
|
<th:block th:if="${(theme.config?.home?.home_card_show_category ?: true) and !#lists.isEmpty(post.categories)}">
|
||||||
class="wi-flow__category"
|
<span class="wi-flow__categories">
|
||||||
th:if="${!#lists.isEmpty(post.categories)}"
|
<a
|
||||||
th:text="${post.categories[0].spec.displayName}"
|
th:each="cat : ${post.categories}"
|
||||||
></span>
|
th:href="@{${cat.status.permalink}}"
|
||||||
|
th:text="${cat.spec.displayName}"
|
||||||
|
class="wi-flow__category-link"
|
||||||
|
></a>
|
||||||
|
</span>
|
||||||
|
</th:block>
|
||||||
<time
|
<time
|
||||||
class="wi-flow__date"
|
class="wi-flow__date"
|
||||||
th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd')}"
|
th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd')}"
|
||||||
></time>
|
></time>
|
||||||
</div>
|
</div>
|
||||||
<h3
|
<a
|
||||||
class="wi-flow__title"
|
th:href="@{${post.status.permalink}}"
|
||||||
th:text="${post.spec.title}"
|
class="wi-flow__title-link"
|
||||||
></h3>
|
>
|
||||||
|
<h3
|
||||||
|
class="wi-flow__title"
|
||||||
|
th:text="${post.spec.title}"
|
||||||
|
></h3>
|
||||||
|
</a>
|
||||||
<p
|
<p
|
||||||
class="wi-flow__excerpt"
|
class="wi-flow__excerpt"
|
||||||
th:if="${post.status.excerpt}"
|
th:if="${post.status.excerpt}"
|
||||||
th:text="${post.status.excerpt}"
|
th:text="${post.status.excerpt}"
|
||||||
th:style="'-webkit-line-clamp:' + (${theme.config?.home?.home_excerpt_lines ?: 3})"
|
th:style="'-webkit-line-clamp:' + (${theme.config?.home?.home_excerpt_lines ?: 3})"
|
||||||
></p>
|
></p>
|
||||||
|
<div class="wi-flow__footer">
|
||||||
|
<th:block th:if="${(theme.config?.home?.home_card_show_tags ?: true) and post.tags != null and !#lists.isEmpty(post.tags)}">
|
||||||
|
<div class="wi-flow__tags">
|
||||||
|
<a
|
||||||
|
th:each="tag : ${post.tags}"
|
||||||
|
th:href="@{${tag.status.permalink}}"
|
||||||
|
th:text="${tag.spec.displayName}"
|
||||||
|
class="wi-flow__tag-link"
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
|
</th:block>
|
||||||
|
<div class="wi-flow__stats">
|
||||||
|
<span
|
||||||
|
class="wi-flow__stat"
|
||||||
|
th:if="${theme.config?.home?.home_card_show_visit ?: true}"
|
||||||
|
>
|
||||||
|
<th:block th:text="${post.stats?.visit ?: 0}"></th:block> 阅读
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="wi-flow__cover"
|
class="wi-flow__cover"
|
||||||
@@ -97,7 +135,7 @@ import HeroSection from "../components/HeroSection.astro";
|
|||||||
>
|
>
|
||||||
<img th:src="${post.spec.cover}" th:alt="${post.spec.title}" class="wi-flow__image" />
|
<img th:src="${post.spec.cover}" th:alt="${post.spec.title}" class="wi-flow__image" />
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
@@ -396,13 +434,19 @@ import HeroSection from "../components/HeroSection.astro";
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: var(--bg-raised);
|
background: var(--bg-raised);
|
||||||
box-shadow: var(--shadow-sm);
|
box-shadow: var(--shadow-sm);
|
||||||
text-decoration: none;
|
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
position: relative;
|
||||||
transition:
|
transition:
|
||||||
transform var(--duration-normal) var(--ease-out-expo),
|
transform var(--duration-normal) var(--ease-out-expo),
|
||||||
box-shadow var(--duration-normal) var(--ease-out-expo);
|
box-shadow var(--duration-normal) var(--ease-out-expo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wi-flow__stretched-link {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.wi-flow__card:hover {
|
.wi-flow__card:hover {
|
||||||
transform: translateY(-4px);
|
transform: translateY(-4px);
|
||||||
box-shadow: var(--shadow-lg);
|
box-shadow: var(--shadow-lg);
|
||||||
@@ -448,20 +492,37 @@ import HeroSection from "../components/HeroSection.astro";
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wi-flow__category {
|
.wi-flow__categories {
|
||||||
font-size: var(--text-xs);
|
font-size: var(--text-xs);
|
||||||
color: var(--accent);
|
|
||||||
letter-spacing: var(--tracking-wide);
|
letter-spacing: var(--tracking-wide);
|
||||||
text-transform: uppercase;
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wi-flow__category::after {
|
.wi-flow__categories::after {
|
||||||
content: '·';
|
content: '·';
|
||||||
margin-left: var(--space-sm);
|
margin-left: var(--space-sm);
|
||||||
|
margin-right: var(--space-sm);
|
||||||
color: var(--ink-3);
|
color: var(--ink-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wi-flow__category-link {
|
||||||
|
color: var(--accent);
|
||||||
|
text-decoration: none;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
transition: color var(--duration-fast) var(--ease-out-quart);
|
||||||
|
}
|
||||||
|
|
||||||
|
.wi-flow__category-link:hover {
|
||||||
|
color: var(--accent-hover);
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wi-flow__category-link + .wi-flow__category-link::before {
|
||||||
|
content: '、';
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
.wi-flow__date {
|
.wi-flow__date {
|
||||||
font-size: var(--text-xs);
|
font-size: var(--text-xs);
|
||||||
color: var(--ink-3);
|
color: var(--ink-3);
|
||||||
@@ -469,6 +530,12 @@ import HeroSection from "../components/HeroSection.astro";
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wi-flow__title-link {
|
||||||
|
text-decoration: none;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
.wi-flow__title {
|
.wi-flow__title {
|
||||||
font-family: var(--font-sans);
|
font-family: var(--font-sans);
|
||||||
font-size: var(--text-lg);
|
font-size: var(--text-lg);
|
||||||
@@ -493,6 +560,57 @@ import HeroSection from "../components/HeroSection.astro";
|
|||||||
margin-block-end: 0;
|
margin-block-end: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wi-flow__footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 0.5rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: auto;
|
||||||
|
padding-top: var(--space-xs);
|
||||||
|
}
|
||||||
|
|
||||||
|
.wi-flow__tags {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wi-flow__tag-link {
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--ink-3);
|
||||||
|
text-decoration: none;
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--bg);
|
||||||
|
border: 1px solid var(--rule);
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
transition: color var(--duration-fast) var(--ease-out-quart), border-color var(--duration-fast) var(--ease-out-quart), background var(--duration-fast) var(--ease-out-quart);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wi-flow__tag-link:hover {
|
||||||
|
color: var(--accent);
|
||||||
|
border-color: var(--accent);
|
||||||
|
background: color-mix(in srgb, var(--accent) 6%, var(--bg));
|
||||||
|
}
|
||||||
|
|
||||||
|
.wi-flow__stats {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
color: var(--ink-3);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wi-flow__stat + .wi-flow__stat::before {
|
||||||
|
content: '·';
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
color: var(--ink-3);
|
||||||
|
}
|
||||||
|
|
||||||
.wi-pagination {
|
.wi-pagination {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -561,5 +679,11 @@ import HeroSection from "../components/HeroSection.astro";
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
aspect-ratio: 16 / 9;
|
aspect-ratio: 16 / 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wi-flow__footer {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 0.4rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
th:alt="''"
|
th:alt="''"
|
||||||
class="wi-moments-page__image"
|
class="wi-moments-page__image"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
</th:block>
|
</th:block>
|
||||||
</div>
|
</div>
|
||||||
@@ -93,6 +94,7 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
th:alt="''"
|
th:alt="''"
|
||||||
class="wi-moments-page__card-image"
|
class="wi-moments-page__card-image"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
</th:block>
|
</th:block>
|
||||||
</div>
|
</div>
|
||||||
@@ -148,6 +150,7 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
th:alt="''"
|
th:alt="''"
|
||||||
class="wi-moments-page__masonry-image"
|
class="wi-moments-page__masonry-image"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
</th:block>
|
</th:block>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
th:alt="${photo.spec.displayName ?: ''}"
|
th:alt="${photo.spec.displayName ?: ''}"
|
||||||
class="wi-photos-page__image"
|
class="wi-photos-page__image"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
<div class="wi-photos-page__overlay">
|
<div class="wi-photos-page__overlay">
|
||||||
<span
|
<span
|
||||||
@@ -111,6 +112,7 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
th:alt="${photo.spec.displayName ?: ''}"
|
th:alt="${photo.spec.displayName ?: ''}"
|
||||||
class="wi-photos-page__image"
|
class="wi-photos-page__image"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
<div class="wi-photos-page__overlay">
|
<div class="wi-photos-page__overlay">
|
||||||
<span
|
<span
|
||||||
@@ -148,6 +150,7 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
th:alt="${photo.spec.displayName ?: ''}"
|
th:alt="${photo.spec.displayName ?: ''}"
|
||||||
class="wi-photos-page__image"
|
class="wi-photos-page__image"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
<div class="wi-photos-page__overlay">
|
<div class="wi-photos-page__overlay">
|
||||||
<span
|
<span
|
||||||
@@ -176,6 +179,7 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
th:alt="${photo.spec.displayName ?: ''}"
|
th:alt="${photo.spec.displayName ?: ''}"
|
||||||
class="wi-photos-page__image"
|
class="wi-photos-page__image"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
<div class="wi-photos-page__overlay">
|
<div class="wi-photos-page__overlay">
|
||||||
<span
|
<span
|
||||||
@@ -187,6 +191,7 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
</th:block>
|
||||||
</div>
|
</div>
|
||||||
</th:block>
|
</th:block>
|
||||||
</th:block>
|
</th:block>
|
||||||
@@ -221,6 +226,7 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
th:alt="${photo.spec.displayName ?: ''}"
|
th:alt="${photo.spec.displayName ?: ''}"
|
||||||
class="wi-photos-page__image"
|
class="wi-photos-page__image"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
<div class="wi-photos-page__overlay">
|
<div class="wi-photos-page__overlay">
|
||||||
<span
|
<span
|
||||||
|
|||||||
+64
-33
@@ -210,12 +210,19 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
if (progressBar) {
|
if (progressBar) {
|
||||||
var article = document.querySelector(".wi-post");
|
var article = document.querySelector(".wi-post");
|
||||||
if (article) {
|
if (article) {
|
||||||
|
var progressTicking = false;
|
||||||
window.addEventListener("scroll", function () {
|
window.addEventListener("scroll", function () {
|
||||||
var rect = article.getBoundingClientRect();
|
if (!progressTicking) {
|
||||||
var articleHeight = article.offsetHeight;
|
requestAnimationFrame(function () {
|
||||||
var scrolled = -rect.top;
|
var rect = article.getBoundingClientRect();
|
||||||
var progress = Math.min(Math.max(scrolled / (articleHeight - window.innerHeight), 0), 1);
|
var articleHeight = article.offsetHeight;
|
||||||
progressBar.style.width = (progress * 100) + "%";
|
var scrolled = -rect.top;
|
||||||
|
var progress = Math.min(Math.max(scrolled / (articleHeight - window.innerHeight), 0), 1);
|
||||||
|
progressBar.style.width = (progress * 100) + "%";
|
||||||
|
progressTicking = false;
|
||||||
|
});
|
||||||
|
progressTicking = true;
|
||||||
|
}
|
||||||
}, { passive: true });
|
}, { passive: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,25 +249,35 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
function buildTocHtml(headings) {
|
function buildTocHtml(headings) {
|
||||||
var groups = [];
|
var groups = [];
|
||||||
var currentGroup = null;
|
var currentGroup = null;
|
||||||
|
var baseLevel = 6;
|
||||||
|
|
||||||
|
headings.forEach(function (h) {
|
||||||
|
var level = parseInt(h.tagName.charAt(1), 10);
|
||||||
|
if (level < baseLevel) baseLevel = level;
|
||||||
|
});
|
||||||
|
|
||||||
headings.forEach(function (h, i) {
|
headings.forEach(function (h, i) {
|
||||||
var id = "wi-heading-" + i;
|
var id = "wi-heading-" + i;
|
||||||
h.id = id;
|
h.id = id;
|
||||||
var level = parseInt(h.tagName.charAt(1), 10);
|
var level = parseInt(h.tagName.charAt(1), 10);
|
||||||
|
|
||||||
if (level === 2 || !currentGroup) {
|
if (level === baseLevel || !currentGroup) {
|
||||||
currentGroup = { h2: { id: id, text: h.textContent.trim() }, children: [] };
|
currentGroup = { h2: { id: id, text: h.textContent.trim(), level: level }, children: [] };
|
||||||
groups.push(currentGroup);
|
groups.push(currentGroup);
|
||||||
} else {
|
} else if (level > baseLevel) {
|
||||||
currentGroup.children.push({ id: id, text: h.textContent.trim(), level: level });
|
currentGroup.children.push({ id: id, text: h.textContent.trim(), level: level });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var html = "";
|
var html = "";
|
||||||
groups.forEach(function (group) {
|
groups.forEach(function (group) {
|
||||||
html += '<div class="wi-toc__group" data-h2="' + group.h2.id + '">';
|
var linkClasses = "wi-toc__link";
|
||||||
html += '<a class="wi-toc__link wi-toc__link--h2" href="#' + group.h2.id + '">' + group.h2.text + '</a>';
|
if (group.children.length > 0) {
|
||||||
if (group.children.length > 0) {
|
linkClasses += " wi-toc__link--group";
|
||||||
|
}
|
||||||
|
html += '<div class="wi-toc__group" data-h2="' + group.h2.id + '">';
|
||||||
|
html += '<a class="' + linkClasses + ' wi-toc__link--h' + group.h2.level + '" href="#' + group.h2.id + '">' + group.h2.text + '</a>';
|
||||||
|
if (group.children.length > 0) {
|
||||||
html += '<div class="wi-toc__sub">';
|
html += '<div class="wi-toc__sub">';
|
||||||
group.children.forEach(function (child) {
|
group.children.forEach(function (child) {
|
||||||
html += '<a class="wi-toc__link wi-toc__link--h' + child.level + '" href="#' + child.id + '">' + child.text + '</a>';
|
html += '<a class="wi-toc__link wi-toc__link--h' + child.level + '" href="#' + child.id + '">' + child.text + '</a>';
|
||||||
@@ -286,16 +303,12 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
var tocLinks = tocNav.querySelectorAll(".wi-toc__link");
|
var tocLinks = tocNav.querySelectorAll(".wi-toc__link");
|
||||||
|
|
||||||
tocGroups.forEach(function (group) {
|
tocGroups.forEach(function (group) {
|
||||||
var h2Link = group.querySelector(".wi-toc__link--h2");
|
var groupLink = group.querySelector(".wi-toc__link--group");
|
||||||
if (h2Link) {
|
if (groupLink) {
|
||||||
h2Link.addEventListener("click", function (e) {
|
groupLink.addEventListener("click", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var isExpanded = group.classList.contains("wi-toc__group--expanded");
|
group.classList.toggle("wi-toc__group--expanded");
|
||||||
tocGroups.forEach(function (g) { g.classList.remove("wi-toc__group--expanded"); });
|
var targetId = groupLink.getAttribute("href").substring(1);
|
||||||
if (!isExpanded) {
|
|
||||||
group.classList.add("wi-toc__group--expanded");
|
|
||||||
}
|
|
||||||
var targetId = h2Link.getAttribute("href").substring(1);
|
|
||||||
var target = document.getElementById(targetId);
|
var target = document.getElementById(targetId);
|
||||||
if (target) {
|
if (target) {
|
||||||
target.scrollIntoView({ behavior: "smooth", block: "start" });
|
target.scrollIntoView({ behavior: "smooth", block: "start" });
|
||||||
@@ -394,16 +407,12 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
var drawerGroups = tocDrawerNav.querySelectorAll(".wi-toc__group");
|
var drawerGroups = tocDrawerNav.querySelectorAll(".wi-toc__group");
|
||||||
tocDrawerNav.querySelectorAll(".wi-toc__link").forEach(function (link) {
|
tocDrawerNav.querySelectorAll(".wi-toc__link").forEach(function (link) {
|
||||||
link.addEventListener("click", function (e) {
|
link.addEventListener("click", function (e) {
|
||||||
var h2Link = link.classList.contains("wi-toc__link--h2");
|
var isGroupLink = link.classList.contains("wi-toc__link--group");
|
||||||
if (h2Link) {
|
if (isGroupLink) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var group = link.closest(".wi-toc__group");
|
var group = link.closest(".wi-toc__group");
|
||||||
if (group) {
|
if (group) {
|
||||||
var isExpanded = group.classList.contains("wi-toc__group--expanded");
|
group.classList.toggle("wi-toc__group--expanded");
|
||||||
drawerGroups.forEach(function (g) { g.classList.remove("wi-toc__group--expanded"); });
|
|
||||||
if (!isExpanded) {
|
|
||||||
group.classList.add("wi-toc__group--expanded");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var targetId = link.getAttribute("href").substring(1);
|
var targetId = link.getAttribute("href").substring(1);
|
||||||
var target = document.getElementById(targetId);
|
var target = document.getElementById(targetId);
|
||||||
@@ -967,9 +976,13 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
transition: max-height 0.3s ease, opacity 0.25s ease;
|
transition: max-height 0.3s ease, opacity 0.25s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wi-toc__group--active .wi-toc__sub,
|
.wi-toc__group--active .wi-toc__sub {
|
||||||
|
max-height: 600px;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.wi-toc__group--expanded .wi-toc__sub {
|
.wi-toc__group--expanded .wi-toc__sub {
|
||||||
max-height: 500px;
|
max-height: 600px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -998,14 +1011,14 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
background: color-mix(in srgb, var(--accent) 8%, transparent);
|
background: color-mix(in srgb, var(--accent) 8%, transparent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wi-toc__link--h2 {
|
.wi-toc__link--group {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 4px;
|
padding-right: 4px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wi-toc__link--h2::before {
|
.wi-toc__link--group::before {
|
||||||
content: "";
|
content: "";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 4px;
|
width: 4px;
|
||||||
@@ -1017,7 +1030,25 @@ import LightGallery from "../components/LightGallery.astro";
|
|||||||
transition: background 0.15s ease;
|
transition: background 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wi-toc__link--active.wi-toc__link--h2::before {
|
.wi-toc__link--group::after {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
border-right: 1.5px solid var(--ink-3);
|
||||||
|
border-bottom: 1.5px solid var(--ink-3);
|
||||||
|
transform: rotate(-45deg);
|
||||||
|
margin-left: 6px;
|
||||||
|
vertical-align: middle;
|
||||||
|
transition: transform 0.2s ease, border-color 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wi-toc__group--expanded > .wi-toc__link--group::after,
|
||||||
|
.wi-toc__group--active > .wi-toc__link--group::after {
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.wi-toc__link--active.wi-toc__link--group::before {
|
||||||
background: var(--accent);
|
background: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -11,7 +11,7 @@ import Layout from "../layouts/Layout.astro";
|
|||||||
<header class="wi-tag__header">
|
<header class="wi-tag__header">
|
||||||
<h1 class="wi-tag__title" th:text="${tag.spec.displayName}"></h1>
|
<h1 class="wi-tag__title" th:text="${tag.spec.displayName}"></h1>
|
||||||
<span class="wi-page-accent"></span>
|
<span class="wi-page-accent"></span>
|
||||||
<p class="wi-tag__subtitle" th:text="${theme.config?.home?.home_label_post_count ?: '共 {total} 篇文章}'.replace('{total}', posts.total)}"></p>
|
<p class="wi-tag__subtitle" th:text="|共 ${posts.total} 篇文章|"></p>
|
||||||
<p
|
<p
|
||||||
th:if="${not #strings.isEmpty(tag.spec.description)}"
|
th:if="${not #strings.isEmpty(tag.spec.description)}"
|
||||||
class="wi-tag__description"
|
class="wi-tag__description"
|
||||||
@@ -46,6 +46,7 @@ import Layout from "../layouts/Layout.astro";
|
|||||||
th:src="${post.spec.cover}"
|
th:src="${post.spec.cover}"
|
||||||
alt=""
|
alt=""
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ $lg-thumb-height: 100px;
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
letter-spacing: 0.02em;
|
letter-spacing: 0.02em;
|
||||||
padding: 48px 16px 12px;
|
padding: 48px 16px 12px;
|
||||||
|
transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wi-lg-caption {
|
.wi-lg-caption {
|
||||||
@@ -165,6 +166,7 @@ $lg-thumb-height: 100px;
|
|||||||
|
|
||||||
.lg-progress-bar {
|
.lg-progress-bar {
|
||||||
height: 2px;
|
height: 2px;
|
||||||
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lg-progress-bar .lg-progress {
|
.lg-progress-bar .lg-progress {
|
||||||
@@ -173,16 +175,35 @@ $lg-thumb-height: 100px;
|
|||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lg-autoplay-button {
|
||||||
|
&.lg-icon::after {
|
||||||
|
content: '';
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lg-outer.lg-show-autoplay .lg-autoplay-button {
|
||||||
|
background: rgba(255, 255, 255, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
.lg-outer .lg-thumb-outer {
|
.lg-outer .lg-thumb-outer {
|
||||||
display: none !important;
|
transform: translateY(100%);
|
||||||
|
transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
|
will-change: transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lg-outer.wi-thumb-shown .lg-thumb-outer {
|
.lg-outer.wi-thumb-shown .lg-thumb-outer {
|
||||||
display: block !important;
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.lg-outer.wi-thumb-shown .lg-inner {
|
.lg-outer.wi-thumb-shown .lg-inner {
|
||||||
bottom: $lg-thumb-height !important;
|
bottom: $lg-thumb-height !important;
|
||||||
|
transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.lg-outer.wi-thumb-shown .lg-sub-html {
|
||||||
|
bottom: $lg-thumb-height;
|
||||||
|
transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.lg-outer .lg-item {
|
.lg-outer .lg-item {
|
||||||
@@ -337,6 +358,10 @@ html.dark {
|
|||||||
.lg-outer.wi-thumb-shown .lg-inner {
|
.lg-outer.wi-thumb-shown .lg-inner {
|
||||||
bottom: 80px !important;
|
bottom: 80px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lg-outer.wi-thumb-shown .lg-sub-html {
|
||||||
|
bottom: 80px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: $breakpoint-sm - 1px) {
|
@media (max-width: $breakpoint-sm - 1px) {
|
||||||
|
|||||||
Reference in New Issue
Block a user