Skip to content

Commit 0eae583

Browse files
committed
new archive time line
1 parent 28a3f2a commit 0eae583

File tree

5 files changed

+95
-76
lines changed

5 files changed

+95
-76
lines changed

deno.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"fs": "https://deno.land/[email protected]/fs/mod.ts",
2424
"type-mdast": "https://cdn.jsdelivr.net/npm/@types/[email protected]/index.d.ts",
2525
"unified": "https://esm.sh/[email protected]",
26+
"mdast-util-toc": "https://esm.sh/[email protected]",
2627
"unified/index.d.ts": "https://esm.sh/[email protected]/index.d.ts",
2728
"unist-util-visit": "https://esm.sh/[email protected]",
2829
"remark-parse": "https://esm.sh/[email protected]",

public/css/index.css

Lines changed: 80 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,86 @@ footer div.footer-icons-container {
171171
margin-block-end: 4rem;
172172
}
173173

174+
main.about-main {
175+
display: flex;
176+
justify-content: center;
177+
}
178+
179+
.about-container {
180+
display: flex;
181+
flex-direction: column;
182+
width: 92%;
183+
max-width: var(--max-about-width);
184+
185+
&>h2 {
186+
text-align: center;
187+
}
188+
}
189+
190+
.about-row {
191+
display: flex;
192+
193+
&:last-child {
194+
margin-block-end: 1.6rem;
195+
}
196+
197+
section.box {
198+
width: auto;
199+
padding: 1.8rem 2rem;
200+
border-color: none;
201+
color: var(--theme-color);
202+
}
203+
}
204+
205+
.about-card-8 {
206+
flex: 8;
207+
}
208+
209+
.about-card-4 {
210+
flex: 4;
211+
}
212+
213+
.about-card-3 {
214+
flex: 3;
215+
}
216+
217+
.about-section-color-one {
218+
background: linear-gradient(120deg, rgba(34, 194, 255, .2392156863) 0%, rgba(255, 29, 206, .15) 100%);
219+
}
220+
221+
.about-section-color-two {
222+
background: linear-gradient(120deg, rgba(29, 255, 199, 0.15) 0%, rgba(255, 211, 34, 0.239) 100%);
223+
}
224+
225+
.about-section-color-three {
226+
background: linear-gradient(120deg, rgba(123, 255, 29, 0.15) 0%, rgba(255, 34, 34, 0.239) 100%);
227+
}
228+
229+
.about-section-color-four {
230+
background: linear-gradient(120deg, rgba(82, 255, 29, 0.15) 0%, rgba(255, 34, 211, 0.239) 100%);
231+
}
232+
233+
.about-section-color-five {
234+
background: linear-gradient(120deg, rgba(255, 29, 29, 0.15) 0%, rgba(152, 34, 255, 0.239) 100%);
235+
}
236+
237+
.about-section-color-six {
238+
background: linear-gradient(120deg, rgba(0, 117, 195, 0.15) 0%, rgba(0, 202, 165, 0.239) 100%);
239+
}
240+
241+
.archive-time-line {
242+
display: flex;
243+
justify-content: space-between;
244+
}
245+
246+
.archive-time-line {
247+
padding-block: 0.16rem;
248+
249+
&:hover {
250+
box-shadow: 0 0.2rem 0 var(--table-border-color);
251+
}
252+
}
253+
174254
/* Match Chrome for about showing */
175255
@media (min-width: 48rem) {
176256
main.blog-main :where(.box, article.blog-article) {
@@ -287,71 +367,4 @@ footer div.footer-icons-container {
287367
width: 90%;
288368
padding-inline: 1rem;
289369
}
290-
}
291-
292-
main.about-main {
293-
display: flex;
294-
justify-content: center;
295-
}
296-
297-
.about-container {
298-
display: flex;
299-
flex-direction: column;
300-
width: 92%;
301-
max-width: var(--max-about-width);
302-
303-
&>h2 {
304-
text-align: center;
305-
}
306-
}
307-
308-
.about-row {
309-
display: flex;
310-
311-
&:last-child {
312-
margin-block-end: 1.6rem;
313-
}
314-
315-
section.box {
316-
width: auto;
317-
padding: 1.8rem 2rem;
318-
border-color: none;
319-
color: var(--theme-color);
320-
}
321-
}
322-
323-
.about-card-8 {
324-
flex: 8;
325-
}
326-
327-
.about-card-4 {
328-
flex: 4;
329-
}
330-
331-
.about-card-3 {
332-
flex: 3;
333-
}
334-
335-
.about-section-color-one {
336-
background: linear-gradient(120deg, rgba(34, 194, 255, .2392156863) 0%, rgba(255, 29, 206, .15) 100%);
337-
}
338-
339-
.about-section-color-two {
340-
background: linear-gradient(120deg, rgba(29, 255, 199, 0.15) 0%, rgba(255, 211, 34, 0.239) 100%);
341-
}
342-
343-
.about-section-color-three {
344-
background: linear-gradient(120deg, rgba(123, 255, 29, 0.15) 0%, rgba(255, 34, 34, 0.239) 100%);
345-
}
346-
347-
.about-section-color-four {
348-
background: linear-gradient(120deg, rgba(82, 255, 29, 0.15) 0%, rgba(255, 34, 211, 0.239) 100%);
349-
}
350-
351-
.about-section-color-five {
352-
background: linear-gradient(120deg, rgba(255, 29, 29, 0.15) 0%, rgba(152, 34, 255, 0.239) 100%);
353-
}
354-
355-
.about-section-color-six {
356-
background: linear-gradient(120deg, rgba(0, 117, 195, 0.15) 0%, rgba(0, 202, 165, 0.239) 100%);
357370
}

src/util/remark/remark-list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { visit } from 'unist-util-visit'
22

3-
/** @return {import('unified/index.d.ts').Plugin<[], import('type-mdast').Root>}*/
3+
/** @type {import('unified/index.d.ts').Plugin<[], import('type-mdast').Root>}*/
44
const remarkList = () => {
55
return (/**@type {import('type-mdast').Root}*/tree) => {
66
visit(

src/util/remark/remark-toc.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
import { visit } from 'unist-util-visit'
2-
import { toc } from 'https://esm.sh/mdast-util-toc@7'
2+
import { toc } from 'mdast-util-toc'
33

4-
/** @returns {import('unified/index.d.ts').Plugin<[], import('type-mdast').Root>}*/
5-
const remarkToc = () => {
6-
return (tree) => {
4+
/**
5+
* @typedef {Object} RemarkTocOptions
6+
* @property {string} [flag='[TOC]'] - The flag to replace with the table of contents.
7+
*/
78

9+
/** @type {import('unified/index.d.ts').Plugin<[RemarkTocOptions], import('type-mdast').Root>}*/
10+
const remarkToc = (options = {}) => {
11+
const { flag = '[TOC]' } = options
12+
return (tree) => {
813
/** @type {{type: string, depth: number, children: []}[]}*/
914
const headings = []
1015
visit(tree, "heading", (/**@type {import("type-mdast").Node} */ node, _index) => {
11-
// Using `type: "link"` when heading is not a text node
1216
/**@type {string} */
1317
let title = node.children[0].value
18+
// Using others type when heading is not a text node
1419
if (node.children[0].type !== "text" && node.children[0].children[0]) {
1520
title = node.children[0].children[0].value
1621
}
@@ -21,7 +26,7 @@ const remarkToc = () => {
2126
})
2227

2328
visit(tree, "paragraph", (/**@type {import("type-mdast").Node} */ node, _index) => {
24-
if (node.children?.[0]?.value !== "[TOC]") return
29+
if (node.children?.[0]?.value !== flag) return
2530
const table = toc({ type: "root", children: headings })
2631
// update toc node
2732
table.map.data = {

src/util/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ export async function generatePage(
114114
(acc, { date, summary }) => {
115115
const place = `/./posts/${handleUTC(date)}/index.html`
116116
return acc +
117-
`<p><a class="decoration-line" href=${place} target="_blank"> ${summary} ··· ${convertToUSA(date)
118-
}</a></p>`
117+
`<p class="archive-p-line"><a class="archive-time-line" href=${place} target="_blank"> <span>${summary}</span> <span>${convertToUSA(date)
118+
}</span></a></p>`
119119
},
120120
'',
121121
)

0 commit comments

Comments
 (0)