change theme to buck

This commit is contained in:
thislight 2024-01-10 18:35:50 +08:00
parent 014b4f6dc7
commit 88da620079
No known key found for this signature in database
GPG key ID: A50F9451AC56A63E
99 changed files with 2197 additions and 38 deletions

View file

@ -8,10 +8,8 @@ subtitle: ''
description: '' description: ''
keywords: keywords:
author: Rubicon author: Rubicon
language: language: zh-Hans
- zh-cn timezone: 'Asia/Chongqing'
- en
timezone: ''
email: "l1589002388@gmail.com" email: "l1589002388@gmail.com"
# URL # URL
@ -105,7 +103,7 @@ ignore:
# Extensions # Extensions
## Plugins: https://hexo.io/plugins/ ## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/ ## Themes: https://hexo.io/themes/
theme: cmd theme: buck
# Deployment # Deployment
## Docs: https://hexo.io/docs/one-command-deployment ## Docs: https://hexo.io/docs/one-command-deployment

View file

@ -1,35 +1,12 @@
menu:
Home: /
Archives: /archives
copyright_addtional: "" site_nav_links:
所有文章: /
归档: /archives
copyright_year_string: "2020-2022" site_links:
- name: "thislight@mastodon.social"
theme_self_claim: true href: "https://mastodon.social/@thislight"
rel: "me"
about_this_blog: 这里是Rubicon's Rubicon。我在无界之点的偏安之地。 class: "mastodon"
- name: "Subscribe (Atom)"
my_mastodon: "https://mastodon.social/@thislight" href: "/atom.xml"
footer_links:
GitHub: "https://github.com/thislight"
GitLab: "https://gitlab.com/thislight"
Feed (Atom): "/atom.xml"
Feed (RSS): "/rss.xml"
site_rss:
atom: /atom.xml
rss: /rss.xml
topic_rss:
tag:
prefix: "/feeds/by-tag"
atom_suffix: atom.xml
rss_suffix: rss.xml
name_lowercase: true
category:
prefix: /feeds/by-category
atom_suffix: atom.xml
rss_suffix: rss.xml
name_lowercase: true

11
themes/buck/.editorconfig Normal file
View file

@ -0,0 +1,11 @@
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

0
themes/buck/_config.yml Normal file
View file

4
themes/buck/build.ts Normal file
View file

@ -0,0 +1,4 @@
import * as esbuild from 'esbuild'
import options from "./config.js"
await esbuild.build(options)

36
themes/buck/config.ts Normal file
View file

@ -0,0 +1,36 @@
import { BuildOptions } from "esbuild";
export default {
target: [
"chrome109",
"ios14.5",
"safari15.6",
"edge114",
"firefox114",
"opera99",
],
entryPoints: [
"src/index.css",
"src/index.ts",
"src/page.css",
"src/page.ts",
"src/styles/materialdesignicons.min.css",
"src/archive.css"
],
outdir: "source",
bundle: true,
splitting: true,
format: "esm",
treeShaking: true,
loader: {
".woff": "copy",
".woff2": "copy",
".ttf": "copy",
".eot": "copy",
".svg": "file",
},
sourcemap: "linked",
jsx: "preserve",
jsxImportSource: "solid-js",
minify: true,
} as BuildOptions;

View file

@ -0,0 +1,19 @@
index:
archive_title:
yearly: "%s年的归档"
tags_title:
all: "所有标签"
yearly: "%s年的标签"
tag_title: '标记为"%s"的文章'
prev_page: "上一页"
next_page: "下一页"
page:
created: "创建"
updated: "更新"
created_by: "由%s创建"
not_published: "这是一篇草稿"
archives:
title: "归档"

View file

@ -0,0 +1,22 @@
{% import "includes/shared.njk" as shared with context %}
{% if (page.archive and page.year) or page.tag or page.category %}
{% include "./index.njk" %}
{% else %}
<!DOCTYPE html>
<html lang="{{ config.language }}">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{{ __('archives.title') }}</title>
<link href="{{ url_for('archive.css') }}" rel="stylesheet"/>
</head>
<body>
{{ shared.sitenav(__('archives.title')) }}
<div id="_layout">
{{ list_archives({
type: 'yearly'
}) }}
</div>
</body>
</html>
{% endif %}

View file

@ -0,0 +1,16 @@
{% set theme = site.data.theme %}
{% macro sitenav(title = config.title) %}
<div class="nav-wrapper">
<nav class="site">
<div>
<h6>{{ title }}</h6>
</div>
<div>
{% for name, link in theme.site_nav_links %}
<a href="{{ link }}">{{ name }}</a>
{% endfor %}
</div>
</nav>
</div>
{% endmacro %}

View file

