@xingwangzhe/stalux 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +192 -0
  3. package/package.json +108 -0
  4. package/scripts/cli.mjs +103 -0
  5. package/src/assets/BiCcCircle.svg +1 -0
  6. package/src/assets/astro.svg +1 -0
  7. package/src/assets/background/README.md +3 -0
  8. package/src/assets/background/pattern-1.min.svg +1 -0
  9. package/src/assets/background/pattern-10.min.svg +1 -0
  10. package/src/assets/background/pattern-11.min.svg +1 -0
  11. package/src/assets/background/pattern-12.min.svg +1 -0
  12. package/src/assets/background/pattern-13.min.svg +1 -0
  13. package/src/assets/background/pattern-14.min.svg +1 -0
  14. package/src/assets/background/pattern-15.min.svg +1 -0
  15. package/src/assets/background/pattern-16.min.svg +1 -0
  16. package/src/assets/background/pattern-17.min.svg +1 -0
  17. package/src/assets/background/pattern-18.min.svg +1 -0
  18. package/src/assets/background/pattern-19.min.svg +1 -0
  19. package/src/assets/background/pattern-2.min.svg +1 -0
  20. package/src/assets/background/pattern-20.min.svg +1 -0
  21. package/src/assets/background/pattern-21.min.svg +1 -0
  22. package/src/assets/background/pattern-22.min.svg +1 -0
  23. package/src/assets/background/pattern-23.min.svg +1 -0
  24. package/src/assets/background/pattern-24.min.svg +1 -0
  25. package/src/assets/background/pattern-25.min.svg +1 -0
  26. package/src/assets/background/pattern-26.min.svg +1 -0
  27. package/src/assets/background/pattern-27.min.svg +1 -0
  28. package/src/assets/background/pattern-28.min.svg +1 -0
  29. package/src/assets/background/pattern-29.min.svg +1 -0
  30. package/src/assets/background/pattern-3.min.svg +1 -0
  31. package/src/assets/background/pattern-30.min.svg +1 -0
  32. package/src/assets/background/pattern-31.min.svg +1 -0
  33. package/src/assets/background/pattern-32.min.svg +1 -0
  34. package/src/assets/background/pattern-33.min.svg +1 -0
  35. package/src/assets/background/pattern-34.min.svg +1 -0
  36. package/src/assets/background/pattern-35.min.svg +1 -0
  37. package/src/assets/background/pattern-36.min.svg +1 -0
  38. package/src/assets/background/pattern-37.min.svg +1 -0
  39. package/src/assets/background/pattern-38.min.svg +1 -0
  40. package/src/assets/background/pattern-39.min.svg +1 -0
  41. package/src/assets/background/pattern-4.min.svg +1 -0
  42. package/src/assets/background/pattern-40.min.svg +1 -0
  43. package/src/assets/background/pattern-41.min.svg +1 -0
  44. package/src/assets/background/pattern-42.min.svg +1 -0
  45. package/src/assets/background/pattern-5.min.svg +1 -0
  46. package/src/assets/background/pattern-6.min.svg +1 -0
  47. package/src/assets/background/pattern-7.min.svg +1 -0
  48. package/src/assets/background/pattern-8.min.svg +1 -0
  49. package/src/assets/background/pattern-9.min.svg +1 -0
  50. package/src/assets/background.svg +1 -0
  51. package/src/assets/cc-icon.svg +4 -0
  52. package/src/assets/fonts/GoogleSansCode-Italic.woff2 +0 -0
  53. package/src/assets/fonts/GoogleSansCode.woff2 +0 -0
  54. package/src/assets/fonts/LXGWWenKai-Regular.ttf +0 -0
  55. package/src/assets/fonts/LXGWWenKai-Regular.woff2 +0 -0
  56. package/src/components/stalux/analytics/clarity.astro +25 -0
  57. package/src/components/stalux/analytics/google.astro +31 -0
  58. package/src/components/stalux/analytics/umami.astro +16 -0
  59. package/src/components/stalux/archives/archivesList.astro +116 -0
  60. package/src/components/stalux/archives/toArchive.astro +14 -0
  61. package/src/components/stalux/categories/categoriesCard.astro +49 -0
  62. package/src/components/stalux/categories/categoriesList.astro +17 -0
  63. package/src/components/stalux/common/author.astro +35 -0
  64. package/src/components/stalux/common/date.astro +59 -0
  65. package/src/components/stalux/common/search.astro +14 -0
  66. package/src/components/stalux/common/textType.astro +16 -0
  67. package/src/components/stalux/common/verCount.astro +10 -0
  68. package/src/components/stalux/footer/FooterBadges.astro +150 -0
  69. package/src/components/stalux/footer/FooterBeian.astro +91 -0
  70. package/src/components/stalux/footer/FooterCopyright.astro +40 -0
  71. package/src/components/stalux/footer/FooterStats.astro +108 -0
  72. package/src/components/stalux/footer/FooterThemeInfo.astro +67 -0
  73. package/src/components/stalux/layout/footer.astro +87 -0
  74. package/src/components/stalux/layout/head.astro +194 -0
  75. package/src/components/stalux/layout/listPage.astro +26 -0
  76. package/src/components/stalux/layout/navs.astro +174 -0
  77. package/src/components/stalux/links/linkCard.astro +50 -0
  78. package/src/components/stalux/links/linkList.astro +20 -0
  79. package/src/components/stalux/links/socialMedia.astro +102 -0
  80. package/src/components/stalux/posts/PhotoSwipeStyle.astro +3 -0
  81. package/src/components/stalux/posts/PostTaxonomy.astro +65 -0
  82. package/src/components/stalux/posts/WalineComment.astro +609 -0
  83. package/src/components/stalux/posts/postAuthor.astro +23 -0
  84. package/src/components/stalux/posts/postCC.astro +52 -0
  85. package/src/components/stalux/posts/postCard.astro +83 -0
  86. package/src/components/stalux/posts/postContent.astro +174 -0
  87. package/src/components/stalux/posts/postLeft.astro +41 -0
  88. package/src/components/stalux/posts/postList.astro +25 -0
  89. package/src/components/stalux/posts/postNavigation.astro +137 -0
  90. package/src/components/stalux/posts/postRight.astro +33 -0
  91. package/src/components/stalux/posts/postToc.astro +88 -0
  92. package/src/components/stalux/posts/randomPost.astro +134 -0
  93. package/src/components/stalux/tags/tagHeader.astro +50 -0
  94. package/src/components/stalux/tags/tagsCloud.astro +100 -0
  95. package/src/components/stalux/words/wordCard.astro +62 -0
  96. package/src/components/stalux/words/wordList.astro +70 -0
  97. package/src/config.ts +58 -0
  98. package/src/i18n/en.json +193 -0
  99. package/src/i18n/zh-CN.json +193 -0
  100. package/src/index.ts +215 -0
  101. package/src/internal/components-plugin.ts +54 -0
  102. package/src/internal/dev-toolbar.ts +33 -0
  103. package/src/internal/override.ts +99 -0
  104. package/src/internal/pagefind.ts +40 -0
  105. package/src/layouts/PostLayout.astro +90 -0
  106. package/src/layouts/Stalux.astro +91 -0
  107. package/src/pages/404.astro +103 -0
  108. package/src/pages/about.astro +59 -0
  109. package/src/pages/about.md.ts +15 -0
  110. package/src/pages/api/post.abbrlink.json.ts +20 -0
  111. package/src/pages/archives.astro +23 -0
  112. package/src/pages/archives.md.ts +24 -0
  113. package/src/pages/atom.xml.ts +29 -0
  114. package/src/pages/categories/[category].astro +35 -0
  115. package/src/pages/categories/[category].md.ts +34 -0
  116. package/src/pages/categories/index.astro +23 -0
  117. package/src/pages/categories/index.md.ts +27 -0
  118. package/src/pages/index.astro +30 -0
  119. package/src/pages/index.md.ts +18 -0
  120. package/src/pages/links.astro +23 -0
  121. package/src/pages/links.md.ts +18 -0
  122. package/src/pages/llms-full.txt.ts +25 -0
  123. package/src/pages/llms.txt.ts +26 -0
  124. package/src/pages/posts/[post].astro +69 -0
  125. package/src/pages/posts/[post].md.ts +109 -0
  126. package/src/pages/rss.xml.ts +29 -0
  127. package/src/pages/tags/[tag].astro +37 -0
  128. package/src/pages/tags/[tag].md.ts +34 -0
  129. package/src/pages/tags/index.astro +23 -0
  130. package/src/pages/tags/index.md.ts +27 -0
  131. package/src/pages/words.astro +24 -0
  132. package/src/pages/words.md.ts +14 -0
  133. package/src/plugins/feature-flags.ts +68 -0
  134. package/src/plugins/satteri-temml.ts +81 -0
  135. package/src/schemas/collections.ts +140 -0
  136. package/src/schemas/config.ts +226 -0
  137. package/src/scripts/background.ts +59 -0
  138. package/src/styles/base/init.css +286 -0
  139. package/src/styles/base/math.css +411 -0
  140. package/src/styles/components/archives/archivesList.module.css +378 -0
  141. package/src/styles/components/archives/toArchive.module.css +3 -0
  142. package/src/styles/components/categories/categoriesCard.module.css +87 -0
  143. package/src/styles/components/categories/categoriesList.module.css +27 -0
  144. package/src/styles/components/common/author.module.css +73 -0
  145. package/src/styles/components/common/date.module.css +15 -0
  146. package/src/styles/components/common/textType.module.css +10 -0
  147. package/src/styles/components/footer/footer.module.css +44 -0
  148. package/src/styles/components/layout/navs.module.css +250 -0
  149. package/src/styles/components/links/linkCard.module.css +99 -0
  150. package/src/styles/components/links/linkList.module.css +67 -0
  151. package/src/styles/components/links/socialLinks.module.css +22 -0
  152. package/src/styles/components/markdown.css +528 -0
  153. package/src/styles/components/posts/postAuthor.module.css +32 -0
  154. package/src/styles/components/posts/postCC.module.css +138 -0
  155. package/src/styles/components/posts/postCard.module.css +156 -0
  156. package/src/styles/components/posts/postCategories.module.css +50 -0
  157. package/src/styles/components/posts/postContent.module.css +230 -0
  158. package/src/styles/components/posts/postLayout.module.css +142 -0
  159. package/src/styles/components/posts/postLeft.module.css +38 -0
  160. package/src/styles/components/posts/postList.module.css +24 -0
  161. package/src/styles/components/posts/postNavigation.module.css +187 -0
  162. package/src/styles/components/posts/postRight.module.css +60 -0
  163. package/src/styles/components/posts/postSidebar.module.css +57 -0
  164. package/src/styles/components/posts/postTags.module.css +51 -0
  165. package/src/styles/components/posts/postTaxonomy.module.css +87 -0
  166. package/src/styles/components/posts/postToc.module.css +74 -0
  167. package/src/styles/components/posts/randomPost.module.css +131 -0
  168. package/src/styles/components/tags/tagHeader.module.css +44 -0
  169. package/src/styles/components/tags/tagsCloud.module.css +124 -0
  170. package/src/styles/components/words/wordCard.module.css +130 -0
  171. package/src/styles/components/words/wordList.module.css +39 -0
  172. package/src/styles/pages/archives.module.css +18 -0
  173. package/src/styles/pages/categories.module.css +13 -0
  174. package/src/styles/pages/home.module.css +51 -0
  175. package/src/styles/pages/listPage.module.css +13 -0
  176. package/src/styles/pages/tags.module.css +12 -0
  177. package/src/styles/pages/words.module.css +13 -0
  178. package/src/styles/shared/animations.css +87 -0
  179. package/src/styles/shared/stagger.css +20 -0
  180. package/src/utils/ai-discovery.ts +547 -0
  181. package/src/utils/badge-generator.ts +68 -0
  182. package/src/utils/cc.ts +46 -0
  183. package/src/utils/collections-stats.ts +48 -0
  184. package/src/utils/config-utils.ts +107 -0
  185. package/src/utils/count-words.ts +20 -0
  186. package/src/utils/dayjs.ts +106 -0
  187. package/src/utils/feed.ts +70 -0
  188. package/src/utils/i18n.ts +64 -0
  189. package/src/utils/lucide-icons.ts +52 -0
  190. package/src/utils/semantic-time.ts +11 -0
  191. package/src/utils/taxonomy.ts +44 -0
  192. package/src/utils/toc-scrollspy.ts +95 -0
  193. package/src/utils/waline.ts +27 -0
  194. package/src/utils/word-count-utils.ts +83 -0
  195. package/template/astro.config.mjs +51 -0
  196. package/template/package.json +27 -0
  197. package/template/public/robots.txt +3 -0
  198. package/template/src/content.config.ts +11 -0
  199. package/template/stalux/about/index.md +14 -0
  200. package/template/stalux/config/ai-discovery.yml +2 -0
  201. package/template/stalux/config/author.yml +4 -0
  202. package/template/stalux/config/comment.yml +5 -0
  203. package/template/stalux/config/footer.yml +13 -0
  204. package/template/stalux/config/head.yml +7 -0
  205. package/template/stalux/config/links.yml +4 -0
  206. package/template/stalux/config/media-links.yml +8 -0
  207. package/template/stalux/config/navs.yml +23 -0
  208. package/template/stalux/config/promote.yml +2 -0
  209. package/template/stalux/config/site.yml +7 -0
  210. package/template/stalux/config/typetexts.yml +5 -0
  211. package/template/stalux/posts/hello-stalux.md +47 -0
  212. package/template/stalux/words/_template.md +12 -0
  213. package/template/stalux/words/einstein-imagination.md +8 -0
  214. package/template/tsconfig.json +9 -0
