1.0.0
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,268 @@
|
||||
// Original source code from: https://github.com/LIlGG/halo-theme-sakura/blob/main/src/libs/pjax.js
|
||||
|
||||
import Pjax from "pjax";
|
||||
|
||||
const pjax = new Pjax({
|
||||
elements: "a[data-pjax]",
|
||||
selectors: ["head title", ".content", ".ex-pjax"],
|
||||
switches: {
|
||||
".content": Pjax.switches.innerHTML,
|
||||
},
|
||||
cacheBust: false,
|
||||
analytics: false,
|
||||
debug: false
|
||||
});
|
||||
|
||||
let _responseText = '';
|
||||
|
||||
pjax._handleResponse = pjax.handleResponse;
|
||||
|
||||
pjax.handleResponse = function (responseText, request, href, options) {
|
||||
_responseText = responseText;
|
||||
pjax._handleResponse(responseText, request, href, options);
|
||||
};
|
||||
|
||||
function djb2(str) {
|
||||
let hash = 5381;
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
hash = ((hash << 5) + hash) + str.charCodeAt(i);
|
||||
}
|
||||
return (hash >>> 0)
|
||||
}
|
||||
|
||||
function renewElement(element) {
|
||||
const newElem = document.createElement(element.tagName);
|
||||
for (let i = 0; i < element.attributes.length; i++) {
|
||||
const attr = element.attributes[i];
|
||||
newElem.setAttribute(attr.name, attr.value);
|
||||
}
|
||||
return newElem;
|
||||
}
|
||||
|
||||
function insertStyle(dom, parentElement, selectors) {
|
||||
const existingStyles = new Set();
|
||||
|
||||
document.querySelectorAll(selectors).forEach(link => {
|
||||
existingStyles.add(link.href);
|
||||
});
|
||||
|
||||
dom.querySelectorAll(selectors).forEach(link => {
|
||||
const href = link.href;
|
||||
if (href && !existingStyles.has(href)) {
|
||||
const newLink = renewElement(link);
|
||||
parentElement.appendChild(newLink);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function insertScript(dom, parentElement, selectors) {
|
||||
const existingScripts = new Set();
|
||||
|
||||
parentElement.querySelectorAll(selectors).forEach(script => {
|
||||
existingScripts.add(script.src);
|
||||
});
|
||||
|
||||
dom.querySelectorAll(selectors).forEach(script => {
|
||||
const src = script.src;
|
||||
if (src && !existingScripts.has(src)) {
|
||||
const newScript = renewElement(script);
|
||||
parentElement.appendChild(newScript);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function insertInlineScript(dom, parentElement, selectors) {
|
||||
dom.querySelectorAll(selectors).forEach(script => {
|
||||
if (script.innerHTML.trim()) {
|
||||
let hash = djb2(script.innerHTML);
|
||||
let old = parentElement.querySelector(`script[data-hash="${hash}"]`);
|
||||
if (old) {
|
||||
parentElement.removeChild(old);
|
||||
} else {
|
||||
let scripts = parentElement.querySelectorAll('script:not([src]):not([no-pjax])');
|
||||
scripts.forEach((s) => {
|
||||
if (djb2(s.innerHTML) === hash) {
|
||||
parentElement.removeChild(s);
|
||||
}
|
||||
});
|
||||
}
|
||||
const newScript = renewElement(script);
|
||||
newScript.innerHTML = script.innerHTML;
|
||||
newScript.setAttribute("data-hash", hash);
|
||||
parentElement.appendChild(newScript);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 这个函数将请求的页面 head 中 script 和 link 都插入进来合成新页面
|
||||
function insertResourcesToHead(dom, parentElement) {
|
||||
insertStyle(dom, parentElement, 'head link[rel="stylesheet"]:not([no-pjax])');
|
||||
insertScript(dom, parentElement, 'head script[src]:not([no-pjax])');
|
||||
insertInlineScript(dom, parentElement, 'head script:not([src]):not([no-pjax])');
|
||||
}
|
||||
|
||||
// 这个函数将请求的页面 footer 中 script 和 link 都插入进来合成新页面
|
||||
function insertResourcesToFooter(dom, parentElement) {
|
||||
insertStyle(dom, parentElement, 'footer link[rel="stylesheet"][data-pjax]:not([no-pjax])');
|
||||
insertScript(dom, parentElement, 'footer script[src][data-pjax]:not([no-pjax])');
|
||||
insertInlineScript(dom, parentElement, 'footer script:not([src])[data-pjax]:not([no-pjax])');
|
||||
}
|
||||
|
||||
// 处理请求的页面新增样式和脚本
|
||||
function processNewScripts(responseText) {
|
||||
const parser = new DOMParser();
|
||||
const dom = parser.parseFromString(responseText, 'text/html');
|
||||
insertResourcesToHead(dom, document.head);
|
||||
let footer = document.querySelector('footer');
|
||||
if (!footer) {
|
||||
return;
|
||||
}
|
||||
insertResourcesToFooter(dom, footer);
|
||||
}
|
||||
|
||||
const originalAddEventListener = EventTarget.prototype.addEventListener;
|
||||
|
||||
EventTarget.prototype.addEventListener = function (type, listener, options) {
|
||||
if (type === "DOMContentLoaded") {
|
||||
if (listener) {
|
||||
window.addEventListener(
|
||||
"pjax:success",
|
||||
() => {
|
||||
retry(() => listener(), 10, 100);
|
||||
},
|
||||
{
|
||||
once: true,
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
originalAddEventListener.call(this, type, listener, options);
|
||||
};
|
||||
|
||||
// 刷新 script, 以及重新刷新主题注册的函数
|
||||
document.addEventListener("pjax:complete", function () {
|
||||
// 处理头和尾有新增的情况
|
||||
processNewScripts(_responseText);
|
||||
// 处理替换的内容中存在脚本的情况
|
||||
let pjaxDoms = document.querySelectorAll(".content script[data-pjax]:not([no-pjax])");
|
||||
pjaxDoms.forEach((element) => {
|
||||
let code = element.text || element.textContent || element.innerHTML || "";
|
||||
let parent = element.parentNode;
|
||||
if (parent === null) {
|
||||
return;
|
||||
}
|
||||
parent.removeChild(element);
|
||||
let script = renewElement(element);
|
||||
if (code !== "") {
|
||||
script.appendChild(document.createTextNode(code));
|
||||
}
|
||||
parent.appendChild(script);
|
||||
});
|
||||
// 刷新注册的函数
|
||||
window.terminal.refresh();
|
||||
});
|
||||
|
||||
window.addEventListener("pjax:error", (event) => {
|
||||
const request = event.request
|
||||
if (request.status === 404 || request.status === 500) {
|
||||
window.location.href = request.responseURL;
|
||||
}
|
||||
});
|
||||
|
||||
pjax.doRequest = function (location, options, callback) {
|
||||
options = options || {};
|
||||
let queryString;
|
||||
const requestOptions = options.requestOptions || {};
|
||||
const requestMethod = (requestOptions.requestMethod || "GET").toUpperCase();
|
||||
const requestParams = requestOptions.requestParams || null;
|
||||
const formData = requestOptions.formData || null;
|
||||
let requestPayload = null;
|
||||
const request = new XMLHttpRequest();
|
||||
const timeout = options.timeout || 0;
|
||||
|
||||
request.onreadystatechange = function () {
|
||||
if (request.readyState === 4) {
|
||||
if (request.status === 200) {
|
||||
callback(request.responseText, request, location, options);
|
||||
} else if (request.status !== 0) {
|
||||
callback(null, request, location, options);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
request.onerror = function (e) {
|
||||
console.log(e);
|
||||
callback(null, request, location, options);
|
||||
};
|
||||
|
||||
request.ontimeout = function () {
|
||||
callback(null, request, location, options);
|
||||
};
|
||||
|
||||
if (requestParams && requestParams.length) {
|
||||
queryString = requestParams
|
||||
.map(function (param) {
|
||||
return param.name + "=" + param.value;
|
||||
})
|
||||
.join("&");
|
||||
|
||||
switch (requestMethod) {
|
||||
case "GET":
|
||||
location = location.split("?")[0];
|
||||
|
||||
location += "?" + queryString;
|
||||
break;
|
||||
|
||||
case "POST":
|
||||
requestPayload = queryString;
|
||||
break;
|
||||
}
|
||||
} else if (formData) {
|
||||
requestPayload = formData;
|
||||
}
|
||||
|
||||
if (options.cacheBust) {
|
||||
location = updateQueryString(location, "t", Date.now());
|
||||
}
|
||||
|
||||
request.open(requestMethod, location, true);
|
||||
request.timeout = timeout;
|
||||
request.setRequestHeader("X-Requested-With", "XMLHttpRequest");
|
||||
request.setRequestHeader("X-PJAX", "true");
|
||||
request.setRequestHeader("X-PJAX-Selectors", JSON.stringify(options.selectors));
|
||||
request.setRequestHeader("accept", "text/html, application/json, text/plain, */*");
|
||||
request.withCredentials = true;
|
||||
|
||||
// 发送 POST 表单
|
||||
if (requestPayload && requestMethod === "POST" && !formData) {
|
||||
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
}
|
||||
|
||||
request.send(requestPayload);
|
||||
|
||||
return request;
|
||||
};
|
||||
|
||||
const updateQueryString = (uri, key, value) => {
|
||||
const re = new RegExp(`([?&])${key}=.*?(&|$)`, "i");
|
||||
const separator = uri.includes("?") ? "&" : "?";
|
||||
return uri.match(re)
|
||||
? uri.replace(re, `$1${key}=${value}$2`)
|
||||
: uri + separator + key + "=" + value;
|
||||
};
|
||||
|
||||
|
||||
async function retry(promiseFn, maxRetries = 3, interval = 1000) {
|
||||
try {
|
||||
return await promiseFn();
|
||||
} catch (error) {
|
||||
if (maxRetries > 0) {
|
||||
await new Promise((resolve) => setTimeout(resolve, interval));
|
||||
return await retry(promiseFn, maxRetries - 1, interval);
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import {terminal} from "./terminal.js";
|
||||
import './styles/style.scss';
|
||||
import './module/post.js'
|
||||
import './module/toggle.js'
|
||||
import './module/effect.js'
|
||||
|
||||
terminal.refresh();
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
function type() {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
let typedTextContainer = document.querySelector('.typed-text');
|
||||
if (!typedTextContainer) {
|
||||
return;
|
||||
}
|
||||
|
||||
function typeWriter(container) {
|
||||
let text = container.innerText;
|
||||
container.innerText = '';
|
||||
let i = 0;
|
||||
|
||||
function _type() {
|
||||
if (i < text.length) {
|
||||
container.innerHTML += text.charAt(i);
|
||||
i++;
|
||||
setTimeout(_type, Math.random() * 200 + 50);
|
||||
}
|
||||
}
|
||||
|
||||
_type();
|
||||
}
|
||||
|
||||
typeWriter(typedTextContainer);
|
||||
})
|
||||
}
|
||||
|
||||
terminal.registerRefresh(type);
|
||||
@@ -0,0 +1,82 @@
|
||||
import tocbot from "tocbot";
|
||||
|
||||
async function generateToc() {
|
||||
const toc = document.querySelector(".toc");
|
||||
if (!toc) return;
|
||||
const content = document.getElementById("content");
|
||||
const titles = content.querySelectorAll("h1, h2, h3, h4");
|
||||
if (!titles || titles.length === 0) {
|
||||
toc.style.display = "none";
|
||||
toc.remove();
|
||||
return;
|
||||
} else {
|
||||
toc.style.display = "block";
|
||||
}
|
||||
if (typeof tocbot !== 'undefined') {
|
||||
tocbot.destroy();
|
||||
tocbot.init({
|
||||
tocSelector: ".toc",
|
||||
contentSelector: "#content",
|
||||
headingSelector: "h1, h2, h3, h4",
|
||||
extraListClasses: "toc-list",
|
||||
extraLinkClasses: "toc-link",
|
||||
headingsOffset: 96,
|
||||
scrollSmoothOffset: -96,
|
||||
scrollSmooth: true,
|
||||
});
|
||||
}
|
||||
void locateToc();
|
||||
}
|
||||
|
||||
async function locateToc() {
|
||||
const toc = document.querySelector(".toc")
|
||||
if (!toc) return;
|
||||
const content = document.getElementById("content");
|
||||
const contentRight = content.getBoundingClientRect().right;
|
||||
if (toc && contentRight) {
|
||||
toc.style.left = `${contentRight}px`;
|
||||
}
|
||||
}
|
||||
|
||||
function destroyToc() {
|
||||
const toc = document.querySelector(".toc")
|
||||
if (!toc) return;
|
||||
toc.style.display = "none";
|
||||
toc.remove();
|
||||
if (typeof tocbot !== 'undefined') {
|
||||
tocbot.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
async function init_toc() {
|
||||
void generateToc();
|
||||
void locateToc();
|
||||
|
||||
let resizeTimer;
|
||||
let isVisible = true;
|
||||
|
||||
document.addEventListener('visibilitychange', () => {
|
||||
isVisible = !document.hidden;
|
||||
});
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
if (!isVisible) return;
|
||||
|
||||
clearTimeout(resizeTimer);
|
||||
resizeTimer = setTimeout(() => {
|
||||
requestAnimationFrame(() => {
|
||||
locateToc();
|
||||
});
|
||||
}, 200);
|
||||
});
|
||||
}
|
||||
|
||||
function register_toc() {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
void init_toc();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
terminal.registerRefresh(generateToc);
|
||||
terminal.registerInitFunc(register_toc);
|
||||
@@ -0,0 +1,47 @@
|
||||
function register_themeToggle() {
|
||||
const toggle = document.getElementById("theme-toggle");
|
||||
let storedMode = localStorage.getItem("theme-mode");
|
||||
|
||||
if (!storedMode) {
|
||||
localStorage.setItem("theme-mode", default_mode);
|
||||
storedMode = default_mode;
|
||||
}
|
||||
|
||||
const targetTheme = storedMode === "light" ? light_theme : dark_theme;
|
||||
|
||||
document.documentElement.setAttribute("data-color-scheme", storedMode);
|
||||
document.documentElement.setAttribute("theme-color-scheme", targetTheme);
|
||||
|
||||
toggle.addEventListener("click", function () {
|
||||
const nextMode = storedMode === "dark" ? "light" : "dark";
|
||||
const nextTheme = nextMode === "dark" ? dark_theme : light_theme;
|
||||
|
||||
document.documentElement.setAttribute("data-color-scheme", nextMode);
|
||||
document.documentElement.setAttribute("theme-color-scheme", nextTheme);
|
||||
localStorage.setItem("theme-mode", nextMode);
|
||||
|
||||
storedMode = nextMode;
|
||||
});
|
||||
}
|
||||
|
||||
function register_pixelToggle() {
|
||||
const pixel_toggle = document.getElementById('pixel-toggle');
|
||||
let storedStatus = localStorage.getItem("pixel_style");
|
||||
if (!storedStatus) {
|
||||
localStorage.setItem("pixel_style", pixel_status);
|
||||
storedStatus = pixel_status.toString();
|
||||
}
|
||||
|
||||
document.documentElement.setAttribute("pixel_style", storedStatus);
|
||||
|
||||
pixel_toggle.addEventListener('click', function () {
|
||||
let newStatus = storedStatus === 'true' ? 'false' : 'true';
|
||||
document.documentElement.setAttribute("pixel_style", newStatus);
|
||||
localStorage.setItem("pixel_style", newStatus);
|
||||
|
||||
storedStatus = newStatus;
|
||||
});
|
||||
}
|
||||
|
||||
terminal.registerInitFunc(register_pixelToggle);
|
||||
terminal.registerInitFunc(register_themeToggle);
|
||||
@@ -0,0 +1,84 @@
|
||||
.button-container {
|
||||
display: table;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
button,
|
||||
.button,
|
||||
a.button {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px 18px;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
font: inherit;
|
||||
font-weight: bold;
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button.outline,
|
||||
.button.outline,
|
||||
a.button.outline {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
padding: 8px 18px;
|
||||
}
|
||||
|
||||
button.outline :hover,
|
||||
.button.outline :hover,
|
||||
a.button.outline :hover {
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
button.link,
|
||||
.button.link,
|
||||
a.button.link {
|
||||
background: none;
|
||||
font-size: var(--font-size);
|
||||
}
|
||||
|
||||
button.small,
|
||||
.button.small,
|
||||
a.button.small {
|
||||
font-size: calc(var(--font-size) * 0.8);
|
||||
}
|
||||
|
||||
button.wide,
|
||||
.button.wide,
|
||||
a.button.wide {
|
||||
min-width: 200px;
|
||||
padding: 14px 24px;
|
||||
}
|
||||
|
||||
a.button.inline {
|
||||
background: none;
|
||||
color: var(--color-theme-accent);
|
||||
padding: initial;
|
||||
margin: initial;
|
||||
border: initial;
|
||||
font-weight: initial;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.button.inline:active,
|
||||
a.button.inline:hover {
|
||||
background: none;
|
||||
}
|
||||
|
||||
a.read-more,
|
||||
a.read-more:hover,
|
||||
a.read-more:active {
|
||||
display: inline-flex;
|
||||
border: none;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
max-width: 100%;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
comment-widget {
|
||||
--halo-comment-widget-base-font-family: var(--font-theme-default) !important;
|
||||
--halo-comment-widget-base-border-radius: 0 !important;
|
||||
--halo-comment-widget-base-color: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-base-info-color: var(--color-theme-foreground) !important;
|
||||
--halo-comment-widget-component-form-input-bg-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-input-color: var(--color-theme-foreground) !important;
|
||||
--halo-comment-widget-component-form-input-border-color: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-form-input-border-color-focus: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-form-input-box-shadow-focus: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-form-button-login-bg-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-login-bg-color-hover: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-login-border-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-submit-bg-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-submit-color: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-form-button-submit-border-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-submit-border-color-hover: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-emoji-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-comment-item-action-bg-color-hover: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-comment-item-action-color-hover: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-pagination-button-bg-color-hover: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-pagination-button-bg-color-active: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-pagination-button-border-color-active: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-emoji-picker-rgb-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-emoji-picker-rgb-accent: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-emoji-picker-rgb-background: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-emoji-picker-rgb-input: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-emoji-picker-color-border: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-emoji-picker-color-border-over: var(--color-theme-background) !important;
|
||||
}
|
||||
|
||||
.comment {
|
||||
margin-top: 80px;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
src: local('JetBrains Mono'), local('JetBrainsMono Nerd Font'), url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
|
||||
font-display: swap;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Fusion Pixel 12px P zh_hans';
|
||||
font-display: swap;
|
||||
src: url("../fonts/fusion-pixel-12px-proportional-zh_hans.woff2") format('woff2');
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
@import "variables";
|
||||
|
||||
.footer {
|
||||
padding: 40px 0;
|
||||
flex-grow: 0;
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
.footer-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
gap: 12px;
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
.footer-copyright-engine {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.footer-copyright-engine span,
|
||||
.footer-copyright-engine a {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
.footer-copyright-site {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.footer-user {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.footer-icp p {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.footer-inner {
|
||||
padding: 15px 10px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.footer-copyright-engine {
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.footer-copyright-site {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.footer-icp p {
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.footer-inner {
|
||||
padding: 12px 8px;
|
||||
}
|
||||
|
||||
.footer-copyright-engine,
|
||||
.footer-copyright-site {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.footer-copyright-engine span,
|
||||
.footer-copyright-engine a {
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
.header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header__inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
#theme-toggle, #search-button, #pixel-toggle {
|
||||
background-color: transparent;
|
||||
color: var(--color-theme-header);
|
||||
border-color: var(--color-theme-header);
|
||||
margin: 0 0 0 .5rem;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.header__logo {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.header__logo::after {
|
||||
content: "";
|
||||
background: repeating-linear-gradient(90deg, var(--color-theme-header), var(--color-theme-header) 2px, transparent 0, transparent 10px);
|
||||
display: block;
|
||||
width: 100%;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.header__logo a {
|
||||
flex: 0 0 auto;
|
||||
max-width: 100%;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
background: var(--color-theme-header);
|
||||
color: var(--color-theme-background);
|
||||
font-weight: bold;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.header {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
.icon-pixel,
|
||||
.icon-regular {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html[pixel_style='false'] .icon-regular {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
html[pixel_style='true'] .icon-pixel {
|
||||
display: inline;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
.link-section {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.link-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.link-item {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.link-item:hover {
|
||||
background-color: var(--color-theme-background);
|
||||
}
|
||||
|
||||
.link-container {
|
||||
display: flex;
|
||||
padding: 0.25rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.link-logo {
|
||||
width: 4rem;
|
||||
height: auto;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.link-content {
|
||||
margin-left: 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
min-height: 4rem;
|
||||
}
|
||||
|
||||
.link-title {
|
||||
margin: 0;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.link-url {
|
||||
color: var(--color-theme-accent);
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.link-description {
|
||||
margin: 0;
|
||||
color: var(--color-theme-foreground);
|
||||
font-size: 0.9em;
|
||||
line-height: 1.4;
|
||||
}
|
||||
@@ -0,0 +1,534 @@
|
||||
@import "variables";
|
||||
|
||||
:root {
|
||||
--color-theme-background: ;
|
||||
--color-theme-foreground: ;
|
||||
--color-theme-accent: ;
|
||||
--color-theme-tag: ;
|
||||
--color-theme-title: ;
|
||||
--color-theme-meta: ;
|
||||
--color-theme-framed: ;
|
||||
--color-theme-menu: ;
|
||||
--color-theme-header: ;
|
||||
--list-marker: "►";
|
||||
--font-size: 1rem;
|
||||
--line-height: 1.54em;
|
||||
--radius: 0;
|
||||
--font-theme-default: 'JetBrains Mono';
|
||||
--font--theme-fallback: Monaco, Consolas, -apple-system, BlinkMacSystemFont, 'segoe ui',
|
||||
Roboto, Oxygen, Ubuntu, Cantarell, 'open sans', 'helvetica neue';
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
--font-size: 0.95rem;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
scrollbar-gutter: stable;
|
||||
}
|
||||
|
||||
html[pixel_style='true'] {
|
||||
--font-theme-default: 'Fusion Pixel 12px P zh_hans';
|
||||
}
|
||||
|
||||
* {
|
||||
scrollbar-width: thin !important;
|
||||
scrollbar-color: rgba(134, 134, 134, 0.45) rgba(255, 255, 255, 0);
|
||||
font-variant-ligatures: none;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: inherit;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: var(--font-theme-default), var(--font--theme-fallback), sans-serif;
|
||||
font-size: var(--font-size);
|
||||
line-height: var(--line-height);
|
||||
background-color: var(--color-theme-background);
|
||||
color: var(--color-theme-foreground);
|
||||
text-rendering: optimizelegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: calc(var(--font-size) * 1.45);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: calc(var(--font-size) * 1.35);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: calc(var(--font-size) * 1.15);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-size: calc(var(--font-size) * 1);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
p,
|
||||
ul,
|
||||
ol,
|
||||
img,
|
||||
figure,
|
||||
video,
|
||||
table {
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-theme-accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
button {
|
||||
position: relative;
|
||||
font: inherit;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
background: transparent;
|
||||
color: var(--color-theme-accent);
|
||||
padding: 5px 18px;
|
||||
border: 4px solid var(--color-theme-accent);
|
||||
border-radius: var(--radius);
|
||||
transition: background 0.15s linear;
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background: color-mix(in srgb, var(--color-theme-accent) 15%, transparent);
|
||||
}
|
||||
|
||||
button:focus-visible,
|
||||
a:focus-visible {
|
||||
outline: 1px solid var(--color-theme-accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
display: inline-block;
|
||||
border: 2px solid var(--color-theme-foreground);
|
||||
border-radius: calc(var(--radius) * 1.6);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
fieldset *:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
fieldset input,
|
||||
fieldset select,
|
||||
fieldset textarea,
|
||||
fieldset label,
|
||||
fieldset button {
|
||||
margin-top: calc(var(--line-height) * 0.5);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
label input {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
textarea,
|
||||
select {
|
||||
background: transparent;
|
||||
color: var(--color-theme-foreground);
|
||||
border: 1px solid var(--color-theme-foreground);
|
||||
border-radius: var(--radius);
|
||||
padding: 10px;
|
||||
font: inherit;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
input:focus-visible,
|
||||
input:active,
|
||||
textarea:focus-visible,
|
||||
textarea:active,
|
||||
select:focus-visible,
|
||||
select:active {
|
||||
border-color: var(--color-theme-accent);
|
||||
outline: 1px solid var(--color-theme-accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
input:active,
|
||||
textarea:active,
|
||||
select:active {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
select {
|
||||
background-image: linear-gradient(
|
||||
45deg,
|
||||
transparent 50%,
|
||||
var(--color-theme-foreground) 50%
|
||||
),
|
||||
linear-gradient(135deg, var(--color-theme-foreground) 50%, transparent 50%);
|
||||
background-position: calc(100% - 20px), calc(100% - 1em);
|
||||
background-size: 5px 5px, 5px 5px;
|
||||
background-repeat: no-repeat;
|
||||
padding-right: 40px;
|
||||
}
|
||||
|
||||
select option {
|
||||
background: var(--color-theme-background);
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
vertical-align: middle;
|
||||
padding: 10px;
|
||||
box-shadow: inset 0 0 0 3px var(--color-theme-background);
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked {
|
||||
background: var(--color-theme-accent);
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
border: 4px solid var(--color-theme-accent);
|
||||
border-radius: var(--radius);
|
||||
padding: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
img.left {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
img.center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
img.right {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
figure {
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
figure.left {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
figure.center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
figure.right {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
figure img,
|
||||
figure video {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
figure figcaption {
|
||||
background: var(--color-theme-accent);
|
||||
color: var(--color-theme-background);
|
||||
text-align: center;
|
||||
font-size: var(--font-size);
|
||||
font-weight: normal;
|
||||
margin-top: -8px;
|
||||
padding: 0 8px;
|
||||
border-radius: 0 0 var(--radius) var(--radius);
|
||||
}
|
||||
|
||||
figure figcaption p:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
margin-left: 4ch;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul ul,
|
||||
ul ol,
|
||||
ol ul,
|
||||
ol ol {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
li::marker {
|
||||
color: var(--color-theme-accent);
|
||||
}
|
||||
|
||||
ul li,
|
||||
ol li {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
code,
|
||||
kbd {
|
||||
font-family: inherit !important;
|
||||
font-feature-settings: normal;
|
||||
background: color-mix(in srgb, var(--color-theme-foreground) 5%, transparent);
|
||||
border: 1px solid var(--code-border);
|
||||
padding: 1px 6px;
|
||||
margin: 0 2px;
|
||||
font-size: calc(var(--font-size) * 0.95);
|
||||
}
|
||||
|
||||
kbd {
|
||||
border-top: 1px solid color-mix(in srgb, var(--color-theme-accent) 25%, transparent);
|
||||
border-left: 1px solid var(--color-theme-accent);
|
||||
border-right: 1px solid var(--color-theme-accent);
|
||||
border-bottom: 4px solid var(--color-theme-accent);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
code code {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: inherit !important;
|
||||
tab-size: 4;
|
||||
background: color-mix(in srgb, var(--color-theme-foreground) 5%, transparent) !important;
|
||||
color: var(--color-theme-foreground);
|
||||
padding: 10px 10px;
|
||||
font-size: calc(var(--font-size) * 0.95) !important;
|
||||
overflow: auto;
|
||||
border-radius: var(--radius);
|
||||
border: 1px solid color-mix(in srgb, var(--color-theme-foreground) 10%, transparent);
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
pre code {
|
||||
background: none !important;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
sup {
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
abbr {
|
||||
position: relative;
|
||||
text-decoration-style: wavy;
|
||||
text-decoration-color: var(--color-theme-accent);
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.25em;
|
||||
}
|
||||
|
||||
mark {
|
||||
background: color-mix(in srgb, var(--color-theme-accent) 45%, transparent);
|
||||
color: var(--color-theme-foreground);
|
||||
}
|
||||
|
||||
blockquote {
|
||||
position: relative;
|
||||
border-top: 1px solid var(--color-theme-foreground);
|
||||
border-bottom: 1px solid var(--color-theme-foreground);
|
||||
border-left: .4rem solid var(--color-theme-foreground);
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
blockquote p:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
blockquote p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
table-layout: auto;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
border: 2px solid var(--color-theme-foreground);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
th {
|
||||
border-style: solid;
|
||||
color: var(--color-theme-foreground);
|
||||
text-align: left;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
hr {
|
||||
width: 100%;
|
||||
border: none;
|
||||
background: var(--color-theme-accent);
|
||||
height: 2px;
|
||||
}
|
||||
|
||||
/* One Heading Size */
|
||||
.headings--one-size h1,
|
||||
.headings--one-size h2,
|
||||
.headings--one-size h3,
|
||||
.headings--one-size h4,
|
||||
.headings--one-size h5,
|
||||
.headings--one-size h6 {
|
||||
font-size: 1.4rem;
|
||||
line-height: 1.3;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.headings--one-size ~ h1:first-child,
|
||||
.headings--one-size ~ h2:first-child,
|
||||
.headings--one-size ~ h3:first-child,
|
||||
.headings--one-size ~ h4:first-child,
|
||||
.headings--one-size ~ h5:first-child,
|
||||
.headings--one-size ~ h6:first-child {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
blockquote.twitter-tweet {
|
||||
position: relative;
|
||||
background: var(--color-theme-background);
|
||||
font: inherit;
|
||||
color: inherit;
|
||||
border: 1px solid var(--color-theme-accent);
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
blockquote.twitter-tweet a {
|
||||
color: var(--color-theme-accent);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
blockquote.twitter-tweet::before {
|
||||
content: "> From X:";
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
left: 20px;
|
||||
color: var(--color-theme-accent);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 40px;
|
||||
max-width: 864px;
|
||||
min-height: 100vh;
|
||||
border-right: 1px solid color-mix(in srgb, var(--color-theme-accent) 10%, transparent);
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.container.full, .container.center {
|
||||
border: none;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.container.full {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.__h_video {
|
||||
position: relative;
|
||||
overflow: visible !important;
|
||||
height: auto !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.__h_video a {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.__h_video a img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.__h_video a .play {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
iframe[src*="youtube.com"] {
|
||||
border: 8px solid var(--color-theme-accent) !important;
|
||||
padding: 8px !important;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.container {
|
||||
display: initial;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: initial;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
@import "variables";
|
||||
|
||||
.navigation-menu {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
margin: 20px 1px;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: var(--color-theme-menu);
|
||||
}
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navigation-menu__inner {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-wrap: wrap;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
li:not(:last-of-type) {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.navigation-menu__inner li {
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navigation-menu__inner > li {
|
||||
flex: 0 0 auto;
|
||||
margin-bottom: 10px;
|
||||
white-space: nowrap;
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.navigation-menu__inner > li:not(:last-of-type) {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.navigation-menu .spacer {
|
||||
flex-grow: 1 !important;
|
||||
}
|
||||
|
||||
.menu {
|
||||
display: flex;
|
||||
position: relative;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.menu__trigger {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
background-color: var(--color-theme-background) !important;
|
||||
margin-right: 0 !important;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
color: var(--color-theme-menu);
|
||||
user-select: none;
|
||||
border: none;
|
||||
display: inline-flex;
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0 !important;
|
||||
outline: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.menu__dropdown {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
background: var(--color-theme-background);
|
||||
box-shadow: 0 10px var(--color-theme-background), -10px 10px var(--color-theme-background), 10px 10px var(--color-theme-background);
|
||||
color: var(--color-theme-accent);
|
||||
border: 2px solid var(--color-theme-menu);
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
top: 25px;
|
||||
list-style: none;
|
||||
z-index: 99;
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.menu__dropdown > li {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.menu__dropdown > li:not(:last-of-type) {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.menu__dropdown > li a {
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.sub-menu:hover .menu__dropdown,
|
||||
.sub-menu:active .menu__dropdown {
|
||||
display: flex !important;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
.moment-media {
|
||||
display: grid;
|
||||
gap: 0.5rem;
|
||||
margin: 1rem 0;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.moment-media video {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
@import "variables";
|
||||
|
||||
.pagination {
|
||||
margin-top: 10px;
|
||||
|
||||
.pagination__title {
|
||||
display: flex;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
margin: 10px 0 10px;
|
||||
}
|
||||
|
||||
.pagination__title-h {
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
padding: 5px 10px;
|
||||
background: var(--color-theme-background);
|
||||
color: color-mix(in srgb, var(--color-theme-foreground) 65%, transparent);
|
||||
font-size: calc(var(--font-size) * 0.8);
|
||||
text-transform: uppercase;
|
||||
text-decoration: none;
|
||||
letter-spacing: 0.1em;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.pagination__title hr {
|
||||
position: absolute;
|
||||
background-color: var(--color-theme-foreground);
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
margin-top: 15px;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.pagination__buttons {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
|
||||
@media (min-width: calc(#{$phone-max-width} + 1px)) {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
span {
|
||||
display: flex;
|
||||
|
||||
@media (min-width: calc(#{$phone-max-width} + 1px)) {
|
||||
&:first-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
&:last-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
max-width: 100%;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-decoration: none;
|
||||
color: var(--color-theme-foreground);
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.button {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
font-size: inherit;
|
||||
padding: 0;
|
||||
appearance: none;
|
||||
}
|
||||
}
|
||||
|
||||
.button__text {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.next .button__icon {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.prev .button__icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.pagination__buttons:has(span:only-child) {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
.pagination {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
@import "variables";
|
||||
|
||||
.index-content {
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
.framed {
|
||||
border: 1px solid var(--color-theme-framed);
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.framed *:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.framed *:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.posts {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.post {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 30px 0;
|
||||
}
|
||||
|
||||
.post:not(:last-of-type) {
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--color-theme-foreground) 10%, transparent);
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
font-size: inherit;
|
||||
margin-bottom: 10px;
|
||||
color: color-mix(in srgb, var(--color-theme-meta) 65%, transparent);
|
||||
}
|
||||
|
||||
.post-meta > *:not(:first-child)::before {
|
||||
content: "::";
|
||||
display: inline-block;
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
||||
.post-title {
|
||||
position: relative;
|
||||
color: var(--color-theme-title);
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 15px !important;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 3px dotted var(--color-theme-accent);
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.post-title::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 2px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
border-bottom: 3px dotted var(--color-theme-accent);
|
||||
}
|
||||
|
||||
.post-title a {
|
||||
text-decoration: none;
|
||||
color: var(--color-theme-title);
|
||||
}
|
||||
|
||||
.post-tags {
|
||||
display: block;
|
||||
margin-bottom: 20px;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.post-tag {
|
||||
color: var(--color-theme-tag);
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
.table-of-contents {
|
||||
margin: 40px 0;
|
||||
}
|
||||
|
||||
.post-content {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.post-cover {
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
.post ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.post ul li:not(:empty)::before {
|
||||
content: var(--list-marker);
|
||||
position: absolute;
|
||||
left: -20px;
|
||||
color: var(--color-theme-foreground);
|
||||
}
|
||||
|
||||
.post--regulation h1 {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.post--regulation h2 {
|
||||
justify-content: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.post--regulation h2 + h2 {
|
||||
margin-top: -10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.hanchor {
|
||||
position: absolute;
|
||||
color: var(--color-theme-accent);
|
||||
text-decoration: none;
|
||||
margin-left: 10px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
h1:hover .hanchor,
|
||||
h2:hover .hanchor,
|
||||
h3:hover .hanchor,
|
||||
h4:hover .hanchor,
|
||||
h5:hover .hanchor,
|
||||
h6:hover .hanchor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.footnotes {
|
||||
color: color-mix(in srgb, var(--color-theme-foreground) 50%, transparent);
|
||||
}
|
||||
|
||||
.footnotes hr {
|
||||
background: color-mix(in srgb, var(--color-theme-foreground) 50%, transparent);
|
||||
}
|
||||
|
||||
.post-list {
|
||||
|
||||
padding: .25rem 0;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
.post-cover {
|
||||
padding: 10px;
|
||||
border-width: 10px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
search-modal {
|
||||
--halo-search-widget-base-font-family: var(--font-theme-default) !important;
|
||||
--halo-search-widget-base-bg-color: var(--color-theme-background) !important;
|
||||
--halo-search-widget-primary-color: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-muted-color: var(--color-theme-foreground) !important;
|
||||
--halo-search-widget-content-color: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-hit-bg-color: var(--color-theme-background) !important;
|
||||
--halo-search-widget-modal-bg-color: var(--color-theme-background) !important;
|
||||
--halo-search-widget-modal-layer-color: #000000cc !important;
|
||||
--halo-search-widget-divider-color: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-kbd-border-color: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-kbd-shadow: none !important;
|
||||
--halo-search-widget-color-form-input-bg: var(--color-theme-background) !important;
|
||||
--halo-search-widget-color-form-input: var(--color-theme-foreground);
|
||||
--halo-search-widget-color-form-input-placeholder: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-form-divider: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-result-empty: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-result-item-bg: var(--color-theme-background) !important;
|
||||
--halo-search-widget-color-result-item-hover-bg: var(--color-theme-background) !important;
|
||||
--halo-search-widget-color-result-item-title: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-result-item-content: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-command-kbd-item: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-command-kbd-borde: var(--color-theme-accent) !important;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
@import "buttons";
|
||||
@import "comment";
|
||||
@import "fonts";
|
||||
@import "footer";
|
||||
@import "header";
|
||||
@import "icons";
|
||||
@import "links";
|
||||
@import "main";
|
||||
@import "menu";
|
||||
@import "moment";
|
||||
@import "pagination";
|
||||
@import "post";
|
||||
@import "search";
|
||||
@import "theme";
|
||||
@import "toc";
|
||||
@import "typed-text";
|
||||
@@ -0,0 +1,121 @@
|
||||
html[theme-color-scheme='day'] {
|
||||
--color-theme-background: #f4f4f4;
|
||||
--color-theme-foreground: #3e3e3e;
|
||||
--color-theme-accent: #003e8a;
|
||||
--color-theme-tag: #07962a;
|
||||
--color-theme-title: #003e8a;
|
||||
--color-theme-meta: #2e6cba;
|
||||
--color-theme-framed: #970b16;
|
||||
--color-theme-menu: #3e3e3e;
|
||||
--color-theme-header: #3e3e3e;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='night'] {
|
||||
--color-theme-background: #101216;
|
||||
--color-theme-foreground: #8b949e;
|
||||
--color-theme-accent: #6ca4f8;
|
||||
--color-theme-tag: #56d364;
|
||||
--color-theme-title: #6ca4f8;
|
||||
--color-theme-meta: #6ca4f8;
|
||||
--color-theme-framed: #f78166;
|
||||
--color-theme-menu: #8b949e;
|
||||
--color-theme-header: #8b949e;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='niello'] {
|
||||
--color-theme-background: #1a170f;
|
||||
--color-theme-foreground: #eceae5;
|
||||
--color-theme-accent: #eec35e;
|
||||
--color-theme-tag: #eec35e;
|
||||
--color-theme-title: #eec35e;
|
||||
--color-theme-meta: #eceae5;
|
||||
--color-theme-framed: #eec35e;
|
||||
--color-theme-menu: #eec35e;
|
||||
--color-theme-header: #eec35e;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='matrix'] {
|
||||
--color-theme-background: #000000;
|
||||
--color-theme-foreground: #4eee85;
|
||||
--color-theme-accent: #4eee85;
|
||||
--color-theme-tag: #4eee85;
|
||||
--color-theme-title: #4eee85;
|
||||
--color-theme-meta: #4eee85;
|
||||
--color-theme-framed: #4eee85;
|
||||
--color-theme-menu: #4eee85;
|
||||
--color-theme-header: #4eee85;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='ink'] {
|
||||
--color-theme-background: #000000;
|
||||
--color-theme-foreground: #FFFFFF;
|
||||
--color-theme-accent: #FFFFFF;
|
||||
--color-theme-tag: #FFFFFF;
|
||||
--color-theme-title: #FFFFFF;
|
||||
--color-theme-meta: #FFFFFF;
|
||||
--color-theme-framed: #FFFFFF;
|
||||
--color-theme-menu: #FFFFFF;
|
||||
--color-theme-header: #FFFFFF;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='hopbush'] {
|
||||
--color-theme-background: #fff6f6;
|
||||
--color-theme-foreground: #462d2d;
|
||||
--color-theme-accent: #cc6099;
|
||||
--color-theme-tag: #cc6099;
|
||||
--color-theme-title: #cc6099;
|
||||
--color-theme-meta: #462d2d;
|
||||
--color-theme-framed: #cc6099;
|
||||
--color-theme-menu: #cc6099;
|
||||
--color-theme-header: #cc6099;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='pistachio'] {
|
||||
--color-theme-background: #1d2021;
|
||||
--color-theme-foreground: #ebdbb2;
|
||||
--color-theme-accent: #8ec07c;
|
||||
--color-theme-tag: #8ec07c;
|
||||
--color-theme-title: #8ec07c;
|
||||
--color-theme-meta: #ebdbb2;
|
||||
--color-theme-framed: #8ec07c;
|
||||
--color-theme-menu: #8ec07c;
|
||||
--color-theme-header: #8ec07c;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='blue'] {
|
||||
--color-theme-background: #153489;
|
||||
--color-theme-foreground: #eceae5;
|
||||
--color-theme-accent: #5ea5ee;
|
||||
--color-theme-tag: #5ea5ee;
|
||||
--color-theme-title: #5ea5ee;
|
||||
--color-theme-meta: #eceae5;
|
||||
--color-theme-framed: #5ea5ee;
|
||||
--color-theme-menu: #5ea5ee;
|
||||
--color-theme-header: #5ea5ee;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='vanilla'] {
|
||||
--color-theme-background: #fff4f2;
|
||||
--color-theme-foreground: #424140;
|
||||
--color-theme-accent: #8f6a5e;
|
||||
--color-theme-tag: #8f6a5e;
|
||||
--color-theme-title: #8f6a5e;
|
||||
--color-theme-meta: #424140;
|
||||
--color-theme-framed: #8f6a5e;
|
||||
--color-theme-menu: #8f6a5e;
|
||||
--color-theme-header: #8f6a5e;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='studio'] {
|
||||
--color-theme-background: #f7f4ff;
|
||||
--color-theme-foreground: #403352;
|
||||
--color-theme-accent: #6f49ab;
|
||||
--color-theme-tag: #6f49ab;
|
||||
--color-theme-title: #6f49ab;
|
||||
--color-theme-meta: #403352;
|
||||
--color-theme-framed: #6f49ab;
|
||||
--color-theme-menu: #6f49ab;
|
||||
--color-theme-header: #6f49ab;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
.toc {
|
||||
margin-left: 12px;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
background: var(--color-theme-background);
|
||||
border: 1px solid var(--color-theme-foreground);
|
||||
padding: 12px;
|
||||
position: fixed;
|
||||
display: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: var(--color-theme-foreground);
|
||||
border-radius: 3px;
|
||||
|
||||
&:hover {
|
||||
background: var(--color-theme-background);
|
||||
}
|
||||
}
|
||||
|
||||
.toc-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.toc-list-item {
|
||||
margin: 4px 0;
|
||||
|
||||
.toc-list {
|
||||
margin-left: 16px;
|
||||
border-left: 1px solid var(--color-theme-foreground);
|
||||
padding-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.toc-link {
|
||||
display: block;
|
||||
padding: 4px 8px;
|
||||
text-decoration: none;
|
||||
color: var(--color-theme-foreground);
|
||||
font-size: 0.875rem;
|
||||
border-radius: 3px;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background: var(--color-theme-background);
|
||||
color: var(--color-theme-accent);
|
||||
}
|
||||
|
||||
&.is-active-link {
|
||||
background: var(--color-theme-background);
|
||||
color: var(--color-theme-accent);
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.is-active-li {
|
||||
> .toc-link {
|
||||
background: var(--color-theme-background);
|
||||
color: var(--color-theme-accent);
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
.typed-text {
|
||||
color: var(--color-theme-framed);
|
||||
}
|
||||
|
||||
.typed-text::after {
|
||||
content: '|';
|
||||
display: inline-block;
|
||||
opacity: 0;
|
||||
animation: blink 0.7s infinite alternate;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
$phone-max-width: 684px;
|
||||
$phone-min-width: 695px;
|
||||
$tablet-max-width: 899px;
|
||||
@@ -0,0 +1,26 @@
|
||||
export class Terminal {
|
||||
constructor() {
|
||||
this._refreshFunctions = [];
|
||||
this._initFunctions = [];
|
||||
this.initialized = false;
|
||||
}
|
||||
|
||||
registerRefresh(func) {
|
||||
this._refreshFunctions.push(func);
|
||||
}
|
||||
|
||||
registerInitFunc(func) {
|
||||
this._initFunctions.push(func);
|
||||
}
|
||||
|
||||
refresh() {
|
||||
if (!this.initialized) {
|
||||
this._initFunctions.forEach(func => func());
|
||||
this.initialized = true;
|
||||
}
|
||||
this._refreshFunctions.forEach(func => func());
|
||||
}
|
||||
}
|
||||
|
||||
export var terminal = new Terminal();
|
||||
window.terminal = terminal;
|
||||
Reference in New Issue
Block a user