@ -0,0 +1,85 @@
<!DOCTYPE html>
{% import "includes/shared.njk" as shared with context %}
{% if page.archive %}
{% set title = __('index.archive_title.yearly', page.year) %}
{% elif page.tag %}
{% set title = __('index.tag_title', page.tag) %}
{% else %}
{% set title = page.title or config.title or "Page" %}
{% endif %}
<html lang="{{ config.language }}">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> {{ open_graph() }}
<title>{{ title }}</title>
<link href="{{ url_for('index.css') }}" rel="stylesheet"/>
<link href="{{ url_for('styles/materialdesignicons.min.css') }}" rel="stylesheet"/>
<script type="module" src="/index.js"></script>
</head>
<body>
{{ shared.sitenav(title) }}
<div id="_layout">
<main>
<ul class="post-list">
{% for post in page.posts.toArray() %}
<li class="post-item">
<div class="post-item-title">
<a href="{{ url_for(post.path) }}">
<h6>{{ post.title if post.title else post.path }}</h6>
</a>
<time>{{ post.date.format() }}</time>
</div>
<div class="content">{{ post.excerpt }}</div>
</li>
{% endfor %}
</ul>
<div style="display: flex; justify-content: center; margin: 16px;">
<div class="pager">
{{ paginator({
prev_text: '<i class="mdi mdi-chevron-left" aria-label="' + __('index.prev_page') + '"></i>',
next_text: '<i class="mdi mdi-chevron-right" aria-label="' + __('index.next_page') +'"></i>',
escape: false
}) }}
</div>
</div>
</main>
<div style="display: flex; flex-flow: column nowrap; gap: 16px;">
<div class="card" style="display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between">
<div class="author-head">
<img class="circle avatar" src="{{ gravatar(config.email if config.email else 'example@foo.bar') }}"/>
<span>{{ config.author }}</span>
<div>
{{ config.description }}
</div>
</div>
<div>
<ul class="link-list">
{% for link_object in shared.theme.site_links %}
<li {% if link_object.class %} class="{{ link_object.class }}" {% endif %}>
<a {% if link_object.rel %} rel="{{ link_object.rel }}" {% endif %} {% if link_object.href %} href="{{ link_object.href }}" {% endif %}>
{{ link_object.name if link_object.name else link_object.href }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% if page.archive %}
{% set tags = tags_of_year(page.year) %}
{% else %}
{% set tags = site.tags.sort('name', 1).toArray() %}
{% endif %}
<div class="card">
<h6 id="tags-title">{{ __('index.tags_title.yearly', page.year) if page.archive else __('index.tags_title.all') }}</h6>
<ul class="chip-group" style="padding: 0; margin-top: 8px;" aria-labelledby="tags-title">
{% for tag in tags %}
<li>
<a {% if tag.length > 1 %} class="chip hottag-chip" {% else %} class="chip" {% endif %} href="{{ url_for(tag.path) }}">{{ tag.name }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
{% import "includes/shared.njk" as shared with context %}
<html lang="{{ config.language }}" prefix="og: https://ogp.me/ns#">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> {{ open_graph() }}
<title>{{ page.title or config.title or "Page" }}</title>
<link href="/page.css" rel="stylesheet"/>
<script type="module" src="/page.js"></script>
</head>
<body>
{{ shared.sitenav(page.title) }}
<div id="_layout">
<div></div>
<main class="content">
<h1>{{ page.title }}</h1>
<div class="page-metadata">
<span>
<time data-time-format="iso" datetime="{{ page.date.format() }}">{{ page.date.format() }}</time>
{{ __('page.created') }}</span>
<span>
<time data-time-format="iso" datetime="{{ page.updated.format() }}">{{ page.updated.format() }}</time>
{{ __('page.updated') }}</span>
{% if not page.published %}
<span>{{ __('page.not_published') }}</span>
{% endif %}
</div>
{{ page.content }}
</main>
<div></div>
</div>
</body>
</html>

View file

@ -0,0 +1 @@
{% include "page.njk" %}

24
themes/buck/package.json Normal file
View file

@ -0,0 +1,24 @@
{
"name": "buck",
"version": "1.0.0",
"description": "",
"private": true,
"type": "module",
"scripts": {
"build": "node --no-warnings --loader ts-node/esm build.ts",
"dev": "node --no-warnings --loader ts-node/esm watch.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"esbuild": "^0.19.11",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"dependencies": {
"@fontsource/roboto": "^5.0.8",
"date-fns": "^3.1.0",
"solid-js": "^1.8.8"
}
}

414
themes/buck/pnpm-lock.yaml Normal file
View file

@ -0,0 +1,414 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
'@fontsource/roboto':
specifier: ^5.0.8
version: 5.0.8
date-fns:
specifier: ^3.1.0
version: 3.1.0
solid-js:
specifier: ^1.8.8
version: 1.8.8
devDependencies:
esbuild:
specifier: ^0.19.11
version: 0.19.11
ts-node:
specifier: ^10.9.2
version: 10.9.2(@types/node@20.10.6)(typescript@5.3.3)
typescript:
specifier: ^5.3.3
version: 5.3.3
packages:
/@cspotcode/source-map-support@0.8.1:
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
engines: {node: '>=12'}
dependencies:
'@jridgewell/trace-mapping': 0.3.9
dev: true
/@esbuild/aix-ppc64@0.19.11:
resolution: {integrity: sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==}
engines: {node: '>=12'}
cpu: [ppc64]
os: [aix]
requiresBuild: true
dev: true
optional: true
/@esbuild/android-arm64@0.19.11:
resolution: {integrity: sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q==}
engines: {node: '>=12'}
cpu: [arm64]
os: [android]
requiresBuild: true
dev: true
optional: true
/@esbuild/android-arm@0.19.11:
resolution: {integrity: sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw==}
engines: {node: '>=12'}
cpu: [arm]
os: [android]
requiresBuild: true
dev: true
optional: true
/@esbuild/android-x64@0.19.11:
resolution: {integrity: sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg==}
engines: {node: '>=12'}
cpu: [x64]
os: [android]
requiresBuild: true
dev: true
optional: true
/@esbuild/darwin-arm64@0.19.11:
resolution: {integrity: sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ==}
engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@esbuild/darwin-x64@0.19.11:
resolution: {integrity: sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g==}
engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@esbuild/freebsd-arm64@0.19.11:
resolution: {integrity: sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA==}
engines: {node: '>=12'}
cpu: [arm64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/@esbuild/freebsd-x64@0.19.11:
resolution: {integrity: sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw==}
engines: {node: '>=12'}
cpu: [x64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-arm64@0.19.11:
resolution: {integrity: sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-arm@0.19.11:
resolution: {integrity: sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q==}
engines: {node: '>=12'}
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-ia32@0.19.11:
resolution: {integrity: sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA==}
engines: {node: '>=12'}
cpu: [ia32]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-loong64@0.19.11:
resolution: {integrity: sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg==}
engines: {node: '>=12'}
cpu: [loong64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-mips64el@0.19.11:
resolution: {integrity: sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg==}
engines: {node: '>=12'}
cpu: [mips64el]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-ppc64@0.19.11:
resolution: {integrity: sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA==}
engines: {node: '>=12'}
cpu: [ppc64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-riscv64@0.19.11:
resolution: {integrity: sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ==}
engines: {node: '>=12'}
cpu: [riscv64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-s390x@0.19.11:
resolution: {integrity: sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q==}
engines: {node: '>=12'}
cpu: [s390x]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-x64@0.19.11:
resolution: {integrity: sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA==}
engines: {node: '>=12'}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/netbsd-x64@0.19.11:
resolution: {integrity: sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [netbsd]
requiresBuild: true
dev: true
optional: true
/@esbuild/openbsd-x64@0.19.11:
resolution: {integrity: sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw==}
engines: {node: '>=12'}
cpu: [x64]
os: [openbsd]
requiresBuild: true
dev: true
optional: true
/@esbuild/sunos-x64@0.19.11:
resolution: {integrity: sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [sunos]
requiresBuild: true
dev: true
optional: true
/@esbuild/win32-arm64@0.19.11:
resolution: {integrity: sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ==}
engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@esbuild/win32-ia32@0.19.11:
resolution: {integrity: sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg==}
engines: {node: '>=12'}
cpu: [ia32]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@esbuild/win32-x64@0.19.11:
resolution: {integrity: sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw==}
engines: {node: '>=12'}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@fontsource/roboto@5.0.8:
resolution: {integrity: sha512-XxPltXs5R31D6UZeLIV1td3wTXU3jzd3f2DLsXI8tytMGBkIsGcc9sIyiupRtA8y73HAhuSCeweOoBqf6DbWCA==}
dev: false
/@jridgewell/resolve-uri@3.1.1:
resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==}
engines: {node: '>=6.0.0'}
dev: true
/@jridgewell/sourcemap-codec@1.4.15:
resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
dev: true
/@jridgewell/trace-mapping@0.3.9:
resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
dependencies:
'@jridgewell/resolve-uri': 3.1.1
'@jridgewell/sourcemap-codec': 1.4.15
dev: true
/@tsconfig/node10@1.0.9:
resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
dev: true
/@tsconfig/node12@1.0.11:
resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==}
dev: true
/@tsconfig/node14@1.0.3:
resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==}
dev: true
/@tsconfig/node16@1.0.4:
resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==}
dev: true
/@types/node@20.10.6:
resolution: {integrity: sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==}
dependencies:
undici-types: 5.26.5
dev: true
/acorn-walk@8.3.1:
resolution: {integrity: sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==}
engines: {node: '>=0.4.0'}
dev: true
/acorn@8.11.3:
resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==}
engines: {node: '>=0.4.0'}
hasBin: true
dev: true
/arg@4.1.3:
resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
dev: true
/create-require@1.1.1:
resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
dev: true
/csstype@3.1.3:
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
dev: false
/date-fns@3.1.0:
resolution: {integrity: sha512-ZO7yefXV/wCWzd3I9haCHmfzlfA3i1a2HHO7ZXjtJrRjXt8FULKJ2Vl8wji3XYF4dQ0ZJ/tokXDZeYlFvgms9Q==}
dev: false
/diff@4.0.2:
resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
engines: {node: '>=0.3.1'}
dev: true
/esbuild@0.19.11:
resolution: {integrity: sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==}
engines: {node: '>=12'}
hasBin: true
requiresBuild: true
optionalDependencies:
'@esbuild/aix-ppc64': 0.19.11
'@esbuild/android-arm': 0.19.11
'@esbuild/android-arm64': 0.19.11
'@esbuild/android-x64': 0.19.11
'@esbuild/darwin-arm64': 0.19.11
'@esbuild/darwin-x64': 0.19.11
'@esbuild/freebsd-arm64': 0.19.11
'@esbuild/freebsd-x64': 0.19.11
'@esbuild/linux-arm': 0.19.11
'@esbuild/linux-arm64': 0.19.11
'@esbuild/linux-ia32': 0.19.11
'@esbuild/linux-loong64': 0.19.11
'@esbuild/linux-mips64el': 0.19.11
'@esbuild/linux-ppc64': 0.19.11
'@esbuild/linux-riscv64': 0.19.11
'@esbuild/linux-s390x': 0.19.11
'@esbuild/linux-x64': 0.19.11
'@esbuild/netbsd-x64': 0.19.11
'@esbuild/openbsd-x64': 0.19.11
'@esbuild/sunos-x64': 0.19.11
'@esbuild/win32-arm64': 0.19.11
'@esbuild/win32-ia32': 0.19.11
'@esbuild/win32-x64': 0.19.11
dev: true
/make-error@1.3.6:
resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
dev: true
/seroval@1.0.2:
resolution: {integrity: sha512-buswWxRzf65ZGUk8MAf3qVtBJHbe5gq6hZyPeqlJCKEIl/tEhUZze0YJg7vB7tFRGgPeneRaP083OB/vDiYLvA==}
engines: {node: '>=10'}
dev: false
/solid-js@1.8.8:
resolution: {integrity: sha512-9CtL5xWTYX1WWjQKqht3Tl0AJzgz4YWVQk8hoscO9TzRCgzlpAauEOexXa6bPG30W+fWLnFVE7XUiAzQFNeUKw==}
dependencies:
csstype: 3.1.3
seroval: 1.0.2
dev: false
/ts-node@10.9.2(@types/node@20.10.6)(typescript@5.3.3):
resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}
hasBin: true
peerDependencies:
'@swc/core': '>=1.2.50'
'@swc/wasm': '>=1.2.50'
'@types/node': '*'
typescript: '>=2.7'
peerDependenciesMeta:
'@swc/core':
optional: true
'@swc/wasm':
optional: true
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.9
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.4
'@types/node': 20.10.6
acorn: 8.11.3
acorn-walk: 8.3.1
arg: 4.1.3
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
typescript: 5.3.3
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
dev: true
/typescript@5.3.3:
resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==}
engines: {node: '>=14.17'}
hasBin: true
dev: true
/undici-types@5.26.5:
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
dev: true
/v8-compile-cache-lib@3.0.1:
resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
dev: true
/yn@3.1.1:
resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
engines: {node: '>=6'}
dev: true

View file

@ -0,0 +1,13 @@
hexo.extend.helper.register("tags_of_year", function (year) {
const yearNumber = Number(year)
const tags = this.site.posts
.filter((post) => post.date.year() === yearNumber)
.map((x) => x.tags)
.reduce((p, c) => {
for (const t of c.toArray()) {
p.add(t)
}
return p
}, new Set())
return Array.from(tags);
})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
import{a as e,d as t}from"./chunk-Q4ALCKUU.js";e(()=>{t(document.querySelectorAll(".post-item-title > time"))});
//# sourceMappingURL=index.js.map

View file

@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts"],
"sourcesContent": ["import { createRoot } from \"solid-js\";\nimport { renderLocalTimeOn } from \"./uxaddon/time.js\";\n\ncreateRoot(() => {\n renderLocalTimeOn(document.querySelectorAll(\".post-item-title > time\"));\n});\n"],
"mappings": "+CAGAA,EAAW,IAAM,CACfC,EAAkB,SAAS,iBAAiB,yBAAyB,CAAC,CACxE,CAAC",
"names": ["createRoot", "renderLocalTimeOn"]
}

View file

@ -0,0 +1,10 @@
<svg width="75" height="79" viewBox="0 0 75 79" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M73.8393 17.4898C72.6973 9.00165 65.2994 2.31235 56.5296 1.01614C55.05 0.797115 49.4441 0 36.4582 0H36.3612C23.3717 0 20.585 0.797115 19.1054 1.01614C10.5798 2.27644 2.79399 8.28712 0.904997 16.8758C-0.00358524 21.1056 -0.100549 25.7949 0.0682394 30.0965C0.308852 36.2651 0.355538 42.423 0.91577 48.5665C1.30307 52.6474 1.97872 56.6957 2.93763 60.6812C4.73325 68.042 12.0019 74.1676 19.1233 76.6666C26.7478 79.2728 34.9474 79.7055 42.8039 77.9162C43.6682 77.7151 44.5217 77.4817 45.3645 77.216C47.275 76.6092 49.5123 75.9305 51.1571 74.7385C51.1797 74.7217 51.1982 74.7001 51.2112 74.6753C51.2243 74.6504 51.2316 74.6229 51.2325 74.5948V68.6416C51.2321 68.6154 51.2259 68.5896 51.2142 68.5661C51.2025 68.5426 51.1858 68.522 51.1651 68.5058C51.1444 68.4896 51.1204 68.4783 51.0948 68.4726C51.0692 68.4669 51.0426 68.467 51.0171 68.4729C45.9835 69.675 40.8254 70.2777 35.6502 70.2682C26.7439 70.2682 24.3486 66.042 23.6626 64.2826C23.1113 62.762 22.7612 61.1759 22.6212 59.5646C22.6197 59.5375 22.6247 59.5105 22.6357 59.4857C22.6466 59.4609 22.6633 59.4391 22.6843 59.422C22.7053 59.4048 22.73 59.3929 22.7565 59.3871C22.783 59.3813 22.8104 59.3818 22.8367 59.3886C27.7864 60.5826 32.8604 61.1853 37.9522 61.1839C39.1768 61.1839 40.3978 61.1839 41.6224 61.1516C46.7435 61.008 52.1411 60.7459 57.1796 59.7621C57.3053 59.7369 57.431 59.7154 57.5387 59.6831C65.4861 58.157 73.0493 53.3672 73.8178 41.2381C73.8465 40.7606 73.9184 36.2364 73.9184 35.7409C73.9219 34.0569 74.4606 23.7949 73.8393 17.4898Z" fill="url(#paint0_linear_549_34)"/>
<path d="M61.2484 27.0263V48.114H52.8916V27.6475C52.8916 23.3388 51.096 21.1413 47.4437 21.1413C43.4287 21.1413 41.4177 23.7409 41.4177 28.8755V40.0782H33.1111V28.8755C33.1111 23.7409 31.0965 21.1413 27.0815 21.1413C23.4507 21.1413 21.6371 23.3388 21.6371 27.6475V48.114H13.2839V27.0263C13.2839 22.7176 14.384 19.2946 16.5843 16.7572C18.8539 14.2258 21.8311 12.926 25.5264 12.926C29.8036 12.926 33.0357 14.5705 35.1905 17.8559L37.2698 21.346L39.3527 17.8559C41.5074 14.5705 44.7395 12.926 49.0095 12.926C52.7013 12.926 55.6784 14.2258 57.9553 16.7572C60.1531 19.2922 61.2508 22.7152 61.2484 27.0263Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear_549_34" x1="37.0692" y1="0" x2="37.0692" y2="79" gradientUnits="userSpaceOnUse">
<stop stop-color="#6364FF"/>
<stop offset="1" stop-color="#563ACC"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
import{a as c,b as a,c as m,d}from"./chunk-Q4ALCKUU.js";function i(o,n){for(let l of o)a(()=>{let e=document.createElement("div");e.classList.add(...n),l.replaceWith(e),e.appendChild(l)})}function f(o){let n=o.parentElement,l=n.cells;for(let e=0;e<l.length;e++)if(l.item(e)===o)return n.parentElement.parentElement.querySelectorAll("thead > tr > th").item(e);return null}var s="table-column-hover";function u(o){for(let n of o){if(!(n instanceof HTMLTableElement)){console.warn(n,"is unable to be rendered as advanced table");continue}let l=t=>{let r=f(t.target);r.classList.contains(s)||r.classList.add(s)},e=t=>{let r=f(t.target);r.classList.contains(s)&&r.classList.remove(s)};a(()=>{for(let t of n.querySelectorAll("td"))t.addEventListener("mouseenter",l),t.addEventListener("mouseleave",e)}),m(()=>{for(let t of n.querySelectorAll("td"))t.removeEventListener("mouseenter",l),t.removeEventListener("mouseenter",e)})}}c(()=>{d(document.querySelectorAll("[data-time-format]")),i(document.querySelectorAll("main > table"),["table-responsive"]),u(document.querySelectorAll("main > .table-responsive > table"))});
//# sourceMappingURL=page.js.map

View file

@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/uxaddon/dom.ts", "../src/uxaddon/table.ts", "../src/page.ts"],
"sourcesContent": ["import { createRenderEffect } from \"solid-js\";\n\n\nexport function wrapElementsInClass(elements: Iterable<Element>, classes: string[]) {\n for (const e of elements) {\n createRenderEffect(() => {\n const wrapper = document.createElement(\"div\");\n wrapper.classList.add(...classes);\n e.replaceWith(wrapper);\n wrapper.appendChild(e);\n });\n }\n}\n", "import { createRenderEffect, onCleanup } from \"solid-js\";\n\nfunction findCorrespondingTableHeadOfCell(target: HTMLTableCellElement): HTMLTableCellElement | null {\n const parentElement = target.parentElement as HTMLTableRowElement;\n const collection = parentElement.cells;\n for (let i = 0; i < collection.length; i++) {\n if (collection.item(i) === target) {\n const tbody = parentElement.parentElement\n const table = tbody.parentElement\n const allHeads =\n table.querySelectorAll(\n \"thead > tr > th\"\n );\n return allHeads.item(i) as HTMLTableCellElement;\n }\n }\n return null;\n}\n\nconst TABLE_COLUMN_HOVER_CLASSNAME = \"table-column-hover\";\n\nexport function renderAdvancedTablesOn(elements: Iterable<Element>) {\n for (const e of elements) {\n if (!(e instanceof HTMLTableElement)) {\n console.warn(e, \"is unable to be rendered as advanced table\");\n continue;\n }\n\n const onMouseEnter = (ev: MouseEvent) => {\n const head = findCorrespondingTableHeadOfCell(\n ev.target as HTMLTableCellElement\n );\n if (!head.classList.contains(TABLE_COLUMN_HOVER_CLASSNAME)) {\n head.classList.add(TABLE_COLUMN_HOVER_CLASSNAME);\n }\n };\n\n const onMouseLeave = (ev: MouseEvent) => {\n const head = findCorrespondingTableHeadOfCell(\n ev.target as HTMLTableCellElement\n );\n if (head.classList.contains(TABLE_COLUMN_HOVER_CLASSNAME)) {\n head.classList.remove(TABLE_COLUMN_HOVER_CLASSNAME);\n }\n };\n\n createRenderEffect(() => {\n for (const td of e.querySelectorAll(\"td\")) {\n td.addEventListener(\"mouseenter\", onMouseEnter);\n td.addEventListener(\"mouseleave\", onMouseLeave);\n }\n });\n\n onCleanup(() => {\n for (const td of e.querySelectorAll(\"td\")) {\n td.removeEventListener(\"mouseenter\", onMouseEnter);\n td.removeEventListener(\"mouseenter\", onMouseLeave);\n }\n });\n }\n}\n", "import { createRoot } from \"solid-js\";\nimport { renderLocalTimeOn } from \"./uxaddon/time.js\";\nimport { wrapElementsInClass } from \"./uxaddon/dom.js\";\nimport { renderAdvancedTablesOn } from \"./uxaddon/table.js\";\n\ncreateRoot(() => {\n renderLocalTimeOn(document.querySelectorAll(\"[data-time-format]\"))\n wrapElementsInClass(document.querySelectorAll(\"main > table\"), [\"table-responsive\"])\n renderAdvancedTablesOn(document.querySelectorAll(\"main > .table-responsive > table\"))\n})\n"],
"mappings": "wDAGO,SAASA,EAAoBC,EAA6BC,EAAmB,CAClF,QAAWC,KAAKF,EACdG,EAAmB,IAAM,CACvB,IAAMC,EAAU,SAAS,cAAc,KAAK,EAC5CA,EAAQ,UAAU,IAAI,GAAGH,CAAO,EAChCC,EAAE,YAAYE,CAAO,EACrBA,EAAQ,YAAYF,CAAC,CACvB,CAAC,CAEL,CCVA,SAASG,EAAiCC,EAA2D,CACnG,IAAMC,EAAgBD,EAAO,cACvBE,EAAaD,EAAc,MACjC,QAASE,EAAI,EAAGA,EAAID,EAAW,OAAQC,IACrC,GAAID,EAAW,KAAKC,CAAC,IAAMH,EAOzB,OANcC,EAAc,cACR,cAEZ,iBACJ,iBACF,EACc,KAAKE,CAAC,EAG1B,OAAO,IACT,CAEA,IAAMC,EAA+B,qBAE9B,SAASC,EAAuBC,EAA6B,CAClE,QAAWC,KAAKD,EAAU,CACxB,GAAI,EAAEC,aAAa,kBAAmB,CACpC,QAAQ,KAAKA,EAAG,4CAA4C,EAC5D,QACF,CAEA,IAAMC,EAAgBC,GAAmB,CACvC,IAAMC,EAAOX,EACXU,EAAG,MACL,EACKC,EAAK,UAAU,SAASN,CAA4B,GACvDM,EAAK,UAAU,IAAIN,CAA4B,CAEnD,EAEMO,EAAgBF,GAAmB,CACvC,IAAMC,EAAOX,EACXU,EAAG,MACL,EACIC,EAAK,UAAU,SAASN,CAA4B,GACtDM,EAAK,UAAU,OAAON,CAA4B,CAEtD,EAEAQ,EAAmB,IAAM,CACvB,QAAWC,KAAMN,EAAE,iBAAiB,IAAI,EACtCM,EAAG,iBAAiB,aAAcL,CAAY,EAC9CK,EAAG,iBAAiB,aAAcF,CAAY,CAElD,CAAC,EAEDG,EAAU,IAAM,CACd,QAAWD,KAAMN,EAAE,iBAAiB,IAAI,EACtCM,EAAG,oBAAoB,aAAcL,CAAY,EACjDK,EAAG,oBAAoB,aAAcF,CAAY,CAErD,CAAC,CACH,CACF,CCvDAI,EAAW,IAAM,CACfC,EAAkB,SAAS,iBAAiB,oBAAoB,CAAC,EACjEC,EAAoB,SAAS,iBAAiB,cAAc,EAAG,CAAC,kBAAkB,CAAC,EACnFC,EAAuB,SAAS,iBAAiB,kCAAkC,CAAC,CACtF,CAAC",
"names": ["wrapElementsInClass", "elements", "classes", "e", "createRenderEffect", "wrapper", "findCorrespondingTableHeadOfCell", "target", "parentElement", "collection", "i", "TABLE_COLUMN_HOVER_CLASSNAME", "renderAdvancedTablesOn", "elements", "e", "onMouseEnter", "ev", "head", "onMouseLeave", "createRenderEffect", "td", "onCleanup", "createRoot", "renderLocalTimeOn", "wrapElementsInClass", "renderAdvancedTablesOn"]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,40 @@
@import "./styles/material.css";
#_layout {
display: grid;
margin-inline: 60px;
padding-block: 24px;
}
@media (max-width: 720px) {
#_layout {
margin-inline: 8px;
}
}
#_layout> :first-child {
max-width: 560px;
}
.archive-list {
display: flex;
flex-flow: column nowrap;
gap: 12px;
padding: 0;
}
.archive-list-item {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--palette-grey-500);
}
a.archive-list-link {
font: var(--typ-title);
line-height: 2;
padding-right: 48px;
padding-left: 16px;
text-align: start;
}

