UNPKG

dailyhot-api

Version:
176 lines (175 loc) 6.87 kB
import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime"; import { css, Style } from "hono/css"; const Layout = (props) => { const globalClass = css ` :-hono-global { * { margin: 0; padding: 0; user-select: none; box-sizing: border-box; -webkit-user-drag: none; } :root { --text-color: #000; --text-color-gray: #cbcbcb; --text-color-hover: #fff; --icon-color: #444; } @media (prefers-color-scheme: dark) { :root { --text-color: #fff; --text-color-gray: #cbcbcb; --text-color-hover: #3c3c3c; --icon-color: #cbcbcb; } } a { text-decoration: none; color: var(--text-color); } body { width: 100vw; height: 100vh; display: flex; flex-direction: column; justify-content: space-between; align-items: center; color: var(--text-color); background-color: var(--text-color-hover); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei"; transition: color 0.3s, background-color 0.3s; } main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; margin: 20px; height: 100%; } .img { width: 120px; height: 120px; margin-bottom: 20px; } .img img, .img svg { width: 100%; height: 100%; } .title { display: flex; flex-direction: column; align-items: center; margin-bottom: 40px; } .title .title-text { font-size: 28px; font-weight: bold; margin-bottom: 12px; text-align: center; } .title .title-tip { font-size: 20px; opacity: 0.8; } .title .content { margin-top: 30px; display: flex; padding: 20px; border-radius: 12px; border: 1px dashed var(--text-color); user-select: text; } .control { display: flex; flex-direction: row; align-items: center; } .control button { display: flex; flex-direction: row; align-items: center; color: var(--text-color); border: var(--text-color) solid; background-color: var(--text-color-hover); border-radius: 8px; padding: 8px 12px; margin: 0 8px; transition: color 0.3s, background-color 0.3s; cursor: pointer; } .control button .btn-icon { width: 22px; height: 22px; margin-right: 8px; } .control button .btn-text { font-size: 14px; } .control button:hover { border: var(--text-color) solid; background: var(--text-color); color: var(--text-color-hover); } .control button i { margin-right: 6px; } footer { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 30px; padding: 20px; } .social { display: flex; flex-direction: row; align-items: center; margin-bottom: 8px; } .social .link { display: flex; flex-direction: row; align-items: center; margin: 0 4px; } .social .link::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background-color: var(--text-color); opacity: 0.4; margin-left: 8px; } .social .link:last-child::after { display: none; } .social .link svg { width: 22px; height: 22px; } footer .power, footer .icp { font-size: 14px; } footer a { color: var(--text-color-gray); transition: color 0.3s; } footer a:hover { color: var(--text-color); } } `; return (_jsxs("html", { lang: "zh-CN", children: [_jsxs("head", { children: [_jsx("meta", { name: "viewport", content: "width=device-width,initial-scale=1" }), _jsx("meta", { charset: "utf-8" }), _jsx("title", { children: props.title }), _jsx("link", { rel: "icon", href: "/favicon.ico" }), _jsx("meta", { name: "description", content: "\u4ECA\u65E5\u70ED\u699C API\uFF0C\u4E00\u4E2A\u805A\u5408\u70ED\u95E8\u6570\u636E\u7684 API \u63A5\u53E3" }), _jsx(Style, { children: globalClass })] }), _jsxs("body", { children: [props.children, _jsxs("footer", { children: [_jsxs("div", { class: "social", children: [_jsx("a", { href: "https://github.com/imsyy/DailyHotApi", className: "link", target: "_blank", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 24 24", children: _jsx("path", { fill: "currentColor", d: "M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33c.85 0 1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2" }) }) }), _jsx("a", { href: "https://www.imsyy.top", className: "link", target: "_blank", children: _jsx("svg", { className: "btn-icon", xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 24 24", children: _jsx("path", { fill: "currentColor", d: "M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1" }) }) }), _jsx("a", { href: "mailto:one@imsyy.top", className: "link", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 24 24", children: _jsx("path", { fill: "currentColor", d: "m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2" }) }) })] }), _jsxs("div", { class: "power", children: ["Copyright\u00A0\u00A9\u00A0", _jsx("a", { href: "https://www.imsyy.top/", target: "_blank", children: "\u7121\u540D" }), "\u00A0|\u00A0Power by\u00A0", _jsx("a", { href: "https://github.com/honojs/hono/", target: "_blank", children: "Hono" })] }), _jsx("div", { class: "icp", children: _jsx("a", { href: "https://beian.miit.gov.cn/", target: "_blank", children: "\u8C6BICP\u59072022018134\u53F7-1" }) })] })] })] })); }; export default Layout;