Rebuild Laysense site with Webman and SQLite CMS
@@ -0,0 +1 @@
|
||||
* text=auto
|
||||
@@ -0,0 +1,7 @@
|
||||
/vendor/
|
||||
/runtime/
|
||||
/storage/*
|
||||
!/storage/.gitignore
|
||||
/.env
|
||||
/.taste-skill/
|
||||
/shots/
|
||||
@@ -0,0 +1,60 @@
|
||||
# 来笙 Laysense 官网
|
||||
|
||||
PHP Webman、原生 CSS 和 SQLite 实现的来笙官网。公开页面由服务端渲染,菜单和 CMS 编辑工具使用原生 JavaScript。运行时只依赖 PHP、Composer 依赖和本机 SQLite 文件。
|
||||
|
||||
## 本地启动
|
||||
|
||||
需要 Linux、PHP 8.2+ CLI、Composer 2,以及启用 `pcntl`、`posix`、`pdo_sqlite`、`dom` 和 `mbstring` 的 PHP 环境。
|
||||
|
||||
```sh
|
||||
composer install
|
||||
php bin/install.php
|
||||
php bin/admin.php admin@example.com
|
||||
LAYSENSE_SECURE_COOKIES=0 php start.php start
|
||||
```
|
||||
|
||||
打开 `http://127.0.0.1:8787`。后台入口为 `/admin`。创建管理员命令会交互读取密码,对同一邮箱再次执行会轮换密码并使旧会话失效。本地 HTTP 测试时关闭 Secure Cookie,生产 HTTPS 环境使用默认设置。
|
||||
|
||||
## 后台编辑
|
||||
|
||||
- **页面**可修改首屏标题、简介、图片、按钮,以及每页的 SEO 标题和描述。页面正文按区块编辑,支持受限 HTML 和预览。
|
||||
- **文章与动态**使用 Markdown,支持正文预览、摘要、标签和公告、新闻、产品分类。状态选「草稿」可撤回公开文章。已发布文章改网址标识后,旧标识会自动跳转。
|
||||
- 首页动态、分类列表和站点地图随发布状态更新。源代码和 SQLite 数据分开管理。安装命令可重复执行,已编辑的内容会保留。
|
||||
|
||||
## 生产运行
|
||||
|
||||
1. 以运行服务的用户执行 `composer install --no-dev --optimize-autoloader`、`php bin/install.php` 和管理员创建命令。
|
||||
2. 通过 systemd 或其他进程管理器以前台命令 `php start.php start` 运行。默认监听 `127.0.0.1:8787`。
|
||||
3. 由 Nginx 等反向代理处理 `laysense.cn` 的 HTTPS,并将请求转发给 Webman。项目根目录保持在公共站点根目录之外。
|
||||
|
||||
下面的 Nginx 片段可放入现有 HTTPS 虚拟主机。
|
||||
|
||||
```nginx
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8787;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
client_max_body_size 2m;
|
||||
}
|
||||
```
|
||||
|
||||
| 环境变量 | 默认值与用途 |
|
||||
| --- | --- |
|
||||
| `LAYSENSE_SITE_URL` | `https://laysense.cn` · canonical、分享链接和站点地图的正式站点地址 |
|
||||
| `LAYSENSE_LISTEN` | `http://127.0.0.1:8787` · Webman 监听地址 |
|
||||
| `LAYSENSE_WORKERS` | `2` · Webman worker 数量 |
|
||||
| `LAYSENSE_DB` | `storage/laysense.sqlite` · SQLite 文件路径。生产可指向独立的持久化目录 |
|
||||
| `LAYSENSE_SECURE_COOKIES` | 默认启用 · 本地 HTTP 测试设为 `0` |
|
||||
| `LAYSENSE_TRUSTED_PROXIES` | 默认空 · 逗号分隔的受信反代 IP。使用上述 Nginx 片段时可设为 `127.0.0.1` |
|
||||
|
||||
SQLite 已启用 WAL。迁移服务器或做线上备份时,可用 `sqlite3 storage/laysense.sqlite ".backup 'laysense-backup.sqlite'"` 取得一致备份。更新代码时保留数据库文件及其存放目录。服务用户需要对 SQLite 目录和 `runtime/` 有写权限。
|
||||
|
||||
## 迁移范围
|
||||
|
||||
- 保留 `/`、`/pagepan`、`/highspeaker`、`/sc`、`/shnu-sc`。旧的动态、分类、标签和已知公告地址通过 301 跳转。SEO 包含 canonical、Open Graph、面包屑与文章结构化数据、XML sitemap 和 robots.txt。
|
||||
- 迁移五页可获取的产品和服务说明、价格、机构信息、问答、对比表、微信二维码和四段 PAGEPAN 演示视频。LayFi 的原始标志地址返回 404,页面保留项目名称和原有站点链接。
|
||||
- 旧站 2024 年 11 月 10 日关于减少全球服务器部署的公告返回空白正文。迁移保留标题、日期、标签和旧链接,正文补录前会标记为不索引。
|
||||
- SHNU 旧页首屏写 ¥69,详细报价表与正文写 ¥66。新版保留报价表中的 ¥66,并保留旧页学生资格及学分说明。两处普通软著页面的咨询按钮现在直达该页既有的企业微信入口。
|
||||
- 中文公开页复用页头、页尾、首屏、内容区块、动态列表及同一套 CSS。历史迁移内容见 `resources/seed.json`,结构见 `resources/schema.sql`。
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Content;
|
||||
|
||||
use PDO;
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
final class Database
|
||||
{
|
||||
private static ?PDO $connection = null;
|
||||
|
||||
public static function connect(): PDO
|
||||
{
|
||||
if (self::$connection !== null) {
|
||||
return self::$connection;
|
||||
}
|
||||
|
||||
$path = getenv('LAYSENSE_DB') ?: dirname(__DIR__, 2) . '/storage/laysense.sqlite';
|
||||
if (!is_dir(dirname($path)) && !mkdir(dirname($path), 0750, true) && !is_dir(dirname($path))) {
|
||||
throw new RuntimeException('无法创建 SQLite 存放目录。');
|
||||
}
|
||||
|
||||
$pdo = new PDO('sqlite:' . $path, options: [PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC]);
|
||||
$pdo->exec('PRAGMA busy_timeout = 5000');
|
||||
$pdo->exec('PRAGMA foreign_keys = ON');
|
||||
self::$connection = $pdo;
|
||||
|
||||
return $pdo;
|
||||
}
|
||||
|
||||
public static function initialize(): void
|
||||
{
|
||||
$root = dirname(__DIR__, 2);
|
||||
$seed = json_decode(file_get_contents($root . '/resources/seed.json'), true, flags: JSON_THROW_ON_ERROR);
|
||||
$pdo = self::connect();
|
||||
$pdo->exec('PRAGMA journal_mode = WAL');
|
||||
|
||||
self::write(function (PDO $pdo) use ($root, $seed): void {
|
||||
$pdo->exec(file_get_contents($root . '/resources/schema.sql'));
|
||||
$site = $pdo->prepare('INSERT OR IGNORE INTO site_settings (id, payload) VALUES (1, ?)');
|
||||
$site->execute([self::json($seed['site'])]);
|
||||
|
||||
$pageQuery = $pdo->prepare('INSERT OR IGNORE INTO pages
|
||||
(slug, name, title, description, heading, accent, lead, image, alt, actions, quicklinks, partners)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
|
||||
$sectionQuery = $pdo->prepare('INSERT OR IGNORE INTO sections
|
||||
(page_slug, key, title, lead, style, body, position) VALUES (?, ?, ?, ?, ?, ?, ?)');
|
||||
foreach ($seed['pages'] as $page) {
|
||||
$pageQuery->execute([
|
||||
$page['slug'], $page['name'], $page['title'], $page['description'], $page['heading'],
|
||||
$page['accent'], $page['lead'], $page['image'], $page['alt'],
|
||||
self::json($page['actions']), self::json($page['quicklinks']), self::json($page['partners'] ?? []),
|
||||
]);
|
||||
if ($pageQuery->rowCount() !== 1) {
|
||||
continue;
|
||||
}
|
||||
foreach ($page['sections'] as $index => $section) {
|
||||
$sectionQuery->execute([
|
||||
$page['slug'], $section['key'], $section['title'], $section['lead'],
|
||||
$section['style'], Html::sanitize($section['body']), $index,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$article = $pdo->prepare('INSERT OR IGNORE INTO articles
|
||||
(slug, title, category, summary, body, tags, status, published_at, updated_at, legacy_path)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
|
||||
foreach ($seed['articles'] as $item) {
|
||||
$exists = $pdo->prepare('SELECT 1 FROM article_redirects WHERE slug = ?');
|
||||
$exists->execute([$item['slug']]);
|
||||
if ($exists->fetchColumn()) {
|
||||
continue;
|
||||
}
|
||||
$article->execute([
|
||||
$item['slug'], $item['title'], $item['category'], $item['summary'], $item['body'],
|
||||
self::json($item['tags']), $item['status'], $item['date'], $item['date'], $item['legacy'],
|
||||
]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static function write(callable $operation): mixed
|
||||
{
|
||||
$pdo = self::connect();
|
||||
$pdo->exec('BEGIN IMMEDIATE');
|
||||
try {
|
||||
$result = $operation($pdo);
|
||||
$pdo->exec('COMMIT');
|
||||
|
||||
return $result;
|
||||
} catch (Throwable $error) {
|
||||
$pdo->exec('ROLLBACK');
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public static function json(array $data): string
|
||||
{
|
||||
return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Content;
|
||||
|
||||
use DOMDocument;
|
||||
use DOMElement;
|
||||
use DOMNode;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
final class Html
|
||||
{
|
||||
private const TAGS = [
|
||||
'a' => ['href'], 'article' => [], 'b' => [], 'blockquote' => [], 'br' => [],
|
||||
'caption' => [], 'code' => [], 'dd' => [], 'details' => [], 'div' => ['role', 'aria-label', 'tabindex'],
|
||||
'dl' => [], 'dt' => [], 'em' => [], 'h3' => [], 'h4' => [], 'h5' => [], 'hr' => [], 'i' => [],
|
||||
'img' => ['src', 'alt', 'loading', 'width', 'height'], 'label' => ['for'],
|
||||
'li' => [], 'ol' => [], 'p' => [], 'pre' => [], 'progress' => ['max', 'value'], 's' => [],
|
||||
'small' => [], 'source' => ['src', 'type'], 'span' => [], 'strong' => [], 'summary' => [],
|
||||
'table' => [], 'tbody' => [], 'td' => ['colspan', 'rowspan'], 'tfoot' => [],
|
||||
'th' => ['scope', 'colspan', 'rowspan'], 'thead' => [], 'tr' => [], 'ul' => [],
|
||||
'video' => ['controls', 'muted', 'playsinline', 'poster', 'preload'],
|
||||
];
|
||||
|
||||
public static function url(string $value, bool $media = false): bool
|
||||
{
|
||||
if ($value === '' || preg_match('/[\x00-\x20\x7f\\\\]/', $value)) {
|
||||
return false;
|
||||
}
|
||||
if (str_starts_with($value, '/')) {
|
||||
return !str_starts_with($value, '//');
|
||||
}
|
||||
if (str_starts_with($value, '#')) {
|
||||
return !$media && strlen($value) > 1;
|
||||
}
|
||||
$scheme = strtolower((string) parse_url($value, PHP_URL_SCHEME));
|
||||
|
||||
return in_array($scheme, $media ? ['https'] : ['https', 'http', 'mailto', 'tel'], true);
|
||||
}
|
||||
|
||||
public static function markdown(string $text): string
|
||||
{
|
||||
static $converter;
|
||||
$converter ??= new CommonMarkConverter(['html_input' => 'strip', 'allow_unsafe_links' => false, 'max_nesting_level' => 30]);
|
||||
|
||||
$html = $converter->convert($text)->getContent();
|
||||
|
||||
return str_replace(['<h1>', '</h1>'], ['<h2>', '</h2>'], $html);
|
||||
}
|
||||
|
||||
public static function sanitize(string $html): string
|
||||
{
|
||||
$document = new DOMDocument('1.0', 'UTF-8');
|
||||
$document->loadHTML('<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body>' . $html . '</body></html>', LIBXML_NOERROR | LIBXML_NOWARNING | LIBXML_NONET);
|
||||
$body = $document->getElementsByTagName('body')->item(0);
|
||||
if (!$body) {
|
||||
return '';
|
||||
}
|
||||
self::sanitizeChildren($body);
|
||||
$output = '';
|
||||
foreach ($body->childNodes as $child) {
|
||||
$output .= $document->saveHTML($child);
|
||||
}
|
||||
|
||||
return trim($output);
|
||||
}
|
||||
|
||||
private static function sanitizeChildren(DOMNode $parent): void
|
||||
{
|
||||
foreach (iterator_to_array($parent->childNodes) as $element) {
|
||||
if ($element->nodeType === XML_COMMENT_NODE) {
|
||||
$parent->removeChild($element);
|
||||
continue;
|
||||
}
|
||||
if (!$element instanceof DOMElement) {
|
||||
continue;
|
||||
}
|
||||
if (!array_key_exists($element->tagName, self::TAGS)) {
|
||||
$parent->removeChild($element);
|
||||
continue;
|
||||
}
|
||||
$allowed = [...self::TAGS[$element->tagName], 'class', 'id'];
|
||||
foreach (iterator_to_array($element->attributes) as $attribute) {
|
||||
$name = $attribute->name;
|
||||
$value = $attribute->value;
|
||||
if (!in_array($name, $allowed, true)
|
||||
|| ($name === 'href' && !self::url($value))
|
||||
|| (in_array($name, ['src', 'poster'], true) && !self::url($value, true))
|
||||
|| ($name === 'tabindex' && $value !== '0')) {
|
||||
$element->removeAttribute($name);
|
||||
}
|
||||
}
|
||||
self::sanitizeChildren($element);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Content;
|
||||
|
||||
use PDO;
|
||||
use RuntimeException;
|
||||
|
||||
final class Repository
|
||||
{
|
||||
public const CATEGORIES = ['announcement' => '公告', 'news' => '新闻', 'product' => '产品'];
|
||||
private PDO $pdo;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->pdo = Database::connect();
|
||||
}
|
||||
|
||||
public function site(): array
|
||||
{
|
||||
return json_decode((string) $this->pdo->query('SELECT payload FROM site_settings WHERE id = 1')->fetchColumn(), true, flags: JSON_THROW_ON_ERROR);
|
||||
}
|
||||
|
||||
public function pages(): array
|
||||
{
|
||||
return $this->pdo->query('SELECT slug, name, title, updated_at FROM pages ORDER BY rowid')->fetchAll();
|
||||
}
|
||||
|
||||
public function page(string $slug): ?array
|
||||
{
|
||||
$page = $this->one('SELECT * FROM pages WHERE slug = ?', [$slug]);
|
||||
if (!$page) {
|
||||
return null;
|
||||
}
|
||||
foreach (['actions', 'quicklinks', 'partners'] as $key) {
|
||||
$page[$key] = json_decode($page[$key], true, flags: JSON_THROW_ON_ERROR);
|
||||
}
|
||||
$query = $this->pdo->prepare('SELECT * FROM sections WHERE page_slug = ? ORDER BY position, key');
|
||||
$query->execute([$slug]);
|
||||
$page['sections'] = $query->fetchAll();
|
||||
|
||||
return $page;
|
||||
}
|
||||
|
||||
public function section(string $page, string $key): ?array
|
||||
{
|
||||
return $this->one('SELECT * FROM sections WHERE page_slug = ? AND key = ?', [$page, $key]);
|
||||
}
|
||||
|
||||
public function savePage(string $slug, array $data, int $version): void
|
||||
{
|
||||
$query = $this->pdo->prepare('UPDATE pages SET title = ?, description = ?, heading = ?, accent = ?, lead = ?,
|
||||
image = ?, alt = ?, actions = ?, updated_at = ?, version = version + 1 WHERE slug = ? AND version = ?');
|
||||
$query->execute([
|
||||
$data['title'], $data['description'], $data['heading'], $data['accent'], $data['lead'],
|
||||
$data['image'], $data['alt'], Database::json($data['actions']), self::now(), $slug, $version,
|
||||
]);
|
||||
self::checkVersion($query->rowCount());
|
||||
}
|
||||
|
||||
public function saveSection(string $page, string $key, array $data, int $version): void
|
||||
{
|
||||
Database::write(function (PDO $pdo) use ($page, $key, $data, $version): void {
|
||||
$query = $pdo->prepare('UPDATE sections SET title = ?, lead = ?, body = ?, version = version + 1
|
||||
WHERE page_slug = ? AND key = ? AND version = ?');
|
||||
$query->execute([$data['title'], $data['lead'], $data['body'], $page, $key, $version]);
|
||||
self::checkVersion($query->rowCount());
|
||||
$query = $pdo->prepare('UPDATE pages SET updated_at = ? WHERE slug = ?');
|
||||
$query->execute([self::now(), $page]);
|
||||
});
|
||||
}
|
||||
|
||||
public function articles(?string $category = null, ?string $tag = null, bool $public = true, int $limit = 30, int $offset = 0): array
|
||||
{
|
||||
$sql = 'SELECT * FROM articles WHERE 1 = 1';
|
||||
$args = [];
|
||||
if ($public) {
|
||||
$sql .= " AND status = 'published' AND published_at IS NOT NULL";
|
||||
}
|
||||
if ($category !== null) {
|
||||
$sql .= ' AND category = ?';
|
||||
$args[] = $category;
|
||||
}
|
||||
if ($tag !== null) {
|
||||
$sql .= ' AND EXISTS (SELECT 1 FROM json_each(articles.tags) WHERE value = ?)';
|
||||
$args[] = $tag;
|
||||
}
|
||||
$order = $public ? 'published_at' : 'updated_at';
|
||||
$query = $this->pdo->prepare($sql . ' ORDER BY ' . $order . ' DESC, id DESC LIMIT ? OFFSET ?');
|
||||
$query->execute([...$args, $limit, $offset]);
|
||||
|
||||
return array_map(self::decodeArticle(...), $query->fetchAll());
|
||||
}
|
||||
|
||||
public function articleById(int $id): ?array
|
||||
{
|
||||
return self::decodeArticle($this->one('SELECT * FROM articles WHERE id = ?', [$id]));
|
||||
}
|
||||
|
||||
public function published(string $slug): ?array
|
||||
{
|
||||
return self::decodeArticle($this->one("SELECT * FROM articles WHERE slug = ? AND status = 'published'", [$slug]));
|
||||
}
|
||||
|
||||
public function articleRedirect(string $slug): ?array
|
||||
{
|
||||
return $this->one("SELECT articles.slug FROM article_redirects
|
||||
JOIN articles ON articles.id = article_redirects.article_id
|
||||
WHERE article_redirects.slug = ? AND articles.status = 'published'", [$slug]);
|
||||
}
|
||||
|
||||
public function legacyArticle(string $path): ?array
|
||||
{
|
||||
return $this->one("SELECT slug FROM articles WHERE legacy_path = ? AND status = 'published'", [$path]);
|
||||
}
|
||||
|
||||
public function saveArticle(?int $id, array $data, int $version): int
|
||||
{
|
||||
return Database::write(function (PDO $pdo) use ($id, $data, $version): int {
|
||||
$old = $id !== null ? $this->articleById($id) : null;
|
||||
if ($id !== null && (!$old || $old['version'] !== $version)) {
|
||||
self::checkVersion(0);
|
||||
}
|
||||
$existing = $this->one('SELECT id FROM articles WHERE slug = ?', [$data['slug']]);
|
||||
$redirect = $this->one('SELECT article_id FROM article_redirects WHERE slug = ?', [$data['slug']]);
|
||||
if (($existing && $existing['id'] !== $id) || ($redirect && $redirect['article_id'] !== $id)) {
|
||||
throw new RuntimeException('此网址标识已被使用。');
|
||||
}
|
||||
$publishedAt = $old['published_at'] ?? ($data['status'] === 'published' ? self::now() : null);
|
||||
$values = [
|
||||
$data['slug'], $data['title'], $data['category'], $data['summary'], $data['body'],
|
||||
Database::json($data['tags']), $data['status'], $publishedAt, self::now(),
|
||||
];
|
||||
if ($id === null) {
|
||||
$query = $pdo->prepare('INSERT INTO articles
|
||||
(slug, title, category, summary, body, tags, status, published_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)');
|
||||
$query->execute($values);
|
||||
|
||||
return (int) $pdo->lastInsertId();
|
||||
}
|
||||
if ($old['slug'] !== $data['slug']) {
|
||||
$pdo->prepare('DELETE FROM article_redirects WHERE slug = ? AND article_id = ?')->execute([$data['slug'], $id]);
|
||||
$pdo->prepare('INSERT INTO article_redirects (slug, article_id) VALUES (?, ?)')->execute([$old['slug'], $id]);
|
||||
}
|
||||
$query = $pdo->prepare('UPDATE articles SET slug = ?, title = ?, category = ?, summary = ?, body = ?, tags = ?,
|
||||
status = ?, published_at = ?, updated_at = ?, version = version + 1 WHERE id = ? AND version = ?');
|
||||
$query->execute([...$values, $id, $version]);
|
||||
self::checkVersion($query->rowCount());
|
||||
|
||||
return $id;
|
||||
});
|
||||
}
|
||||
|
||||
public function sitemapArticles(): iterable
|
||||
{
|
||||
$query = $this->pdo->query("SELECT slug, updated_at FROM articles WHERE status = 'published' AND trim(body) <> '' ORDER BY slug");
|
||||
yield from $query;
|
||||
}
|
||||
|
||||
public function administrator(string $email): ?array
|
||||
{
|
||||
return $this->one('SELECT id, email, password_hash FROM users WHERE email = ?', [$email]);
|
||||
}
|
||||
|
||||
public function administratorById(int $id): ?array
|
||||
{
|
||||
return $this->one('SELECT id, email, password_hash FROM users WHERE id = ?', [$id]);
|
||||
}
|
||||
|
||||
public function recordLoginAttempt(string $address): bool
|
||||
{
|
||||
return Database::write(function (PDO $pdo) use ($address): bool {
|
||||
$now = time();
|
||||
$pdo->prepare('DELETE FROM login_attempts WHERE expires_at <= ?')->execute([$now]);
|
||||
$current = $this->one('SELECT attempts FROM login_attempts WHERE address = ?', [$address]);
|
||||
if ($current && $current['attempts'] >= 12) {
|
||||
return false;
|
||||
}
|
||||
$query = $pdo->prepare('INSERT INTO login_attempts (address, attempts, expires_at) VALUES (?, 1, ?)
|
||||
ON CONFLICT (address) DO UPDATE SET attempts = attempts + 1');
|
||||
$query->execute([$address, $now + 900]);
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
public function clearLoginAttempts(string $address): void
|
||||
{
|
||||
$this->pdo->prepare('DELETE FROM login_attempts WHERE address = ?')->execute([$address]);
|
||||
}
|
||||
|
||||
private function one(string $sql, array $args): ?array
|
||||
{
|
||||
$query = $this->pdo->prepare($sql);
|
||||
$query->execute($args);
|
||||
|
||||
return $query->fetch() ?: null;
|
||||
}
|
||||
|
||||
private static function decodeArticle(?array $article): ?array
|
||||
{
|
||||
if ($article !== null) {
|
||||
$article['tags'] = json_decode($article['tags'], true, flags: JSON_THROW_ON_ERROR);
|
||||
}
|
||||
|
||||
return $article;
|
||||
}
|
||||
|
||||
private static function now(): string
|
||||
{
|
||||
return date('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
private static function checkVersion(int $count): void
|
||||
{
|
||||
if ($count !== 1) {
|
||||
throw new RuntimeException('此内容已在其他窗口更新。请保留你的修改,重新打开后再合并。');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Content;
|
||||
|
||||
use support\Response;
|
||||
|
||||
final class View
|
||||
{
|
||||
public static function render(string $template, array $data, int $status = 200, bool $admin = false): Response
|
||||
{
|
||||
$html = self::fragment($template, $data);
|
||||
$page = self::fragment($admin ? 'admin-layout' : 'layout', $data + ['content' => $html]);
|
||||
$headers = [
|
||||
'Content-Type' => 'text/html; charset=utf-8',
|
||||
'X-Content-Type-Options' => 'nosniff',
|
||||
'Referrer-Policy' => 'strict-origin-when-cross-origin',
|
||||
'X-Frame-Options' => 'DENY',
|
||||
'Content-Security-Policy' => "default-src 'self'; img-src 'self' https:; media-src 'self' https:; "
|
||||
. "style-src 'self'; script-src 'self'; frame-ancestors 'none'; form-action 'self'; base-uri 'none'; object-src 'none'",
|
||||
];
|
||||
if ($admin) {
|
||||
$headers['Cache-Control'] = 'no-store';
|
||||
$headers['X-Robots-Tag'] = 'noindex, nofollow';
|
||||
} elseif (($data['noindex'] ?? false) || $status >= 400) {
|
||||
$headers['X-Robots-Tag'] = 'noindex';
|
||||
}
|
||||
|
||||
return new Response($status, $headers, $page);
|
||||
}
|
||||
|
||||
public static function fragment(string $template, array $data = []): string
|
||||
{
|
||||
extract($data, EXTR_SKIP);
|
||||
ob_start();
|
||||
try {
|
||||
require dirname(__DIR__) . '/view/' . $template . '.php';
|
||||
|
||||
return (string) ob_get_contents();
|
||||
} finally {
|
||||
ob_end_clean();
|
||||
}
|
||||
}
|
||||
|
||||
public static function escape(string|int|null $value): string
|
||||
{
|
||||
return htmlspecialchars((string) $value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
}
|
||||
|
||||
public static function absolute(string $path): string
|
||||
{
|
||||
return rtrim(getenv('LAYSENSE_SITE_URL') ?: 'https://laysense.cn', '/') . $path;
|
||||
}
|
||||
|
||||
public static function date(?string $value, string $format = 'Y年n月j日'): string
|
||||
{
|
||||
return $value ? date($format, strtotime($value)) : '';
|
||||
}
|
||||
|
||||
public static function redirect(string $path, int $status = 303): Response
|
||||
{
|
||||
return new Response($status, ['Location' => $path, 'Cache-Control' => $status === 301 ? 'public, max-age=300' : 'no-store'], '');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Content\Html;
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
use RuntimeException;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
|
||||
final class AdminController
|
||||
{
|
||||
private ?array $user = null;
|
||||
|
||||
public function login(Request $request): Response
|
||||
{
|
||||
if ($this->signedIn($request)) {
|
||||
return View::redirect('/admin');
|
||||
}
|
||||
$error = '';
|
||||
$email = '';
|
||||
$status = 200;
|
||||
if ($request->method() === 'POST') {
|
||||
if (!$this->validToken($request)) {
|
||||
return $this->error($request, '表单已过期,请刷新后重试。', 403);
|
||||
}
|
||||
$email = strtolower($this->input($request, 'email'));
|
||||
$password = $this->input($request, 'password', trimValue: false);
|
||||
$repo = new Repository();
|
||||
$address = $this->address($request);
|
||||
if (!$repo->recordLoginAttempt($address)) {
|
||||
$error = '尝试次数过多,请在 15 分钟后重试。';
|
||||
$status = 429;
|
||||
} else {
|
||||
$user = strlen($email) <= 254 ? $repo->administrator($email) : null;
|
||||
$hash = $user['password_hash'] ?? '$2y$12$XGNKW.dBbfpUrZT8MYvWquCW1dBN3fIlVb29tlaoFIge3YDWG0AzG';
|
||||
if (strlen($password) <= 72 && password_verify($password, $hash) && $user) {
|
||||
$request->sessionRegenerateId(true);
|
||||
$request->session()->flush();
|
||||
$request->session()->set('admin_id', $user['id']);
|
||||
$request->session()->set('auth_version', hash('sha256', $user['password_hash']));
|
||||
$request->session()->set('admin_since', time());
|
||||
$repo->clearLoginAttempts($address);
|
||||
|
||||
return View::redirect('/admin');
|
||||
}
|
||||
$error = '邮箱或密码有误。';
|
||||
$status = 422;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render($request, 'admin-login', ['title' => '登录内容管理', 'error' => $error, 'email' => $email], $status);
|
||||
}
|
||||
|
||||
public function logout(Request $request): Response
|
||||
{
|
||||
if ($failure = $this->guard($request)) {
|
||||
return $failure;
|
||||
}
|
||||
$request->session()->flush();
|
||||
$request->sessionRegenerateId(true);
|
||||
|
||||
return View::redirect('/admin/login');
|
||||
}
|
||||
|
||||
public function dashboard(Request $request): Response
|
||||
{
|
||||
if ($failure = $this->guard($request)) {
|
||||
return $failure;
|
||||
}
|
||||
$repo = new Repository();
|
||||
|
||||
return $this->render($request, 'admin-dashboard', [
|
||||
'title' => '内容管理', 'pages' => $repo->pages(), 'articles' => $repo->articles(public: false, limit: 5),
|
||||
]);
|
||||
}
|
||||
|
||||
public function articles(Request $request): Response
|
||||
{
|
||||
if ($failure = $this->guard($request)) {
|
||||
return $failure;
|
||||
}
|
||||
$page = max(1, min(10000, (int) $request->get('page', 1)));
|
||||
$articles = (new Repository())->articles(public: false, limit: 31, offset: ($page - 1) * 30);
|
||||
|
||||
return $this->render($request, 'admin-articles', [
|
||||
'title' => '文章与动态', 'articles' => array_slice($articles, 0, 30), 'pageNumber' => $page, 'hasNext' => count($articles) > 30,
|
||||
]);
|
||||
}
|
||||
|
||||
public function article(Request $request, ?string $id = null): Response
|
||||
{
|
||||
if ($failure = $this->guard($request)) {
|
||||
return $failure;
|
||||
}
|
||||
$repo = new Repository();
|
||||
$article = $id !== null ? $repo->articleById((int) $id) : [
|
||||
'title' => '', 'slug' => '', 'summary' => '', 'category' => 'news', 'body' => '',
|
||||
'tags' => [], 'status' => 'draft', 'version' => 0,
|
||||
];
|
||||
if (!$article) {
|
||||
return $this->error($request, '找不到这篇文章。', 404);
|
||||
}
|
||||
$error = '';
|
||||
if ($request->method() === 'POST') {
|
||||
$data = $this->articleInput($request);
|
||||
$article = array_replace($article, $data, ['version' => $this->version($request)]);
|
||||
try {
|
||||
if (mb_strlen($data['title']) < 1 || mb_strlen($data['title']) > 120
|
||||
|| !preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/D', $data['slug']) || strlen($data['slug']) > 100
|
||||
|| mb_strlen($data['summary']) > 250 || strlen($data['body']) > 200000
|
||||
|| !isset(Repository::CATEGORIES[$data['category']])
|
||||
|| !in_array($data['status'], ['draft', 'published'], true)) {
|
||||
throw new RuntimeException('请检查标题、网址标识、分类、摘要和正文长度。');
|
||||
}
|
||||
if ($data['status'] === 'published' && trim(Html::markdown($data['body'])) === '') {
|
||||
throw new RuntimeException('发布前请填写文章正文。');
|
||||
}
|
||||
$saved = $repo->saveArticle($id === null ? null : (int) $id, $data, $this->version($request));
|
||||
|
||||
return View::redirect('/admin/articles/' . $saved . '?saved=1');
|
||||
} catch (RuntimeException $exception) {
|
||||
$error = $this->validationMessage($exception);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render($request, 'admin-article', [
|
||||
'title' => $id === null ? '新建文章' : '编辑文章', 'article' => $article, 'error' => $error,
|
||||
'articleId' => $id, 'saved' => $request->get('saved') === '1',
|
||||
], $error !== '' ? 422 : 200);
|
||||
}
|
||||
|
||||
public function page(Request $request, string $slug): Response
|
||||
{
|
||||
if ($failure = $this->guard($request)) {
|
||||
return $failure;
|
||||
}
|
||||
$repo = new Repository();
|
||||
$page = $repo->page($slug);
|
||||
if (!$page) {
|
||||
return $this->error($request, '找不到此页面。', 404);
|
||||
}
|
||||
$error = '';
|
||||
if ($request->method() === 'POST') {
|
||||
$data = [];
|
||||
foreach (['title', 'description', 'heading', 'accent', 'lead', 'image', 'alt'] as $field) {
|
||||
$data[$field] = $this->input($request, $field);
|
||||
}
|
||||
$data['actions'] = [];
|
||||
$validButtons = true;
|
||||
foreach ([1, 2] as $index) {
|
||||
$label = $this->input($request, 'label' . $index);
|
||||
$url = $this->input($request, 'url' . $index);
|
||||
if ($label === '' && $url === '') {
|
||||
continue;
|
||||
}
|
||||
$data['actions'][] = [$url, $label];
|
||||
$validButtons = $validButtons && mb_strlen($label) <= 50 && $label !== '' && strlen($url) <= 1000 && Html::url($url);
|
||||
}
|
||||
$page = array_replace($page, $data, ['version' => $this->version($request)]);
|
||||
try {
|
||||
if ($data['title'] === '' || mb_strlen($data['title']) > 160 ||
|
||||
$data['description'] === '' || mb_strlen($data['description']) > 300 ||
|
||||
$data['heading'] === '' || mb_strlen($data['heading'] . $data['accent']) > 110 ||
|
||||
mb_strlen($data['lead']) > 600 || mb_strlen($data['alt']) > 200 ||
|
||||
strlen($data['image']) > 1000 || ($data['image'] !== '' && !Html::url($data['image'], true)) || !$validButtons) {
|
||||
throw new RuntimeException('请检查页面标题、说明、图片地址和按钮链接。');
|
||||
}
|
||||
$repo->savePage($slug, $data, $this->version($request));
|
||||
|
||||
return View::redirect('/admin/pages/' . $slug . '?saved=1');
|
||||
} catch (RuntimeException $exception) {
|
||||
$error = $this->validationMessage($exception);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render($request, 'admin-page', [
|
||||
'title' => '编辑 ' . $page['name'], 'page' => $page, 'error' => $error, 'saved' => $request->get('saved') === '1',
|
||||
], $error !== '' ? 422 : 200);
|
||||
}
|
||||
|
||||
public function section(Request $request, string $slug, string $key): Response
|
||||
{
|
||||
if ($failure = $this->guard($request)) {
|
||||
return $failure;
|
||||
}
|
||||
$repo = new Repository();
|
||||
$section = $repo->section($slug, $key);
|
||||
if (!$section) {
|
||||
return $this->error($request, '找不到此区块。', 404);
|
||||
}
|
||||
$error = '';
|
||||
if ($request->method() === 'POST') {
|
||||
$data = [
|
||||
'title' => $this->input($request, 'title'), 'lead' => $this->input($request, 'lead'),
|
||||
'body' => $this->input($request, 'body'),
|
||||
];
|
||||
$section = array_replace($section, $data, ['version' => $this->version($request)]);
|
||||
try {
|
||||
if ($data['title'] === '' || mb_strlen($data['title']) > 100 || mb_strlen($data['lead']) > 500 || strlen($data['body']) > 300000) {
|
||||
throw new RuntimeException('请填写区块标题,并检查说明及正文长度。');
|
||||
}
|
||||
$data['body'] = Html::sanitize($data['body']);
|
||||
$repo->saveSection($slug, $key, $data, $this->version($request));
|
||||
|
||||
return View::redirect('/admin/pages/' . $slug . '/' . $key . '?saved=1');
|
||||
} catch (RuntimeException $exception) {
|
||||
$error = $this->validationMessage($exception);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render($request, 'admin-section', [
|
||||
'title' => '编辑区块', 'section' => $section, 'error' => $error, 'saved' => $request->get('saved') === '1',
|
||||
], $error !== '' ? 422 : 200);
|
||||
}
|
||||
|
||||
public function preview(Request $request): Response
|
||||
{
|
||||
if ($failure = $this->guard($request)) {
|
||||
return $failure;
|
||||
}
|
||||
$body = $this->input($request, 'body');
|
||||
if (strlen($body) > 300000) {
|
||||
return new Response(413, ['Cache-Control' => 'no-store'], '正文太长。');
|
||||
}
|
||||
$html = $this->input($request, 'format') === 'html' ? Html::sanitize($body) : Html::markdown($body);
|
||||
|
||||
return new Response(200, [
|
||||
'Content-Type' => 'text/html; charset=utf-8', 'Cache-Control' => 'no-store', 'X-Robots-Tag' => 'noindex, nofollow',
|
||||
'Content-Security-Policy' => "default-src 'none'; frame-ancestors 'none'; sandbox",
|
||||
], $html);
|
||||
}
|
||||
|
||||
private function guard(Request $request): ?Response
|
||||
{
|
||||
if (!$this->signedIn($request)) {
|
||||
return View::redirect('/admin/login');
|
||||
}
|
||||
if ($request->method() === 'POST' && !$this->validToken($request)) {
|
||||
return $this->error($request, '表单已过期,请刷新后重试。', 403);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function signedIn(Request $request): bool
|
||||
{
|
||||
$session = $request->session();
|
||||
$id = $session->get('admin_id');
|
||||
if (!is_int($id) || (int) $session->get('admin_since') < time() - 8 * 60 * 60) {
|
||||
return false;
|
||||
}
|
||||
$user = (new Repository())->administratorById($id);
|
||||
if (!$user || !hash_equals(hash('sha256', $user['password_hash']), (string) $session->get('auth_version'))) {
|
||||
$session->flush();
|
||||
|
||||
return false;
|
||||
}
|
||||
$this->user = $user;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function token(Request $request): string
|
||||
{
|
||||
$session = $request->session();
|
||||
$token = $session->get('csrf');
|
||||
if (!is_string($token)) {
|
||||
$token = bin2hex(random_bytes(32));
|
||||
$session->set('csrf', $token);
|
||||
}
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
private function validToken(Request $request): bool
|
||||
{
|
||||
return hash_equals($this->token($request), $this->input($request, 'csrf'));
|
||||
}
|
||||
|
||||
private function input(Request $request, string $key, bool $trimValue = true): string
|
||||
{
|
||||
$value = $request->post($key, '');
|
||||
if (!is_string($value) || !mb_check_encoding($value, 'UTF-8')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $trimValue ? trim($value) : $value;
|
||||
}
|
||||
|
||||
private function version(Request $request): int
|
||||
{
|
||||
$version = $this->input($request, 'version');
|
||||
|
||||
return ctype_digit($version) ? (int) $version : -1;
|
||||
}
|
||||
|
||||
private function articleInput(Request $request): array
|
||||
{
|
||||
$data = [];
|
||||
foreach (['title', 'slug', 'category', 'summary', 'body', 'status'] as $key) {
|
||||
$data[$key] = $this->input($request, $key);
|
||||
}
|
||||
$tags = preg_split('/[,,\r\n]+/u', $this->input($request, 'tags'));
|
||||
$data['tags'] = array_values(array_unique(array_slice(array_filter(
|
||||
array_map('trim', $tags),
|
||||
static fn (string $tag): bool => $tag !== '' && mb_strlen($tag) <= 80 && !str_contains($tag, '/'),
|
||||
), 0, 12)));
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function address(Request $request): string
|
||||
{
|
||||
$peer = $request->getRemoteIp();
|
||||
$trusted = explode(',', getenv('LAYSENSE_TRUSTED_PROXIES') ?: '');
|
||||
$candidate = $request->header('x-real-ip', '');
|
||||
|
||||
return in_array($peer, $trusted, true) && filter_var($candidate, FILTER_VALIDATE_IP) ? $candidate : $peer;
|
||||
}
|
||||
|
||||
private function validationMessage(RuntimeException $exception): string
|
||||
{
|
||||
if ($exception instanceof \PDOException) {
|
||||
error_log($exception->getMessage());
|
||||
|
||||
return '保存失败,请稍后重试。';
|
||||
}
|
||||
|
||||
return $exception->getMessage();
|
||||
}
|
||||
|
||||
private function render(Request $request, string $view, array $data, int $status = 200): Response
|
||||
{
|
||||
return View::render($view, $data + ['token' => $this->token($request), 'user' => $this->user], $status, true);
|
||||
}
|
||||
|
||||
private function error(Request $request, string $message, int $status): Response
|
||||
{
|
||||
return $this->render($request, 'admin-error', ['title' => $message], $status);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Content\Html;
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
|
||||
final class SiteController
|
||||
{
|
||||
public function home(Request $request): Response
|
||||
{
|
||||
return $this->page($request, 'home');
|
||||
}
|
||||
|
||||
public function page(Request $request, string $slug): Response
|
||||
{
|
||||
$repo = new Repository();
|
||||
$page = $repo->page($slug);
|
||||
if (!$page) {
|
||||
return $this->missing($request);
|
||||
}
|
||||
$isHome = $slug === 'home';
|
||||
|
||||
return View::render('page', [
|
||||
'site' => $repo->site(),
|
||||
'page' => $page,
|
||||
'path' => $isHome ? '/' : '/' . $slug,
|
||||
'title' => $page['title'],
|
||||
'description' => $page['description'],
|
||||
'socialImage' => $page['image'],
|
||||
'socialAlt' => $page['alt'],
|
||||
'articles' => $isHome ? $repo->articles(limit: 3) : [],
|
||||
]);
|
||||
}
|
||||
|
||||
public function archive(Request $request, ?string $category = null, ?string $tag = null): Response
|
||||
{
|
||||
$repo = new Repository();
|
||||
$title = $category ? Repository::CATEGORIES[$category] : ($tag ?: '来笙动态');
|
||||
$path = '/articles' . ($category ? '/category/' . $category : ($tag ? '/tag/' . rawurlencode($tag) : ''));
|
||||
$number = $request->get('page', '1');
|
||||
if (!is_scalar($number) || !preg_match('/^[1-9][0-9]{0,4}$/D', (string) $number)) {
|
||||
return $this->missing($request);
|
||||
}
|
||||
$page = (int) $number;
|
||||
$articles = $repo->articles($category, $tag, limit: 21, offset: ($page - 1) * 20);
|
||||
if ($page > 1 && $articles === []) {
|
||||
return $this->missing($request);
|
||||
}
|
||||
|
||||
return View::render('archive', [
|
||||
'site' => $repo->site(), 'title' => $title . ' · 来笙', 'headline' => $title,
|
||||
'description' => '查看来笙的公告、新闻和产品动态。',
|
||||
'path' => $path . ($page > 1 ? '?page=' . $page : ''), 'archivePath' => $path,
|
||||
'category' => $category, 'tag' => $tag, 'pageNumber' => $page,
|
||||
'hasNext' => count($articles) > 20, 'articles' => array_slice($articles, 0, 20),
|
||||
'noindex' => $articles === [],
|
||||
]);
|
||||
}
|
||||
|
||||
public function tagged(Request $request, string $tag): Response
|
||||
{
|
||||
$tag = rawurldecode($tag);
|
||||
if (mb_strlen($tag) > 80 || $tag === '') {
|
||||
return $this->missing($request);
|
||||
}
|
||||
|
||||
return $this->archive($request, tag: $tag);
|
||||
}
|
||||
|
||||
public function article(Request $request, string $slug): Response
|
||||
{
|
||||
$repo = new Repository();
|
||||
$article = $repo->published($slug);
|
||||
if (!$article) {
|
||||
$redirect = $repo->articleRedirect($slug);
|
||||
|
||||
return $redirect ? View::redirect('/articles/' . $redirect['slug'], 301) : $this->missing($request);
|
||||
}
|
||||
$articleHtml = Html::markdown($article['body']);
|
||||
|
||||
return View::render('article', [
|
||||
'site' => $repo->site(), 'article' => $article, 'articleHtml' => $articleHtml,
|
||||
'title' => $article['title'] . ' · 来笙',
|
||||
'description' => $article['summary'] ?: mb_substr(trim(strip_tags($articleHtml)), 0, 150) ?: $article['title'],
|
||||
'path' => '/articles/' . $article['slug'], 'noindex' => trim($articleHtml) === '',
|
||||
]);
|
||||
}
|
||||
|
||||
public function legacyArticle(Request $request, string $id): Response
|
||||
{
|
||||
$article = (new Repository())->legacyArticle('/news/id/' . $id . '.html');
|
||||
|
||||
return $article ? View::redirect('/articles/' . $article['slug'], 301) : $this->missing($request);
|
||||
}
|
||||
|
||||
public function legacyCategory(Request $request, string $id): Response
|
||||
{
|
||||
$target = [
|
||||
'1' => '/articles/category/product', '2' => '/articles/category/news', '3' => '/articles/category/announcement',
|
||||
'5' => '/#supported-projects', '6' => '/#partners',
|
||||
][$id] ?? null;
|
||||
|
||||
return $target ? View::redirect($target, 301) : $this->missing($request);
|
||||
}
|
||||
|
||||
public function legacyTag(Request $request, string $tag): Response
|
||||
{
|
||||
return View::redirect('/articles/tag/' . rawurlencode(rawurldecode($tag)), 301);
|
||||
}
|
||||
|
||||
public function sitemap(Request $request): Response
|
||||
{
|
||||
$repo = new Repository();
|
||||
$xml = ['<?xml version="1.0" encoding="UTF-8"?>', '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'];
|
||||
$pages = $repo->pages();
|
||||
if ($repo->articles(limit: 1)) {
|
||||
$pages[] = ['slug' => 'articles', 'updated_at' => null];
|
||||
}
|
||||
foreach ($pages as $page) {
|
||||
$xml[] = $this->sitemapUrl($page['slug'] === 'home' ? '/' : '/' . $page['slug'], $page['updated_at']);
|
||||
}
|
||||
foreach ($repo->sitemapArticles() as $article) {
|
||||
$xml[] = $this->sitemapUrl('/articles/' . $article['slug'], $article['updated_at']);
|
||||
}
|
||||
$xml[] = '</urlset>';
|
||||
|
||||
return new Response(200, ['Content-Type' => 'application/xml; charset=utf-8'], implode("\n", $xml) . "\n");
|
||||
}
|
||||
|
||||
public function robots(Request $request): Response
|
||||
{
|
||||
return new Response(200, ['Content-Type' => 'text/plain; charset=utf-8'],
|
||||
"User-agent: *\nAllow: /\nDisallow: /admin\nSitemap: " . View::absolute('/sitemap.xml') . "\n");
|
||||
}
|
||||
|
||||
public function missing(Request $request): Response
|
||||
{
|
||||
$path = $request->path();
|
||||
if ($request->method() === 'GET' && strlen($path) > 1 && str_ends_with($path, '/')) {
|
||||
$normal = rtrim($path, '/');
|
||||
if (preg_match('~^/(?:pagepan|highspeaker|sc|shnu-sc|articles(?:/[a-z0-9-]+){0,2})$~D', $normal)) {
|
||||
$query = $request->queryString();
|
||||
|
||||
return View::redirect($normal . ($query !== '' ? '?' . $query : ''), 301);
|
||||
}
|
||||
}
|
||||
|
||||
return View::render('missing', [
|
||||
'site' => (new Repository())->site(), 'title' => '页面未找到 · 来笙', 'description' => '',
|
||||
'path' => null, 'noindex' => true,
|
||||
], 404);
|
||||
}
|
||||
|
||||
private function sitemapUrl(string $path, ?string $updated): string
|
||||
{
|
||||
$url = htmlspecialchars(View::absolute($path), ENT_XML1 | ENT_QUOTES, 'UTF-8');
|
||||
$date = $updated ? '<lastmod>' . View::date($updated, 'Y-m-d') . '</lastmod>' : '';
|
||||
|
||||
return ' <url><loc>' . $url . '</loc>' . $date . '</url>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<?php if ($articles): ?>
|
||||
<ul class="admin-list">
|
||||
<?php foreach ($articles as $item): ?>
|
||||
<li>
|
||||
<div><strong><?= $e($item['title']) ?></strong>
|
||||
<small><?= $e(Repository::CATEGORIES[$item['category']]) ?> · <?= $item['status'] === 'published' ? '已发布' : '草稿' ?> · <?= $e(View::date($item['updated_at'])) ?></small>
|
||||
</div>
|
||||
<a class="button button-outline" href="/admin/articles/<?= $e($item['id']) ?>">编辑文章</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<p class="empty-state">暂无文章。</p>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<a class="back-link" href="/admin/articles">返回文章列表</a>
|
||||
<header class="admin-heading">
|
||||
<h1><?= $e($title) ?></h1>
|
||||
<?php if ($articleId && $article['status'] === 'published' && $article['slug'] !== ''): ?>
|
||||
<a class="button button-outline" href="/articles/<?= $e($article['slug']) ?>">查看公开页面</a>
|
||||
<?php endif ?>
|
||||
</header>
|
||||
<?= View::fragment('admin-feedback', compact('error', 'saved')) ?>
|
||||
<form class="admin-form admin-panel" method="post" action="/admin/articles/<?= $e($articleId ?? 'new') ?>">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<input type="hidden" name="version" value="<?= $e($article['version']) ?>">
|
||||
<label>文章标题<input name="title" value="<?= $e($article['title']) ?>" required maxlength="120"></label>
|
||||
<div class="form-grid">
|
||||
<label>网址标识<input name="slug" value="<?= $e($article['slug']) ?>" required maxlength="100" pattern="[a-z0-9]+(-[a-z0-9]+)*" placeholder="product-update"><small>使用小写英文字母、数字和连字符。</small></label>
|
||||
<label>分类<select name="category">
|
||||
<?php foreach (Repository::CATEGORIES as $key => $label): ?>
|
||||
<option value="<?= $e($key) ?>" <?= $article['category'] === $key ? 'selected' : '' ?>><?= $e($label) ?></option>
|
||||
<?php endforeach ?>
|
||||
</select></label>
|
||||
</div>
|
||||
<label>标签<input name="tags" value="<?= $e(implode(',', $article['tags'])) ?>" placeholder="用逗号分隔"></label>
|
||||
<label>摘要<textarea name="summary" rows="2" maxlength="250"><?= $e($article['summary']) ?></textarea><small>用于动态列表和搜索摘要。</small></label>
|
||||
<?= View::fragment('admin-editor', ['format' => 'markdown', 'body' => $article['body']]) ?>
|
||||
<div class="form-submit">
|
||||
<label>发布状态<select name="status">
|
||||
<option value="draft" <?= $article['status'] === 'draft' ? 'selected' : '' ?>>草稿</option>
|
||||
<option value="published" <?= $article['status'] === 'published' ? 'selected' : '' ?>>已发布</option>
|
||||
</select></label>
|
||||
<button class="button button-primary" type="submit">保存文章</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
?>
|
||||
<header class="admin-heading">
|
||||
<h1>文章与动态</h1>
|
||||
<a class="button button-primary" href="/admin/articles/new">新建文章</a>
|
||||
</header>
|
||||
<div class="admin-panel">
|
||||
<?= View::fragment('admin-article-list', ['articles' => $articles]) ?>
|
||||
</div>
|
||||
<?php if ($pageNumber > 1 || $hasNext): ?>
|
||||
<nav class="pagination" aria-label="文章分页">
|
||||
<?php if ($pageNumber > 1): ?><a class="button button-outline" href="/admin/articles?page=<?= $pageNumber - 1 ?>">上一页</a><?php endif ?>
|
||||
<span>第 <?= $pageNumber ?> 页</span>
|
||||
<?php if ($hasNext): ?><a class="button button-outline" href="/admin/articles?page=<?= $pageNumber + 1 ?>">下一页</a><?php endif ?>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<header class="admin-heading">
|
||||
<div><h1>内容管理</h1><p>管理网站页面、文章、公告和产品动态。</p></div>
|
||||
<a class="button button-primary" href="/admin/articles/new">新建文章</a>
|
||||
</header>
|
||||
<section class="admin-panel" aria-labelledby="pages-title">
|
||||
<h2 id="pages-title">网站页面</h2>
|
||||
<ul class="admin-list">
|
||||
<?php foreach ($pages as $page): ?>
|
||||
<li>
|
||||
<div><strong><?= $e($page['name']) ?></strong><small><?= $e($page['slug'] === 'home' ? '/' : '/' . $page['slug']) ?></small></div>
|
||||
<a class="button button-outline" href="/admin/pages/<?= $e($page['slug']) ?>">编辑页面</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="admin-panel" aria-labelledby="recent-title">
|
||||
<div class="admin-heading compact"><h2 id="recent-title">最近编辑的文章</h2><a href="/admin/articles">管理全部文章</a></div>
|
||||
<?= View::fragment('admin-article-list', ['articles' => $articles]) ?>
|
||||
</section>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<div class="editor" data-editor data-format="<?= $format ?>">
|
||||
<label for="editor-text">正文(<?= $format === 'markdown' ? 'Markdown' : 'HTML' ?>)</label>
|
||||
<div class="editor-toolbar">
|
||||
<div role="group" aria-label="插入格式">
|
||||
<button type="button" data-insert="heading">小标题</button>
|
||||
<button type="button" data-insert="bold">粗体</button>
|
||||
<button type="button" data-insert="list">列表</button>
|
||||
<button type="button" data-insert="link">链接</button>
|
||||
</div>
|
||||
<button data-preview-button type="button" aria-controls="editor-preview" aria-expanded="false">预览正文</button>
|
||||
</div>
|
||||
<textarea id="editor-text" name="body" rows="15" spellcheck="false"><?= $e($body) ?></textarea>
|
||||
<?php if ($format === 'html'): ?>
|
||||
<p class="field-note">支持段落、标题、链接、图片、列表、表格和折叠问答。保存时会清理脚本、内联样式等标签或属性。</p>
|
||||
<?php endif ?>
|
||||
<div class="editor-preview rich prose" id="editor-preview" aria-live="polite" hidden></div>
|
||||
</div>
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1><?= App\Content\View::escape($title) ?></h1>
|
||||
<a class="button button-primary" href="/admin">返回内容管理</a>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php use App\Content\View; ?>
|
||||
<?php if ($error): ?><p class="feedback error" role="alert"><?= View::escape($error) ?></p><?php endif ?>
|
||||
<?php if ($saved && !$error): ?><p class="feedback success" role="status">已保存。</p><?php endif ?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title><?= $e($title) ?> · 来笙 CMS</title>
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<link rel="stylesheet" href="/assets/site.css">
|
||||
<link rel="stylesheet" href="/assets/admin.css">
|
||||
<script src="/assets/admin.js" defer></script>
|
||||
</head>
|
||||
<body class="admin-body">
|
||||
<a class="skip-link" href="#admin-content">跳到内容</a>
|
||||
<header class="admin-bar">
|
||||
<div class="admin-wrap admin-bar-inner">
|
||||
<a class="wordmark" href="/admin" aria-label="来笙内容管理首页"><img src="/assets/wordmark.webp" alt="来笙 Laysense" width="130" height="33"></a>
|
||||
<?php if ($user): ?>
|
||||
<nav aria-label="后台导航">
|
||||
<a href="/admin">页面</a>
|
||||
<a href="/admin/articles">文章</a>
|
||||
<a href="/">访问网站</a>
|
||||
<form method="post" action="/admin/logout">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<button class="button button-outline" type="submit">退出</button>
|
||||
</form>
|
||||
</nav>
|
||||
<?php else: ?>
|
||||
<a class="back-link" href="/">返回网站</a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</header>
|
||||
<main class="admin-wrap admin-main" id="admin-content"><?= $content ?></main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<div class="login-box">
|
||||
<h1>登录内容管理</h1>
|
||||
<p>编辑来笙网站的页面、公告和文章。</p>
|
||||
<?php if ($error): ?><p class="feedback error" role="alert"><?= $e($error) ?></p><?php endif ?>
|
||||
<form class="admin-form" method="post" action="/admin/login">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<label>管理员邮箱<input name="email" type="email" value="<?= $e($email) ?>" autocomplete="username" required maxlength="254"></label>
|
||||
<label>密码<input name="password" type="password" autocomplete="current-password" required></label>
|
||||
<button class="button button-primary" type="submit">登录</button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
$slug = $page['slug'];
|
||||
?>
|
||||
<a class="back-link" href="/admin">返回内容管理</a>
|
||||
<header class="admin-heading">
|
||||
<h1><?= $e($title) ?></h1>
|
||||
<a class="button button-outline" href="<?= $e($slug === 'home' ? '/' : '/' . $slug) ?>">查看公开页面</a>
|
||||
</header>
|
||||
<?= View::fragment('admin-feedback', compact('error', 'saved')) ?>
|
||||
<form class="admin-form admin-panel" method="post" action="/admin/pages/<?= $e($slug) ?>">
|
||||
<h2>首屏与 SEO</h2>
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<input type="hidden" name="version" value="<?= $e($page['version']) ?>">
|
||||
<label>SEO 标题<input name="title" value="<?= $e($page['title']) ?>" required maxlength="160"></label>
|
||||
<label>SEO 描述<textarea name="description" rows="3" required maxlength="300"><?= $e($page['description']) ?></textarea></label>
|
||||
<div class="form-grid">
|
||||
<label>首屏标题<input name="heading" value="<?= $e($page['heading']) ?>" required maxlength="110"></label>
|
||||
<label>标题第二行<input name="accent" value="<?= $e($page['accent']) ?>" maxlength="110"></label>
|
||||
</div>
|
||||
<label>首屏简介<textarea name="lead" rows="3" maxlength="600"><?= $e($page['lead']) ?></textarea></label>
|
||||
<div class="form-grid">
|
||||
<label>首屏图片地址<input name="image" value="<?= $e($page['image']) ?>" maxlength="1000"></label>
|
||||
<label>图片替代文本<input name="alt" value="<?= $e($page['alt']) ?>" maxlength="200"></label>
|
||||
</div>
|
||||
<?php foreach ([1, 2] as $index): ?>
|
||||
<div class="form-grid">
|
||||
<label>按钮 <?= $index ?> 文案<input name="label<?= $index ?>" value="<?= $e($page['actions'][$index - 1][1] ?? '') ?>" maxlength="50"></label>
|
||||
<label>按钮 <?= $index ?> 链接<input name="url<?= $index ?>" value="<?= $e($page['actions'][$index - 1][0] ?? '') ?>" maxlength="1000"></label>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
<div class="form-submit"><button class="button button-primary" type="submit">保存页面</button></div>
|
||||
</form>
|
||||
<section class="admin-panel">
|
||||
<h2>内容区块</h2>
|
||||
<ul class="admin-list">
|
||||
<?php foreach ($page['sections'] as $item): ?>
|
||||
<li>
|
||||
<div><strong><?= $e($item['title']) ?></strong><small>#<?= $e($item['key']) ?></small></div>
|
||||
<a class="button button-outline" href="/admin/pages/<?= $e($slug) ?>/<?= $e($item['key']) ?>">编辑区块</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
$slug = $section['page_slug'];
|
||||
$key = $section['key'];
|
||||
?>
|
||||
<a class="back-link" href="/admin/pages/<?= $e($slug) ?>">返回页面编辑</a>
|
||||
<header class="admin-heading">
|
||||
<div><h1><?= $e($title) ?></h1><p><?= $e($slug) ?> · #<?= $e($key) ?></p></div>
|
||||
<a class="button button-outline" href="<?= $e(($slug === 'home' ? '/' : '/' . $slug) . '#' . $key) ?>">查看公开区块</a>
|
||||
</header>
|
||||
<?= View::fragment('admin-feedback', compact('error', 'saved')) ?>
|
||||
<form class="admin-form admin-panel" method="post" action="/admin/pages/<?= $e($slug) ?>/<?= $e($key) ?>">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<input type="hidden" name="version" value="<?= $e($section['version']) ?>">
|
||||
<label>区块标题<input name="title" value="<?= $e($section['title']) ?>" required maxlength="100"></label>
|
||||
<label>区块简介<textarea name="lead" rows="2" maxlength="500"><?= $e($section['lead']) ?></textarea></label>
|
||||
<?= View::fragment('admin-editor', ['format' => 'html', 'body' => $section['body']]) ?>
|
||||
<div class="form-submit"><button class="button button-primary" type="submit">保存区块</button></div>
|
||||
</form>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<section class="section article-page" aria-labelledby="archive-title" data-enter>
|
||||
<div class="wrap">
|
||||
<div class="section-heading">
|
||||
<?php if ($tag || $category): ?><a class="back-link" href="/articles">全部动态</a><?php endif ?>
|
||||
<h1 id="archive-title"><?= $e($headline) ?></h1>
|
||||
<p>来笙的公告、新闻和产品动态。</p>
|
||||
</div>
|
||||
<nav class="filter-nav" aria-label="动态分类">
|
||||
<a href="/articles" <?= !$category && !$tag ? 'aria-current="page"' : '' ?>>全部</a>
|
||||
<?php foreach (Repository::CATEGORIES as $key => $label): ?>
|
||||
<a href="/articles/category/<?= $e($key) ?>" <?= $category === $key ? 'aria-current="page"' : '' ?>><?= $e($label) ?></a>
|
||||
<?php endforeach ?>
|
||||
</nav>
|
||||
<?= View::fragment('article-list', ['articles' => $articles]) ?>
|
||||
<?php if ($pageNumber > 1 || $hasNext): ?>
|
||||
<nav class="pagination" aria-label="动态分页">
|
||||
<?php if ($pageNumber > 1): ?><a class="button button-outline" href="<?= $e($archivePath . ($pageNumber > 2 ? '?page=' . ($pageNumber - 1) : '')) ?>" rel="prev">上一页</a><?php endif ?>
|
||||
<span>第 <?= $e($pageNumber) ?> 页</span>
|
||||
<?php if ($hasNext): ?><a class="button button-outline" href="<?= $e($archivePath . '?page=' . ($pageNumber + 1)) ?>" rel="next">下一页</a><?php endif ?>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<?php if ($articles): ?>
|
||||
<ul class="article-list">
|
||||
<?php foreach ($articles as $item): ?>
|
||||
<li>
|
||||
<a class="article-row" href="/articles/<?= $e($item['slug']) ?>">
|
||||
<span class="article-category"><?= $e(Repository::CATEGORIES[$item['category']]) ?></span>
|
||||
<span class="article-row-title"><?= $e($item['title']) ?>
|
||||
<?php if ($item['summary']): ?><small><?= $e($item['summary']) ?></small><?php endif ?>
|
||||
</span>
|
||||
<time datetime="<?= $e(View::date($item['published_at'], 'Y-m-d')) ?>"><?= $e(View::date($item['published_at'], 'Y.m.d')) ?></time>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<p class="empty-state">暂无已发布的动态。</p>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<article class="section article-page" itemscope itemtype="https://schema.org/Article" data-enter>
|
||||
<div class="wrap reading-wrap">
|
||||
<a class="back-link" href="/articles">全部动态</a>
|
||||
<header class="section-heading">
|
||||
<div class="article-meta">
|
||||
<a href="/articles/category/<?= $e($article['category']) ?>" itemprop="articleSection"><?= $e(Repository::CATEGORIES[$article['category']]) ?></a>
|
||||
<time itemprop="datePublished" datetime="<?= $e(View::date($article['published_at'], DATE_ATOM)) ?>"><?= $e(View::date($article['published_at'])) ?></time>
|
||||
<meta itemprop="dateModified" content="<?= $e(View::date($article['updated_at'], DATE_ATOM)) ?>">
|
||||
</div>
|
||||
<h1 itemprop="headline"><?= $e($article['title']) ?></h1>
|
||||
<?php if ($article['summary']): ?><p itemprop="description"><?= $e($article['summary']) ?></p><?php endif ?>
|
||||
<span itemprop="author" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="<?= $e($site['name']) ?>"></span>
|
||||
</header>
|
||||
<div class="rich prose" itemprop="articleBody">
|
||||
<?php if (trim($articleHtml) !== ''): ?>
|
||||
<?= $articleHtml ?>
|
||||
<?php else: ?>
|
||||
<p class="empty-state">此公告的原文暂不可用。</p>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php if ($article['tags']): ?>
|
||||
<nav class="filter-nav" aria-label="文章标签">
|
||||
<?php foreach ($article['tags'] as $tag): ?>
|
||||
<a href="/articles/tag/<?= $e(rawurlencode($tag)) ?>"><?= $e($tag) ?></a>
|
||||
<?php endforeach ?>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</article>
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
$canonical = $path !== null ? View::absolute($path) : null;
|
||||
$imageUrl = !empty($socialImage) ? $socialImage : '/assets/original/home-hero.webp';
|
||||
if (str_starts_with($imageUrl, '/')) {
|
||||
$imageUrl = View::absolute($imageUrl);
|
||||
}
|
||||
$kind = in_array($page['slug'] ?? '', ['sc', 'shnu-sc'], true) ? 'service' : 'software';
|
||||
$siteKind = $kind === 'service' ? 'other' : 'software';
|
||||
$nav = [
|
||||
['/', '首页'], ['/#product', '产品与服务'], ['/articles', '动态'], ['/#about', '关于来笙'],
|
||||
];
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN" data-type="<?= $e($kind) ?>" data-buttons="solid" data-motion="on">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= $e($title) ?></title>
|
||||
<meta name="description" content="<?= $e($description) ?>">
|
||||
<meta name="theme-color" content="#f5f7fb">
|
||||
<meta name="page-type" content="<?= $e($kind) ?>">
|
||||
<meta name="site-kind" content="<?= $e($siteKind) ?>">
|
||||
<?php if ($canonical): ?>
|
||||
<link rel="canonical" href="<?= $e($canonical) ?>">
|
||||
<meta property="og:url" content="<?= $e($canonical) ?>">
|
||||
<?php endif ?>
|
||||
<?php if (!empty($noindex)): ?><meta name="robots" content="noindex"><?php endif ?>
|
||||
<meta property="og:type" content="<?= isset($article) ? 'article' : 'website' ?>">
|
||||
<meta property="og:locale" content="zh_CN">
|
||||
<meta property="og:site_name" content="来笙 Laysense">
|
||||
<meta property="og:title" content="<?= $e($title) ?>">
|
||||
<meta property="og:description" content="<?= $e($description) ?>">
|
||||
<meta property="og:image" content="<?= $e($imageUrl) ?>">
|
||||
<meta property="og:image:alt" content="<?= $e(($socialAlt ?? '') ?: '来笙 Laysense') ?>">
|
||||
<?php if (isset($article)): ?>
|
||||
<meta property="article:published_time" content="<?= $e(View::date($article['published_at'], DATE_ATOM)) ?>">
|
||||
<meta property="article:modified_time" content="<?= $e(View::date($article['updated_at'], DATE_ATOM)) ?>">
|
||||
<?php endif ?>
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<link rel="stylesheet" href="/assets/site.css">
|
||||
<script src="/assets/site.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#main-content">跳到内容</a>
|
||||
<header class="masthead">
|
||||
<div class="wrap masthead-inner">
|
||||
<a class="wordmark" href="/" aria-label="来笙 Laysense 首页">
|
||||
<img src="/assets/wordmark.webp" alt="Laysense 来笙" width="130" height="33">
|
||||
</a>
|
||||
<button class="menu-toggle" type="button" aria-expanded="false" aria-controls="primary-navigation" hidden>
|
||||
<span></span><span></span><span class="sr-only">菜单</span>
|
||||
</button>
|
||||
<nav id="primary-navigation" class="primary-nav" aria-label="主导航">
|
||||
<?php foreach ($nav as [$url, $label]): ?>
|
||||
<?php $current = $url === $path || ($url === '/articles' && str_starts_with($path ?? '', '/articles')); ?>
|
||||
<a href="<?= $e($url) ?>" <?= $current ? 'aria-current="page"' : '' ?>><?= $e($label) ?></a>
|
||||
<?php endforeach ?>
|
||||
<a class="mobile-contact" href="#contact">联系来笙</a>
|
||||
</nav>
|
||||
<a class="button button-outline masthead-action" href="#contact">联系来笙</a>
|
||||
</div>
|
||||
</header>
|
||||
<main id="main-content" tabindex="-1"><?= $content ?></main>
|
||||
<footer class="site-footer" id="contact">
|
||||
<div class="wrap">
|
||||
<div class="footer-grid">
|
||||
<div class="footer-company" itemscope itemtype="https://schema.org/Organization">
|
||||
<a href="/" itemprop="url" aria-label="来笙 Laysense 首页">
|
||||
<img src="/assets/wordmark.webp" alt="来笙 Laysense" width="130" height="33" itemprop="logo" loading="lazy">
|
||||
</a>
|
||||
<p itemprop="name"><?= $e($site['name']) ?></p>
|
||||
<address itemprop="address"><?= $e($site['address']) ?></address>
|
||||
<a itemprop="email" href="mailto:<?= $e($site['email']) ?>"><?= $e($site['email']) ?></a>
|
||||
<div class="payment-methods" aria-label="支持的付款方式">
|
||||
<img src="/assets/original/payment-taobao.png" alt="淘宝" width="26" height="26" loading="lazy">
|
||||
<img src="/assets/original/payment-alipay.png" alt="支付宝" width="26" height="26" loading="lazy">
|
||||
<img src="/assets/original/payment-wechat.png" alt="微信支付" width="26" height="26" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p class="footer-label">产品与服务</p>
|
||||
<a href="/pagepan">PAGEPAN 小飞页</a>
|
||||
<a href="/highspeaker">HighSpeaker DNS</a>
|
||||
<a href="/sc">软著代理服务</a>
|
||||
<a href="/shnu-sc">SHNU 学生软著服务</a>
|
||||
</div>
|
||||
<div>
|
||||
<p class="footer-label">公司</p>
|
||||
<a href="/#about">关于来笙</a>
|
||||
<a href="/articles">来笙动态</a>
|
||||
<a href="https://git.laysense.com">Laysense Git</a>
|
||||
<a href="https://www.layso.de">LaySo</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-meta">
|
||||
<p><?= $e($site['copyright']) ?> 2024–<?= $e(date('Y')) ?></p>
|
||||
<p>全球号码 <a href="tel:+16699004532">+1 (669) 900 4532</a> / <a href="tel:+85257012856">+852 5701 2856</a></p>
|
||||
<a href="https://beian.miit.gov.cn/"><?= $e($site['registration']) ?></a>
|
||||
<p class="footer-terms"><?= $e($site['terms']) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<section class="section article-page">
|
||||
<div class="wrap">
|
||||
<p class="overline">404</p>
|
||||
<h1>页面未找到</h1>
|
||||
<p>请检查网址,或回到首页浏览产品与服务。</p>
|
||||
<a class="button button-primary" href="/">返回首页</a>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
$home = $page['slug'] === 'home';
|
||||
$service = in_array($page['slug'], ['sc', 'shnu-sc'], true);
|
||||
?>
|
||||
<section class="hero hero-<?= $e($page['slug']) ?>" id="home" data-enter>
|
||||
<div class="wrap hero-inner">
|
||||
<div class="hero-copy">
|
||||
<?php if (!$home): ?>
|
||||
<nav class="breadcrumbs" aria-label="面包屑" itemscope itemtype="https://schema.org/BreadcrumbList">
|
||||
<span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
|
||||
<a itemprop="item" href="/"><span itemprop="name">首页</span></a>
|
||||
<meta itemprop="position" content="1">
|
||||
</span>
|
||||
<span class="crumb-divider" aria-hidden="true">/</span>
|
||||
<span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
|
||||
<a itemprop="item" href="/<?= $e($page['slug']) ?>" aria-current="page"><span itemprop="name"><?= $e($page['name']) ?></span></a>
|
||||
<meta itemprop="position" content="2">
|
||||
</span>
|
||||
</nav>
|
||||
<?php else: ?>
|
||||
<p class="overline hero-label">上海来笙信息科技有限公司</p>
|
||||
<?php endif ?>
|
||||
<h1><?= $e($page['heading']) ?><?php if ($page['accent'] !== ''): ?><br><span><?= $e($page['accent']) ?></span><?php endif ?></h1>
|
||||
<p class="hero-lead"><?= $e($page['lead']) ?></p>
|
||||
<div class="actions hero-actions">
|
||||
<?php foreach ($page['actions'] as $index => [$url, $label]): ?>
|
||||
<a class="button <?= $index ? 'button-outline' : 'button-primary' ?>" href="<?= $e($url) ?>"><?= $e($label) ?></a>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($page['image'] !== ''): ?>
|
||||
<div class="hero-visual <?= $home ? 'hero-illustration' : ($service ? 'hero-service-art' : 'app-frame') ?>" data-visual>
|
||||
<img src="<?= $e($page['image']) ?>" alt="<?= $e($page['alt']) ?>" width="1448" height="1086" fetchpriority="high">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php if ($home): ?>
|
||||
<div class="wrap hero-directory">
|
||||
<span class="overline">产品与服务</span>
|
||||
<a href="/pagepan"><span>PAGEPAN</span><small>可视化建站</small></a>
|
||||
<a href="/highspeaker"><span>HighSpeaker DNS</span><small>开源智能解析</small></a>
|
||||
<a href="/sc"><span>软著代理</span><small>登记申请与材料服务</small></a>
|
||||
<a href="/shnu-sc"><span>SHNU 学生</span><small>软著申请方案</small></a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
<?php if ($page['quicklinks']): ?>
|
||||
<nav class="section-nav" aria-label="本页目录">
|
||||
<div class="wrap section-nav-inner">
|
||||
<?php foreach ($page['quicklinks'] as [$url, $label]): ?>
|
||||
<a href="<?= $e($url) ?>"><?= $e($label) ?></a>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<?php foreach ($page['sections'] as $section): ?>
|
||||
<?= View::fragment('section', ['section' => $section, 'moment' => $home && $section['key'] === 'about']) ?>
|
||||
<?php endforeach ?>
|
||||
<?php if ($home): ?>
|
||||
<section class="section home-news" id="blog" aria-labelledby="updates-heading">
|
||||
<div class="wrap">
|
||||
<div class="section-heading inline-heading">
|
||||
<h2 id="updates-heading">来笙动态</h2>
|
||||
<a class="button button-outline" href="/articles">查看全部动态</a>
|
||||
</div>
|
||||
<?= View::fragment('article-list', ['articles' => $articles]) ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php if ($page['partners']): ?>
|
||||
<section class="section network" aria-labelledby="network-heading">
|
||||
<div class="wrap">
|
||||
<div class="section-heading"><h2 id="network-heading">支持项目与合作伙伴</h2></div>
|
||||
<?php foreach (['来笙支持项目' => 'supported-projects', '来笙合作伙伴' => 'partners'] as $group => $id): ?>
|
||||
<div class="network-group" id="<?= $e($id) ?>">
|
||||
<h3><?= $e($group) ?></h3>
|
||||
<ul class="network-list">
|
||||
<?php foreach ($page['partners'] as $partner): ?>
|
||||
<?php if ($partner['group'] !== $group) { continue; } ?>
|
||||
<li>
|
||||
<?php if ($partner['url']): ?><a href="<?= $e($partner['url']) ?>"><?php else: ?><div><?php endif ?>
|
||||
<?php if ($partner['image']): ?>
|
||||
<img src="<?= $e($partner['image']) ?>" alt="" loading="lazy" width="76" height="28">
|
||||
<?php endif ?>
|
||||
<span><?= $e($partner['name']) ?></span>
|
||||
<?php if ($partner['url']): ?></a><?php else: ?></div><?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<section class="section section-<?= $e($section['style']) ?>" id="<?= $e($section['key']) ?>" aria-labelledby="heading-<?= $e($section['key']) ?>" <?= $moment ? 'data-moment="iris-opens"' : '' ?>>
|
||||
<div class="wrap">
|
||||
<div class="section-heading">
|
||||
<h2 id="heading-<?= $e($section['key']) ?>"><?= $e($section['title']) ?></h2>
|
||||
<?php if ($section['lead']): ?><p><?= $e($section['lead']) ?></p><?php endif ?>
|
||||
</div>
|
||||
<div class="rich"><?= $section['body'] ?></div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
use App\Content\Database;
|
||||
|
||||
$email = strtolower(trim($argv[1] ?? ''));
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
fwrite(STDERR, "用法:php bin/admin.php admin@example.com\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fwrite(STDERR, "请输入至少 12 字符的管理员密码:");
|
||||
$tty = function_exists('stream_isatty') && stream_isatty(STDIN);
|
||||
if ($tty) {
|
||||
exec('stty -echo');
|
||||
}
|
||||
try {
|
||||
$password = rtrim((string) fgets(STDIN), "\r\n");
|
||||
} finally {
|
||||
if ($tty) {
|
||||
exec('stty echo');
|
||||
}
|
||||
fwrite(STDERR, "\n");
|
||||
}
|
||||
if (mb_strlen($password) < 12 || strlen($password) > 72 || str_contains($password, "\0")) {
|
||||
fwrite(STDERR, "密码需至少 12 字符,并且最多 72 字节。\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Database::initialize();
|
||||
$hash = password_hash($password, PASSWORD_DEFAULT);
|
||||
$query = Database::connect()->prepare('INSERT INTO users (email, password_hash) VALUES (?, ?)
|
||||
ON CONFLICT (email) DO UPDATE SET password_hash = excluded.password_hash');
|
||||
$query->execute([$email, $hash]);
|
||||
fwrite(STDOUT, "管理员账户已就绪。\n");
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
use App\Content\Database;
|
||||
|
||||
umask(0027);
|
||||
Database::initialize();
|
||||
fwrite(STDOUT, "SQLite 已初始化。现有内容会保留。\n");
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "laysense/website",
|
||||
"description": "Laysense website and content manager",
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"ext-dom": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-pdo_sqlite": "*",
|
||||
"league/commonmark": "^2.8",
|
||||
"monolog/monolog": "^3.0",
|
||||
"workerman/webman-framework": "^2.2"
|
||||
},
|
||||
"autoload": {"psr-4": {"App\\": "app/"}},
|
||||
"config": {"sort-packages": true}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'debug' => false,
|
||||
'error_reporting' => E_ALL,
|
||||
'default_timezone' => 'Asia/Shanghai',
|
||||
'request_class' => support\Request::class,
|
||||
'public_path' => base_path() . '/public',
|
||||
'runtime_path' => base_path() . '/runtime',
|
||||
'controller_suffix' => 'Controller',
|
||||
'controller_reuse' => false,
|
||||
];
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return [support\bootstrap\Session::class];
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return new Webman\Container();
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return ['' => support\exception\Handler::class];
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'default' => [
|
||||
'handlers' => [
|
||||
[
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
'constructor' => [runtime_path() . '/logs/webman.log', 14, Monolog\Level::Info],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'webman' => [
|
||||
'handler' => Webman\App::class,
|
||||
'listen' => getenv('LAYSENSE_LISTEN') ?: 'http://127.0.0.1:8787',
|
||||
'count' => max(1, (int) (getenv('LAYSENSE_WORKERS') ?: 2)),
|
||||
'constructor' => [
|
||||
'requestClass' => support\Request::class,
|
||||
'logger' => support\Log::channel('default'),
|
||||
'appPath' => app_path(),
|
||||
'publicPath' => public_path(),
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use App\Controller\AdminController;
|
||||
use App\Controller\SiteController;
|
||||
use App\Content\View;
|
||||
use support\Request;
|
||||
use Webman\Route;
|
||||
|
||||
Route::disableDefaultRoute();
|
||||
Route::get('/', [SiteController::class, 'home']);
|
||||
Route::get('/{slug:pagepan|highspeaker|sc|shnu-sc}', [SiteController::class, 'page']);
|
||||
Route::get('/articles', [SiteController::class, 'archive']);
|
||||
Route::get('/articles/category/{category:announcement|news|product}', [SiteController::class, 'archive']);
|
||||
Route::get('/articles/tag/{tag:[^/]+}', [SiteController::class, 'tagged']);
|
||||
Route::get('/articles/{slug:[a-z0-9-]+}', [SiteController::class, 'article']);
|
||||
Route::get('/main', static fn () => View::redirect('/articles', 301));
|
||||
Route::get('/main/category/{id:[0-9]+}.html', [SiteController::class, 'legacyCategory']);
|
||||
Route::get('/main/tag/{tag:[^/]+}', [SiteController::class, 'legacyTag']);
|
||||
Route::get('/news/id/{id:[0-9]+}.html', [SiteController::class, 'legacyArticle']);
|
||||
Route::get('/robots.txt', [SiteController::class, 'robots']);
|
||||
Route::get('/sitemap.xml', [SiteController::class, 'sitemap']);
|
||||
|
||||
Route::add(['GET', 'POST'], '/admin/login', [AdminController::class, 'login']);
|
||||
Route::post('/admin/logout', [AdminController::class, 'logout']);
|
||||
Route::get('/admin', [AdminController::class, 'dashboard']);
|
||||
Route::get('/admin/articles', [AdminController::class, 'articles']);
|
||||
Route::add(['GET', 'POST'], '/admin/articles/new', [AdminController::class, 'article']);
|
||||
Route::add(['GET', 'POST'], '/admin/articles/{id:[0-9]+}', [AdminController::class, 'article']);
|
||||
Route::add(['GET', 'POST'], '/admin/pages/{slug:[a-z0-9-]+}', [AdminController::class, 'page']);
|
||||
Route::add(['GET', 'POST'], '/admin/pages/{slug:[a-z0-9-]+}/{key:[a-z0-9-]+}', [AdminController::class, 'section']);
|
||||
Route::post('/admin/preview', [AdminController::class, 'preview']);
|
||||
|
||||
Route::fallback(static fn (Request $request) => (new SiteController())->missing($request));
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'pid_file' => runtime_path() . '/webman.pid',
|
||||
'status_file' => runtime_path() . '/webman.status',
|
||||
'stdout_file' => runtime_path() . '/logs/stdout.log',
|
||||
'log_file' => runtime_path() . '/logs/workerman.log',
|
||||
'stop_timeout' => 4,
|
||||
'max_package_size' => 2 * 1024 * 1024,
|
||||
];
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'type' => 'file',
|
||||
'handler' => Webman\Session\FileSessionHandler::class,
|
||||
'config' => ['file' => ['save_path' => runtime_path() . '/sessions']],
|
||||
'session_name' => 'LAYSENSE_CMS',
|
||||
'lifetime' => 8 * 60 * 60,
|
||||
'cookie_lifetime' => 0,
|
||||
'cookie_path' => '/admin',
|
||||
'http_only' => true,
|
||||
'secure' => getenv('LAYSENSE_SECURE_COOKIES') !== '0',
|
||||
'same_site' => 'Lax',
|
||||
];
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return ['enable' => true, 'middleware' => []];
|
||||
@@ -0,0 +1,51 @@
|
||||
.admin-body { background: var(--paper); min-height: 100vh; }
|
||||
.admin-wrap { width: min(calc(100% - 2rem), 67rem); margin-inline: auto; }
|
||||
.admin-bar { background: var(--white); border-bottom: 1px solid var(--line); }
|
||||
.admin-bar-inner, .admin-bar nav { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.15rem; }
|
||||
.admin-bar-inner { justify-content: space-between; min-height: 4.5rem; padding-block: .45rem; }
|
||||
.admin-bar nav > a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; font-weight: 550; }
|
||||
.admin-main { padding-block: clamp(1.65rem, 4vw, 3.25rem); }
|
||||
.admin-main h1 { font-size: clamp(2rem, 4vw, 3.1rem); margin: 0; }
|
||||
.admin-main h2 { font-size: 1.38rem; margin-bottom: 1rem; }
|
||||
.admin-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; margin: 0 0 1.2rem; }
|
||||
.admin-heading.compact h2, .admin-heading p { margin: 0; }
|
||||
.admin-heading p { margin-top: .4rem; }
|
||||
.admin-panel, .login-box { border: 1px solid var(--line); padding: clamp(1rem, 3vw, 2rem); background: var(--white); border-radius: var(--radius); margin-bottom: 1.15rem; }
|
||||
.login-box { max-width: 27rem; margin: clamp(1.5rem, 6vw, 5rem) auto; }
|
||||
.login-box p { margin-block: .6rem 1.25rem; }
|
||||
.admin-form { display: grid; gap: 1rem; }
|
||||
.admin-form label { display: grid; gap: .4rem; font-weight: 570; color: var(--ink); }
|
||||
.admin-form :where(input:not([type=hidden]), select, textarea) {
|
||||
background: white;
|
||||
color: var(--ink);
|
||||
width: 100%;
|
||||
border: 1px solid #b9c7dd;
|
||||
border-radius: .5rem;
|
||||
padding: .6rem .75rem;
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
min-height: 44px;
|
||||
}
|
||||
.admin-form textarea { resize: vertical; }
|
||||
.admin-form small, .field-note { color: var(--muted); font-size: .875rem; font-weight: 400; }
|
||||
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
|
||||
.form-submit { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
|
||||
.form-submit label { min-width: 10rem; }
|
||||
.admin-list { margin: 0; padding: 0; list-style: none; }
|
||||
.admin-list li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; padding-block: .7rem; border-top: 1px solid var(--line); }
|
||||
.admin-list small { display: block; color: var(--muted); font-size: .875rem; }
|
||||
.feedback { padding: .8rem 1rem; border-radius: .5rem; }
|
||||
.feedback.error { background: #feebeb; color: #9c252a; }
|
||||
.feedback.success { background: #e5f6ed; color: #126044; }
|
||||
.editor { display: grid; gap: .45rem; }
|
||||
.editor-toolbar { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: space-between; padding: .45rem; border: 1px solid var(--line); background: var(--paper); border-radius: .5rem; }
|
||||
.editor-toolbar > div { display: flex; flex-wrap: wrap; gap: .25rem; }
|
||||
.editor-toolbar button { border: 1px solid var(--line); background: var(--white); border-radius: .35rem; min-height: 44px; padding: .45rem .7rem; color: var(--ink); }
|
||||
.editor-toolbar button:hover { border-color: var(--accent); color: var(--accent); }
|
||||
.editor textarea { font-family: var(--mono); font-size: .95rem; line-height: 1.55; }
|
||||
.editor-preview { padding: 1rem; border: 1px solid var(--line); border-radius: .5rem; }
|
||||
.field-note { margin: 0; }
|
||||
@media (max-width: 38rem) {
|
||||
.form-grid { grid-template-columns: 1fr; }
|
||||
.admin-bar nav { gap: .3rem .85rem; }
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
'use strict';
|
||||
|
||||
const formats = {
|
||||
markdown: {
|
||||
heading: ['## ', '', '小标题'],
|
||||
bold: ['**', '**', '粗体文字'],
|
||||
list: ['- ', '', '列表项'],
|
||||
link: ['[', '](https://)', '链接文字']
|
||||
},
|
||||
html: {
|
||||
heading: ['<h3>', '</h3>', '小标题'],
|
||||
bold: ['<strong>', '</strong>', '粗体文字'],
|
||||
list: ['<ul>\n <li>', '</li>\n</ul>', '列表项'],
|
||||
link: ['<a href="https://">', '</a>', '链接文字']
|
||||
}
|
||||
};
|
||||
|
||||
for (const editor of document.querySelectorAll('[data-editor]')) {
|
||||
const area = editor.querySelector('textarea');
|
||||
const format = editor.dataset.format;
|
||||
const preview = editor.querySelector('.editor-preview');
|
||||
const previewButton = editor.querySelector('[data-preview-button]');
|
||||
const form = editor.closest('form');
|
||||
|
||||
for (const button of editor.querySelectorAll('[data-insert]')) {
|
||||
button.addEventListener('click', () => {
|
||||
const [before, after, example] = formats[format][button.dataset.insert];
|
||||
const start = area.selectionStart;
|
||||
const end = area.selectionEnd;
|
||||
const selection = area.value.slice(start, end) || example;
|
||||
area.setRangeText(before + selection + after, start, end, 'end');
|
||||
area.focus();
|
||||
area.setSelectionRange(start + before.length, start + before.length + selection.length);
|
||||
});
|
||||
}
|
||||
|
||||
previewButton.addEventListener('click', async () => {
|
||||
const show = preview.hidden;
|
||||
preview.hidden = !show;
|
||||
previewButton.textContent = show ? '收起预览' : '预览正文';
|
||||
previewButton.setAttribute('aria-expanded', String(show));
|
||||
if (!show) return;
|
||||
|
||||
preview.textContent = '正在加载预览…';
|
||||
try {
|
||||
const body = new URLSearchParams({body: area.value, format, csrf: form.elements.csrf.value});
|
||||
const response = await fetch('/admin/preview', {method: 'POST', body, redirect: 'error'});
|
||||
if (!response.ok) throw new Error('Preview could not be loaded');
|
||||
const markup = await response.text();
|
||||
preview.innerHTML = markup;
|
||||
} catch {
|
||||
preview.textContent = '预览无法加载,请刷新后重试。';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
After Width: | Height: | Size: 6.4 KiB |
@@ -0,0 +1,93 @@
|
||||
Copyright 2026 The Geist Project Authors (https://github.com/vercel/geist-font)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://openfontlicense.org
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1712308870808" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1501" width="500" height="500" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M193.36704 165.97504l52.9664 100.22912-97.78688 337.36192c-52.9664 185.79456-96.9728 341.43744-96.9728 345.50784 0 5.70368 99.41504 6.51776 291.72736 3.26144 327.58272-4.8896 334.10048-6.51776 412.32896-67.6352 89.63584-70.89664 146.67776-186.60864 196.38784-398.47936 27.70432-116.52608 27.70432-163.79392 0-220.83072-36.66944-74.96704-88.82176-100.22912-265.6512-129.56672C560.87552 115.45088 187.65824 66.56 156.69248 66.56c-13.8496 0-9.77408 12.22144 36.67456 99.41504z m517.44768 182.53312c21.18656 17.92512 25.26208 26.89024 25.26208 57.856 0 41.55904-14.6688 98.60096-50.52416 193.94048-49.70496 132.01408-79.85664 149.94432-240.38912 150.7584-68.44928 0-108.38016-3.26144-108.38016-8.15104 0-7.33184 105.9328-369.14176 118.15936-405.8112 2.44224-7.33184 33.408-9.7792 117.34528-9.7792 110.00832 0 114.07872 0.81408 138.52672 21.18656z" fill="#2E8CFF" p-id="1502"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 705 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 28.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 3840 1280" enable-background="new 0 0 3840 1280" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<rect x="160" y="96" fill="#FFFFFF" width="1088" height="1088"/>
|
||||
<path fill="#333333" d="M1216,128v1024H192V128H1216 M1280,64H128v1152h1152V64L1280,64z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#333333" d="M482.46,526h152l-12.92,76h-152l-53.96,304h-76l53.96-304h-76l12.92-76h76l13.68-76h76L482.46,526z
|
||||
M509.06,374h152l-12.92,76h-152L509.06,374z"/>
|
||||
<path fill="#333333" d="M710.46,526h76l-53.2,304h-76L710.46,526z M1023.58,906h-304l13.68-76h76l26.6-152h76l-26.6,152h76
|
||||
l53.2-304h76L1023.58,906z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#333333" d="M1702.8,1054.4v-28h26.4c5.06,0,10.06-0.87,15-2.6c4.93-1.74,9.33-4.47,13.2-8.2c3.86-3.74,6.86-8.07,9-13
|
||||
c2.13-4.94,3.6-9.8,4.4-14.6l29.6-180.8H1746v-28h59.2l7.2-42.8c0.8-5.6,2.13-11.13,4-16.6c1.86-5.46,4.4-10.73,7.6-15.8
|
||||
c3.2-5.06,7.13-9.6,11.8-13.6c4.66-4,9.66-7.2,15-9.6c5.33-2.4,10.86-4.06,16.6-5c5.73-0.93,11.26-1.4,16.6-1.4h26.4l0.4,28h-26.4
|
||||
c-5.07,0-10.07,0.87-15,2.6c-4.94,1.74-9.4,4.47-13.4,8.2c-4,3.74-7,8.07-9,13c-2,4.94-3.4,9.8-4.2,14.6l-6.4,38.8h54.4v27.6
|
||||
h-59.2l-30.4,185.2c-1.07,5.6-2.47,11.13-4.2,16.6c-1.74,5.46-4.27,10.73-7.6,15.8c-3.34,5.06-7.34,9.6-12,13.6
|
||||
c-4.67,4-9.67,7.2-15,9.6c-5.34,2.4-10.87,4.06-16.6,5c-5.74,0.93-11.27,1.4-16.6,1.4H1702.8z"/>
|
||||
<path fill="#333333" d="M1999.2,971.6c-8,0-15.8-0.74-23.4-2.2c-7.6-1.46-14.54-4.13-20.8-8c-6.27-3.86-11.6-8.8-16-14.8
|
||||
c-4.4-6-7.67-12.6-9.8-19.8c-2.14-7.2-3.14-14.73-3-22.6c0.13-7.86,0.86-15.66,2.2-23.4l8-48c1.06-6.66,2.66-13.26,4.8-19.8
|
||||
c2.13-6.53,5.06-12.8,8.8-18.8c3.73-6,8.26-11.46,13.6-16.4c5.33-4.93,11.2-9,17.6-12.2s12.93-5.4,19.6-6.6
|
||||
c6.66-1.2,13.33-1.8,20-1.8c6.66,0,13.2,0.54,19.6,1.6c6.4,1.07,12.33,2.94,17.8,5.6c5.46,2.67,10.46,6.14,15,10.4
|
||||
c4.53,4.27,8.06,9.2,10.6,14.8c2.53,5.6,4.26,11.6,5.2,18c0.93,6.4,0.86,12.94-0.2,19.6c-0.8,5.34-2.54,10.67-5.2,16
|
||||
c-2.67,5.34-6,10.2-10,14.6c-4,4.4-8.6,8.14-13.8,11.2c-5.2,3.07-10.54,5.54-16,7.4c-5.47,1.87-11,3.07-16.6,3.6
|
||||
c-5.6,0.54-11.2,0.8-16.8,0.8h-14.8c-5.87-0.26-11.74-0.6-17.6-1c-5.87-0.4-11.87-1.13-18-2.2l-1.2,7.6
|
||||
c-0.8,4.8-1.27,9.6-1.4,14.4c-0.14,4.8,0.33,9.47,1.4,14c1.06,4.54,2.8,8.8,5.2,12.8c2.4,4,5.33,7.34,8.8,10
|
||||
c3.46,2.67,7.53,4.54,12.2,5.6c4.66,1.07,9.4,1.6,14.2,1.6c5.06,0,10.13-0.6,15.2-1.8c5.06-1.2,9.93-3.2,14.6-6
|
||||
c4.66-2.8,8.86-6.2,12.6-10.2c3.73-4,6.8-8.4,9.2-13.2l26,12.8c-4,6.94-8.74,13.47-14.2,19.6c-5.47,6.14-11.67,11.27-18.6,15.4
|
||||
c-6.94,4.14-14.27,7.07-22,8.8C2014.26,970.73,2006.66,971.6,1999.2,971.6z M2015.6,854c4.53,0,9.13-0.53,13.8-1.6
|
||||
c4.66-1.06,9.06-3,13.2-5.8c4.13-2.8,7.53-6.33,10.2-10.6c2.66-4.26,4.4-8.66,5.2-13.2c0.8-5.33,0.53-10.53-0.8-15.6
|
||||
c-1.34-5.06-3.8-9.26-7.4-12.6c-3.6-3.33-7.94-5.73-13-7.2c-5.07-1.46-10.27-2.2-15.6-2.2c-4.27,0-8.74,0.47-13.4,1.4
|
||||
c-4.67,0.94-9,2.54-13,4.8c-4,2.27-7.67,5.2-11,8.8c-3.34,3.6-6.14,7.4-8.4,11.4c-2.27,4-4.07,8.2-5.4,12.6
|
||||
c-1.34,4.4-2.4,8.74-3.2,13l-2,12.4c4,0.8,8.13,1.4,12.4,1.8c4.26,0.4,8.6,0.67,13,0.8c4.4,0.14,8.66,0.47,12.8,1
|
||||
C2007.13,853.74,2011.33,854,2015.6,854z"/>
|
||||
<path fill="#333333" d="M2175.2,971.6c-6.94,0-13.54-1.14-19.8-3.4c-6.27-2.26-11.47-5.8-15.6-10.6c-4.14-4.8-7.27-10.33-9.4-16.6
|
||||
c-2.14-6.26-3.54-12.73-4.2-19.4c-0.67-6.66-0.74-13.4-0.2-20.2c0.53-6.8,1.33-13.66,2.4-20.6l8-48c1.06-6.13,2.4-12.26,4-18.4
|
||||
c1.6-6.13,3.93-12.06,7-17.8c3.06-5.73,6.8-11.13,11.2-16.2c4.4-5.06,9.26-9.4,14.6-13c5.33-3.6,11.13-6.2,17.4-7.8
|
||||
c6.26-1.6,12.46-2.4,18.6-2.4c6.4,0,12.6,0.94,18.6,2.8c6,1.87,11.13,4.87,15.4,9c4.26,4.14,7.6,8.94,10,14.4
|
||||
c2.4,5.47,4.13,11.27,5.2,17.4l16.4-98.4h-16.4l-0.4-28h52.4L2268,931.2c-0.27,1.6-0.27,3.2,0,4.8c0.26,1.6,0.93,3,2,4.2
|
||||
c1.06,1.2,2.33,2.07,3.8,2.6c1.46,0.54,3,0.8,4.6,0.8h6v28h-10.8c-5.34,0-10.47-0.67-15.4-2c-4.94-1.33-9.27-3.6-13-6.8
|
||||
c-3.74-3.2-6.34-7.26-7.8-12.2c-1.47-4.93-1.94-10.06-1.4-15.4c-2.94,5.34-6.67,10.4-11.2,15.2c-4.54,4.8-9.47,8.8-14.8,12
|
||||
c-5.34,3.2-11,5.54-17,7S2181.06,971.6,2175.2,971.6z M2192,943.6c6.13,0,12.33-1.13,18.6-3.4c6.26-2.26,11.73-5.8,16.4-10.6
|
||||
c4.66-4.8,8.2-10.2,10.6-16.2c2.4-6,4.13-12.06,5.2-18.2l8-48c0.8-4.8,1.33-9.6,1.6-14.4c0.26-4.8,0.06-9.46-0.6-14
|
||||
c-0.67-4.53-1.74-8.93-3.2-13.2c-1.47-4.26-3.67-8-6.6-11.2c-2.94-3.2-6.6-5.53-11-7c-4.4-1.46-9-2.2-13.8-2.2
|
||||
c-6.14,0-12.4,1.4-18.8,4.2c-6.4,2.8-11.8,6.8-16.2,12s-7.8,10.87-10.2,17c-2.4,6.14-4.14,12.4-5.2,18.8l-8,48
|
||||
c-0.8,4.54-1.27,9.07-1.4,13.6c-0.14,4.54,0.06,9,0.6,13.4c0.53,4.4,1.6,8.6,3.2,12.6s3.93,7.47,7,10.4
|
||||
c3.06,2.94,6.66,5.07,10.8,6.4C2183.13,942.94,2187.46,943.6,2192,943.6z"/>
|
||||
<path fill="#333333" d="M2399.2,971.6c-8,0-15.8-0.74-23.4-2.2c-7.6-1.46-14.54-4.13-20.8-8c-6.27-3.86-11.6-8.8-16-14.8
|
||||
c-4.4-6-7.67-12.6-9.8-19.8c-2.14-7.2-3.14-14.73-3-22.6c0.13-7.86,0.86-15.66,2.2-23.4l8-48c1.06-6.66,2.66-13.26,4.8-19.8
|
||||
c2.13-6.53,5.06-12.8,8.8-18.8c3.73-6,8.26-11.46,13.6-16.4c5.33-4.93,11.2-9,17.6-12.2s12.93-5.4,19.6-6.6
|
||||
c6.66-1.2,13.33-1.8,20-1.8c6.66,0,13.2,0.54,19.6,1.6c6.4,1.07,12.33,2.94,17.8,5.6c5.46,2.67,10.46,6.14,15,10.4
|
||||
c4.53,4.27,8.06,9.2,10.6,14.8c2.53,5.6,4.26,11.6,5.2,18c0.93,6.4,0.86,12.94-0.2,19.6c-0.8,5.34-2.54,10.67-5.2,16
|
||||
c-2.67,5.34-6,10.2-10,14.6c-4,4.4-8.6,8.14-13.8,11.2c-5.2,3.07-10.54,5.54-16,7.4c-5.47,1.87-11,3.07-16.6,3.6
|
||||
c-5.6,0.54-11.2,0.8-16.8,0.8h-14.8c-5.87-0.26-11.74-0.6-17.6-1c-5.87-0.4-11.87-1.13-18-2.2l-1.2,7.6
|
||||
c-0.8,4.8-1.27,9.6-1.4,14.4c-0.14,4.8,0.33,9.47,1.4,14c1.06,4.54,2.8,8.8,5.2,12.8c2.4,4,5.33,7.34,8.8,10
|
||||
c3.46,2.67,7.53,4.54,12.2,5.6c4.66,1.07,9.4,1.6,14.2,1.6c5.06,0,10.13-0.6,15.2-1.8c5.06-1.2,9.93-3.2,14.6-6
|
||||
c4.66-2.8,8.86-6.2,12.6-10.2c3.73-4,6.8-8.4,9.2-13.2l26,12.8c-4,6.94-8.74,13.47-14.2,19.6c-5.47,6.14-11.67,11.27-18.6,15.4
|
||||
c-6.94,4.14-14.27,7.07-22,8.8C2414.26,970.73,2406.66,971.6,2399.2,971.6z M2415.6,854c4.53,0,9.13-0.53,13.8-1.6
|
||||
c4.66-1.06,9.06-3,13.2-5.8c4.13-2.8,7.53-6.33,10.2-10.6c2.66-4.26,4.4-8.66,5.2-13.2c0.8-5.33,0.53-10.53-0.8-15.6
|
||||
c-1.34-5.06-3.8-9.26-7.4-12.6c-3.6-3.33-7.94-5.73-13-7.2c-5.07-1.46-10.27-2.2-15.6-2.2c-4.27,0-8.74,0.47-13.4,1.4
|
||||
c-4.67,0.94-9,2.54-13,4.8c-4,2.27-7.67,5.2-11,8.8c-3.34,3.6-6.14,7.4-8.4,11.4c-2.27,4-4.07,8.2-5.4,12.6
|
||||
c-1.34,4.4-2.4,8.74-3.2,13l-2,12.4c4,0.8,8.13,1.4,12.4,1.8c4.26,0.4,8.6,0.67,13,0.8c4.4,0.14,8.66,0.47,12.8,1
|
||||
C2407.13,853.74,2411.33,854,2415.6,854z"/>
|
||||
<path fill="#333333" d="M2541.2,968.4l29.6-180h-23.6v-28h59.6L2600,800c2.93-5.6,6.33-11.06,10.2-16.4c3.86-5.33,8.2-10,13-14
|
||||
s10.26-7.06,16.4-9.2c6.13-2.13,12.13-3.2,18-3.2c4.8,0,9.4,0.67,13.8,2c4.4,1.34,8.26,3.54,11.6,6.6
|
||||
c3.33,3.07,5.93,6.67,7.8,10.8c1.86,4.14,3.06,8.54,3.6,13.2c0.53,4.67,0.6,9.4,0.2,14.2c-0.4,4.8-1,9.6-1.8,14.4h-31.2
|
||||
c0.53-3.73,0.86-7.4,1-11c0.13-3.6-0.27-7.13-1.2-10.6c-0.94-3.46-2.74-6.26-5.4-8.4c-2.67-2.13-5.87-3.2-9.6-3.2
|
||||
c-5.07,0-10.14,0.87-15.2,2.6c-5.07,1.74-9.6,4.34-13.6,7.8c-4,3.47-7.4,7.4-10.2,11.8s-5.2,9-7.2,13.8s-3.67,9.67-5,14.6
|
||||
c-1.34,4.94-2.4,9.8-3.2,14.6l-19.6,118H2541.2z"/>
|
||||
<path fill="#333333" d="M2775.2,971.6c-6.94,0-13.54-1.14-19.8-3.4c-6.27-2.26-11.47-5.8-15.6-10.6c-4.14-4.8-7.27-10.33-9.4-16.6
|
||||
c-2.14-6.26-3.54-12.73-4.2-19.4c-0.67-6.66-0.74-13.4-0.2-20.2c0.53-6.8,1.33-13.66,2.4-20.6l8-48c1.06-6.13,2.4-12.26,4-18.4
|
||||
c1.6-6.13,3.93-12.06,7-17.8c3.06-5.73,6.8-11.13,11.2-16.2c4.4-5.06,9.26-9.4,14.6-13c5.33-3.6,11.13-6.2,17.4-7.8
|
||||
c6.26-1.6,12.46-2.4,18.6-2.4c6.4,0,12.6,0.94,18.6,2.8c6,1.87,11.13,4.87,15.4,9c4.26,4.14,7.6,8.94,10,14.4
|
||||
c2.4,5.47,4.13,11.27,5.2,17.4l6.8-40.4h31.2L2868,931.2c-0.27,1.6-0.27,3.2,0,4.8c0.26,1.6,0.93,3,2,4.2
|
||||
c1.06,1.2,2.33,2.07,3.8,2.6c1.46,0.54,3,0.8,4.6,0.8h6v28h-10.8c-5.34,0-10.47-0.67-15.4-2c-4.94-1.33-9.27-3.6-13-6.8
|
||||
c-3.74-3.2-6.34-7.26-7.8-12.2c-1.47-4.93-1.94-10.06-1.4-15.4c-2.94,5.34-6.67,10.4-11.2,15.2c-4.54,4.8-9.47,8.8-14.8,12
|
||||
c-5.34,3.2-11,5.54-17,7S2781.06,971.6,2775.2,971.6z M2792,943.6c6.13,0,12.33-1.13,18.6-3.4c6.26-2.26,11.73-5.8,16.4-10.6
|
||||
c4.66-4.8,8.2-10.2,10.6-16.2c2.4-6,4.13-12.06,5.2-18.2l8-48c0.8-4.8,1.33-9.6,1.6-14.4c0.26-4.8,0.06-9.46-0.6-14
|
||||
c-0.67-4.53-1.74-8.93-3.2-13.2c-1.47-4.26-3.67-8-6.6-11.2c-2.94-3.2-6.6-5.53-11-7c-4.4-1.46-9-2.2-13.8-2.2
|
||||
c-6.14,0-12.4,1.4-18.8,4.2c-6.4,2.8-11.8,6.8-16.2,12s-7.8,10.87-10.2,17c-2.4,6.14-4.14,12.4-5.2,18.8l-8,48
|
||||
c-0.8,4.54-1.27,9.07-1.4,13.6c-0.14,4.54,0.06,9,0.6,13.4c0.53,4.4,1.6,8.6,3.2,12.6s3.93,7.47,7,10.4
|
||||
c3.06,2.94,6.66,5.07,10.8,6.4C2783.13,942.94,2787.46,943.6,2792,943.6z"/>
|
||||
<path fill="#333333" d="M3022,971.6c-6.4,0-12.74-0.74-19-2.2c-6.27-1.46-11.74-4-16.4-7.6c-4.67-3.6-8.6-8.06-11.8-13.4
|
||||
c-3.2-5.33-5.47-11-6.8-17c-1.34-6-1.87-12.26-1.6-18.8c0.26-6.53,0.93-13,2-19.4l17.2-104.8h-36v-28h40.8l14-86h31.2l-14,86h68
|
||||
v28h-72.8l-18,109.2c-0.54,3.47-0.87,6.94-1,10.4c-0.14,3.47-0.14,6.87,0,10.2c0.13,3.34,0.73,6.6,1.8,9.8
|
||||
c1.06,3.2,2.66,6,4.8,8.4c2.13,2.4,4.73,4.2,7.8,5.4c3.06,1.2,6.33,1.8,9.8,1.8c4.8,0,9.53-1.2,14.2-3.6
|
||||
c4.66-2.4,8.6-5.6,11.8-9.6s5.8-8.33,7.8-13c2-4.66,3.66-9.4,5-14.2l28.4,8c-1.34,5.07-3.07,10.07-5.2,15
|
||||
c-2.14,4.94-4.74,9.74-7.8,14.4c-3.07,4.67-6.54,9-10.4,13c-3.87,4-8.2,7.4-13,10.2c-4.8,2.8-9.87,4.8-15.2,6
|
||||
C3032.26,971,3027.06,971.6,3022,971.6z"/>
|
||||
<path fill="#333333" d="M3228.8,971.6c-6.14,0-12.07-0.67-17.8-2c-5.74-1.33-10.94-3.66-15.6-7c-4.67-3.33-8.54-7.46-11.6-12.4
|
||||
c-3.07-4.93-5.34-10.2-6.8-15.8c-1.47-5.6-2.07-11.46-1.8-17.6c0.26-6.13,0.93-12.26,2-18.4l18-110h-52.4v-28h88.8L3208,902.8
|
||||
c-0.8,4.54-1.27,9.14-1.4,13.8c-0.14,4.67,0.6,9.07,2.2,13.2c1.6,4.14,4.2,7.47,7.8,10c3.6,2.54,7.8,3.8,12.6,3.8
|
||||
c4.26,0,8.53-1.06,12.8-3.2c4.26-2.13,7.8-5,10.6-8.6c2.8-3.6,5.13-7.46,7-11.6c1.86-4.13,3.33-8.33,4.4-12.6l28.8,7.6
|
||||
c-2.14,7.2-5,14.27-8.6,21.2c-3.6,6.94-8.2,13.14-13.8,18.6c-5.6,5.47-12.07,9.6-19.4,12.4
|
||||
C3243.66,970.2,3236.26,971.6,3228.8,971.6z M3228.8,725.2c-4,0-7.8-0.66-11.4-2c-3.6-1.33-6.47-3.53-8.6-6.6
|
||||
c-2.14-3.06-3.54-6.53-4.2-10.4c-0.67-3.86-0.74-7.8-0.2-11.8c0.53-2.66,1.53-5.33,3-8c1.46-2.66,3.33-4.86,5.6-6.6
|
||||
c2.26-1.73,4.8-2.93,7.6-3.6c2.8-0.66,5.66-1,8.6-1c4,0,7.8,0.74,11.4,2.2c3.6,1.47,6.46,3.74,8.6,6.8
|
||||
c2.13,3.07,3.6,6.54,4.4,10.4c0.8,3.87,0.8,7.8,0,11.8c-0.54,2.67-1.54,5.34-3,8c-1.47,2.67-3.34,4.87-5.6,6.6
|
||||
c-2.27,1.74-4.8,2.87-7.6,3.4C3234.6,724.94,3231.73,725.2,3228.8,725.2z"/>
|
||||
<path fill="#333333" d="M3393.2,971.6c-7.74,0-15.2-0.8-22.4-2.4c-7.2-1.6-13.67-4.46-19.4-8.6c-5.74-4.13-10.54-9.2-14.4-15.2
|
||||
c-3.87-6-6.67-12.6-8.4-19.8c-1.74-7.2-2.54-14.6-2.4-22.2c0.13-7.6,0.86-15.13,2.2-22.6l8-48c1.06-6.66,2.66-13.26,4.8-19.8
|
||||
c2.13-6.53,5.06-12.8,8.8-18.8c3.73-6,8.2-11.46,13.4-16.4c5.2-4.93,10.93-9,17.2-12.2c6.26-3.2,12.73-5.4,19.4-6.6
|
||||
c6.66-1.2,13.33-1.8,20-1.8c7.73,0,15.2,0.8,22.4,2.4c7.2,1.6,13.73,4.47,19.6,8.6c5.86,4.14,10.73,9.2,14.6,15.2
|
||||
c3.86,6,6.66,12.6,8.4,19.8c1.73,7.2,2.46,14.6,2.2,22.2c-0.27,7.6-0.94,15.14-2,22.6l-8,48c-1.07,6.67-2.74,13.27-5,19.8
|
||||
c-2.27,6.54-5.2,12.8-8.8,18.8c-3.6,6-8,11.47-13.2,16.4c-5.2,4.94-10.94,9-17.2,12.2c-6.27,3.2-12.8,5.4-19.6,6.6
|
||||
C3406.6,971,3399.86,971.6,3393.2,971.6z M3393.6,943.6c4.53,0,8.93-0.53,13.2-1.6c4.26-1.06,8.4-2.8,12.4-5.2
|
||||
c4-2.4,7.66-5.33,11-8.8c3.33-3.46,6.06-7.2,8.2-11.2c2.13-4,3.86-8.13,5.2-12.4c1.33-4.26,2.26-8.53,2.8-12.8l8-48
|
||||
c0.8-4.53,1.33-9.13,1.6-13.8c0.26-4.66,0-9.2-0.8-13.6c-0.8-4.4-2.07-8.6-3.8-12.6c-1.74-4-4.14-7.46-7.2-10.4
|
||||
c-3.07-2.93-6.74-5-11-6.2c-4.27-1.2-8.67-1.8-13.2-1.8c-4.54,0-9,0.54-13.4,1.6c-4.4,1.07-8.6,2.8-12.6,5.2
|
||||
c-4,2.4-7.6,5.34-10.8,8.8c-3.2,3.47-5.87,7.2-8,11.2c-2.14,4-3.87,8.14-5.2,12.4c-1.34,4.27-2.4,8.54-3.2,12.8l-8,48
|
||||
c-0.8,4.54-1.27,9.14-1.4,13.8c-0.14,4.67,0.13,9.2,0.8,13.6c0.66,4.4,1.86,8.6,3.6,12.6c1.73,4,4.13,7.47,7.2,10.4
|
||||
c3.06,2.94,6.8,5,11.2,6.2C3384.6,943,3389.06,943.6,3393.6,943.6z"/>
|
||||
<path fill="#333333" d="M3517.2,968.4l29.6-180h-16.4v-28h52.4l-5.6,32.4c3.2-5.33,6.86-10.26,11-14.8c4.13-4.53,8.8-8.4,14-11.6
|
||||
s10.73-5.53,16.6-7c5.86-1.46,11.6-2.2,17.2-2.2c6.93,0,13.46,1.2,19.6,3.6c6.13,2.4,11.2,6,15.2,10.8s7,10.34,9,16.6
|
||||
c2,6.27,3.4,12.67,4.2,19.2c0.8,6.54,0.93,13.27,0.4,20.2c-0.54,6.94-1.34,13.74-2.4,20.4l-15.6,92.4h16.4l0.4,28h-52.4
|
||||
l20.4-124.8c0.8-4.53,1.33-9.06,1.6-13.6c0.26-4.53,0.13-8.93-0.4-13.2c-0.54-4.26-1.54-8.4-3-12.4c-1.47-4-3.6-7.53-6.4-10.6
|
||||
c-2.8-3.06-6.27-5.26-10.4-6.6c-4.14-1.33-8.47-2-13-2c-5.87,0-11.87,1.2-18,3.6c-6.14,2.4-11.4,6-15.8,10.8
|
||||
c-4.4,4.8-7.8,10.2-10.2,16.2c-2.4,6-4,11.94-4.8,17.8l-22.4,134.8H3517.2z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#333333" d="M2317.2,550.4l29.6-180h-16.4v-28h52.4l-5.6,32.4c3.2-5.33,6.86-10.26,11-14.8c4.13-4.53,8.8-8.4,14-11.6
|
||||
s10.73-5.53,16.6-7c5.86-1.46,11.6-2.2,17.2-2.2c6.93,0,13.46,1.2,19.6,3.6c6.13,2.4,11.2,6,15.2,10.8c4,4.8,7,10.34,9,16.6
|
||||
c2,6.27,3.4,12.67,4.2,19.2c0.8,6.54,0.93,13.27,0.4,20.2c-0.54,6.94-1.34,13.74-2.4,20.4l-15.6,92.4h16.4l0.4,28h-52.4
|
||||
l20.4-124.8c0.8-4.53,1.33-9.06,1.6-13.6c0.26-4.53,0.13-8.93-0.4-13.2c-0.54-4.26-1.54-8.4-3-12.4c-1.47-4-3.6-7.53-6.4-10.6
|
||||
c-2.8-3.06-6.27-5.26-10.4-6.6c-4.14-1.33-8.47-2-13-2c-5.87,0-11.87,1.2-18,3.6c-6.14,2.4-11.4,6-15.8,10.8
|
||||
c-4.4,4.8-7.8,10.2-10.2,16.2c-2.4,6-4,11.94-4.8,17.8l-22.4,134.8H2317.2z"/>
|
||||
<path fill="#333333" d="M2599.2,553.6c-8,0-15.8-0.74-23.4-2.2c-7.6-1.46-14.54-4.13-20.8-8c-6.27-3.86-11.6-8.8-16-14.8
|
||||
s-7.67-12.6-9.8-19.8c-2.14-7.2-3.14-14.73-3-22.6c0.13-7.86,0.86-15.66,2.2-23.4l8-48c1.06-6.66,2.66-13.26,4.8-19.8
|
||||
c2.13-6.53,5.06-12.8,8.8-18.8c3.73-6,8.26-11.46,13.6-16.4c5.33-4.93,11.2-9,17.6-12.2c6.4-3.2,12.93-5.4,19.6-6.6
|
||||
c6.66-1.2,13.33-1.8,20-1.8c6.66,0,13.2,0.54,19.6,1.6c6.4,1.07,12.33,2.94,17.8,5.6c5.46,2.67,10.46,6.14,15,10.4
|
||||
c4.53,4.27,8.06,9.2,10.6,14.8c2.53,5.6,4.26,11.6,5.2,18c0.93,6.4,0.86,12.94-0.2,19.6c-0.8,5.34-2.54,10.67-5.2,16
|
||||
c-2.67,5.34-6,10.2-10,14.6s-8.6,8.14-13.8,11.2c-5.2,3.07-10.54,5.54-16,7.4c-5.47,1.87-11,3.07-16.6,3.6
|
||||
c-5.6,0.54-11.2,0.8-16.8,0.8h-14.8c-5.87-0.26-11.74-0.6-17.6-1c-5.87-0.4-11.87-1.13-18-2.2l-1.2,7.6
|
||||
c-0.8,4.8-1.27,9.6-1.4,14.4c-0.14,4.8,0.33,9.47,1.4,14c1.06,4.54,2.8,8.8,5.2,12.8s5.33,7.34,8.8,10
|
||||
c3.46,2.67,7.53,4.54,12.2,5.6c4.66,1.07,9.4,1.6,14.2,1.6c5.06,0,10.13-0.6,15.2-1.8c5.06-1.2,9.93-3.2,14.6-6
|
||||
c4.66-2.8,8.86-6.2,12.6-10.2c3.73-4,6.8-8.4,9.2-13.2l26,12.8c-4,6.94-8.74,13.47-14.2,19.6c-5.47,6.14-11.67,11.27-18.6,15.4
|
||||
c-6.94,4.14-14.27,7.07-22,8.8C2614.26,552.74,2606.66,553.6,2599.2,553.6z M2615.6,436c4.53,0,9.13-0.53,13.8-1.6
|
||||
c4.66-1.06,9.06-3,13.2-5.8c4.13-2.8,7.53-6.33,10.2-10.6c2.66-4.26,4.4-8.66,5.2-13.2c0.8-5.33,0.53-10.53-0.8-15.6
|
||||
c-1.34-5.06-3.8-9.26-7.4-12.6c-3.6-3.33-7.94-5.73-13-7.2c-5.07-1.46-10.27-2.2-15.6-2.2c-4.27,0-8.74,0.47-13.4,1.4
|
||||
c-4.67,0.94-9,2.54-13,4.8c-4,2.27-7.67,5.2-11,8.8c-3.34,3.6-6.14,7.4-8.4,11.4c-2.27,4-4.07,8.2-5.4,12.6
|
||||
c-1.34,4.4-2.4,8.74-3.2,13l-2,12.4c4,0.8,8.13,1.4,12.4,1.8c4.26,0.4,8.6,0.67,13,0.8c4.4,0.14,8.66,0.47,12.8,1
|
||||
C2607.13,435.74,2611.33,436,2615.6,436z"/>
|
||||
<path fill="#333333" d="M2822,553.6c-6.4,0-12.74-0.74-19-2.2c-6.27-1.46-11.74-4-16.4-7.6c-4.67-3.6-8.6-8.06-11.8-13.4
|
||||
c-3.2-5.33-5.47-11-6.8-17c-1.34-6-1.87-12.26-1.6-18.8c0.26-6.53,0.93-13,2-19.4l17.2-104.8h-36v-28h40.8l14-86h31.2l-14,86h68
|
||||
v28h-72.8l-18,109.2c-0.54,3.47-0.87,6.94-1,10.4c-0.14,3.47-0.14,6.87,0,10.2c0.13,3.34,0.73,6.6,1.8,9.8
|
||||
c1.06,3.2,2.66,6,4.8,8.4c2.13,2.4,4.73,4.2,7.8,5.4c3.06,1.2,6.33,1.8,9.8,1.8c4.8,0,9.53-1.2,14.2-3.6
|
||||
c4.66-2.4,8.6-5.6,11.8-9.6s5.8-8.33,7.8-13c2-4.66,3.66-9.4,5-14.2l28.4,8c-1.34,5.07-3.07,10.07-5.2,15
|
||||
c-2.14,4.94-4.74,9.74-7.8,14.4c-3.07,4.67-6.54,9-10.4,13c-3.87,4-8.2,7.4-13,10.2c-4.8,2.8-9.87,4.8-15.2,6
|
||||
C2832.26,553,2827.06,553.6,2822,553.6z"/>
|
||||
<path fill="#333333" d="M2936.4,550.4l0.4-180h-16.4v-28h48l-10.8,180.8l38-102.4h30.4l4.4,102.4l49.2-180.8h31.6l-68.4,208h-30.4
|
||||
l-6.8-96.8l-38.8,96.8H2936.4z"/>
|
||||
<path fill="#333333" d="M3193.2,553.6c-7.74,0-15.2-0.8-22.4-2.4c-7.2-1.6-13.67-4.46-19.4-8.6c-5.74-4.13-10.54-9.2-14.4-15.2
|
||||
c-3.87-6-6.67-12.6-8.4-19.8c-1.74-7.2-2.54-14.6-2.4-22.2c0.13-7.6,0.86-15.13,2.2-22.6l8-48c1.06-6.66,2.66-13.26,4.8-19.8
|
||||
c2.13-6.53,5.06-12.8,8.8-18.8c3.73-6,8.2-11.46,13.4-16.4c5.2-4.93,10.93-9,17.2-12.2c6.26-3.2,12.73-5.4,19.4-6.6
|
||||
c6.66-1.2,13.33-1.8,20-1.8c7.73,0,15.2,0.8,22.4,2.4c7.2,1.6,13.73,4.47,19.6,8.6c5.86,4.14,10.73,9.2,14.6,15.2
|
||||
c3.86,6,6.66,12.6,8.4,19.8c1.73,7.2,2.46,14.6,2.2,22.2c-0.27,7.6-0.94,15.14-2,22.6l-8,48c-1.07,6.67-2.74,13.27-5,19.8
|
||||
c-2.27,6.54-5.2,12.8-8.8,18.8c-3.6,6-8,11.47-13.2,16.4c-5.2,4.94-10.94,9-17.2,12.2c-6.27,3.2-12.8,5.4-19.6,6.6
|
||||
C3206.6,553,3199.86,553.6,3193.2,553.6z M3193.6,525.6c4.53,0,8.93-0.53,13.2-1.6c4.26-1.06,8.4-2.8,12.4-5.2s7.66-5.33,11-8.8
|
||||
c3.33-3.46,6.06-7.2,8.2-11.2c2.13-4,3.86-8.13,5.2-12.4c1.33-4.26,2.26-8.53,2.8-12.8l8-48c0.8-4.53,1.33-9.13,1.6-13.8
|
||||
c0.26-4.66,0-9.2-0.8-13.6c-0.8-4.4-2.07-8.6-3.8-12.6c-1.74-4-4.14-7.46-7.2-10.4c-3.07-2.93-6.74-5-11-6.2
|
||||
c-4.27-1.2-8.67-1.8-13.2-1.8c-4.54,0-9,0.54-13.4,1.6c-4.4,1.07-8.6,2.8-12.6,5.2s-7.6,5.34-10.8,8.8c-3.2,3.47-5.87,7.2-8,11.2
|
||||
c-2.14,4-3.87,8.14-5.2,12.4c-1.34,4.27-2.4,8.54-3.2,12.8l-8,48c-0.8,4.54-1.27,9.14-1.4,13.8c-0.14,4.67,0.13,9.2,0.8,13.6
|
||||
c0.66,4.4,1.86,8.6,3.6,12.6c1.73,4,4.13,7.47,7.2,10.4c3.06,2.94,6.8,5,11.2,6.2C3184.6,525,3189.06,525.6,3193.6,525.6z"/>
|
||||
<path fill="#333333" d="M3341.2,550.4l29.6-180h-23.6v-28h59.6L3400,382c2.93-5.6,6.33-11.06,10.2-16.4c3.86-5.33,8.2-10,13-14
|
||||
s10.26-7.06,16.4-9.2c6.13-2.13,12.13-3.2,18-3.2c4.8,0,9.4,0.67,13.8,2c4.4,1.34,8.26,3.54,11.6,6.6
|
||||
c3.33,3.07,5.93,6.67,7.8,10.8c1.86,4.14,3.06,8.54,3.6,13.2c0.53,4.67,0.6,9.4,0.2,14.2c-0.4,4.8-1,9.6-1.8,14.4h-31.2
|
||||
c0.53-3.73,0.86-7.4,1-11c0.13-3.6-0.27-7.13-1.2-10.6c-0.94-3.46-2.74-6.26-5.4-8.4c-2.67-2.13-5.87-3.2-9.6-3.2
|
||||
c-5.07,0-10.14,0.87-15.2,2.6c-5.07,1.74-9.6,4.34-13.6,7.8c-4,3.47-7.4,7.4-10.2,11.8c-2.8,4.4-5.2,9-7.2,13.8
|
||||
c-2,4.8-3.67,9.67-5,14.6c-1.34,4.94-2.4,9.8-3.2,14.6l-19.6,118H3341.2z"/>
|
||||
<path fill="#333333" d="M3635.6,553.2c-4,0-7.94-0.67-11.8-2c-3.87-1.33-7.07-3.33-9.6-6c-2.54-2.66-4.47-5.8-5.8-9.4
|
||||
c-1.34-3.6-2.4-7.4-3.2-11.4l-10.4-54.8c-2.14,0.27-4.34,0.47-6.6,0.6c-2.27,0.14-4.6,0.2-7,0.2c-2.14,0-4.34-0.06-6.6-0.2
|
||||
c-2.27-0.13-4.47-0.33-6.6-0.6l-13.2,80.8h-31.6l44-266h-16.4v-28h52.4l-17.6,108c3.73-3.73,7.73-7.26,12-10.6
|
||||
c4.26-3.33,8.86-6.06,13.8-8.2c4.93-2.13,9.93-3.73,15-4.8c5.06-1.06,10-1.6,14.8-1.6c7.2,0,13.8,1.47,19.8,4.4
|
||||
c6,2.94,10.8,7.07,14.4,12.4c3.6,5.34,5.93,11.4,7,18.2c1.06,6.8,1.06,13.67,0,20.6c-1.34,7.47-3.54,14.87-6.6,22.2
|
||||
c-3.07,7.34-7.2,14-12.4,20c-5.2,6-11.2,11.14-18,15.4c-6.8,4.27-14.07,7.74-21.8,10.4l10.8,56.8c0.26,1.6,0.86,3.07,1.8,4.4
|
||||
c0.93,1.34,2.2,2,3.8,2s3.13-0.6,4.6-1.8c1.46-1.2,2.6-2.46,3.4-3.8l31.6-54.8l25.6,13.6l-31.2,54.4c-1.87,3.2-4.34,6-7.4,8.4
|
||||
c-3.07,2.4-6.34,4.47-9.8,6.2c-3.47,1.74-7,3-10.6,3.8C3642.6,552.8,3639.06,553.2,3635.6,553.2z M3583.6,444
|
||||
c4.53,0,9.2-0.4,14-1.2c4.8-0.8,9.6-2,14.4-3.6c4.8-1.6,9.4-3.66,13.8-6.2c4.4-2.53,8.46-5.66,12.2-9.4
|
||||
c3.73-3.73,6.6-7.93,8.6-12.6c2-4.66,3.4-9.4,4.2-14.2c0.53-3.46,0.73-6.86,0.6-10.2c-0.14-3.33-0.94-6.46-2.4-9.4
|
||||
c-1.47-2.93-3.54-5.33-6.2-7.2c-2.67-1.86-5.74-2.8-9.2-2.8c-5.34,0-10.87,1.27-16.6,3.8c-5.74,2.54-10.74,5.87-15,10
|
||||
c-4.27,4.14-8,8.74-11.2,13.8c-3.2,5.07-6,10.27-8.4,15.6c-2.4,5.34-4.34,10.74-5.8,16.2c-1.47,5.47-2.87,11-4.2,16.6
|
||||
c1.86,0.27,3.73,0.47,5.6,0.6C3579.86,443.94,3581.73,444,3583.6,444z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 140 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 151 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect x="4" width="16" height="8" style="fill:#ff7186"/><rect x="4" width="8" height="24" style="fill:#ff7186"/><rect x="12" width="8" height="8" style="fill:#ff889f"/><rect x="4" y="8" width="8" height="8" style="fill:#ff4e58"/><rect x="4" y="16" width="8" height="8" style="fill:#f2254d"/></svg>
|
||||
|
After Width: | Height: | Size: 380 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,373 @@
|
||||
@font-face {
|
||||
font-family: Geist;
|
||||
src: url("/assets/geist.woff2") format("woff2");
|
||||
font-style: normal;
|
||||
font-weight: 100 900;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--paper: #f5f7fb;
|
||||
--white: #fff;
|
||||
--ink: #111a2e;
|
||||
--muted: #505d73;
|
||||
--accent: #214ed7;
|
||||
--accent-deep: #173bae;
|
||||
--accent-light: #e8efff;
|
||||
--navy: #101c34;
|
||||
--line: #dbe3f0;
|
||||
--radius: 1.125rem;
|
||||
--space-section: clamp(4.25rem, 9vw, 8.5rem);
|
||||
--edge: clamp(1.25rem, 5.3vw, 5.5rem);
|
||||
--sans: Geist, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
|
||||
--mono: "SFMono-Regular", Consolas, monospace;
|
||||
font: 400 100%/1.6 var(--sans);
|
||||
color: var(--ink);
|
||||
background: var(--white);
|
||||
}
|
||||
|
||||
*, *::before, *::after { box-sizing: border-box; }
|
||||
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
|
||||
body { margin: 0; }
|
||||
[hidden] { display: none !important; }
|
||||
img, video { display: block; max-width: 100%; }
|
||||
img { height: auto; }
|
||||
button, input, select, textarea { font: inherit; }
|
||||
button { cursor: pointer; }
|
||||
h1, h2, h3, h4, p, ul, ol { margin-top: 0; }
|
||||
h1, h2, h3, h4 { line-height: 1.18; }
|
||||
h1, h2 { text-wrap: balance; }
|
||||
h1 { font-size: clamp(2.75rem, 6vw, 5.75rem); letter-spacing: -.055em; font-weight: 650; }
|
||||
h2 { font-size: clamp(2rem, 4.15vw, 3.65rem); letter-spacing: -.042em; font-weight: 640; }
|
||||
h3 { font-size: clamp(1.18rem, 2vw, 1.65rem); letter-spacing: -.024em; font-weight: 650; }
|
||||
p { color: var(--muted); }
|
||||
a { color: var(--accent); text-underline-offset: .23em; text-decoration-thickness: .075em; }
|
||||
a:hover { color: var(--accent-deep); }
|
||||
a, button, summary { -webkit-tap-highlight-color: transparent; }
|
||||
:focus-visible { outline: 3px solid #4477f9; outline-offset: 4px; }
|
||||
address { font-style: normal; }
|
||||
.wrap { width: min(calc(100% - var(--edge) * 2), 82.5rem); margin-inline: auto; }
|
||||
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
||||
.skip-link {
|
||||
position: fixed;
|
||||
z-index: 20;
|
||||
top: .8rem;
|
||||
left: .8rem;
|
||||
padding: .65rem 1rem;
|
||||
border-radius: .45rem;
|
||||
transform: translateY(-200%);
|
||||
color: var(--ink);
|
||||
background: var(--white);
|
||||
}
|
||||
.skip-link:focus { transform: translateY(0); }
|
||||
|
||||
.masthead { position: sticky; z-index: 5; top: 0; background: var(--white); border-bottom: 1px solid var(--line); }
|
||||
.masthead-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.25rem; min-height: 4.75rem; }
|
||||
.wordmark { display: inline-flex; align-items: center; min-height: 44px; width: fit-content; }
|
||||
.wordmark img { width: 8.125rem; height: auto; }
|
||||
.primary-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1rem, 3vw, 2.75rem); }
|
||||
.primary-nav a { min-height: 44px; display: grid; align-items: center; color: var(--muted); text-decoration: none; font-size: .9375rem; font-weight: 550; }
|
||||
.primary-nav a:hover, .primary-nav a[aria-current] { color: var(--accent); }
|
||||
.masthead-action { justify-self: end; }
|
||||
.primary-nav .mobile-contact { display: none; }
|
||||
.menu-toggle { display: none; }
|
||||
.button {
|
||||
min-height: 46px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: .65rem 1.18rem;
|
||||
border: 1px solid transparent;
|
||||
border-radius: .62rem;
|
||||
font-size: .9375rem;
|
||||
font-weight: 640;
|
||||
line-height: 1.25;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
|
||||
}
|
||||
.button:hover { transform: translateY(-2px); }
|
||||
.button:active { transform: translateY(1px); }
|
||||
.button-primary { color: white; background: var(--accent); border-color: var(--accent); }
|
||||
.button-primary:hover { color: white; background: var(--accent-deep); border-color: var(--accent-deep); }
|
||||
.button-outline { color: var(--ink); background: transparent; border-color: #c8d4e7; }
|
||||
.button-outline:hover { color: var(--accent); background: var(--white); border-color: var(--accent); }
|
||||
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
|
||||
.actions > a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; font-weight: 550; }
|
||||
.overline { color: var(--accent); font-size: .875rem; font-weight: 650; letter-spacing: .075em; }
|
||||
|
||||
.hero { background: var(--paper); border-bottom: 1px solid var(--line); }
|
||||
.hero-inner {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
|
||||
align-items: center;
|
||||
gap: clamp(1.6rem, 4vw, 4.5rem);
|
||||
min-height: clamp(34rem, 48vw, 48rem);
|
||||
padding-block: clamp(3.25rem, 7vw, 7rem);
|
||||
}
|
||||
.hero-home .hero-inner {
|
||||
min-height: max(33.5rem, calc(100svh - 12rem));
|
||||
padding-block: clamp(3.25rem, 6vw, 6.75rem);
|
||||
}
|
||||
.hero-home {
|
||||
background: radial-gradient(ellipse at 82% 42%, #e5edff 0, transparent 52%), #f5f7fb;
|
||||
}
|
||||
.hero-label { margin-bottom: 1.4rem; }
|
||||
.hero h1 { margin-bottom: 1.5rem; text-wrap: initial; }
|
||||
.hero h1 span { color: var(--accent); }
|
||||
.hero-home h1 { font-size: clamp(3.2rem, 7.4vw, 7.3rem); line-height: 1.08; letter-spacing: -.09em; margin: 0 0 1.5rem -.065em; padding-right: .08em; }
|
||||
.hero-lead { margin-bottom: 1.8rem; max-width: 35rem; font-size: clamp(1.03rem, 1.58vw, 1.28rem); line-height: 1.78; }
|
||||
.hero-home .hero-lead { max-width: 28rem; }
|
||||
.hero-actions .button { min-height: 50px; padding-inline: 1.35rem; }
|
||||
.hero-visual { min-width: 0; position: relative; }
|
||||
.hero-visual img { width: 100%; object-fit: contain; }
|
||||
.hero-illustration {
|
||||
isolation: isolate;
|
||||
border: 1px solid #cad9f6;
|
||||
border-radius: 1.8rem;
|
||||
background:
|
||||
radial-gradient(circle, #a9bce9 1px, transparent 1.3px) 0 0 / 20px 20px,
|
||||
#eaf0fd;
|
||||
padding: clamp(.45rem, 1.8vw, 1.7rem);
|
||||
box-shadow: 0 22px 85px -44px #204dba65;
|
||||
}
|
||||
.hero-illustration img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 1.15rem; mix-blend-mode: multiply; }
|
||||
.app-frame, .hero-service-art {
|
||||
border: 1px solid #c9d7ef;
|
||||
border-radius: var(--radius);
|
||||
background: #e7eefd;
|
||||
padding: clamp(.5rem, 1.4vw, 1.2rem);
|
||||
box-shadow: 0 28px 60px -42px #204ea791;
|
||||
}
|
||||
.app-frame img, .hero-service-art img { border-radius: calc(var(--radius) / 2); }
|
||||
.hero-pagepan .app-frame img, .hero-highspeaker .app-frame img { aspect-ratio: 16/9; object-fit: contain; height: auto; }
|
||||
.hero-shnu-sc .hero-service-art img { aspect-ratio: 1916/821; object-fit: contain; height: auto; }
|
||||
.hero-sc .hero-service-art img { aspect-ratio: 1586/992; object-fit: contain; height: auto; }
|
||||
.hero-pagepan h1 { font-size: clamp(2.8rem, 6vw, 6.1rem); }
|
||||
.hero-highspeaker h1 { font-size: clamp(2.7rem, 5.1vw, 5.05rem); }
|
||||
.hero-sc, .hero-shnu-sc { background: #f7f8fb; }
|
||||
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; font-size: .9rem; color: var(--muted); margin-bottom: 1.35rem; }
|
||||
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--muted); }
|
||||
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
|
||||
.crumb-divider { color: #74859d; }
|
||||
.hero-directory {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, .9fr) repeat(4, minmax(0, 1fr));
|
||||
border: 1px solid var(--line);
|
||||
border-radius: .85rem .85rem 0 0;
|
||||
background: #ffffffb8;
|
||||
min-height: 7rem;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.hero-directory > * { display: flex; flex-direction: column; justify-content: center; gap: .12rem; padding: .75rem clamp(.6rem, 2vw, 1.85rem); }
|
||||
.hero-directory a { color: var(--ink); text-decoration: none; border-inline-start: 1px solid var(--line); transition: background-color 160ms ease, color 160ms ease; }
|
||||
.hero-directory a:hover { color: var(--accent); background: #fff; }
|
||||
.hero-directory a span { font-size: 1.12rem; font-weight: 670; }
|
||||
.hero-directory small { color: var(--muted); font-size: .875rem; }
|
||||
.hero-copy, .hero-visual { animation: enter 560ms cubic-bezier(.2,.7,.3,1) both; }
|
||||
.hero-visual { animation-delay: 80ms; }
|
||||
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
||||
|
||||
.section-nav { background: var(--white); border-bottom: 1px solid var(--line); }
|
||||
.section-nav-inner { display: flex; flex-wrap: wrap; gap: .2rem clamp(1rem, 4vw, 2.8rem); padding-block: .3rem; }
|
||||
.section-nav a { color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; font-size: .95rem; text-decoration: none; }
|
||||
.section-nav a:hover { color: var(--accent); text-decoration: underline; }
|
||||
|
||||
.section { padding-block: var(--space-section); }
|
||||
.section + .section { border-top: 1px solid var(--line); }
|
||||
.section-tinted, .network { background: var(--paper); }
|
||||
.section-heading { margin-bottom: clamp(1.75rem, 4.3vw, 3.75rem); }
|
||||
.section-heading h1, .section-heading h2 { margin: 0; }
|
||||
.section-heading p { font-size: clamp(1.02rem, 1.55vw, 1.2rem); margin: .9rem 0 0; max-width: 45rem; }
|
||||
.inline-heading { display: flex; flex-wrap: wrap; gap: .9rem 1.75rem; justify-content: space-between; align-items: center; }
|
||||
.rich > :last-child, .rich article > :last-child, .rich article > div > :last-child { margin-bottom: 0; }
|
||||
.rich h3 { margin-bottom: .65rem; }
|
||||
.rich p { line-height: 1.78; }
|
||||
.rich strong { color: var(--ink); }
|
||||
.rich ul, .rich ol { padding-left: 1.3rem; }
|
||||
.rich :where(a,img,video) { transition: transform 180ms ease, color 180ms ease; }
|
||||
.rich a:not(.button):hover { text-decoration-thickness: .14em; }
|
||||
.rich img { border-radius: .45rem; }
|
||||
.rich > img { max-width: min(100%, 46rem); }
|
||||
.rich > p:not([class]) { max-width: 47rem; }
|
||||
.rich a > img:hover, .project > div:first-child:hover img { transform: scale(1.02); }
|
||||
.project-stack { display: grid; gap: 2.15rem; }
|
||||
.project {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
|
||||
align-items: center;
|
||||
gap: clamp(1.4rem, 5vw, 5rem);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
padding: clamp(1rem, 2.4vw, 2.15rem);
|
||||
}
|
||||
.project:nth-child(even) { grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); }
|
||||
.project:nth-child(even) > div:first-child { order: 2; }
|
||||
.project > div:first-child { overflow: hidden; border-radius: .75rem; background: #edf2fe; }
|
||||
.project img { width: 100%; border-radius: .75rem; }
|
||||
.project h3 { font-size: clamp(1.7rem, 3.15vw, 3rem); margin: .55rem 0 .75rem; }
|
||||
.project p { margin-bottom: 1rem; }
|
||||
.section-about { position: relative; overflow: hidden; isolation: isolate; color: white; background: var(--navy); }
|
||||
.section-about::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
inset: 0;
|
||||
background: repeating-radial-gradient(circle at 90% 72%, transparent 0 33px, #5e8ff822 34px 35px, transparent 36px 60px), linear-gradient(135deg, #111f3b, #142b5f);
|
||||
pointer-events: none;
|
||||
}
|
||||
.section-about.moment-active::before { animation: iris 900ms ease-out both; }
|
||||
@keyframes iris { from { clip-path: circle(14% at 80% 60%); } to { clip-path: circle(100% at 70% 57%); } }
|
||||
.section-about .section-heading { margin-bottom: 1.45rem; }
|
||||
.section-about .rich p { color: #dbe7ff; font-size: clamp(1.2rem, 2.4vw, 1.7rem); max-width: 50rem; }
|
||||
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.65rem; }
|
||||
.content-card {
|
||||
border: 1px solid var(--line);
|
||||
background: var(--white);
|
||||
border-radius: var(--radius);
|
||||
padding: clamp(1.15rem, 2.5vw, 2.1rem);
|
||||
min-width: 0;
|
||||
line-height: 1.65;
|
||||
}
|
||||
.content-card > img:first-child, .content-card > a:first-child img { width: 2.75rem; height: 2.75rem; object-fit: contain; margin-bottom: 1rem; }
|
||||
.feature-card p { margin-bottom: .9rem; }
|
||||
.feature-card a { display: inline-flex; align-items: center; min-height: 44px; }
|
||||
.price-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
|
||||
.price-card { display: flex; flex-direction: column; min-width: 0; }
|
||||
.price-card h3 { margin-bottom: .55rem; }
|
||||
.price-card .price-value { color: var(--accent); font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.15; margin: .4rem 0 .85rem; font-weight: 650; }
|
||||
.price-value small { font-weight: 450; font-size: .9rem; color: var(--muted); }
|
||||
.price-note { font-size: .875rem; }
|
||||
.price-card ul { margin-block: .75rem 1.2rem; }
|
||||
.price-card li + li { margin-top: .35rem; }
|
||||
.price-card > .button, .price-card > .availability { margin-top: auto; align-self: start; }
|
||||
.price-card .availability { color: var(--muted); font-size: .9rem; }
|
||||
.contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.contact-card img { max-width: 10rem; }
|
||||
.contact-card > img:first-child { width: 3rem; }
|
||||
.contact-card a { min-height: 44px; display: inline-flex; align-items: center; }
|
||||
.testimonials .content-card h3 + h3 { font-size: .96rem; color: var(--muted); font-weight: 500; }
|
||||
.demo-row { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr); align-items: center; gap: 2.1rem; padding: 1.4rem 0; border-top: 1px solid var(--line); }
|
||||
.demo-row video { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
|
||||
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: .85rem; background: var(--white); }
|
||||
.table-scroll table { width: 100%; min-width: 39rem; border-collapse: collapse; text-align: left; font-size: .94rem; }
|
||||
th, td { padding: .85rem 1rem; line-height: 1.55; vertical-align: top; border-bottom: 1px solid var(--line); }
|
||||
th { font-weight: 650; }
|
||||
thead { background: var(--accent-light); }
|
||||
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
|
||||
.section-description, .fine-print { color: var(--muted); font-size: .9rem; }
|
||||
.progress-note { margin-top: 1.75rem; max-width: 34rem; }
|
||||
.progress-note label { display: block; margin-bottom: .6rem; font-weight: 600; }
|
||||
progress { width: 100%; height: .8rem; accent-color: var(--accent); }
|
||||
.contact-panel { display: flex; flex-wrap: wrap; gap: 1.4rem 3rem; align-items: center; }
|
||||
.contact-panel img { width: 10rem; border: 1px solid var(--line); }
|
||||
.resource-box { max-width: 46rem; }
|
||||
.faq { max-width: 62rem; border-top: 1px solid var(--line); }
|
||||
.faq details { border-bottom: 1px solid var(--line); }
|
||||
.faq summary { cursor: pointer; padding: 1.05rem 2.5rem 1.05rem 0; min-height: 48px; position: relative; list-style: none; font-weight: 630; }
|
||||
.faq summary::-webkit-details-marker { display: none; }
|
||||
.faq summary::after { content: "+"; position: absolute; right: .5rem; top: .75rem; font-size: 1.4rem; color: var(--accent); }
|
||||
.faq details[open] summary::after { content: "−"; }
|
||||
.faq details > div { max-width: 55rem; padding-bottom: .95rem; }
|
||||
|
||||
.article-list, .network-list { list-style: none; margin: 0; padding: 0; }
|
||||
.article-row { display: grid; grid-template-columns: 5rem minmax(0, 1fr) auto; gap: .8rem 1.3rem; align-items: baseline; color: var(--ink); padding: 1.3rem .2rem; text-decoration: none; border-block-start: 1px solid var(--line); min-height: 55px; transition: background-color 160ms ease, transform 160ms ease; }
|
||||
.article-list li:last-child .article-row { border-bottom: 1px solid var(--line); }
|
||||
.article-row:hover { background: var(--paper); transform: translateY(-2px); }
|
||||
.article-category { font-weight: 640; color: var(--accent); font-size: .875rem; }
|
||||
.article-row-title { font-weight: 630; font-size: clamp(1.05rem, 2vw, 1.34rem); }
|
||||
.article-row-title small { display: block; margin-top: .4rem; color: var(--muted); font-size: .93rem; font-weight: 400; }
|
||||
.article-row time { color: var(--muted); font-size: .875rem; font-family: var(--mono); }
|
||||
.network-group + .network-group { margin-top: 2.2rem; }
|
||||
.network-group h3 { margin-bottom: .8rem; }
|
||||
.network-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .7rem; }
|
||||
.network-list li > * { display: flex; align-items: center; gap: .75rem; min-height: 4rem; height: 100%; border-radius: .65rem; background: var(--white); border: 1px solid var(--line); color: var(--ink); text-decoration: none; padding: .75rem; transition: transform 160ms ease, border-color 160ms ease; }
|
||||
.network-list a:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
|
||||
.network-list img { max-width: 3rem; max-height: 1.8rem; object-fit: contain; object-position: left; }
|
||||
.network-list img[src$="oneprovider_invert.svg"] { background: #29354a; border-radius: .25rem; padding: .21rem; }
|
||||
.article-page { min-height: 44vh; background: var(--white); }
|
||||
.article-page h1 { font-size: clamp(2.45rem, 5.25vw, 4.7rem); }
|
||||
.reading-wrap { max-width: 55rem; }
|
||||
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .95rem; font-weight: 600; }
|
||||
.article-meta { display: flex; gap: 1.15rem; color: var(--muted); align-items: center; margin-block: 1rem .85rem; }
|
||||
.prose { overflow-wrap: anywhere; }
|
||||
.prose h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); margin-top: 2rem; }
|
||||
.prose pre { overflow-x: auto; padding: 1rem; background: var(--paper); border-radius: .5rem; }
|
||||
.prose code { font-family: var(--mono); }
|
||||
.filter-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0; }
|
||||
.filter-nav a { display: inline-flex; align-items: center; min-height: 44px; background: var(--paper); color: var(--muted); padding: .3rem .85rem; border: 1px solid var(--line); border-radius: .5rem; text-decoration: none; }
|
||||
.filter-nav a:hover, .filter-nav a[aria-current] { color: var(--accent); background: var(--accent-light); border-color: #b8cafa; }
|
||||
.pagination { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
|
||||
.empty-state { background: var(--paper); padding: 1rem; border-radius: .6rem; }
|
||||
|
||||
.site-footer { padding: clamp(2.5rem, 5.8vw, 5.5rem) 0 2rem; background: #edf2fa; border-top: 1px solid var(--line); }
|
||||
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, .75fr)); gap: 1.5rem 3rem; }
|
||||
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; }
|
||||
.footer-grid a, .footer-meta a { color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
|
||||
.footer-grid a:hover, .footer-meta a:hover { color: var(--accent); text-decoration: underline; }
|
||||
.footer-grid a { min-height: 44px; display: inline-flex; align-items: center; }
|
||||
.footer-company p, .footer-label { color: var(--ink); font-weight: 640; margin: .2rem 0 .35rem; }
|
||||
.footer-company p { margin-top: .6rem; }
|
||||
.footer-company address { color: var(--muted); max-width: 26rem; font-size: .95rem; }
|
||||
.footer-meta { display: flex; flex-wrap: wrap; gap: .6rem 1.8rem; padding-top: 1.2rem; margin-top: 1.25rem; border-top: 1px solid var(--line); font-size: .875rem; }
|
||||
.footer-meta p { margin: 0; }
|
||||
.footer-terms { flex-basis: 100%; }
|
||||
|
||||
@media (max-width: 62rem) {
|
||||
.masthead-inner { gap: .85rem; }
|
||||
.primary-nav { gap: clamp(.75rem, 2.3vw, 1.45rem); }
|
||||
.hero-inner { min-height: 33rem; }
|
||||
.hero-home .hero-inner { min-height: 32rem; }
|
||||
.hero-directory { min-height: 6rem; }
|
||||
.hero-directory a span { font-size: 1rem; }
|
||||
.hero-directory small { font-size: .81rem; }
|
||||
.card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
}
|
||||
@media (max-width: 44rem) {
|
||||
html { scroll-padding-top: 5rem; }
|
||||
.masthead-inner { grid-template-columns: 1fr auto; min-height: 4rem; }
|
||||
.masthead-action { display: none; }
|
||||
.primary-nav .mobile-contact { display: grid; }
|
||||
.primary-nav { grid-column: 1 / -1; justify-content: flex-start; }
|
||||
.primary-nav.has-toggle { display: none; width: 100%; padding-bottom: .75rem; }
|
||||
.primary-nav.has-toggle.is-open { display: grid; gap: .15rem; }
|
||||
.primary-nav.is-open a { padding-inline: .65rem; }
|
||||
.menu-toggle { display: grid; place-content: center; gap: 5px; width: 44px; height: 44px; padding: 0; background: white; border: 1px solid var(--line); border-radius: .5rem; }
|
||||
.menu-toggle span:not(.sr-only) { display: block; width: 17px; height: 2px; background: var(--ink); border-radius: 1px; transition: transform 160ms ease; }
|
||||
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
|
||||
.menu-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }
|
||||
.hero-inner, .hero-home .hero-inner { grid-template-columns: 1fr; min-height: auto; padding-block: 2.75rem 2.1rem; gap: 1.8rem; }
|
||||
.hero-home h1 { font-size: clamp(3.25rem, 13vw, 5.5rem); }
|
||||
.hero-label { margin-bottom: .85rem; }
|
||||
.hero h1 { margin-bottom: 1rem; }
|
||||
.hero-lead { margin-bottom: 1.3rem; }
|
||||
.hero-illustration { border-radius: 1.15rem; }
|
||||
.hero-illustration img { border-radius: .8rem; }
|
||||
.hero-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .2rem; }
|
||||
.hero-directory > .overline { grid-column: 1 / -1; }
|
||||
.hero-directory a { border-top: 1px solid var(--line); min-height: 4rem; padding-inline: .8rem; }
|
||||
.hero-directory a:nth-child(even) { border-inline-start: 0; }
|
||||
.section-nav-inner { column-gap: 1.1rem; }
|
||||
.section-nav a { font-size: .875rem; }
|
||||
.project, .project:nth-child(even) { grid-template-columns: 1fr; gap: 1rem; }
|
||||
.project > div:first-child, .project:nth-child(even) > div:first-child { order: 2; }
|
||||
.card-grid { grid-template-columns: 1fr; }
|
||||
.demo-row { grid-template-columns: 1fr; gap: .55rem; }
|
||||
.article-row { grid-template-columns: minmax(0, 1fr) auto; }
|
||||
.article-category { grid-column: 1; grid-row: 1; }
|
||||
.article-row-title { grid-column: 1 / -1; grid-row: 2; }
|
||||
.article-row time { grid-column: 2; grid-row: 1; }
|
||||
.footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
|
||||
.footer-company { grid-column: 1 / -1; }
|
||||
}
|
||||
@media (max-width: 23rem) {
|
||||
.hero-actions .button { width: 100%; }
|
||||
.hero-highspeaker h1 { font-size: clamp(2.4rem, 12vw, 2.7rem); }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
|
||||
}
|
||||
|
||||
.payment-methods { display: flex; gap: .65rem; align-items: center; margin-block: .5rem; }
|
||||
.payment-methods img { width: 1.625rem; height: 1.625rem; object-fit: contain; }
|
||||
@@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
|
||||
const toggle = document.querySelector('.menu-toggle');
|
||||
const nav = document.querySelector('.primary-nav');
|
||||
if (toggle && nav) {
|
||||
toggle.hidden = false;
|
||||
nav.classList.add('has-toggle');
|
||||
|
||||
const closeMenu = () => {
|
||||
toggle.setAttribute('aria-expanded', 'false');
|
||||
nav.classList.remove('is-open');
|
||||
};
|
||||
|
||||
toggle.addEventListener('click', () => {
|
||||
const open = toggle.getAttribute('aria-expanded') === 'true';
|
||||
if (open) {
|
||||
closeMenu();
|
||||
} else {
|
||||
toggle.setAttribute('aria-expanded', 'true');
|
||||
nav.classList.add('is-open');
|
||||
}
|
||||
});
|
||||
|
||||
nav.addEventListener('click', closeMenu);
|
||||
document.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'Escape' && toggle.getAttribute('aria-expanded') === 'true') {
|
||||
closeMenu();
|
||||
toggle.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ('IntersectionObserver' in window && !matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
for (const entry of entries) {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('moment-active');
|
||||
observer.unobserve(entry.target);
|
||||
}
|
||||
}
|
||||
}, {threshold: 0.35});
|
||||
|
||||
document.querySelectorAll('[data-moment]').forEach((section) => observer.observe(section));
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.6 KiB |
@@ -0,0 +1,60 @@
|
||||
CREATE TABLE IF NOT EXISTS site_settings (
|
||||
id INTEGER PRIMARY KEY CHECK (id = 1),
|
||||
payload TEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS pages (
|
||||
slug TEXT PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
heading TEXT NOT NULL,
|
||||
accent TEXT NOT NULL,
|
||||
lead TEXT NOT NULL,
|
||||
image TEXT NOT NULL,
|
||||
alt TEXT NOT NULL,
|
||||
actions TEXT NOT NULL,
|
||||
quicklinks TEXT NOT NULL,
|
||||
partners TEXT NOT NULL,
|
||||
updated_at TEXT,
|
||||
version INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS sections (
|
||||
page_slug TEXT NOT NULL REFERENCES pages(slug) ON DELETE CASCADE,
|
||||
key TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
lead TEXT NOT NULL,
|
||||
style TEXT NOT NULL DEFAULT 'plain',
|
||||
body TEXT NOT NULL,
|
||||
position INTEGER NOT NULL,
|
||||
version INTEGER NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (page_slug, key)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS articles (
|
||||
id INTEGER PRIMARY KEY,
|
||||
slug TEXT NOT NULL UNIQUE,
|
||||
title TEXT NOT NULL,
|
||||
category TEXT NOT NULL CHECK (category IN ('announcement','news','product')),
|
||||
summary TEXT NOT NULL,
|
||||
body TEXT NOT NULL,
|
||||
tags TEXT NOT NULL,
|
||||
status TEXT NOT NULL CHECK (status IN ('draft','published')),
|
||||
published_at TEXT,
|
||||
updated_at TEXT NOT NULL,
|
||||
legacy_path TEXT UNIQUE,
|
||||
version INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS articles_public ON articles (status, published_at DESC, id DESC);
|
||||
CREATE TABLE IF NOT EXISTS article_redirects (
|
||||
slug TEXT PRIMARY KEY,
|
||||
article_id INTEGER NOT NULL REFERENCES articles(id) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id INTEGER PRIMARY KEY,
|
||||
email TEXT NOT NULL UNIQUE COLLATE NOCASE,
|
||||
password_hash TEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS login_attempts (
|
||||
address TEXT PRIMARY KEY,
|
||||
attempts INTEGER NOT NULL,
|
||||
expires_at INTEGER NOT NULL
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
chdir(__DIR__);
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
$sessionPath = __DIR__ . '/runtime/sessions';
|
||||
if (!is_dir($sessionPath) && !mkdir($sessionPath, 0750, true) && !is_dir($sessionPath)) {
|
||||
throw new RuntimeException('无法创建会话目录。');
|
||||
}
|
||||
ini_set('session.save_path', $sessionPath);
|
||||
|
||||
support\App::run();
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
require dirname(__DIR__) . '/vendor/workerman/webman-framework/src/support/bootstrap.php';
|
||||