View file

@ -0,0 +1,10 @@
<svg width="75" height="79" viewBox="0 0 75 79" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M73.8393 17.4898C72.6973 9.00165 65.2994 2.31235 56.5296 1.01614C55.05 0.797115 49.4441 0 36.4582 0H36.3612C23.3717 0 20.585 0.797115 19.1054 1.01614C10.5798 2.27644 2.79399 8.28712 0.904997 16.8758C-0.00358524 21.1056 -0.100549 25.7949 0.0682394 30.0965C0.308852 36.2651 0.355538 42.423 0.91577 48.5665C1.30307 52.6474 1.97872 56.6957 2.93763 60.6812C4.73325 68.042 12.0019 74.1676 19.1233 76.6666C26.7478 79.2728 34.9474 79.7055 42.8039 77.9162C43.6682 77.7151 44.5217 77.4817 45.3645 77.216C47.275 76.6092 49.5123 75.9305 51.1571 74.7385C51.1797 74.7217 51.1982 74.7001 51.2112 74.6753C51.2243 74.6504 51.2316 74.6229 51.2325 74.5948V68.6416C51.2321 68.6154 51.2259 68.5896 51.2142 68.5661C51.2025 68.5426 51.1858 68.522 51.1651 68.5058C51.1444 68.4896 51.1204 68.4783 51.0948 68.4726C51.0692 68.4669 51.0426 68.467 51.0171 68.4729C45.9835 69.675 40.8254 70.2777 35.6502 70.2682C26.7439 70.2682 24.3486 66.042 23.6626 64.2826C23.1113 62.762 22.7612 61.1759 22.6212 59.5646C22.6197 59.5375 22.6247 59.5105 22.6357 59.4857C22.6466 59.4609 22.6633 59.4391 22.6843 59.422C22.7053 59.4048 22.73 59.3929 22.7565 59.3871C22.783 59.3813 22.8104 59.3818 22.8367 59.3886C27.7864 60.5826 32.8604 61.1853 37.9522 61.1839C39.1768 61.1839 40.3978 61.1839 41.6224 61.1516C46.7435 61.008 52.1411 60.7459 57.1796 59.7621C57.3053 59.7369 57.431 59.7154 57.5387 59.6831C65.4861 58.157 73.0493 53.3672 73.8178 41.2381C73.8465 40.7606 73.9184 36.2364 73.9184 35.7409C73.9219 34.0569 74.4606 23.7949 73.8393 17.4898Z" fill="url(#paint0_linear_549_34)"/>
<path d="M61.2484 27.0263V48.114H52.8916V27.6475C52.8916 23.3388 51.096 21.1413 47.4437 21.1413C43.4287 21.1413 41.4177 23.7409 41.4177 28.8755V40.0782H33.1111V28.8755C33.1111 23.7409 31.0965 21.1413 27.0815 21.1413C23.4507 21.1413 21.6371 23.3388 21.6371 27.6475V48.114H13.2839V27.0263C13.2839 22.7176 14.384 19.2946 16.5843 16.7572C18.8539 14.2258 21.8311 12.926 25.5264 12.926C29.8036 12.926 33.0357 14.5705 35.1905 17.8559L37.2698 21.346L39.3527 17.8559C41.5074 14.5705 44.7395 12.926 49.0095 12.926C52.7013 12.926 55.6784 14.2258 57.9553 16.7572C60.1531 19.2922 61.2508 22.7152 61.2484 27.0263Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear_549_34" x1="37.0692" y1="0" x2="37.0692" y2="79" gradientUnits="userSpaceOnUse">
<stop stop-color="#6364FF"/>
<stop offset="1" stop-color="#563ACC"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

127
themes/buck/src/index.css Normal file
View file

@ -0,0 +1,127 @@
@import "./styles/material.css";
@import "./styles/posts.css";
@import "./styles/pager.css";
@import "./styles/content.css";
#_layout {
display: grid;
grid-template-columns: auto 1fr;
margin-inline: 60px;
padding-block: 24px;
gap: 8px;
row-gap: 0;
}
@media (max-width: 720px) {
#_layout {
margin-inline: 8px;
grid-template-columns: 1fr;
}
}
#_layout> :first-child {
max-width: 560px;
}
.avatar {
width: 60px;
height: 60px;
}
.card {
background-color: var(--palette-white);
box-shadow: var(--box-shadow-2);
padding: 8px 0 16px;
border: 1px solid var(--palette-grey-300);
& > * {
margin-inline: 8px;
}
&:hover {
box-shadow: var(--box-shadow-4);
}
}
.author-head {
display: grid;
grid-template-columns: 60px 1fr;
grid-template-rows: 1fr auto;
align-items: center;
column-gap: 12px;
&>:first-child {
grid-row: 1 /3;
grid-column: 1/1;
}
&>* {
grid-column: 2/2;
}
&>:nth-child(2) {
grid-row: 1 / 1;
}
&>:nth-child(3) {
grid-row: 2/ 2;
}
}
.link-list {
display: flex;
flex-direction: column;
list-style: none;
padding: 0;
gap: 16px;
> li {
display: flex;
&::before {
display: inherit;
width: 1.25rem;
height: 1.25rem;
padding: 4px;
content: "";
object-fit: contain;
overflow: hidden;
}
&.mastodon::before {
content: url("./assets/mastodon-purple.svg");
}
}
}
.chip-group {
display: flex;
flex-flow: row wrap;
gap: 16px;
column-gap: 8px;
}
:where(ul, ol).chip-group {
> * {
display: inline-block;
}
}
.chip {
border-radius: 1.5rem;
padding: 0 12px;
line-height: 2rem;
font-size: 0.8125rem;
text-align: center;
}
.hottag-chip {
background-color: var(--p-secondary);
color: var(--p-secondary-fg);
&:is(:hover, :focus) {
background-color: var(--p-secondary);
color: var(--p-secondary-fg);
filter: saturate(0.65);
}
}