@@ -0,0 +1,609 @@
1
+ ---
2
+ import "@waline/client/style";
3
+ import { getCollection } from "astro:content";
4
+ import { createTranslator } from "@utils/i18n";
5
+
6
+ interface Props {
7
+ path?: string;
8
+ title?: string;
9
+ serverURL?: string;
10
+ lang?: string;
11
+ locale?: any;
12
+ emoji?: any;
13
+ requiredMeta?: string[];
14
+ reaction?: boolean;
15
+ meta?: string[];
16
+ wordLimit?: number;
17
+ pageSize?: number;
18
+ login?: string;
19
+ recaptchaV3Key?: string;
20
+ turnstileKey?: string;
21
+ dark?: string | boolean;
22
+ noCopyright?: boolean;
23
+ commentSorting?: string;
24
+ imageUploader?: any;
25
+ highlighter?: any;
26
+ texRenderer?: any;
27
+ search?: any;
28
+ }
29
+
30
+ const configEntries = await getCollection("config");
31
+ const siteConfig = (configEntries.find(e => e.id === "site")?.data ?? {}) as Record<string, unknown>;
32
+ const { t } = createTranslator((siteConfig.lang as string) || "zh-CN");
33
+
34
+ // 为客户端脚本准备配置对象:先给默认配置,再用实际传入的 props 覆盖。
35
+ // 这样避免把同一组字段在 Props 接口、解构默认值、init 调用里各写一遍。
36
+ const walineConfig = {
37
+ path: typeof window !== "undefined" ? window.location.pathname : "",
38
+ title: "",
39
+ serverURL: "",
40
+ lang: (siteConfig.lang as string) || "zh-CN",
41
+ locale: undefined,
42
+ emoji: false,
43
+ requiredMeta: [] as string[],
44
+ reaction: true,
45
+ meta: ["nick", "mail", "link"] as string[],
46
+ wordLimit: 200,
47
+ pageSize: 10,
48
+ login: "enable",
49
+ recaptchaV3Key: "",
50
+ turnstileKey: "",
51
+ dark: true,
52
+ noCopyright: false,
53
+ commentSorting: "latest",
54
+ imageUploader: undefined,
55
+ highlighter: undefined,
56
+ texRenderer: undefined,
57
+ search: undefined,
58
+ ...Astro.props,
59
+ };
60
+ ---
61
+
62
+ {
63
+ walineConfig.serverURL && (
64
+ <section
65
+ id="waline-container"
66
+ class="waline-comment-container"
67
+ aria-label={t("comment.title")}
68
+ data-waline-config={
69
+ // base64 可逆混淆(非加密,仅避免 SSR 注入/转义问题),兼容 Node 与浏览器
70
+ Buffer.from(
71
+ new TextEncoder().encode(JSON.stringify(walineConfig)),
72
+ ).toString("base64")
73
+ }
74
+ >
75
+ <h2 class="waline-comment-title">{t("comment.title")}</h2>
76
+ <div id="waline-comment" class="waline-comment" data-nosnippet />
77
+ <div class="comments-seo-notice" style="display:none">
78
+ {t("comment.disclaimer")}
79
+ </div>
80
+ </section>
81
+ )
82
+ }
83
+
84
+ <script>
85
+ import { init } from "@waline/client";
86
+ let walineInstance: ReturnType<typeof init> | null = null;
87
+
88
+ // 安全销毁 Waline 实例
89
+ const safeDestroy = () => {
90
+ try {
91
+ if (walineInstance?.destroy) {
92
+ const commentEl = document.getElementById("waline-comment");
93
+ if (commentEl && commentEl.parentNode) {
94
+ walineInstance.destroy();
95
+ }
96
+ }
97
+ } catch (e) {
98
+ console.warn("Waline destroy error:", e);
99
+ }
100
+ walineInstance = null;
101
+ };
102
+
103
+ // 初始化 Waline 评论系统
104
+ const initWaline = async () => {
105
+ const container = document.getElementById("waline-container");
106
+ if (!container) {
107
+ return;
108
+ }
109
+
110
+ let walineConfig;
111
+ try {
112
+ // base64 可逆混淆解码(无 unescape,兼容 Node/浏览器)
113
+ const base64 = container.dataset.walineConfig || "";
114
+ const bytes = Uint8Array.from(atob(base64), (c) => c.charCodeAt(0));
115
+ const jsonStr = new TextDecoder().decode(bytes);
116
+ walineConfig = JSON.parse(jsonStr);
117
+ } catch (error) {
118
+ console.error("Failed to decode Waline config:", error);
119
+ return;
120
+ }
121
+
122
+ // 先销毁旧实例
123
+ safeDestroy();
124
+
125
+ if (!walineConfig.serverURL) {
126
+ console.warn("Waline serverURL not configured");
127
+ return;
128
+ }
129
+
130
+ const commentEl = document.getElementById("waline-comment");
131
+ if (!commentEl) {
132
+ return;
133
+ }
134
+
135
+ try {
136
+ // 直接将配置对象展开传给 init,无需逐字段罗列
137
+ walineInstance = init({
138
+ el: commentEl,
139
+ ...walineConfig,
140
+ path: walineConfig.path || window.location.pathname,
141
+ });
142
+ } catch (error) {
143
+ console.error("Failed to initialize Waline:", error);
144
+ }
145
+ };
146
+
147
+ // 首屏加载
148
+ if (document.readyState === "loading") {
149
+ document.addEventListener("DOMContentLoaded", initWaline, {
150
+ once: true,
151
+ });
152
+ } else {
153
+ setTimeout(initWaline, 0);
154
+ }
155
+
156
+ // 视图过渡:页面导航前清理
157
+ document.addEventListener("astro:before-swap", safeDestroy);
158
+
159
+ // 视图过渡:页面导航后重新初始化
160
+ document.addEventListener("astro:page-load", initWaline);
161
+ </script>
162
+
163
+ <style is:global>
164
+ :root {
165
+ --waline-accent: var(--stalux-accent-color);
166
+ --waline-accent-rgb: 100, 255, 218;
167
+ }
168
+
169
+ /* 评论区容器与博客风格一致 */
170
+ .waline-comment-container {
171
+ margin-top: 3rem;
172
+ margin-bottom: 1rem;
173
+ padding: 2rem;
174
+ border-radius: 12px;
175
+ animation: fadeInUpComment 0.8s ease-in-out forwards;
176
+ opacity: 0;
177
+ animation-delay: 0.3s;
178
+ }
179
+
180
+ /* 评论区标题样式与博客风格一致 */
181
+ .waline-comment-title {
182
+ margin: 0 0 1.5rem 0;
183
+ font-size: 2rem;
184
+ text-align: center;
185
+ background: linear-gradient(
186
+ 90deg,
187
+ var(--white-90p),
188
+ rgba(var(--waline-accent-rgb), 0.9)
189
+ );
190
+ -webkit-background-clip: text;
191
+ -webkit-text-fill-color: transparent;
192
+ background-clip: text;
193
+ }
194
+
195
+ /* Waline根元素自定义 */
196
+ .wl-panel {
197
+ background-color: rgba(17, 17, 17, 0.3);
198
+ border-radius: 12px;
199
+ padding: 1rem;
200
+ border: 1px solid rgba(255, 255, 255, 0.1);
201
+ margin-bottom: 1.5rem;
202
+ }
203
+
204
+ /* 修改输入框样式 */
205
+ .wl-editor,
206
+ .wl-input {
207
+ background-color: rgba(17, 17, 17, 0.5) !important;
208
+ color: var(--white-90p) !important;
209
+ border: 1px solid rgba(100, 100, 100, 0.3) !important;
210
+ border-radius: 8px;
211
+ transition: all 0.3s ease;
212
+ }
213
+
214
+ /* 输入框焦点状态 */
215
+ .wl-editor:focus,
216
+ .wl-input:focus {
217
+ border-color: rgba(var(--waline-accent-rgb), 0.5) !important;
218
+ box-shadow: 0 0 5px rgba(var(--waline-accent-rgb), 0.3) !important;
219
+ outline: none;
220
+ }
221
+
222
+ /* 修复登录后头像向下偏移 — 全局 a::after 下划线动画撑高了 wl-login-nick */
223
+ .wl-login-nick {
224
+ display: block !important;
225
+ height: var(--waline-avatar-size, 52px);
226
+ overflow: hidden;
227
+ }
228
+ .wl-login-nick::after {
229
+ display: none;
230
+ }
231
+
232
+ /* 修复 markdown 全局 img margin 误伤 Waline 头像 */
233
+ .waline-comment-container img {
234
+ margin: 0 !important;
235
+ }
236
+ .wl-btn {
237
+ background: rgba(var(--waline-accent-rgb), 0.6) !important;
238
+ color: var(--white-full) !important;
239
+ border: none !important;
240
+ border-radius: 6px;
241
+ transition: all 0.2s ease;
242
+ font-weight: 500;
243
+ padding: 8px 15px;
244
+ cursor: pointer;
245
+ }
246
+
247
+ .wl-btn:hover {
248
+ background: rgba(var(--waline-accent-rgb), 0.7) !important;
249
+ transform: none;
250
+ box-shadow: none !important;
251
+ }
252
+
253
+ .wl-btn.primary {
254
+ background: rgba(var(--waline-accent-rgb), 0.6) !important;
255
+ }
256
+
257
+ .wl-btn.primary:hover {
258
+ background: rgba(var(--waline-accent-rgb), 0.7) !important;
259
+ transform: none;
260
+ box-shadow: none !important;
261
+ }
262
+
263
+ /* 标签文字颜色 */
264
+ .wl-header label {
265
+ color: var(--white-85p);
266
+ font-weight: 500;
267
+ }
268
+
269
+ /* 评论卡片样式 */
270
+ .wl-card {
271
+ background-color: rgba(17, 17, 17, 0.3) !important;
272
+ border-radius: 12px;
273
+ padding: 1.2rem;
274
+ margin-top: 1.2rem;
275
+ border: 1px solid rgba(70, 70, 70, 0.2) !important;
276
+ transition: all 0.3s ease;
277
+ }
278
+
279
+ .wl-card:hover {
280
+ transform: translateY(-3px);
281
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
282
+ border-color: rgba(var(--waline-accent-rgb), 0.3) !important;
283
+ }
284
+
285
+ /* 修改用户名样式 */
286
+ .wl-nick {
287
+ color: rgba(var(--waline-accent-rgb), 0.95) !important;
288
+ font-weight: 600;
289
+ transition: all 0.2s ease;
290
+ }
291
+
292
+ .wl-nick:hover {
293
+ color: rgba(var(--waline-accent-rgb), 1) !important;
294
+ }
295
+
296
+ /* 评论内容样式 */
297
+ .wl-content {
298
+ color: var(--white-90p);
299
+ line-height: 1.7;
300
+ margin: 0.8rem 0;
301
+ word-break: break-word;
302
+ }
303
+
304
+ /* 回复按钮样式 */
305
+ .wl-reply {
306
+ opacity: 0.8;
307
+ transition: all 0.2s ease;
308
+ }
309
+
310
+ .wl-reply:hover {
311
+ opacity: 1;
312
+ text-decoration: none;
313
+ }
314
+
315
+ /* 表情面板样式 */
316
+ .wl-emoji-popup,
317
+ .wl-gif-popup {
318
+ background-color: rgba(25, 25, 25, 0.95) !important;
319
+ border: 1px solid rgba(70, 70, 70, 0.3) !important;
320
+ border-radius: 10px;
321
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
322
+ backdrop-filter: blur(10px);
323
+ }
324
+
325
+ /* 表情按钮样式 */
326
+ .wl-emoji-popup button {
327
+ border-radius: 6px;
328
+ transition: all 0.2s ease;
329
+ }
330
+
331
+ .wl-emoji-popup button:hover {
332
+ background-color: rgba(var(--waline-accent-rgb), 0.2);
333
+ transform: scale(1.05);
334
+ }
335
+
336
+ /* 文章评价反应区域 */
337
+ .wl-reaction {
338
+ background-color: rgba(17, 17, 17, 0.3);
339
+ border-radius: 12px;
340
+ padding: 1rem;
341
+ margin-bottom: 1.5rem;
342
+ border: 1px solid rgba(70, 70, 70, 0.2);
343
+ text-align: center;
344
+ }
345
+
346
+ .wl-reaction-title {
347
+ font-size: 1.1rem;
348
+ margin-bottom: 1rem;
349
+ color: var(--white-90p);
350
+ }
351
+
352
+ .wl-reaction-list {
353
+ display: flex;
354
+ justify-content: center;
355
+ flex-wrap: wrap;
356
+ }
357
+
358
+ .wl-reaction-item {
359
+ background-color: rgba(30, 30, 30, 0.5) !important;
360
+ border-radius: 8px;
361
+ margin: 5px;
362
+ transition: all 0.3s ease;
363
+ cursor: pointer;
364
+ border: 1px solid rgba(70, 70, 70, 0.2) !important;
365
+ }
366
+
367
+ .wl-reaction-item:hover {
368
+ transform: translateY(-3px);
369
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
370
+ background-color: rgba(40, 40, 40, 0.8) !important;
371
+ border-color: rgba(var(--waline-accent-rgb), 0.3) !important;
372
+ }
373
+
374
+ .wl-reaction-img {
375
+ padding: 6px;
376
+ }
377
+
378
+ .wl-reaction-img img {
379
+ transition: transform 0.3s ease;
380
+ }
381
+
382
+ .wl-reaction-item:hover .wl-reaction-img img {
383
+ transform: scale(1.15);
384
+ }
385
+
386
+ .wl-reaction-votes {
387
+ font-size: 0.8rem;
388
+ padding: 5px 0;
389
+ background-color: rgba(var(--waline-accent-rgb), 0.7);
390
+ color: var(--white-full);
391
+ }
392
+
393
+ /* 评论计数和排序 */
394
+ .wl-meta-head {
395
+ margin-bottom: 1.2rem;
396
+ border-bottom: 1px solid rgba(70, 70, 70, 0.3);
397
+ padding-bottom: 0.8rem;
398
+ display: flex;
399
+ justify-content: space-between;
400
+ align-items: center;
401
+ }
402
+
403
+ .wl-count {
404
+ font-size: 1.1rem;
405
+ font-weight: 500;
406
+ color: var(--white-90p);
407
+ }
408
+
409
+ .wl-sort {
410
+ display: flex;
411
+ gap: 1rem;
412
+ }
413
+
414
+ .wl-sort li {
415
+ cursor: pointer;
416
+ transition: all 0.2s ease;
417
+ color: var(--white-70p);
418
+ }
419
+
420
+ .wl-sort li:hover {
421
+ color: var(--white-90p);
422
+ }
423
+
424
+ .wl-sort li.active {
425
+ color: rgba(var(--waline-accent-rgb), 1);
426
+ font-weight: 500;
427
+ }
428
+
429
+ /* 页码导航 */
430
+ .wl-page {
431
+ margin-top: 1.2rem;
432
+ text-align: center;
433
+ }
434
+
435
+ .wl-page button {
436
+ background: rgba(30, 30, 30, 0.5) !important;
437
+ color: var(--white-80p) !important;
438
+ border: 1px solid rgba(70, 70, 70, 0.3) !important;
439
+ border-radius: 6px;
440
+ margin: 0 5px;
441
+ padding: 5px 10px;
442
+ transition: all 0.2s ease;
443
+ }
444
+
445
+ .wl-page button:hover:not(:disabled) {
446
+ background: rgba(var(--waline-accent-rgb), 0.7) !important;
447
+ color: var(--white-full) !important;
448
+ transform: translateY(-2px);
449
+ }
450
+
451
+ .wl-page button.active {
452
+ background: rgba(var(--waline-accent-rgb), 0.8) !important;
453
+ color: var(--white-full) !important;
454
+ }
455
+
456
+ /* Waline底部版权信息 */
457
+ .wl-power {
458
+ opacity: 0.6;
459
+ font-size: 0.85rem;
460
+ margin-top: 2rem;
461
+ text-align: center;
462
+ }
463
+
464
+ .wl-power a {
465
+ color: rgba(var(--waline-accent-rgb), 0.9);
466
+ text-decoration: none;
467
+ transition: all 0.2s ease;
468
+ }
469
+
470
+ .wl-power a:hover {
471
+ color: rgba(var(--waline-accent-rgb), 1);
472
+ text-decoration: underline;
473
+ }
474
+
475
+ /* 评论为空状态 */
476
+ .wl-empty {
477
+ text-align: center;
478
+ padding: 2rem 0;
479
+ color: var(--white-60p);
480
+ font-size: 1.1rem;
481
+ }
482
+
483
+ /* 支持文字数量统计 */
484
+ .wl-text-number {
485
+ font-size: 0.9rem;
486
+ color: var(--white-60p);
487
+ }
488
+
489
+ /* 添加动画效果 */
490
+ @keyframes fadeInUpComment {
491
+ from {
492
+ opacity: 0;
493
+ transform: translateY(30px);
494
+ }
495
+ to {
496
+ opacity: 1;
497
+ transform: translateY(0);
498
+ }
499
+ }
500
+
501
+ /* 降低选中文本高亮程度,移除外边框 */
502
+ .waline-comment-container *::selection {
503
+ background: rgba(var(--waline-accent-rgb), 0.25);
504
+ color: inherit;
505
+ border: none;
506
+ outline: none;
507
+ }
508
+
509
+ .waline-comment-container *::-moz-selection {
510
+ background: rgba(var(--waline-accent-rgb), 0.25);
511
+ color: inherit;
512
+ border: none;
513
+ outline: none;
514
+ }
515
+
516
+ /* 响应式调整 */
517
+ @media (max-width: 768px) {
518
+ .waline-comment-container {
519
+ padding: 1.5rem;
520
+ margin-top: 2rem;
521
+ }
522
+
523
+ .waline-comment-title {
524
+ font-size: 1.8rem;
525
+ }
526
+
527
+ .wl-panel {
528
+ padding: 0.8rem;
529
+ }
530
+
531
+ .wl-header {
532
+ flex-direction: column;
533
+ }
534
+
535
+ .wl-header-item {
536
+ width: 100%;
537
+ margin-bottom: 0.5rem;
538
+ }
539
+
540
+ /* 平板设备上的嵌套评论处理 */
541
+ .wl-card {
542
+ padding: 0.8rem;
543
+ margin-left: 0;
544
+ }
545
+
546
+ .wl-children {
547
+ margin-left: 0;
548
+ padding-left: 0;
549
+ }
550
+
551
+ .wl-children .wl-card {
552
+ margin-left: 0;
553
+ border-left: 3px solid rgba(var(--waline-accent-rgb), 0.4);
554
+ padding-left: 0.8rem;
555
+ }
556
+ }
557
+
558
+ @media (max-width: 480px) {
559
+ .waline-comment-container {
560
+ padding: 1rem;
561
+ margin-top: 1.5rem;
562
+ }
563
+
564
+ .waline-comment-title {
565
+ font-size: 1.6rem;
566
+ }
567
+
568
+ .wl-panel {
569
+ padding: 0.8rem;
570
+ }
571
+
572
+ .wl-reaction-list {
573
+ gap: 5px;
574
+ }
575
+
576
+ .wl-card {
577
+ padding: 0.75rem;
578
+ margin-left: 0;
579
+ width: 100%;
580
+ box-sizing: border-box;
581
+ }
582
+
583
+ /* 小屏幕上的嵌套评论处理 */
584
+ .wl-children {
585
+ margin-left: 0;
586
+ padding-left: 0;
587
+ width: 100%;
588
+ box-sizing: border-box;
589
+ }
590
+
591
+ .wl-children .wl-card {
592
+ margin-left: 0;
593
+ border-left: 3px solid rgba(var(--waline-accent-rgb), 0.4);
594
+ padding-left: 0.6rem;
595
+ width: 100%;
596
+ }
597
+
598
+ .wl-children .wl-children .wl-card {
599
+ border-left: 3px solid rgba(var(--waline-accent-rgb), 0.3);
600
+ padding-left: 0.6rem;
601
+ }
602
+
603
+ .wl-meta-head {
604
+ flex-direction: column;
605
+ gap: 0.5rem;
606
+ align-items: flex-start;
607
+ }
608
+ }
609
+ </style>
@@ -0,0 +1,23 @@
1
+ ---
2
+ import { getCollection } from "astro:content";
3
+ import Author from "@components/stalux/common/author.astro";
4
+ import style from "@styles/components/posts/postAuthor.module.css";
5
+ import { getSiteData, getAuthorData, getHeadData, getNavsData, getLinksData, getCommentData, getFooterData, getPromoteData, getTypetextsData, getMediaLinksData } from "@utils/config-utils";
6
+ const configEntries = await getCollection("config");
7
+ const authorConfig = getAuthorData(configEntries);
8
+
9
+ // 判断是否为文章页面
10
+ const isPostPage = Astro.url.pathname.includes("/posts/");
11
+ ---
12
+
13
+ <aside
14
+ class={style.sidebarContainer}
15
+ style={isPostPage ? "margin-top: -3em;" : ""}
16
+ >
17
+ <div class={style.authorSection}>
18
+ <div class={style.authorCard}>
19
+ <Author iscolum />
20
+ <p class={style.authorBio}>{authorConfig.bio}</p>
21
+ </div>
22
+ </div>
23
+ </aside>
@@ -0,0 +1,52 @@
1
+ ---
2
+ import style from "@styles/components/posts/postCC.module.css";
3
+ import ccIcon from "@assets/cc-icon.svg?raw";
4
+ import { getCollection } from "astro:content";
5
+ import { createTranslator } from "@utils/i18n";
6
+ import { buildCCName, buildCCLink } from "@utils/cc";
7
+
8
+ interface Props {
9
+ title: string;
10
+ author: string;
11
+ url: string;
12
+ cc?: string;
13
+ }
14
+
15
+ const configEntries = await getCollection("config");
16
+ const siteConfig = (configEntries.find(e => e.id === "site")?.data ?? {}) as Record<string, unknown>;
17
+ const { t } = createTranslator((siteConfig.lang as string) || "zh-CN");
18
+ const { title, author, url, cc = "CC-BY-NC-SA-4.0" } = Astro.props;
19
+
20
+ const licenseLink = buildCCLink(cc);
21
+ const licenseName = buildCCName(cc, t);
22
+ ---
23
+
24
+ <div class={style.ccBox}>
25
+ <div class={style.ccContent}>
26
+ <p class={style.ccTitle}>{title}</p>
27
+ <p class={style.ccAuthor}>{t("post.author")}{author}</p>
28
+ {
29
+ url && (
30
+ <p class={style.ccUrl}>
31
+ {t("post.articleLink")}
32
+ <a href={url} target="_blank" rel="noopener noreferrer">
33
+ {url}
34
+ </a>
35
+ </p>
36
+ )
37
+ }
38
+ <p class={style.ccLicense}>
39
+ {t("post.licensedUnder")} <a
40
+ href={licenseLink}
41
+ target="_blank"
42
+ rel="noopener noreferrer"
43
+ >
44
+ {licenseName}
45
+ </a>{t("post.licenseSuffix")}
46
+ </p>
47
+ </div>
48
+
49
+ <div class={style.ccWatermark}>
50
+ <div class={style.ccIcon} set:html={ccIcon} />
51
+ </div>
52
+ </div>