6
themes/buck/src/index.ts Normal file
View file

@ -0,0 +1,6 @@
import { createRoot } from "solid-js";
import { renderLocalTimeOn } from "./uxaddon/time.js";
createRoot(() => {
renderLocalTimeOn(document.querySelectorAll(".post-item-title > time"));
});

40
themes/buck/src/page.css Normal file
View file

@ -0,0 +1,40 @@
@import "./styles/material.css";
@import "./styles/content.css";
:root {
background-color: var(--palette-grey-200);
}
#_layout {
display: grid;
grid-template-columns: 1fr auto 1fr;
margin: auto;
&>* {
overflow: hidden;
word-wrap: normal;
}
}
.page-metadata {
display: grid;
justify-content: flex-end;
margin-inline: 16px;
gap: 4px;
color: var(--palette-grey-700);
> * {
display: flex;
gap: 2px;
justify-content: flex-end;
}
}
main {
max-width: 70rem;
margin-top: 32px;
margin-bottom: calc(env(safe-area-insets-bottom, 16px) + 16px);
background-color: var(--palette-grey-50);
padding-block: 16px;
border-radius: 2px;
}

10
themes/buck/src/page.ts Normal file
View file

@ -0,0 +1,10 @@
import { createRoot } from "solid-js";
import { renderLocalTimeOn } from "./uxaddon/time.js";
import { wrapElementsInClass } from "./uxaddon/dom.js";
import { renderAdvancedTablesOn } from "./uxaddon/table.js";
createRoot(() => {
renderLocalTimeOn(document.querySelectorAll("[data-time-format]"))
wrapElementsInClass(document.querySelectorAll("main > table"), ["table-responsive"])
renderAdvancedTablesOn(document.querySelectorAll("main > .table-responsive > table"))
})

View file

@ -0,0 +1,106 @@
/*
XCode style (c) Angel Garcia <angelgarcia.mail@gmail.com>
Ported to Hexo highlight.js system by Rubicon <l1589002388@gmail.com>
*/
.highlight {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #fff;
color: black;
}
/* Gray DOCTYPE selectors like WebKit */
.code .xml .meta {
color: #c0c0c0;
}
.code .comment,
.code .quote {
color: #007400;
}
.code .tag,
.code .attribute,
.code .keyword,
.code .selector-tag,
.code .literal,
.code .name {
color: #aa0d91;
}
.code .variable,
.code .template-variable {
color: #3F6E74;
}
.code .code,
.code .string,
.code .meta-string {
color: #c41a16;
}
.code .regexp,
.code .link {
color: #0E0EFF;
}
.code .title,
.code .symbol,
.code .bullet,
.code .number {
color: #1c00cf;
}
.code .section,
.code .meta {
color: #643820;
}
.code .class .title,
.code .type,
.code .built_in,
.code .builtin-name,
.code .params {
color: #5c2699;
}
.code .attr {
color: #836C28;
}
.code .subst {
color: #000;
}
.code .formula {
background-color: #eee;
font-style: italic;
}
.code .addition {
background-color: #baeeba;
}
.code .deletion {
background-color: #ffc8bd;
}
.code .selector-id,
.code .selector-class {
color: #9b703f;
}
.code .doctag,
.code .strong {
font-weight: bold;
}
.code .emphasis {
font-style: italic;
}

View file

@ -0,0 +1,227 @@
@import "./codehighlight/xcode.css";
.content {
line-height: 1.5;
>p {
padding: 16px;
>img {
width: 100%;
object-fit: contain;
object-position: 50% 50%;
min-height: 44px;
max-height: 40vh;
}
>a>img {
max-width: 100%;
object-fit: contain;
}
}
> :where(h1, h2, h3, h4, h5, h6) {
margin-inline: 16px;
hyphens: auto;
text-wrap: wrap;
text-wrap: pretty;
}
>#more {
display: block;
width: 100%;
border-top: 1px solid var(--palette-grey-200);
}
> :where(ul, ol) {
background-color: var(--palette-white);
line-height: 1.5;
>li {
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
transition: border-color 220ms ease-in-out;
&:hover {
border-top-color: var(--palette-grey-200);
border-bottom-color: var(--palette-grey-400);
&+li {
border-bottom-color: var(--palette-grey-200);
}
}
}
}
hr {
border: none;
border-top: 1px solid var(--palette-grey-300);
margin-inline: 16px;
}
> :where(h2, h3, h4, h5, h6) {
margin-top: 16px;
margin-bottom: 8px;
}
}
.table-responsive {
max-width: 100%;
overflow-y: auto;
}
.content > :where(table, .table-responsive > table) {
background-color: var(--table-background-color);
width: 100%;
white-space: nowrap;
border: 1px solid var(--palette-grey-300);
border-collapse: collapse;
> :where(thead, tbody) > tr {
& > :first-child {
padding-inline-start: 16px;
}
& > :last-child {
padding-inline-end: 16px;
}
}
>thead {
color: var(--table-header-color);
>tr {
border-bottom: 1px solid var(--palette-grey-300);
>th {
padding-block: 15px;
text-align: start;
&:hover, &.table-column-hover {
color: var(--table-content-color);
}
&[align="center"] {
text-align: center;
}
&[align="right"] {
text-align: end;
}
}
}
}
>tbody {
color: var(--table-content-color);
>tr {
>td {
padding-block: 15px;
text-align: start;
&[align="center"] {
text-align: center;
}
&[align="right"] {
text-align: end;
}
}
&:first-child {
border-top: 1px solid transparent;
}
&+& {
border-top: 1px solid var(--palette-grey-300);
}
&:hover {
background-color: var(--palette-grey-200);
}
}
}
}
.content figure {
border-radius: 2px;
&.highlight {
padding: 0 8px;
outline: 1px solid var(--palette-grey-300);
transition: box-shadow 220ms ease-in-out;
line-height: 1.25;
min-height: 44px;
&:hover {
box-shadow: var(--box-shadow-4);
}
.gutter {
border-inline-end: 1px solid var(--palette-grey-200);
margin-inline-end: 8px;
>pre {
>.line {
display: block;
width: 100%;
text-align: end;
}
>br {
display: none;
}
}
}
.code {
.line {
border-bottom: 1px solid transparent;
&:hover {
border-bottom: 1px solid var(--palette-grey-500);
}
}
}
}
}
.content kbd {
padding: 6px;
margin-inline: 2px;
background-color: var(--palette-black);
color: var(--palette-white);
border-radius: 4px;
}
.content dl {
>dt {
font: var(--typ-body2);
margin-left: 16px;
}
>dd {
margin-left: 32px;
}
}
.content blockquote {
background-color: white;
padding-left: 12px;
margin-block: 16px;
border: 1px solid var(--palette-grey-200);
border-left: 4px solid var(--p-secondary);
&:hover, &:focus {
outline: 1px solid var(--palette-grey-400);
}
}
.content .video-container {
width: 100%;
border: 1px solid var(--palette-grey-200);
> iframe {
width: 100%;
}
}

View file

@ -0,0 +1,256 @@
@import "./palette.css";
@import "@fontsource/roboto/400.css";
@import "@fontsource/roboto/100.css";
* {
margin: 0;
box-sizing: border-box;
font-family: var(--font-family-sans);
}
:root {
--font-family-sans: Roboto, "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
--p-primary: var(--palette-blue-500);
--p-primary-fg: var(--palette-blue-500-fg);
--p-secondary: var(--palette-pink-500);
--p-secondary-fg: var(--palette-pink-500-fg);
--typ-r-display4: lighter 7rem / 7rem var(--font-family-sans);
--typ-r-display3: normal 3.5rem / 3.5rem var(--font-family-sans);
--typ-r-display2: normal 2.8125rem / 2.8125rem var(--font-family-sans);
--typ-r-display1: normal 2.125rem / 2.125rem var(--font-family-sans);
--typ-r-headline: bold 1.5rem / 1.5rem var(--font-family-sans);
--typ-r-title: bold 1.25rem / 1.25rem var(--font-family-sans);
--typ-r-subheading: normal 1rem / 1rem var(--font-family-sans);
--typ-r-body2: bold 0.875rem / 0.875rem var(--font-family-sans);
--typ-r-body1: normal 0.875rem / 0.875rem var(--font-family-sans);
--typ-r-caption: normal 0.75rem / 0.75rem var(--font-family-sans);
--typ-r-button: bold 0.875rem / 0.875rem var(--font-family-sans);
--typ-d-display4: var(--typ-r-display4);
--typ-d-display3: var(--typ-r-display3);
--typ-d-display2: var(--typ-r-display2);
--typ-d-display1: var(--typ-r-display1);
--typ-d-headline: var(--typ-r-headline);
--typ-d-title: bold 1.3125rem / 1.3125rem var(--font-family-sans);
--typ-d-subheading: normal 1.0625rem / 1.0625rem var(--font-family-sans);
--typ-d-body2: bold 0.9375rem / 0.9375rem var(--font-family-sans);
--typ-d-body1: normal 0.9375rem / 0.9375rem var(--font-family-sans);
--typ-d-caption: normal 0.8125rem / 0.8125rem var(--font-family-sans);
--typ-d-button: bold 0.9375rem / 0.9375rem var(--font-family-sans);
& {
--typ-display4: var(--typ-r-display4);
--typ-display3: var(--typ-r-display3);
--typ-display2: var(--typ-r-display2);
--typ-display1: var(--typ-r-display1);
--typ-headline: var(--typ-r-display1);
--typ-title: var(--typ-r-title);
--typ-subheading: var(--typ-r-subheading);
--typ-body2: var(--typ-r-body2);
--typ-body1: var(--typ-r-body1);
--typ-caption: var(--typ-r-caption);
--typ-button: var(--typ-r-button);
}
&[lang~="zh"],
&[lang~="ja"],
&[lang~="kr"] {
--typ-title: var(--typ-d-headline);
--typ-subheading: var(--typ-d-subheading);
--typ-body2: var(--typ-d-body2);
--typ-body1: var(--typ-d-body1);
--typ-caption: var(--typ-d-caption);
--typ-button: var(--typ-d-button);
}
--elevation-0: 0px;
--elevation-1: 1px;
--elevation-2: 2px;
--elevation-3: 3px;
--elevation-4: 4px;
--elevation-5: 6px;
--elevation-6: 8px;
--elevation-7: 9px;
--elevation-8: 12px;
--elevation-9: 16px;
--elevation-10: 24px;
--box-shadow-2: 0 var(--elevation-2) var(--elevation-2) rgba(0, 0, 0, 0.15);
--box-shadow-4: 0 var(--elevation-4) var(--elevation-4) rgba(0, 0, 0, 0.15);
--box-shadow-6: 0 var(--elevation-6) var(--elevation-6) rgba(0, 0, 0, 0.15);
--box-shadow-9: 0 var(--elevation-9) var(--elevation-9) rgba(0, 0, 0, 0.15);
--link-bg: var(--palette-blue-50);
--link-color: var(--palette-blue-50-fg);
--link-bg-hover: var(--palette-blue-100);
--link-color-hover: var(--palette-blue-100-fg);
}
table {
--table-header-color: rgba(0, 0, 0, 0.54);
--table-content-color: rgba(0, 0, 0, 0.87);
--table-background-color: white;
}
:root {
font: var(--typ-body1);
}
h1 {
font: var(--typ-display4);
}
h2 {
font: var(--typ-display3);
}
h3 {
font: var(--typ-display2);
}
h4 {
font: var(--typ-display1);
}
h5 {
font: var(--typ-headline);
}
h6 {
font: var(--typ-title);
}
.container {
width: 80%;
margin: auto;
}
@media (max-width: 600px) {
.container {
width: 100%;
}
}
.nav-wrapper {
background-color: var(--p-primary);
box-shadow: var(--box-shadow-4);
}
nav.site {
--nav-site-height: 4rem;
display: flex;
flex-wrap: wrap-reverse;
justify-content: space-between;
white-space: nowrap;
min-height: var(--nav-site-height);
color: var(--palette-white);
width: 80%;
margin: auto;
padding-inline: 8px;
>* {
display: flex;
align-items: center;
}
}
@media (max-width: 1280px) {
nav.site {
width: 90%;
}
}
@media (max-width: 600px) {
nav.site {
width: 100%;
}
}
nav.site a {
font: var(--typ-button);
display: inline-block;
line-height: var(--nav-site-height);
padding: 0 16px;
transition: background-color .2s ease-in-out;
background-color: transparent;
color: var(--palette-white);
&:hover {
color: inherit;
background-color: rgba(0, 0, 0, 0.1);
}
}
:where(a):not([href^="#"]) {
display: inline-block;
color: var(--link-color);
text-decoration: none;
background-color: var(--link-bg);
border-radius: 4px;
padding: 4px 8px;
transition: background-color .2s ease-in-out, color .2s ease-in-out;
min-width: 44px;
&:hover {
background-color: var(--link-bg-hover);
color: var(--link-color-hover);
}
&[target="_blank"]::after {
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>open-in-new</title><path d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z" /></svg>');
display: inline-block;
width: 1rem;
height: 1rem;
}
}
nav.site .textinput-lg {
background-color: rgba(255, 255, 255, 0.25);
border: none;
outline: none;
border-radius: 2px;
font-size: 1rem;
line-height: 2rem;
vertical-align: middle;
flex-grow: 1;
transition: background-color .2s ease-in-out, width .2s ease-in-out, box-shadow .2s ease-in-out;
padding-inline: 1rem;
&::placeholder {
color: white;
}
&:focus {
background-color: white;
box-shadow: var(--box-shadow-9);
&::placeholder {
color: transparent;
text-align: center;
}
}
}
@media (max-width: 600px) {
nav.site .textinput-lg {
width: 100%;
}
}
nav.site > *:first-child > *:first-child {
padding-left: 16px;
}
nav.site :where(h1, h2, h3, h4, h5, h6) {
text-overflow: ellipsis;
overflow: hidden;
line-height: var(--nav-site-height);
}
.circle {
border-radius: 50% 50%;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,30 @@
.pager {
display: grid;
width: fit-content;
grid-auto-columns: minmax(44px, 1fr);
grid-auto-flow: column;
gap: 16px;
row-gap: 8px;
font-size: 1.125rem;
> :is(.extend, .page-number) {
aspect-ratio: 1;
display: flex;
align-items: center;
justify-content: center;
}
> .extend > .mdi {
font-size: 1.375em;
}
> .extend {
background-color: var(--p-secondary);
color: var(--p-secondary-fg);
&:is(:hover, :focus) {
filter: saturate(0.65);
}
}
}

View file

@ -0,0 +1,51 @@
:root {
--palette-black: #000000;
--palette-white: #ffffff;
--palette-blue-50: #e3f2fd;
--palette-blue-50-fg: var(--palette-black);
--palette-blue-100: #bbdefb;
--palette-blue-100-fg: var(--palette-black);
--palette-blue-200: #90caf9;
--palette-blue-200-fg: var(--palette-black);
--palette-blue-400: #42a5f5;
--palette-blue-400-fg: var(--palette-black);
--palette-blue-500: #2196f3;
--palette-blue-500-fg: var(--palette-black);
--palette-blue-600: #1e88e5;
--palette-blue-600-fg: var(--palette-white);
--palette-blue-700: #1976d2;
--palette-blue-700-fg: var(--palette-white);
--palette-blue-800: #1565c0;
--palette-blue-800-fg: var(--palette-white);
--palette-blue-900: #0d47a1;
--palette-blue-900-fg: var(--palette-white);
--palette-blue-a100: #82b1ff;
--palette-blue-a100-fg: var(--palette-black);
--palette-blue-a200: #448aff;
--palette-blue-a200-fg: var(--palette-white);
--palette-blue-a400: #2979ff;
--palette-blue-a400-fg: var(--palette-white);
--palette-blue-a700: #2962ff;
--palette-blue-a700-fg: var(--palette-white);
--palette-grey-50: #fafafa;
--palette-grey-50-fg: var(--palette-black);
--palette-grey-100: #f5f5f5;
--palette-grey-100-fg: var(--palette-black);
--palette-grey-200: #eeeeee;
--palette-grey-200-fg: var(--palette-black);
--palette-grey-300: #e0e0e0;
--palette-grey-300-fg: var(--palette-black);
--palette-grey-400: #bdbdbd;
--palette-grey-400-fg: var(--palette-black);
--palette-grey-500: #9e9e9e;
--palette-grey-500-fg: var(--palette-black);
--palette-grey-600: #757575;
--palette-grey-600-fg: white;
--palette-grey-700: #616161;
--palette-grey-700-fg: white;
--palette-pink-500: #e91e63;
--palette-pink-500-fg: var(--palette-white);
}

View file

@ -0,0 +1,81 @@
@import "./material.css";
:is(ul, ol).post-list {
list-style-type: none;
padding: 0;
}
.post-item {
display: block;
padding: 12px 0;
> *:not(:where(figure)) {
margin-left: 4px;
margin-right: 4px;
}
border: 1px solid transparent;
border-top-color: var(--palette-grey-300);
transition: border-color 220ms ease-in-out;
&:hover, &:focus-within {
border-top-color: var(--palette-grey-400);
border-left-color: var(--palette-grey-400);
border-right-color: var(--palette-grey-400);
+ .post-item {
border-top-color: var(--palette-grey-400);
}
&:first-child {
border-top-color: var(--palette-grey-400);
}
&:last-child {
border-bottom-color: var(--palette-grey-400);
}
}
&:first-child {
border-top-color: transparent;
}
& p {
line-height: 1.375;
& > a {
line-height: 1.175;
}
}
&:last-child {
border-bottom-color: rgba(0, 0, 0, 0.05);
}
}
.post-item-title {
display: grid;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
gap: 8px;
grid-template-columns: auto auto;
@media (width <= 400px) {
& {
grid-template-columns: 1fr;
}
& > :last-child {
text-align: end;
}
}
& > a {
min-height: 44px;
display: inline-flex;
align-items: center;
}
& > time {
color: var(--palette-grey-700);
}
}

View file

View file

@ -0,0 +1,13 @@
import { createRenderEffect } from "solid-js";
export function wrapElementsInClass(elements: Iterable<Element>, classes: string[]) {
for (const e of elements) {
createRenderEffect(() => {
const wrapper = document.createElement("div");
wrapper.classList.add(...classes);
e.replaceWith(wrapper);
wrapper.appendChild(e);
});
}
}

View file

@ -0,0 +1,61 @@
import { createRenderEffect, onCleanup } from "solid-js";
function findCorrespondingTableHeadOfCell(target: HTMLTableCellElement): HTMLTableCellElement | null {
const parentElement = target.parentElement as HTMLTableRowElement;
const collection = parentElement.cells;
for (let i = 0; i < collection.length; i++) {
if (collection.item(i) === target) {
const tbody = parentElement.parentElement
const table = tbody.parentElement
const allHeads =
table.querySelectorAll(
"thead > tr > th"
);
return allHeads.item(i) as HTMLTableCellElement;
}
}
return null;
}
const TABLE_COLUMN_HOVER_CLASSNAME = "table-column-hover";
export function renderAdvancedTablesOn(elements: Iterable<Element>) {
for (const e of elements) {
if (!(e instanceof HTMLTableElement)) {
console.warn(e, "is unable to be rendered as advanced table");
continue;
}
const onMouseEnter = (ev: MouseEvent) => {
const head = findCorrespondingTableHeadOfCell(
ev.target as HTMLTableCellElement
);
if (!head.classList.contains(TABLE_COLUMN_HOVER_CLASSNAME)) {
head.classList.add(TABLE_COLUMN_HOVER_CLASSNAME);
}
};
const onMouseLeave = (ev: MouseEvent) => {
const head = findCorrespondingTableHeadOfCell(
ev.target as HTMLTableCellElement
);
if (head.classList.contains(TABLE_COLUMN_HOVER_CLASSNAME)) {
head.classList.remove(TABLE_COLUMN_HOVER_CLASSNAME);
}
};
createRenderEffect(() => {
for (const td of e.querySelectorAll("td")) {
td.addEventListener("mouseenter", onMouseEnter);
td.addEventListener("mouseleave", onMouseLeave);
}
});
onCleanup(() => {
for (const td of e.querySelectorAll("td")) {
td.removeEventListener("mouseenter", onMouseEnter);
td.removeEventListener("mouseenter", onMouseLeave);
}
});
}
}

View file

@ -0,0 +1,152 @@
import {
createRenderEffect,
createSignal,
onCleanup,
createMemo,
untrack,
} from "solid-js";
import {
parseISO,
parse,
isSameDay,
intlFormatDistance,
intlFormat,
differenceInSeconds,
differenceInMilliseconds,
} from "date-fns";
export enum DateRefreshPercision {
seconds = 0,
minutes = 1,
hours,
days,
}
export function useCurrentDate(
percision:
| (() => DateRefreshPercision)
| DateRefreshPercision = DateRefreshPercision.minutes
) {
const [current, setCurrent] = createSignal(new Date());
const updateInterval = () => {
switch (typeof percision === "function" ? percision() : percision) {
case DateRefreshPercision.seconds:
return 1000;
case DateRefreshPercision.minutes:
return 15 * 1000;
case DateRefreshPercision.hours:
return 60 * 1000;
case DateRefreshPercision.days:
return 60 * 60 * 1000;
}
};
let id: undefined | number;
const update = () => setCurrent(new Date());
createRenderEffect(() => {
if (typeof id !== "undefined") {
window.clearInterval(id);
id = undefined;
}
const interval = updateInterval();
const now = new Date();
if (differenceInMilliseconds(now, untrack(current)) <= interval) {
update();
}
id = window.setInterval(update, interval);
});
onCleanup(() => {
if (typeof id !== "undefined") {
window.clearInterval(id);
id = undefined;
}
});
return current;
}
/** Translate the elements with time to human-readable form.
*
* @param elements
*/
export function renderLocalTimeOn(elements: Iterable<Element>) {
const [allPercisionRequired, setAllPercisionRequired] = createSignal<
DateRefreshPercision[]
>([], { equals: false });
const percision = createMemo(() => {
const arr = allPercisionRequired();
if (arr.length < 1) {
return DateRefreshPercision.hours;
}
return arr.reduce((p, c) => (p < c ? p : c));
});
const date = useCurrentDate(percision);
const starts = new Date();
let idx = 0;
for (const e of elements) {
if (!(e instanceof HTMLElement)) {
console.warn(e, "is not a html element can be rendered local time");
continue;
}
const timeFormat = e.dataset.timeFormat ?? "iso";
if (timeFormat === "local") {
continue;
}
const i = idx++;
const content = e.hasAttribute('datetime') ? e.getAttribute('datetime') : e.textContent
const rawDate =
timeFormat === "iso"
? parseISO(content)
: parse(content, timeFormat, starts);
e.dataset.raw = rawDate.toISOString();
e.dataset.timeFormat = "local";
const percisionOfRawDate = createMemo(() => {
const seconds = differenceInSeconds(date(), rawDate);
if (seconds < 60) {
return DateRefreshPercision.seconds;
} else if (seconds < 60 * 60) {
return DateRefreshPercision.minutes;
} else if (seconds < 60 * 60 * 24) {
return DateRefreshPercision.hours;
}
return DateRefreshPercision.days;
});
const fmtString = createMemo(() => {
if (isSameDay(rawDate, date())) {
return intlFormatDistance(rawDate, date());
}
return intlFormat(rawDate);
});
createRenderEffect(() => {
if (!e.hasAttribute('datetime')) {
e.setAttribute('datetime', rawDate.toISOString())
}
})
createRenderEffect(() => {
e.textContent = fmtString();
});
createRenderEffect(() => {
const p = percisionOfRawDate();
setAllPercisionRequired((x) => {
x[i] = p;
return x;
});
});
}
}

View file

13
themes/buck/tsconfig.json Normal file
View file

@ -0,0 +1,13 @@
{
"compilerOptions": {
"esModuleInterop": true,
"target": "es2020",
"module": "Node16",
"alwaysStrict": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "solid-js"
},
"include": ["src"]
}

5
themes/buck/watch.ts Normal file
View file

@ -0,0 +1,5 @@
import * as esbuild from 'esbuild'
import options from './config.js'
const ctx = await esbuild.context(options)
await ctx.watch()