Release 2.7.0: executable handbooks and native user-site workflows
No files matched your search
@@ -13,50 +13,58 @@ import:
|
||||
|
||||
# main
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
|
||||
|
||||
This is an offline knowledge-reuse workflow, not a request to an external model. It loads the agent plugin, promotes the visible workbook for one exact goal and asks the same agent goal again. The expected hit comes from the promoted knowledge base. The dummy key only satisfies model setup; it is not a credential or evidence that a model call succeeded.
|
||||
|
||||
The example uses its own named files under .marqdo and replaces that example knowledge base on rerun. Grant the actual plugin and filesystem effects in a disposable example root. Promotion and execution are separate outcomes: inspect promoted first, then cache, match and the returned result. A hit marker alone does not prove that an unrelated new goal is safe to reuse.
|
||||
|
||||
OKF flywheel offline: promote → plan same goal → `cache=hit` (no live LLM required for the hit path).
|
||||
|
||||
**p = > plugin.native_path name="agent"**
|
||||
We first **p = [Compute p](plugin.native_path(name="agent"))** for the next step.
|
||||
1. `p`
|
||||
> plugin.load path=`p`
|
||||
We now **[Call plugin.load](> plugin.load path=`p`)**.
|
||||
2. *
|
||||
> print text=no-agent-plugin
|
||||
> sys.exit code=1
|
||||
We now **[Display this step's result](> print text="no-agent-plugin")**.
|
||||
We now **[Call sys.exit](> sys.exit code=1)**.
|
||||
|
||||
> sys.env_set name="OPENAI_API_KEY" value="offline-okf-dummy"
|
||||
**model = > llm.llm**
|
||||
**tools = > json.parse text=[]**
|
||||
**助手 = > agent.agent model=`model` tools=`tools` standing="offline okf flywheel"**
|
||||
We now **[Call sys.env set](> sys.env_set name="OPENAI_API_KEY" value="offline-okf-dummy")**.
|
||||
We first **model = [Compute model](llm.llm())** for the next step.
|
||||
We first **tools = [Compute tools](json.parse(text="[]"))** for the next step.
|
||||
We first **助手 = [Compute 助手](agent.agent(model=`model`, tools=`tools`, standing="offline okf flywheel"))** for the next step.
|
||||
|
||||
**kb = ".marqdo/agent-kb-example-flywheel"**
|
||||
**wb = ".marqdo/agent-runs/example-pong-solid.mq.md"**
|
||||
**goal = "Reply with exactly the word pong and nothing else."**
|
||||
**body = "---\ntitle: okf pong\n---\n\n# main\n\n*msg = \"pong\"*\n\n**msg**\n"**
|
||||
We first **kb = ".marqdo/agent-kb-example-flywheel"** for the next step.
|
||||
We first **wb = ".marqdo/agent-runs/example-pong-solid.mq.md"** for the next step.
|
||||
We first **goal = "Reply with exactly the word pong and nothing else."** for the next step.
|
||||
We first **body = "---\ntitle: okf pong\n---\n\n# main\n\n*msg = \"pong\"*\n\n**msg**\n"** for the next step.
|
||||
|
||||
1. > fs.exists path=`kb`
|
||||
> fs.remove path=`kb`
|
||||
We now **[Call fs.remove](> fs.remove path=`kb`)**.
|
||||
2. *
|
||||
---
|
||||
|
||||
> fs.write_text path=`wb` text=`body`
|
||||
We now **[Call fs.write text](> fs.write_text path=`wb` text=`body`)**.
|
||||
|
||||
**prom = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb`**
|
||||
**okp = > json.get value=`prom` key="promoted"**
|
||||
We first **prom = [Compute prom](agent_kb_promote(kb_dir=`kb`, goal=`goal`, workbook=`wb`))** for the next step.
|
||||
We first **okp = [Compute okp](json.get(value=`prom`, key="promoted"))** for the next step.
|
||||
1. `okp`
|
||||
> print text=promoted
|
||||
We now **[Display this step's result](> print text="promoted")**.
|
||||
2. *
|
||||
> print text=promote-fail
|
||||
> sys.exit code=1
|
||||
We now **[Display this step's result](> print text="promote-fail")**.
|
||||
We now **[Call sys.exit](> sys.exit code=1)**.
|
||||
|
||||
**out = > `助手`.plan goal=`goal` max_rounds=2 writeback=False kb_dir=`kb` explore_n=0 promote=False**
|
||||
**cache = > json.get value=`out` key="cache"**
|
||||
> print text=`cache`
|
||||
**match = > json.get value=`out` key="match"**
|
||||
> print text=`match`
|
||||
**val = > json.get value=`out` key="result"**
|
||||
> print text=`val`
|
||||
We first **out = [Compute out](> `助手`.plan goal=`goal` max_rounds=2 writeback=False kb_dir=`kb` explore_n=0 promote=False)** for the next step.
|
||||
We first **cache = [Compute cache](json.get(value=`out`, key="cache"))** for the next step.
|
||||
We now **[Display this step's result](> print text=`cache`)**.
|
||||
We first **match = [Compute match](json.get(value=`out`, key="match"))** for the next step.
|
||||
We now **[Display this step's result](> print text=`match`)**.
|
||||
We first **val = [Compute val](json.get(value=`out`, key="result"))** for the next step.
|
||||
We now **[Display this step's result](> print text=`val`)**.
|
||||
|
||||
1. `cache` == "hit"
|
||||
> print text=flywheel-ok
|
||||
We now **[Display this step's result](> print text="flywheel-ok")**.
|
||||
2. *
|
||||
> print text=flywheel-miss
|
||||
> sys.exit code=1
|
||||
We now **[Display this step's result](> print text="flywheel-miss")**.
|
||||
We now **[Call sys.exit](> sys.exit code=1)**.
|
||||
@@ -15,21 +15,33 @@ import:
|
||||
|
||||
## 获取时间
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | The value explicitly returned below; conditional returns follow the selected branch |
|
||||
|
||||
Return today's date string (tool visible in source to the model).
|
||||
|
||||
**u = > time.now_unix**
|
||||
*> time.format unix=`u` pattern="%Y-%m-%d"*
|
||||
We first **u = [Compute u](time.now_unix())** for the next step.
|
||||
After these steps, return *time.format(unix=`u`, pattern="%Y-%m-%d")*.
|
||||
|
||||
# main
|
||||
|
||||
**p = > plugin.native_path name="agent"**
|
||||
1. `p`
|
||||
> plugin.load path=`p`
|
||||
2. *
|
||||
> print text=no-agent-plugin
|
||||
> sys.exit code=1
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
|
||||
|
||||
> llm.load_env path="../../.env"
|
||||
This entry first verifies what the agent can read about its own call site. It assembles a step context and checks for the call-site section, source section and the actual time-tool name before considering an optional live step. The tool table points to the real local function; it is not an independently maintained tool description detached from the source.
|
||||
|
||||
Normal demonstration stops at context evidence and does not require a paid model response. AGENT_LIVE and an available key together opt into the separate live branch. Context markers establish prompt content, not the correctness of a future model answer. Keep the tool result and returned status visible when exercising that branch; never replace a missing credential with a fixed successful response.
|
||||
|
||||
We first **p = [Compute p](plugin.native_path(name="agent"))** for the next step.
|
||||
1. `p`
|
||||
We now **[Call plugin.load](> plugin.load path=`p`)**.
|
||||
2. *
|
||||
We now **[Display this step's result](> print text="no-agent-plugin")**.
|
||||
We now **[Call sys.exit](> sys.exit code=1)**.
|
||||
|
||||
We now **[Call llm.load env](> llm.load_env path="../../.env")**.
|
||||
|
||||
`工具表` =
|
||||
|
||||
@@ -37,55 +49,55 @@ Return today's date string (tool visible in source to the model).
|
||||
|------|
|
||||
| 获取时间 |
|
||||
|
||||
**model = > llm.llm**
|
||||
**助手 = > agent.agent model=`model` tools=`工具表` standing="You are a Marqdo agent. Prefer CALL:获取时间 when the task needs today's date."**
|
||||
We first **model = [Compute model](llm.llm())** for the next step.
|
||||
We first **助手 = [Compute 助手](agent.agent(model=`model`, tools=`工具表`, standing="You are a Marqdo agent. Prefer CALL:获取时间 when the task needs today's date."))** for the next step.
|
||||
|
||||
Assert constitution markers in the assembled prompt (call site before how-to-act):
|
||||
|
||||
**ctx = > agent.build_step_context agent=`助手` task="What is today's date? Use the tool in this runbook."**
|
||||
We first **ctx = [Compute ctx](agent.build_step_context(agent=`助手`, task="What is today's date? Use the tool in this runbook."))** for the next step.
|
||||
|
||||
**parts = > split value=`ctx` sep="--- call site ---"**
|
||||
**n = > len value=`parts`**
|
||||
We first **parts = [Compute parts](split(value=`ctx`, sep="--- call site ---"))** for the next step.
|
||||
We first **n = [Compute n](len(value=`parts`))** for the next step.
|
||||
1. `n` > 1
|
||||
> print text=call-site-ok
|
||||
We now **[Display this step's result](> print text="call-site-ok")**.
|
||||
2. *
|
||||
> print text=call-site-missing
|
||||
> sys.exit code=1
|
||||
We now **[Display this step's result](> print text="call-site-missing")**.
|
||||
We now **[Call sys.exit](> sys.exit code=1)**.
|
||||
|
||||
**parts2 = > split value=`ctx` sep="--- source (.mq.md) ---"**
|
||||
**n2 = > len value=`parts2`**
|
||||
We first **parts2 = [Compute parts2](split(value=`ctx`, sep="--- source (.mq.md) ---"))** for the next step.
|
||||
We first **n2 = [Compute n2](len(value=`parts2`))** for the next step.
|
||||
1. `n2` > 1
|
||||
> print text=source-ok
|
||||
We now **[Display this step's result](> print text="source-ok")**.
|
||||
2. *
|
||||
> print text=source-missing
|
||||
> sys.exit code=1
|
||||
We now **[Display this step's result](> print text="source-missing")**.
|
||||
We now **[Call sys.exit](> sys.exit code=1)**.
|
||||
|
||||
**parts3 = > split value=`ctx` sep="获取时间"**
|
||||
**n3 = > len value=`parts3`**
|
||||
We first **parts3 = [Compute parts3](split(value=`ctx`, sep="获取时间"))** for the next step.
|
||||
We first **n3 = [Compute n3](len(value=`parts3`))** for the next step.
|
||||
1. `n3` > 1
|
||||
> print text=tool-in-source-ok
|
||||
We now **[Display this step's result](> print text="tool-in-source-ok")**.
|
||||
2. *
|
||||
> print text=tool-in-source-missing
|
||||
> sys.exit code=1
|
||||
We now **[Display this step's result](> print text="tool-in-source-missing")**.
|
||||
We now **[Call sys.exit](> sys.exit code=1)**.
|
||||
|
||||
**site = > agent_call_site**
|
||||
**fn = > json.get value=`site` key="function"**
|
||||
> print text=`fn`
|
||||
We first **site = [Compute site](agent_call_site())** for the next step.
|
||||
We first **fn = [Compute fn](json.get(value=`site`, key="function"))** for the next step.
|
||||
We now **[Display this step's result](> print text=`fn`)**.
|
||||
|
||||
Optional live step — set env AGENT_LIVE=1 and put keys in repo-root `.env`:
|
||||
|
||||
**live = > sys.env_get name="AGENT_LIVE"**
|
||||
**key = > sys.env_get name="OPENAI_API_KEY"**
|
||||
We first **live = [Compute live](sys.env_get(name="AGENT_LIVE"))** for the next step.
|
||||
We first **key = [Compute key](sys.env_get(name="OPENAI_API_KEY"))** for the next step.
|
||||
1. `live` == "1"
|
||||
1. `key`
|
||||
**out = > `助手`.step task="请调用获取时间工具,然后只回复日期字符串。" writeback=False**
|
||||
**status = > json.get value=`out` key="status"**
|
||||
> print text=`status`
|
||||
**tool = > json.get value=`out` key="tool"**
|
||||
> print text=`tool`
|
||||
**result = > json.get value=`out` key="result"**
|
||||
> print text=`result`
|
||||
We first **out = [Compute out](> `助手`.step task="请调用获取时间工具,然后只回复日期字符串。" writeback=False)** for the next step.
|
||||
We first **status = [Compute status](json.get(value=`out`, key="status"))** for the next step.
|
||||
We now **[Display this step's result](> print text=`status`)**.
|
||||
We first **tool = [Compute tool](json.get(value=`out`, key="tool"))** for the next step.
|
||||
We now **[Display this step's result](> print text=`tool`)**.
|
||||
We first **result = [Compute result](json.get(value=`out`, key="result"))** for the next step.
|
||||
We now **[Display this step's result](> print text=`result`)**.
|
||||
2. *
|
||||
> print text=live-skipped-no-key
|
||||
We now **[Display this step's result](> print text="live-skipped-no-key")**.
|
||||
2. *
|
||||
> print text=live-skipped
|
||||
We now **[Display this step's result](> print text="live-skipped")**.
|
||||
@@ -10,52 +10,60 @@ import:
|
||||
|
||||
# main
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
|
||||
|
||||
The two trials intentionally differ only in commit. First inspect a successful dry trial and verify that note.txt has not appeared in the host directory. Then run the committed trial, read the host file and compare its actual content. This separates an observed proposal from an observed filesystem change; neither ok alone nor a proposed path establishes that a commit happened.
|
||||
|
||||
Use a disposable filesystem root: the example replaces its named _example_sbx directory and leaves the committed evidence there for inspection. It does not promise to roll back a committed external effect. Read the returned profile as part of the trial evidence, and keep failures visible rather than manufacturing a success marker when the expected file is absent.
|
||||
|
||||
Short demo: write via `agent.trial`, prove the host is clean until commit.
|
||||
|
||||
**had = fs.exists path="_example_sbx"**
|
||||
We first **had = [Compute had](fs.exists(path="_example_sbx"))** for the next step.
|
||||
1. `had`
|
||||
> fs.remove path="_example_sbx"
|
||||
We now **[Call fs.remove](> fs.remove path="_example_sbx")**.
|
||||
2. *
|
||||
**_ = 0**
|
||||
We first **_ = 0** for the next step.
|
||||
|
||||
> fs.make_dir path="_example_sbx"
|
||||
We now **[Call fs.make dir](> fs.make_dir path="_example_sbx")**.
|
||||
|
||||
**dry = agent.trial root="_example_sbx" write_path="note.txt" text=sandbox-okf commit=False**
|
||||
**dry_ok = [ok](access(dry, "ok"))**
|
||||
**dry_committed = [committed](access(dry, "committed"))**
|
||||
We first **dry = [Compute dry](agent.trial(root="_example_sbx", write_path="note.txt", text="sandbox-okf", commit=False))** for the next step.
|
||||
We first **dry_ok = [ok](access(`dry`, "ok"))** for the next step.
|
||||
We first **dry_committed = [committed](access(`dry`, "committed"))** for the next step.
|
||||
1. `dry_ok`
|
||||
1. not `dry_committed`
|
||||
> print text=dry-ok
|
||||
We now **[Display this step's result](> print text="dry-ok")**.
|
||||
2. *
|
||||
> print text=dry-bad-commit
|
||||
We now **[Display this step's result](> print text="dry-bad-commit")**.
|
||||
2. *
|
||||
> print text=dry-fail
|
||||
We now **[Display this step's result](> print text="dry-fail")**.
|
||||
|
||||
**leaked = fs.exists path="_example_sbx/note.txt"**
|
||||
We first **leaked = [Compute leaked](fs.exists(path="_example_sbx/note.txt"))** for the next step.
|
||||
1. `leaked`
|
||||
> print text=host-leaked
|
||||
We now **[Display this step's result](> print text="host-leaked")**.
|
||||
2. *
|
||||
> print text=host-clean
|
||||
We now **[Display this step's result](> print text="host-clean")**.
|
||||
|
||||
**wet = agent.trial root="_example_sbx" write_path="note.txt" text=sandbox-okf commit=True**
|
||||
**wet_ok = [ok](access(wet, "ok"))**
|
||||
**wet_committed = [committed](access(wet, "committed"))**
|
||||
We first **wet = [Compute wet](agent.trial(root="_example_sbx", write_path="note.txt", text="sandbox-okf", commit=True))** for the next step.
|
||||
We first **wet_ok = [ok](access(`wet`, "ok"))** for the next step.
|
||||
We first **wet_committed = [committed](access(`wet`, "committed"))** for the next step.
|
||||
1. `wet_ok`
|
||||
1. `wet_committed`
|
||||
> print text=wet-ok
|
||||
We now **[Display this step's result](> print text="wet-ok")**.
|
||||
2. *
|
||||
> print text=wet-no-commit
|
||||
We now **[Display this step's result](> print text="wet-no-commit")**.
|
||||
2. *
|
||||
> print text=wet-fail
|
||||
We now **[Display this step's result](> print text="wet-fail")**.
|
||||
|
||||
**body = fs.read_text path="_example_sbx/note.txt"**
|
||||
We first **body = [Compute body](fs.read_text(path="_example_sbx/note.txt"))** for the next step.
|
||||
1. `body` == "sandbox-okf"
|
||||
> print text=proof-visible
|
||||
We now **[Display this step's result](> print text="proof-visible")**.
|
||||
2. *
|
||||
> print text=proof-missing
|
||||
We now **[Display this step's result](> print text="proof-missing")**.
|
||||
|
||||
**pname = [name](access([profile](access(wet, "profile")), "name"))**
|
||||
We first **pname = [name](access([profile](access(`wet`, "profile")), "name"))** for the next step.
|
||||
1. `pname` == "default"
|
||||
> print text=profile-default
|
||||
We now **[Display this step's result](> print text="profile-default")**.
|
||||
2. *
|
||||
> print text=profile-other
|
||||
We now **[Display this step's result](> print text="profile-other")**.
|
||||
@@ -1,45 +0,0 @@
|
||||
# 暗恋见君 · Marqdo 重写
|
||||
|
||||
用 **Marqdo + `ext/web`(Go `libweb`)** 对齐 Django [anlian](../../../anlian/) 的主浏览路径与视觉:原站 CSS/JS、首页四段、列表/详情、发帖门禁、聊天室、专题、搜索入口、API 指南。
|
||||
|
||||
默认 **SQLite**(`data/anlian-mq.db`);生产可换 `postgres://` + Redis。
|
||||
|
||||
## 设计约定
|
||||
|
||||
| 做 | 不做 |
|
||||
|----|------|
|
||||
| GFM 表装配库表/种子/表单/门禁/头资源 | `json.set` 链拼页面 |
|
||||
| 原站 `public/css|js|img` + DOM class 对齐 | 另起一套模板糊弄验收 |
|
||||
| `页面.壳HTML` 挂 Django 级导航/页脚 | 业务写进 Go 插件 |
|
||||
| 缺能力时改 `ext/web` / `libweb` | 在应用层堆不可读胶水 |
|
||||
|
||||
## 路径(对齐原站)
|
||||
|
||||
| 路径 | 能力 |
|
||||
|------|------|
|
||||
| `/` | Hero + 公告 + 新闻时间线 + 论坛板块栏/卡片 |
|
||||
| `/post`、`/post/{slug}` | 帖子列表 / 详情 |
|
||||
| `/news`、`/news/{slug}` | 新闻列表 / 详情 |
|
||||
| `/post/public` | 发帖(需登录) |
|
||||
| `/post/ten`、`/news/five` | 首页 AJAX 片段 |
|
||||
| `/chat`、`/chat/lobby`、`/chat/casual` | 房间列表 + 公聊 WS |
|
||||
| `/topics` | 专题书架 |
|
||||
| `/search` | 搜索入口 |
|
||||
| `/guide/automation-api` | API 指南 |
|
||||
| `/accounts/login` | 粉玻璃登录 |
|
||||
| `/sitemap.xml`、`/robots.txt` | 站长 |
|
||||
|
||||
## 运行
|
||||
|
||||
```bash
|
||||
export PATH="$HOME/.local/go/bin:$PATH"
|
||||
./scripts/build-web-plugin.sh
|
||||
export MARQDO_WEB_PLUGIN=$PWD/plugins/web/build/libweb.so
|
||||
rm -f examples/anlian-mq/data/anlian-mq.db* # 首次或改 schema 后
|
||||
./target/debug/marqdo run examples/anlian-mq/index.mq.md
|
||||
# → http://127.0.0.1:18180/
|
||||
|
||||
bash examples/anlian-mq/smoke.sh
|
||||
```
|
||||
|
||||
默认账号:`admin` / `anlian`。
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: components/chrome
|
||||
description: 暗恋见君壳层 — head 资源表、导航 HTML、页脚 HTML(对齐 Django base / site_footer)。
|
||||
---
|
||||
|
||||
## 头资源
|
||||
|
||||
首页与浏览页共用的 CSS / JS 链接表(挂到 `页面.头装配`)。路径对齐 `public/` 静态树。
|
||||
|
||||
`头` =
|
||||
|
||||
| 关系 | 地址 | 推迟 |
|
||||
|------|------|------|
|
||||
| stylesheet | "/static/vendor/bootstrap-anlian.min.css" | |
|
||||
| stylesheet | "/static/css/base.css" | |
|
||||
| stylesheet | "/static/css/navbar_search.css" | |
|
||||
| stylesheet | "/static/css/footer.css" | |
|
||||
| stylesheet | "/static/css/icons.css" | |
|
||||
| stylesheet | "/static/css/feed_common.css" | |
|
||||
| stylesheet | "/static/css/feed_list.css" | |
|
||||
| stylesheet | "/static/css/index.css" | |
|
||||
| stylesheet | "/static/css/index/hero.css" | |
|
||||
| stylesheet | "/static/css/index/notice.css" | |
|
||||
| stylesheet | "/static/css/index/home_news_timeline.css" | |
|
||||
| stylesheet | "/static/css/index/home_posts.css" | |
|
||||
| stylesheet | "/static/css/anlian_forms.css" | |
|
||||
| stylesheet | "/static/css/login.css" | |
|
||||
| stylesheet | "/static/css/rich_content.css" | |
|
||||
| stylesheet | "/static/css/detail_reading.css" | |
|
||||
| stylesheet | "/static/css/search.css" | |
|
||||
| stylesheet | "/static/css/chat.css" | |
|
||||
| stylesheet | "/static/css/topic_index.css" | |
|
||||
| script | "/static/vendor/bootstrap.bundle.min.js" | 真 |
|
||||
| script | "/static/js/anlian_partial.js" | 真 |
|
||||
| script | "/static/js/feed_board.js" | 真 |
|
||||
| script | "/static/js/index.js" | 真 |
|
||||
|
||||
*`头`*
|
||||
|
||||
## 导航HTML
|
||||
|
||||
对齐 Django `front/base.html` 顶栏:品牌「暗恋见君论坛」、主导航、搜索、登录/退出(`nav-when-guest` / `nav-when-auth` 由 CSS/JS 切换)。
|
||||
|
||||
**"<nav class=\"navbar navbar-expand-lg navbar-dark bg-dark\"><div class=\"container-fluid navbar-shell\"><div class=\"navbar-start\"><div class=\"navbar-logo\"><img src=\"/static/img/logo.svg\" alt=\"logo\" width=\"30\" height=\"30\" decoding=\"async\"></div><a class=\"navbar-brand\" href=\"/\">暗恋见君论坛</a></div><button class=\"navbar-toggler\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\"><span class=\"navbar-toggler-icon\"></span></button><div class=\"collapse navbar-collapse\" id=\"navbarNav\"><ul class=\"navbar-nav navbar-nav-main\"><li class=\"nav-item\"><a class=\"nav-link\" href=\"/\">首页</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"/post\">帖子</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"/news\">新闻</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"/topics\">专题</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"/chat\">聊天</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"/post/public\">发帖</a></li></ul><div class=\"navbar-end\"><form class=\"navbar-search d-flex\" action=\"/search\" method=\"get\" role=\"search\"><input class=\"form-control\" type=\"search\" name=\"q\" placeholder=\"搜索帖子、新闻、用户\" aria-label=\"搜索\" maxlength=\"100\" autocomplete=\"off\"><button class=\"btn btn-search-submit\" type=\"submit\">搜索</button></form><ul class=\"navbar-nav navbar-auth\"><li class=\"nav-item nav-when-guest\"><a class=\"nav-link nav-link-auth\" href=\"/accounts/login\">登录</a></li><li class=\"nav-item nav-when-auth\"><a class=\"nav-link nav-link-btn\" href=\"/admin/logout\">退出</a></li></ul></div></div></div></nav>"**
|
||||
|
||||
## 页脚HTML
|
||||
|
||||
对齐 `site_footer`:站点列 + 作者列;标语、版权、API 指南、作者 cflmy。
|
||||
|
||||
**"<footer class=\"site-footer\"><div class=\"site-footer-inner\"><div class=\"footer-col footer-col-site\"><img src=\"/static/img/logo.svg\" alt=\"\" class=\"footer-site-logo\" width=\"40\" height=\"40\" loading=\"lazy\"><p class=\"footer-site-name\">暗恋见君论坛</p><p class=\"footer-site-tagline\">期待人们能够继续相信爱情</p><p class=\"footer-copy\">© 2026 暗恋见君论坛</p><p class=\"footer-meta-sm footer-api-guide\"><a href=\"/guide/automation-api\" class=\"footer-guide-btn\" title=\"面向开发者的 API Key 与自动化对接说明\"><span class=\"anlian-icon anlian-icon--book\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H6Zm0 2h5v7.5L8.5 10 6 11.5V4Zm7 0h5v16h-5V4Z\"/></svg></span> API 自动化指南</a></p></div><div class=\"footer-col footer-col-author\"><img src=\"/static/img/author_avatar-144.webp\" alt=\"\" class=\"footer-author-avatar\" width=\"72\" height=\"72\" loading=\"lazy\"><div class=\"footer-author-info\"><p class=\"footer-author-name\">cflmy</p><p class=\"footer-author-title\">站长</p></div></div></div></footer>"**
|
||||
@@ -1,99 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: components/feed
|
||||
description: 帖子列表 / 新闻时间线 / 板块栏 HTML 片段(对齐 Django feed 与 home 局部模板)。
|
||||
import:
|
||||
table: lib/table.mq.md
|
||||
text: lib/text.mq.md
|
||||
---
|
||||
|
||||
## 帖子列表HTML
|
||||
+ `行`
|
||||
|
||||
给定帖子行记录列表,输出 `ul.home-posts-list` 标记(首页与列表页共用)。
|
||||
|
||||
**段 = None**
|
||||
- [帖](遍历 行 为 帖)
|
||||
**板 = [board](access(帖, "board"))**
|
||||
**题 = [title](access(帖, "title"))**
|
||||
**链 = [slug](access(帖, "slug"))**
|
||||
**作 = [author](access(帖, "author"))**
|
||||
**评 = [comments_count](access(帖, "comments_count"))**
|
||||
**时 = [created_at](access(帖, "created_at"))**
|
||||
1. not 作
|
||||
**作 = "匿名"**
|
||||
2. *
|
||||
1. not 评
|
||||
**评 = 0**
|
||||
2. *
|
||||
1. not 时
|
||||
**时 = ""**
|
||||
2. *
|
||||
**一项 = "<li><article class=\"home-post-card feed-post-card\"><a href=\"/post/" + 链 + "\" class=\"home-post-card-link feed-post-card-link\"><span class=\"home-post-board feed-post-board\">" + 板 + "</span><div class=\"home-post-body feed-post-body\"><h3 class=\"home-post-title feed-post-title\">" + 题 + "</h3><div class=\"home-post-meta feed-post-meta\"><span class=\"home-post-meta-item feed-post-meta-item\"><span class=\"anlian-icon anlian-icon--user\" aria-hidden=\"true\"></span> " + 作 + "</span><span class=\"home-post-meta-item feed-post-meta-item\"><span class=\"anlian-icon anlian-icon--comment\" aria-hidden=\"true\"></span> " + 评 + "</span><time>" + 时 + "</time></div></div><span class=\"home-post-arrow feed-post-arrow\" aria-hidden=\"true\"><span class=\"anlian-icon anlian-icon--chevron-right\"></span></span></a></article></li>"**
|
||||
**段 = > table.append list=段 item=一项**
|
||||
1. 段
|
||||
**内 = > text.str_join xs=段 sep=""**
|
||||
*"<ul class=\"home-posts-list feed-posts-list\">" + 内 + "</ul>"*
|
||||
2. *
|
||||
*"<ul class=\"home-posts-list feed-posts-list\"><li class=\"home-posts-empty feed-empty\">暂无帖子,<a href=\"/post/public\">去发帖</a></li></ul>"*
|
||||
|
||||
## 新闻时间线HTML
|
||||
+ `行`
|
||||
|
||||
给定新闻行记录列表,输出 `.news-timeline` 标记。
|
||||
|
||||
**段 = None**
|
||||
- [讯](遍历 行 为 讯)
|
||||
**题 = [title](access(讯, "title"))**
|
||||
**链 = [slug](access(讯, "slug"))**
|
||||
**板 = [board](access(讯, "board"))**
|
||||
**时 = [created_at](access(讯, "created_at"))**
|
||||
1. not 板
|
||||
**板 = ""**
|
||||
2. *
|
||||
1. not 时
|
||||
**时 = ""**
|
||||
2. *
|
||||
**一项 = "<li class=\"news-timeline-item\"><span class=\"news-timeline-node\" aria-hidden=\"true\"></span><article class=\"news-timeline-card\"><div class=\"news-timeline-meta\"><time class=\"news-timeline-date\">" + 时 + "</time><span class=\"news-timeline-board\">" + 板 + "</span></div><h3 class=\"news-timeline-title\"><a href=\"/news/" + 链 + "\" class=\"news-timeline-link\">" + 题 + "</a></h3></article></li>"**
|
||||
**段 = > table.append list=段 item=一项**
|
||||
1. 段
|
||||
**内 = > text.str_join xs=段 sep=""**
|
||||
*"<div class=\"news-timeline\"><div class=\"news-timeline-rail\" aria-hidden=\"true\"><span class=\"news-timeline-line\"></span><span class=\"news-timeline-arrow\" aria-hidden=\"true\"><span class=\"anlian-icon anlian-icon--chevron-right news-timeline-arrow-icon--right\"></span><span class=\"anlian-icon anlian-icon--chevron-down news-timeline-arrow-icon--down\"></span></span></div><ol class=\"news-timeline-items\">" + 内 + "</ol></div>"*
|
||||
2. *
|
||||
*"<div class=\"news-timeline\"><div class=\"news-timeline-rail\" aria-hidden=\"true\"><span class=\"news-timeline-line\"></span><span class=\"news-timeline-arrow\" aria-hidden=\"true\"></span></div><ol class=\"news-timeline-items\"><li class=\"news-timeline-item news-timeline-item-empty\"><article class=\"news-timeline-card\"><p class=\"news-timeline-empty\">暂无新闻</p></article></li></ol></div>"*
|
||||
|
||||
## 板块栏HTML
|
||||
+ `板块`
|
||||
+ `前缀`
|
||||
+ `查询键`
|
||||
+ `全部类`
|
||||
|
||||
板块 Tab 栏。`前缀` 如 `/post/ten/`;`查询键` 为 `board_id` 或 `news_board_id`;`全部类` 为 Tab 共用 class(含 js hook)。
|
||||
|
||||
**数据属 = "data-board"**
|
||||
**全标签 = "全部"**
|
||||
1. 查询键 == "news_board_id"
|
||||
**数据属 = "data-news-board"**
|
||||
**全标签 = "所有板块"**
|
||||
2. *
|
||||
|
||||
**段 = None**
|
||||
**全链 = 前缀 + "?" + 查询键 + "=0"**
|
||||
**全项 = "<a href=\"" + 全链 + "\" class=\"" + 全部类 + " active\" " + 数据属 + "=\"0\">" + 全标签 + "</a>"**
|
||||
**段 = > table.append list=段 item=全项**
|
||||
- [板](遍历 板块 为 板)
|
||||
**名 = [name](access(板, "name"))**
|
||||
**号 = [id](access(板, "id"))**
|
||||
**链 = 前缀 + "?" + 查询键 + "=" + 号**
|
||||
**项 = "<a href=\"" + 链 + "\" class=\"" + 全部类 + "\" " + 数据属 + "=\"" + 号 + "\">" + 名 + "</a>"**
|
||||
**段 = > table.append list=段 item=项**
|
||||
1. 查询键 == "news_board_id"
|
||||
**更多 = "<a href=\"/news\" class=\"home-posts-tab home-posts-tab-more\">全部新闻</a>"**
|
||||
**段 = > table.append list=段 item=更多**
|
||||
2. *
|
||||
**内 = > text.str_join xs=段 sep=""**
|
||||
**栏类 = "home-posts-board-bar"**
|
||||
1. 查询键 == "news_board_id"
|
||||
**栏类 = "home-posts-board-bar home-news-board-bar"**
|
||||
2. *
|
||||
*"<div class=\"" + 栏类 + "\" data-feed-board><button type=\"button\" class=\"home-posts-scroll home-posts-scroll-left\" aria-label=\"向左滚动\"><span class=\"anlian-icon anlian-icon--chevron-left\"></span></button><div class=\"home-posts-segment-outer\"><div class=\"home-posts-segment\"><div class=\"home-posts-spotlight\" aria-hidden=\"true\"></div><div class=\"home-posts-tabs-scroll\"><div class=\"home-posts-tabs\" role=\"tablist\">" + 内 + "</div></div></div></div><button type=\"button\" class=\"home-posts-scroll home-posts-scroll-right\" aria-label=\"向右滚动\"><span class=\"anlian-icon anlian-icon--chevron-right\"></span></button></div>"*
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
## 页脚
|
||||
|
||||
站点信息与站长链接(毛玻璃底由壳样式绘制)。
|
||||
|
||||
`页脚` =
|
||||
|
||||
| 属性 | 值 |
|
||||
|------|-----|
|
||||
| 暗恋见君 · 期待人们能够继续相信爱情 | / |
|
||||
| 帖子 | /posts |
|
||||
| 新闻 | /news |
|
||||
| 公聊 | /chat |
|
||||
| sitemap | /sitemap.xml |
|
||||
|
||||
*`页脚`*
|
||||
@@ -1,23 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: components/fragments
|
||||
description: AJAX 片段 — /post/ten、/news/five。
|
||||
导入:
|
||||
网页: ext/web/网页.mq.md
|
||||
db: ../db/index.mq.md
|
||||
feed: feed.mq.md
|
||||
---
|
||||
|
||||
## 帖子十
|
||||
+ `board_id`="0"
|
||||
|
||||
**store = > db.打开**
|
||||
**行 = > store.查询 表="posts" 上限=10 排序="-created_at"**
|
||||
*> feed.帖子列表HTML 行=`行`*
|
||||
|
||||
## 新闻五
|
||||
+ `news_board_id`="0"
|
||||
|
||||
**store = > db.打开**
|
||||
**行 = > store.查询 表="news" 上限=5 排序="-created_at"**
|
||||
*> feed.新闻时间线HTML 行=`行`*
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
## 首页引言
|
||||
|
||||
英雄区 HTML(品牌标语 + CTA + 漂浮主图)。样式在 `styles/shell` 的 Hero / 动效表。
|
||||
|
||||
**"<section class=\"hero\" aria-label=\"暗恋见君\"><div class=\"hero-content\"><div class=\"hero-left\"><p class=\"hero-brand\"><img class=\"hero-logo\" src=\"/static/logo.svg\" alt=\"\" width=\"30\" height=\"30\"><span>暗恋<span class=\"hero-pink\">见君</span></span></p><h1 class=\"main-text\">期待人们能够继续相信<span class=\"hero-pink\">爱情</span></h1><p class=\"sub-text\">粉玻璃、呼吸 Logo、漂浮主图——用 Marqdo 表格装配的社区站点,验收「代码即文档」能否撑起真实前端。</p><p class=\"hero-cta\"><a class=\"hero-btn\" href=\"/posts\">浏览帖子</a><a class=\"hero-btn ghost\" href=\"/news\">新闻</a><a class=\"hero-btn ghost\" href=\"/chat\">公聊</a></p></div><div class=\"hero-right\"><img class=\"hero-art\" src=\"/static/bg-hero-640.webp\" alt=\"暗恋见君\"></div></div></section><div class=\"home-feed-head\"><h2>最新帖子</h2><p>来自粉玻璃卡片流</p></div>"**
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: components/home_body
|
||||
description: 首页主体 HTML — hero + 公告 + 新闻时间线 + 论坛帖子(对齐 Django home.html,无外层导航)。
|
||||
导入:
|
||||
网页: ext/web/网页.mq.md
|
||||
table: lib/table.mq.md
|
||||
text: lib/text.mq.md
|
||||
feed: feed.mq.md
|
||||
---
|
||||
|
||||
## 装配
|
||||
+ `库`
|
||||
|
||||
查询 notices / boards / news_boards / news(5) / posts(10),拼装首页四段 HTML(不含导航与页脚)。调用方传入已打开的 store。
|
||||
|
||||
**公告行 = > 库.查询 表="notices" 上限=20 排序="-created_at"**
|
||||
**板块行 = > 库.查询 表="boards" 上限=50**
|
||||
**新闻板块行 = > 库.查询 表="news_boards" 上限=50**
|
||||
**新闻行 = > 库.查询 表="news" 上限=5 排序="-created_at"**
|
||||
**帖子行 = > 库.查询 表="posts" 上限=10 排序="-created_at"**
|
||||
|
||||
**公告段 = None**
|
||||
- [告](遍历 公告行 为 告)
|
||||
**文 = [content](access(告, "content"))**
|
||||
**时 = [created_at](access(告, "created_at"))**
|
||||
**一项 = "<div class=\"notice-item\"><article class=\"notice-content\">" + 文 + "</article><p class=\"notice-create-time\">" + 时 + "</p></div>"**
|
||||
**公告段 = > table.append list=公告段 item=一项**
|
||||
1. 公告段
|
||||
**公告内 = > text.str_join xs=公告段 sep=""**
|
||||
2. *
|
||||
**公告内 = "<p class=\"text-muted\">暂无公告</p>"**
|
||||
|
||||
**新闻栏 = > feed.板块栏HTML 板块=新闻板块行 前缀="/news/five" 查询键="news_board_id" 全部类="home-posts-tab js-home-news-tab"**
|
||||
**新闻板 = > feed.新闻时间线HTML 行=新闻行**
|
||||
**帖子栏 = > feed.板块栏HTML 板块=板块行 前缀="/post/ten" 查询键="board_id" 全部类="home-posts-tab js-home-post-tab"**
|
||||
**帖子表 = > feed.帖子列表HTML 行=帖子行**
|
||||
|
||||
**段 = None**
|
||||
**英雄 = "<section class=\"hero\"><div class=\"section-wrap\"><header><img src=\"/static/img/logo.svg\" alt=\"logo\" width=\"30\" height=\"30\" decoding=\"async\"><a class=\"head-logo\" href=\"/\"><span>暗恋</span>见君</a></header><div class=\"hero-content\"><div class=\"left\"><h1 class=\"main-text\">期待人们能够继续相信<span style=\"color:#ffd0d0\">爱情</span></h1><h2 class=\"sub-text\">粉玻璃社区 · 匿名与实名同在</h2></div><div class=\"right\"><img src=\"/static/img/bg-hero-640.webp\" alt=\"首页展示图\" width=\"640\" height=\"482\" fetchpriority=\"high\" decoding=\"async\"></div></div><div class=\"social\"></div></div></section>"**
|
||||
**段 = > table.append list=段 item=英雄**
|
||||
**公告区 = "<section class=\"notice\"><div class=\"section-wrap\"><h2 class=\"notice-title\">公告信息</h2><div class=\"notice-content-container\"><div class=\"notice-list\">" + 公告内 + "</div></div></div></section>"**
|
||||
**段 = > table.append list=段 item=公告区**
|
||||
**新闻区 = "<section class=\"news home-news\" id=\"news\"><div class=\"section-wrap home-news-stage\"><h2 class=\"news-title\">新闻动态</h2>" + 新闻栏 + "<div class=\"news-timeline-wrap\"><div id=\"homeNewsPanel\" class=\"news-timeline-panel home-panel-swap\">" + 新闻板 + "</div></div></div></section>"**
|
||||
**段 = > table.append list=段 item=新闻区**
|
||||
**更多 = "<a href=\"/post\" class=\"home-posts-more-link\">查看更多帖子</a>"**
|
||||
**帖子区 = "<section class=\"home-posts\" id=\"post\"><div class=\"section-wrap home-posts-stage\"><h2 class=\"home-posts-title\">论坛交流</h2>" + 帖子栏 + "<div id=\"tenPostContainer\" class=\"home-posts-panel home-panel-swap\">" + 帖子表 + 更多 + "</div></div></section>"**
|
||||
**段 = > table.append list=段 item=帖子区**
|
||||
*> text.str_join xs=段 sep=""*
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
## 导航
|
||||
|
||||
顶栏:首页、帖子、新闻、搜索、聊天、发帖(登录后)、后台。
|
||||
|
||||
`导航` =
|
||||
|
||||
| 属性 | 值 | 样式 | 媒体 | 当 |
|
||||
|------|-----|------|------|-----|
|
||||
| 暗恋见君 | / | | | |
|
||||
| 帖子 | /posts | | | |
|
||||
| 新闻 | /news | | | |
|
||||
| 搜索 | /search | | | |
|
||||
| 聊天 | /chat | | | |
|
||||
| 发帖 | /write | | | auth |
|
||||
| 登录 | /admin/login | | | guest |
|
||||
| 后台 | /admin | | | auth |
|
||||
|
||||
*`导航`*
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: components/page
|
||||
description: 用原站 chrome 包一层完整 HTML 引言(bare 布局)。
|
||||
import:
|
||||
text: lib/text.mq.md
|
||||
chrome: chrome.mq.md
|
||||
---
|
||||
|
||||
## 包装
|
||||
+ `正文`
|
||||
+ `体类`=""
|
||||
|
||||
导航 + 正文 + 页脚;体类如 `page-home`。
|
||||
|
||||
**顶 = > chrome.导航HTML**
|
||||
**底 = > chrome.页脚HTML**
|
||||
**鉴权脚本 = "<script>(function(){var c=document.cookie.indexOf('marqdo_sid=')>=0;document.querySelectorAll('.nav-when-guest').forEach(function(el){el.style.display=c?'none':'';});document.querySelectorAll('.nav-when-auth').forEach(function(el){el.style.display=c?'':'none';});})();</script>"**
|
||||
**鉴权样式 = "<style>.nav-when-auth{display:none}</style>"**
|
||||
*鉴权样式 + 顶 + "<main class=\"anlian-main " + 体类 + "\">" + 正文 + "</main>" + 底 + 鉴权脚本*
|
||||
@@ -1,65 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: db/index
|
||||
description: 打开库、建全表、幂等种子、帖子全文索引。
|
||||
导入:
|
||||
网页: ext/web/网页.mq.md
|
||||
schema: schema.mq.md
|
||||
seed: seed.mq.md
|
||||
---
|
||||
|
||||
## 打开
|
||||
|
||||
打开 sqlite:data/anlian-mq.db,初始化全部表;帖子建 FTS;若 posts 为空则写入种子。返回 store。
|
||||
|
||||
**store = > 网页.数据库 地址="sqlite:data/anlian-mq.db"**
|
||||
**帖子字段 = > schema.posts**
|
||||
**新闻字段 = > schema.news**
|
||||
**板块字段 = > schema.boards**
|
||||
**新闻板块字段 = > schema.news_boards**
|
||||
**公告字段 = > schema.notices**
|
||||
**评论字段 = > schema.comments**
|
||||
**房间字段 = > schema.chat_rooms**
|
||||
**专题字段 = > schema.topics**
|
||||
**密钥字段 = > schema.api_keys**
|
||||
> `store`.初始化 名=posts 字段=`帖子字段`
|
||||
> `store`.初始化 名=news 字段=`新闻字段`
|
||||
> `store`.初始化 名=boards 字段=`板块字段`
|
||||
> `store`.初始化 名=news_boards 字段=`新闻板块字段`
|
||||
> `store`.初始化 名=notices 字段=`公告字段`
|
||||
> `store`.初始化 名=comments 字段=`评论字段`
|
||||
> `store`.初始化 名=chat_rooms 字段=`房间字段`
|
||||
> `store`.初始化 名=topics 字段=`专题字段`
|
||||
> `store`.初始化 名=api_keys 字段=`密钥字段`
|
||||
|
||||
`全文列` =
|
||||
|
||||
| 列 |
|
||||
|----|
|
||||
| title |
|
||||
| summary |
|
||||
| body |
|
||||
|
||||
> `store`.全文 表=posts 列=`全文列` 名=posts_fts
|
||||
|
||||
**已有 = > store.查询 表="posts" 上限=1**
|
||||
1. `已有`
|
||||
*store*
|
||||
2. *
|
||||
**板块 = > seed.boards**
|
||||
**新闻板块 = > seed.news_boards**
|
||||
**帖子 = > seed.posts**
|
||||
**新闻 = > seed.news**
|
||||
**公告 = > seed.notices**
|
||||
**评论 = > seed.comments**
|
||||
**房间 = > seed.chat_rooms**
|
||||
**专题 = > seed.topics**
|
||||
> `store`.插入 表=boards 行=`板块`
|
||||
> `store`.插入 表=news_boards 行=`新闻板块`
|
||||
> `store`.插入 表=posts 行=`帖子`
|
||||
> `store`.插入 表=news 行=`新闻`
|
||||
> `store`.插入 表=notices 行=`公告`
|
||||
> `store`.插入 表=comments 行=`评论`
|
||||
> `store`.插入 表=chat_rooms 行=`房间`
|
||||
> `store`.插入 表=topics 行=`专题`
|
||||
*store*
|
||||
@@ -1,150 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
## posts
|
||||
|
||||
帖子主表。`slug` 用于详情路径;`board` 为板块显示名,`board_id` 关联 `boards`。
|
||||
|
||||
`posts` =
|
||||
|
||||
| 字段 | 类型 | 可空 | 索引 |
|
||||
|------|------|------|------|
|
||||
| id | integer | false | |
|
||||
| title | text | false | |
|
||||
| slug | text | false | 是 |
|
||||
| summary | text | true | |
|
||||
| body | text | true | |
|
||||
| board | text | true | |
|
||||
| board_id | integer | true | |
|
||||
| author | text | true | |
|
||||
| comments_count | integer | true | |
|
||||
| views | integer | true | |
|
||||
| created_at | timestamp | true | |
|
||||
| updated_at | timestamp | true | |
|
||||
|
||||
*`posts`*
|
||||
|
||||
## news
|
||||
|
||||
新闻主表。`board_id` 关联 `news_boards`;`board` 为板块显示名。
|
||||
|
||||
`news` =
|
||||
|
||||
| 字段 | 类型 | 可空 | 索引 |
|
||||
|------|------|------|------|
|
||||
| id | integer | false | |
|
||||
| title | text | false | |
|
||||
| slug | text | false | 是 |
|
||||
| summary | text | true | |
|
||||
| body | text | true | |
|
||||
| board | text | true | |
|
||||
| board_id | integer | true | |
|
||||
| created_at | timestamp | true | |
|
||||
| updated_at | timestamp | true | |
|
||||
|
||||
*`news`*
|
||||
|
||||
## boards
|
||||
|
||||
帖子板块。
|
||||
|
||||
`boards` =
|
||||
|
||||
| 字段 | 类型 | 可空 | 索引 |
|
||||
|------|------|------|------|
|
||||
| id | integer | false | |
|
||||
| name | text | false | |
|
||||
| slug | text | false | 是 |
|
||||
|
||||
*`boards`*
|
||||
|
||||
## news_boards
|
||||
|
||||
新闻板块。
|
||||
|
||||
`news_boards` =
|
||||
|
||||
| 字段 | 类型 | 可空 | 索引 |
|
||||
|------|------|------|------|
|
||||
| id | integer | false | |
|
||||
| name | text | false | |
|
||||
| slug | text | false | 是 |
|
||||
|
||||
*`news_boards`*
|
||||
|
||||
## notices
|
||||
|
||||
首页公告。
|
||||
|
||||
`notices` =
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| id | integer | false |
|
||||
| content | text | false |
|
||||
| created_at | timestamp | true |
|
||||
|
||||
*`notices`*
|
||||
|
||||
## comments
|
||||
|
||||
评论(按目标类型 + slug 挂接)。
|
||||
|
||||
`comments` =
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| id | integer | false |
|
||||
| target_type | text | false |
|
||||
| target_slug | text | false |
|
||||
| body | text | false |
|
||||
| author | text | true |
|
||||
| created_at | timestamp | true |
|
||||
|
||||
*`comments`*
|
||||
|
||||
## chat_rooms
|
||||
|
||||
公聊房间。
|
||||
|
||||
`chat_rooms` =
|
||||
|
||||
| 字段 | 类型 | 可空 | 索引 |
|
||||
|------|------|------|------|
|
||||
| id | integer | false | |
|
||||
| slug | text | false | 是 |
|
||||
| name | text | false | |
|
||||
| summary | text | true | |
|
||||
|
||||
*`chat_rooms`*
|
||||
|
||||
## topics
|
||||
|
||||
专题占位。
|
||||
|
||||
`topics` =
|
||||
|
||||
| 字段 | 类型 | 可空 | 索引 |
|
||||
|------|------|------|------|
|
||||
| id | integer | false | |
|
||||
| slug | text | false | 是 |
|
||||
| title | text | false | |
|
||||
| summary | text | true | |
|
||||
|
||||
*`topics`*
|
||||
|
||||
## api_keys
|
||||
|
||||
API Key 校验用哈希表(应用层 scopes)。
|
||||
|
||||
`api_keys` =
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| id | integer | false |
|
||||
| name | text | false |
|
||||
| hash | text | false |
|
||||
| scopes | text | true |
|
||||
|
||||
*`api_keys`*
|
||||
@@ -1,110 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
## boards
|
||||
|
||||
帖子板块:日常 / 开发 / 聊天。
|
||||
|
||||
`boards` =
|
||||
|
||||
| @ | name | slug |
|
||||
|---|------|------|
|
||||
| 1 | 日常 | daily |
|
||||
| 2 | 开发 | develop |
|
||||
| 3 | 聊天 | chat |
|
||||
|
||||
*`boards`*
|
||||
|
||||
## news_boards
|
||||
|
||||
新闻板块:站务 / 技术。
|
||||
|
||||
`news_boards` =
|
||||
|
||||
| @ | name | slug |
|
||||
|---|------|------|
|
||||
| 1 | 站务 | site |
|
||||
| 2 | 技术 | tech |
|
||||
|
||||
*`news_boards`*
|
||||
|
||||
## posts
|
||||
|
||||
种子帖子(标题/短链与原 anlian-mq 一致)。
|
||||
|
||||
`posts` =
|
||||
|
||||
| @ | title | slug | summary | body | board | board_id | author | comments_count | views |
|
||||
|---|-------|------|---------|------|-------|----------|--------|----------------|-------|
|
||||
| 1 | 欢迎来到暗恋见君 | welcome | 期待人们能够继续相信爱情。 | 这是用 Marqdo 重写的验收站点。页面、库表与门禁都用 GFM 表格装配——代码即文档。 | 日常 | 1 | 站务 | 2 | 42 |
|
||||
| 2 | 如何用表格写论坛 | tables-for-forums | 导航、表单、种子数据都是可读表格。 | 若某功能逼你写一长串 json.set,请先审视 ext/web 是否缺命名方法。 | 开发 | 2 | 站务 | 0 | 18 |
|
||||
| 3 | 公聊室已开放 | chat-open | WebSocket 广播房间。 | 打开 /chat,连上 /chat/ws,消息会扇出给同房间所有人。 | 聊天 | 3 | 站务 | 0 | 9 |
|
||||
|
||||
*`posts`*
|
||||
|
||||
## news
|
||||
|
||||
种子新闻。
|
||||
|
||||
`news` =
|
||||
|
||||
| @ | title | slug | summary | body | board | board_id |
|
||||
|---|-------|------|---------|------|-------|----------|
|
||||
| 1 | 站点迁往 Marqdo | migrate-to-marqdo | 原生层换 Go libweb,作者面保持表格。 | 暗恋见君的验收目标:登录、发帖、列表详情、聊天与站长工具都能用 .mq.md 写完。 | 站务 | 1 |
|
||||
| 2 | 外接 PostgreSQL / Redis | pg-redis | 生产可用外接驱动。 | 本示例默认 sqlite:;把数据库地址换成 postgres:// 即可。 | 技术 | 2 |
|
||||
|
||||
*`news`*
|
||||
|
||||
## notices
|
||||
|
||||
首页公告(2–3 条)。
|
||||
|
||||
`notices` =
|
||||
|
||||
| @ | content | created_at |
|
||||
|---|---------|------------|
|
||||
| 1 | 欢迎来到暗恋见君论坛。本站支持匿名与实名交流,请友善发言。 | 2026-09-01 10:00:00 |
|
||||
| 2 | 站点正用 Marqdo 表格重写验收:导航、首页四段、列表与公聊对齐原站 DOM。 | 2026-09-08 14:30:00 |
|
||||
| 3 | 发帖与评论请遵守社区规范;站务公告将在此置顶。 | 2026-09-10 09:00:00 |
|
||||
|
||||
*`notices`*
|
||||
|
||||
## comments
|
||||
|
||||
欢迎帖下的评论。
|
||||
|
||||
`comments` =
|
||||
|
||||
| @ | target_type | target_slug | body | author | created_at |
|
||||
|---|-------------|-------------|------|--------|------------|
|
||||
| 1 | post | welcome | 终于等到用表格写论坛的一天。 | 路人甲 | 2026-09-10 11:00:00 |
|
||||
| 2 | post | welcome | 期待人们能够继续相信爱情。 | 见君 | 2026-09-10 12:15:00 |
|
||||
|
||||
*`comments`*
|
||||
|
||||
## chat_rooms
|
||||
|
||||
公聊:大厅 + 闲聊。
|
||||
|
||||
`chat_rooms` =
|
||||
|
||||
| @ | slug | name | summary |
|
||||
|---|------|------|---------|
|
||||
| 1 | lobby | 大厅 | 全站公共聊天室。 |
|
||||
| 2 | casual | 闲聊 | 轻松闲聊,勿刷屏。 |
|
||||
|
||||
*`chat_rooms`*
|
||||
|
||||
## topics
|
||||
|
||||
专题占位条目。
|
||||
|
||||
`topics` =
|
||||
|
||||
| @ | slug | title | summary |
|
||||
|---|------|-------|---------|
|
||||
| 1 | glass-ui | 粉玻璃界面 | 首页与列表的毛玻璃视觉专题(占位)。 |
|
||||
| 2 | tables-as-code | 表格即代码 | Marqdo GFM 表装配专题(占位)。 |
|
||||
|
||||
*`topics`*
|
||||
@@ -1,212 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: 暗恋见君 · Marqdo
|
||||
description: 对齐 Django 暗恋见君:原站 CSS/DOM、首页四段、列表详情、发帖门禁、聊天室、专题、搜索、API 指南。
|
||||
导入:
|
||||
网页: ext/web/网页.mq.md
|
||||
table: lib/table.mq.md
|
||||
text: lib/text.mq.md
|
||||
chrome: components/chrome.mq.md
|
||||
page: components/page.mq.md
|
||||
home: components/home_body.mq.md
|
||||
feed: components/feed.mq.md
|
||||
fragments: components/fragments.mq.md
|
||||
db: db/index.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
路径对齐原站:`/post`、`/news`、`/post/public`、`/chat`、`/topics`、`/search`、`/accounts/login`。
|
||||
|
||||
`用户表` =
|
||||
|
||||
| 行 | 用户名 | 密码 | 角色 |
|
||||
|----|--------|------|------|
|
||||
| 1 | admin | anlian | admin |
|
||||
|
||||
`发帖字段` =
|
||||
|
||||
| 字段 | 标签 | 类型 | 必填 |
|
||||
|------|------|------|------|
|
||||
| title | 标题 | text | true |
|
||||
| slug | 短链 | text | true |
|
||||
| summary | 摘要 | text | false |
|
||||
| body | 正文 | textarea | true |
|
||||
| board | 板块 | text | false |
|
||||
| board_id | 板块ID | number | false |
|
||||
| author | 署名 | text | false |
|
||||
|
||||
`发帖规则` =
|
||||
|
||||
| 字段 | 规则 | 消息 |
|
||||
|------|------|------|
|
||||
| title | required | 标题不能为空 |
|
||||
| slug | required | 需要短链 |
|
||||
| body | required | 正文不能为空 |
|
||||
|
||||
`帖子详情` =
|
||||
|
||||
| 属性 | 值 | 样式 |
|
||||
|------|-----|------|
|
||||
| title | posts.title | |
|
||||
| meta | posts.author | |
|
||||
| body | posts.body | |
|
||||
|
||||
`新闻详情` =
|
||||
|
||||
| 属性 | 值 | 样式 |
|
||||
|------|-----|------|
|
||||
| title | news.title | |
|
||||
| body | news.body | |
|
||||
|
||||
`帖子条件` =
|
||||
|
||||
| 字段 | 操作 | 值 |
|
||||
|------|------|-----|
|
||||
| slug | = | {slug} |
|
||||
|
||||
`新闻条件` =
|
||||
|
||||
| 字段 | 操作 | 值 |
|
||||
|------|------|-----|
|
||||
| slug | = | {slug} |
|
||||
|
||||
`地图项` =
|
||||
|
||||
| loc | 更新 |
|
||||
|-----|------|
|
||||
| / | 2026-09-10 |
|
||||
| /post | 2026-09-10 |
|
||||
| /news | 2026-09-10 |
|
||||
| /chat | 2026-09-10 |
|
||||
| /topics | 2026-09-10 |
|
||||
| /search | 2026-09-10 |
|
||||
| /guide/automation-api | 2026-09-10 |
|
||||
|
||||
`图标` =
|
||||
|
||||
| 路径 | 关系 | 类型 | 尺寸 | 地址 |
|
||||
|------|------|------|------|------|
|
||||
| "public/img/favicon-32.png" | icon | "image/png" | 32x32 | "/favicon.ico" |
|
||||
|
||||
**store = > db.打开**
|
||||
**头 = > chrome.头资源**
|
||||
**顶 = > chrome.导航HTML**
|
||||
**底 = > chrome.页脚HTML**
|
||||
**鉴权补丁 = "<style>.nav-when-auth{display:none}</style><script>(function(){var c=document.cookie.indexOf('marqdo_sid=')>=0;document.querySelectorAll('.nav-when-guest').forEach(function(el){el.style.display=c?'none':'';});document.querySelectorAll('.nav-when-auth').forEach(function(el){el.style.display=c?'':'none';});})();</script>"**
|
||||
|
||||
**主页体 = > home.装配 库=`store`**
|
||||
**主页文 = > page.包装 正文=`主页体` 体类="page-home"**
|
||||
**首页 = > 网页.页面 标题="暗恋见君论坛" 引言=`主页文` 壳样式="off" 布局="bare"**
|
||||
**首页 = > 首页.头装配 表=`头`**
|
||||
|
||||
**板块行 = > store.查询 表="boards" 上限=50**
|
||||
**帖子行 = > store.查询 表="posts" 上限=50 排序="-created_at"**
|
||||
**帖子栏 = > feed.板块栏HTML 板块=板块行 前缀="/post" 查询键="board_id" 全部类="feed-tab"**
|
||||
**帖子表 = > feed.帖子列表HTML 行=帖子行**
|
||||
**帖子列表体 = "<section class=\"feed-list-page\"><div class=\"section-wrap\"><h1 class=\"feed-list-title\">论坛交流</h1>" + 帖子栏 + 帖子表 + "<p style=\"margin-top:1rem\"><a href=\"/post/public\">发布帖子</a></p></div></section>"**
|
||||
**帖子列表文 = > page.包装 正文=`帖子列表体` 体类="page-post-list"**
|
||||
**帖子列表 = > 网页.页面 标题="帖子 · 暗恋见君" 引言=`帖子列表文` 壳样式="off" 布局="bare"**
|
||||
**帖子列表 = > 帖子列表.头装配 表=`头`**
|
||||
|
||||
**新闻板块行 = > store.查询 表="news_boards" 上限=50**
|
||||
**新闻行 = > store.查询 表="news" 上限=50 排序="-created_at"**
|
||||
**新闻栏 = > feed.板块栏HTML 板块=新闻板块行 前缀="/news" 查询键="news_board_id" 全部类="feed-tab"**
|
||||
**新闻表 = > feed.新闻时间线HTML 行=新闻行**
|
||||
**新闻列表体 = "<section class=\"feed-list-page home-news\"><div class=\"section-wrap\"><h1 class=\"feed-list-title\">新闻动态</h1>" + 新闻栏 + 新闻表 + "</div></section>"**
|
||||
**新闻列表文 = > page.包装 正文=`新闻列表体` 体类="page-news-list"**
|
||||
**新闻列表 = > 网页.页面 标题="新闻 · 暗恋见君" 引言=`新闻列表文` 壳样式="off" 布局="bare"**
|
||||
**新闻列表 = > 新闻列表.头装配 表=`头`**
|
||||
|
||||
**帖子页 = > 网页.页面 标题="帖子详情" 引言=`鉴权补丁` 壳样式="off" 布局="stacked"**
|
||||
**帖子页 = > 帖子页.头装配 表=`头`**
|
||||
**帖子页 = > 帖子页.壳HTML 导航=`顶` 页脚=`底` 体类="page-post-detail"**
|
||||
**帖子页 = > 帖子页.主体装配 主体=`帖子详情`**
|
||||
**帖子页 = > 帖子页.查询条件 条件=`帖子条件`**
|
||||
**帖子页 = > 帖子页.详情 详情=True**
|
||||
|
||||
**新闻页 = > 网页.页面 标题="新闻详情" 引言=`鉴权补丁` 壳样式="off" 布局="stacked"**
|
||||
**新闻页 = > 新闻页.头装配 表=`头`**
|
||||
**新闻页 = > 新闻页.壳HTML 导航=`顶` 页脚=`底` 体类="page-news-detail"**
|
||||
**新闻页 = > 新闻页.主体装配 主体=`新闻详情`**
|
||||
**新闻页 = > 新闻页.查询条件 条件=`新闻条件`**
|
||||
**新闻页 = > 新闻页.详情 详情=True**
|
||||
|
||||
**发帖表 = > 网页.表单 表="posts" 动作="插入"**
|
||||
**发帖表 = > 发帖表.字段 字段=`发帖字段`**
|
||||
**发帖表 = > 发帖表.规则 规则=`发帖规则`**
|
||||
**发帖引言 = > page.包装 正文="<section class=\"feed-list-page\"><div class=\"section-wrap\"><h1>发布帖子</h1><p>需登录(admin / anlian)</p></div></section>" 体类="page-post-public"**
|
||||
**发帖页 = > 网页.页面 标题="发帖 · 暗恋见君" 引言=`发帖引言` 壳样式="off" 布局="bare"**
|
||||
**发帖页 = > 发帖页.头装配 表=`头`**
|
||||
**发帖页 = > 发帖页.表单装配 id="post" 表单=`发帖表`**
|
||||
|
||||
**房间行 = > store.查询 表="chat_rooms" 上限=50**
|
||||
**房间段 = None**
|
||||
- [房](遍历 房间行 为 房)
|
||||
**名 = [name](access(房, "name"))**
|
||||
**链 = [slug](access(房, "slug"))**
|
||||
**摘 = [summary](access(房, "summary"))**
|
||||
**项 = "<article class=\"chat-room-card\"><h3><a href=\"/chat/" + 链 + "\">" + 名 + "</a></h3><p>" + 摘 + "</p></article>"**
|
||||
**房间段 = > table.append list=房间段 item=项**
|
||||
**房间内 = > text.str_join xs=房间段 sep=""**
|
||||
**聊天列表体 = "<section class=\"feed-list-page\"><div class=\"section-wrap\"><h1>聊天室</h1><div class=\"chat-room-grid\">" + 房间内 + "</div></div></section>"**
|
||||
**聊天列表文 = > page.包装 正文=`聊天列表体` 体类="page-chat"**
|
||||
**聊天列表 = > 网页.页面 标题="聊天 · 暗恋见君" 引言=`聊天列表文` 壳样式="off" 布局="bare"**
|
||||
**聊天列表 = > 聊天列表.头装配 表=`头`**
|
||||
|
||||
**大厅体 = "<section class=\"feed-list-page\"><div class=\"section-wrap\"><h1>大厅</h1><div class=\"chat-box\"><div id=\"chat-log\" class=\"chat-log\"></div><p class=\"search-bar\"><input id=\"chat-msg\" placeholder=\"说点什么…\" aria-label=\"消息\"><button id=\"chat-send\" type=\"button\">发送</button></p></div><script src=\"/static/chat.js\"></script></div></section>"**
|
||||
**大厅文 = > page.包装 正文=`大厅体` 体类="page-chat-room"**
|
||||
**大厅页 = > 网页.页面 标题="大厅 · 暗恋见君" 引言=`大厅文` 壳样式="off" 布局="bare"**
|
||||
**大厅页 = > 大厅页.头装配 表=`头`**
|
||||
|
||||
**闲聊体 = "<section class=\"feed-list-page\"><div class=\"section-wrap\"><h1>闲聊</h1><div class=\"chat-box\"><div id=\"chat-log\" class=\"chat-log\"></div><p class=\"search-bar\"><input id=\"chat-msg\" placeholder=\"说点什么…\" aria-label=\"消息\"><button id=\"chat-send\" type=\"button\">发送</button></p></div><script src=\"/static/chat.js\"></script></div></section>"**
|
||||
**闲聊文 = > page.包装 正文=`闲聊体` 体类="page-chat-room"**
|
||||
**闲聊页 = > 网页.页面 标题="闲聊 · 暗恋见君" 引言=`闲聊文` 壳样式="off" 布局="bare"**
|
||||
**闲聊页 = > 闲聊页.头装配 表=`头`**
|
||||
|
||||
**专题行 = > store.查询 表="topics" 上限=50**
|
||||
**专题段 = None**
|
||||
- [题](遍历 专题行 为 题)
|
||||
**题名 = [title](access(题, "title"))**
|
||||
**链 = [slug](access(题, "slug"))**
|
||||
**摘 = [summary](access(题, "summary"))**
|
||||
**项 = "<article class=\"topic-card\"><h3>" + 题名 + "</h3><p>" + 摘 + "</p><p class=\"text-muted\">slug: " + 链 + "</p></article>"**
|
||||
**专题段 = > table.append list=专题段 item=项**
|
||||
**专题内 = > text.str_join xs=专题段 sep=""**
|
||||
**专题体 = "<section class=\"feed-list-page\"><div class=\"section-wrap\"><h1>专题书架</h1><div class=\"topic-shelf\">" + 专题内 + "</div></div></section>"**
|
||||
**专题文 = > page.包装 正文=`专题体` 体类="page-topics"**
|
||||
**专题页 = > 网页.页面 标题="专题 · 暗恋见君" 引言=`专题文` 壳样式="off" 布局="bare"**
|
||||
**专题页 = > 专题页.头装配 表=`头`**
|
||||
|
||||
**搜索体 = "<section class=\"feed-list-page\"><div class=\"section-wrap\"><h1>搜索</h1><form class=\"search-bar\" method=\"get\" action=\"/search\"><input name=\"q\" placeholder=\"关键词\" aria-label=\"关键词\"><button type=\"submit\">搜</button></form><p class=\"text-muted\">全文检索走 SQLite FTS(posts_fts);结果面板后续可按 q 扩展。</p></div></section>"**
|
||||
**搜索文 = > page.包装 正文=`搜索体` 体类="page-search"**
|
||||
**搜索页 = > 网页.页面 标题="搜索 · 暗恋见君" 引言=`搜索文` 壳样式="off" 布局="bare"**
|
||||
**搜索页 = > 搜索页.头装配 表=`头`**
|
||||
|
||||
**指南体 = "<section class=\"feed-list-page\"><div class=\"section-wrap\"><h1>API 自动化指南</h1><p>使用 Bearer / X-Api-Key 调用自动化接口。本验收切片提供 <code>api_keys</code> 表与 <code>web_api_key_check</code> 原语;业务 scopes 写在 .mq.md。</p><pre>Authorization: Bearer <token></pre></div></section>"**
|
||||
**指南文 = > page.包装 正文=`指南体` 体类="page-guide"**
|
||||
**指南页 = > 网页.页面 标题="API 指南 · 暗恋见君" 引言=`指南文` 壳样式="off" 布局="bare"**
|
||||
**指南页 = > 指南页.头装配 表=`头`**
|
||||
|
||||
**应用 = > 网页.应用 页面=`首页` 数据库=`store` 后台=True 主机="127.0.0.1" 端口=18180**
|
||||
**应用 = > 应用.路由 路径="/post" 页面=`帖子列表`**
|
||||
**应用 = > 应用.路由 路径="/post/public" 页面=`发帖页`**
|
||||
**应用 = > 应用.路由 路径="/post/{slug}" 页面=`帖子页`**
|
||||
**应用 = > 应用.路由 路径="/news" 页面=`新闻列表`**
|
||||
**应用 = > 应用.路由 路径="/news/{slug}" 页面=`新闻页`**
|
||||
**应用 = > 应用.路由 路径="/chat" 页面=`聊天列表`**
|
||||
**应用 = > 应用.路由 路径="/chat/lobby" 页面=`大厅页`**
|
||||
**应用 = > 应用.路由 路径="/chat/casual" 页面=`闲聊页`**
|
||||
**应用 = > 应用.路由 路径="/topics" 页面=`专题页`**
|
||||
**应用 = > 应用.路由 路径="/search" 页面=`搜索页`**
|
||||
**应用 = > 应用.路由 路径="/guide/automation-api" 页面=`指南页`**
|
||||
**应用 = > 应用.静态 目录="public" 挂载="/static"**
|
||||
**应用 = > 应用.图标 表=`图标`**
|
||||
**应用 = > 应用.鉴权 用户表=`用户表` 会话时长=7200 登录路径="/accounts/login" 登录回跳="/post/public" 登出回跳="/"**
|
||||
**应用 = > 应用.门禁 路径="/post/public" 角色="admin" 匹配="prefix" 拒绝="redirect" 排除="/accounts/login"**
|
||||
**应用 = > 应用.路由实时 路径="/chat/ws" 模式="broadcast"**
|
||||
**应用 = > 应用.调用 路径="/post/ten" 方法="GET" 函数="fragments.帖子十" 正文="query" 返回="html"**
|
||||
**应用 = > 应用.调用 路径="/news/five" 方法="GET" 函数="fragments.新闻五" 正文="query" 返回="html"**
|
||||
**应用 = > 应用.站点地图 路径="/sitemap.xml" 基址="http://127.0.0.1:18180" 条目=`地图项`**
|
||||
**应用 = > 应用.爬虫协议 站点地图="http://127.0.0.1:18180/sitemap.xml"**
|
||||
> `应用`.监听
|
||||
@@ -1,74 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: anlian-mq offline smoke
|
||||
description: 不 listen:装配库表/页面/门禁/WS 路由袋,验证可读路径可构造。
|
||||
导入:
|
||||
网页: ext/web/网页.mq.md
|
||||
shell: styles/shell.mq.md
|
||||
nav: components/nav.mq.md
|
||||
foot: components/foot.mq.md
|
||||
db: db/index.mq.md
|
||||
sys: lib/sys.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
`壳` =
|
||||
|
||||
| 组件 | 样式 |
|
||||
|------|------|
|
||||
| nav.`导航` | |
|
||||
| foot.`页脚` | |
|
||||
|
||||
`帖子卡片` =
|
||||
|
||||
| 属性 | 值 |
|
||||
|------|-----|
|
||||
| title | posts.title |
|
||||
| body | posts.summary |
|
||||
| href | posts.slug |
|
||||
|
||||
`用户表` =
|
||||
|
||||
| 行 | 用户名 | 密码 | 角色 |
|
||||
|----|--------|------|------|
|
||||
| 1 | admin | anlian | admin |
|
||||
|
||||
**store = > db.打开**
|
||||
**壳CSS = > shell.全局**
|
||||
**首页 = > 网页.页面 标题="暗恋见君" 引言="<h1>ok</h1>"**
|
||||
**首页 = > 首页.组件装配 组件=`壳`**
|
||||
**首页 = > 首页.主体装配 主体=`帖子卡片`**
|
||||
**首页 = > 首页.样式 样式=`壳CSS`**
|
||||
|
||||
**应用 = > 网页.应用 页面=`首页` 数据库=`store` 后台=True 主机="127.0.0.1" 端口=18180**
|
||||
**应用 = > 应用.鉴权 用户表=`用户表`**
|
||||
**应用 = > 应用.门禁 路径="/write" 角色="admin" 匹配="prefix" 拒绝="redirect"**
|
||||
**应用 = > 应用.路由实时 路径="/chat/ws" 模式="broadcast"**
|
||||
|
||||
**gates = [gates](access(应用, "gates"))**
|
||||
**n = > len value=`gates`**
|
||||
1. `n` >= 2
|
||||
> print text=gates-ok
|
||||
2. *
|
||||
> print text=gates-fail
|
||||
> sys.exit code=1
|
||||
|
||||
**ws = [ws_routes](access(应用, "ws_routes"))**
|
||||
**room = [/chat/ws](access(ws, "/chat/ws"))**
|
||||
**mode = [mode](access(room, "mode"))**
|
||||
1. `mode` == "broadcast"
|
||||
> print text=ws-ok
|
||||
2. *
|
||||
> print text=ws-fail
|
||||
> sys.exit code=1
|
||||
|
||||
**list = > store.查询 表="posts" 上限=10**
|
||||
**nr = > len value=`list`**
|
||||
1. `nr` >= 1
|
||||
> print text=seed-ok
|
||||
2. *
|
||||
> print text=seed-fail
|
||||
> sys.exit code=1
|
||||
|
||||
> print text=anlian-offline-ok
|
||||
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 45 KiB |
@@ -1,37 +0,0 @@
|
||||
/* 公聊客户端:保持极薄;业务配置仍在 .mq.md 表格里。 */
|
||||
(function () {
|
||||
var log = document.getElementById("chat-log");
|
||||
var input = document.getElementById("chat-msg");
|
||||
var send = document.getElementById("chat-send");
|
||||
if (!log || !input || !send) return;
|
||||
|
||||
var proto = location.protocol === "https:" ? "wss:" : "ws:";
|
||||
var ws = new WebSocket(proto + "//" + location.host + "/chat/ws");
|
||||
|
||||
function line(text) {
|
||||
log.textContent += text + "\n";
|
||||
log.scrollTop = log.scrollHeight;
|
||||
}
|
||||
|
||||
ws.onopen = function () {
|
||||
line("[已连接公聊室]");
|
||||
};
|
||||
ws.onclose = function () {
|
||||
line("[连接关闭]");
|
||||
};
|
||||
ws.onmessage = function (ev) {
|
||||
line(String(ev.data));
|
||||
};
|
||||
|
||||
function publish() {
|
||||
var t = (input.value || "").trim();
|
||||
if (!t || ws.readyState !== 1) return;
|
||||
ws.send(t);
|
||||
input.value = "";
|
||||
}
|
||||
|
||||
send.addEventListener("click", publish);
|
||||
input.addEventListener("keydown", function (e) {
|
||||
if (e.key === "Enter") publish();
|
||||
});
|
||||
})();
|
||||
@@ -1,454 +0,0 @@
|
||||
/**
|
||||
* 暗恋见君 — 登录/注册/发帖/评论 共用表单样式(粉色毛玻璃主题)
|
||||
*/
|
||||
|
||||
:root {
|
||||
--anlian-accent: #fdbbdb;
|
||||
--anlian-accent-deep: #f0a8c4;
|
||||
--anlian-accent-text: #a85878;
|
||||
--anlian-accent-muted: #c97a96;
|
||||
--anlian-glass-bg: rgba(255, 255, 255, 0.38);
|
||||
--anlian-glass-border: rgba(255, 255, 255, 0.52);
|
||||
--anlian-text: #222;
|
||||
--anlian-text-muted: #666;
|
||||
--anlian-radius: 14px;
|
||||
--anlian-radius-pill: 999px;
|
||||
--anlian-transition: 0.2s ease;
|
||||
}
|
||||
|
||||
/* ---------- 页面布局 ---------- */
|
||||
.anlian-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
max-width: 520px;
|
||||
margin: 0 auto;
|
||||
padding: 1.5rem 1rem 2.5rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.anlian-page-wide {
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.anlian-page-title {
|
||||
margin: 0 0 1.25rem;
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
color: var(--anlian-text);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.anlian-page-lead {
|
||||
margin: -0.5rem 0 1.25rem;
|
||||
font-size: 0.9rem;
|
||||
color: var(--anlian-text-muted);
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* ---------- 表单卡片 ---------- */
|
||||
.anlian-form-card {
|
||||
width: 100%;
|
||||
padding: 2rem 1.75rem;
|
||||
border-radius: 24px;
|
||||
background: var(--anlian-glass-bg);
|
||||
backdrop-filter: blur(18px);
|
||||
-webkit-backdrop-filter: blur(18px);
|
||||
border: 1px solid var(--anlian-glass-border);
|
||||
box-shadow: 0 12px 40px rgba(253, 189, 219, 0.15);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.anlian-form-card .form-group,
|
||||
.anlian-form-card .anlian-field {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.anlian-form-card .anlian-field:last-child,
|
||||
.anlian-form-card .form-group:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* ---------- 标签与输入框 ---------- */
|
||||
.anlian-field-label,
|
||||
.anlian-form-card label:not(.anlian-pill-label):not(.anlian-switch) {
|
||||
display: block;
|
||||
margin-bottom: 0.45rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--anlian-accent-text);
|
||||
}
|
||||
|
||||
.anlian-form-card input[type="text"],
|
||||
.anlian-form-card input[type="email"],
|
||||
.anlian-form-card input[type="password"],
|
||||
.anlian-form-card input[type="search"],
|
||||
.anlian-form-card input[type="number"],
|
||||
.anlian-form-card input.anlian-input,
|
||||
.anlian-form-card .form-control,
|
||||
.anlian-form-card textarea,
|
||||
.anlian-form-card select {
|
||||
display: block;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0.7rem 0.95rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.4;
|
||||
color: var(--anlian-text);
|
||||
background: rgba(255, 255, 255, 0.55);
|
||||
border: 1px solid rgba(253, 189, 219, 0.35);
|
||||
border-radius: 12px;
|
||||
transition: border-color var(--anlian-transition), box-shadow var(--anlian-transition),
|
||||
background var(--anlian-transition);
|
||||
}
|
||||
|
||||
.anlian-form-card input::placeholder,
|
||||
.anlian-form-card textarea::placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.anlian-form-card input:focus,
|
||||
.anlian-form-card textarea:focus,
|
||||
.anlian-form-card select:focus {
|
||||
outline: none;
|
||||
border-color: var(--anlian-accent-deep);
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
box-shadow: 0 0 0 3px rgba(253, 189, 219, 0.28);
|
||||
}
|
||||
|
||||
.anlian-form-card select {
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a85878' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 0.95rem center;
|
||||
padding-right: 2.25rem;
|
||||
}
|
||||
|
||||
.anlian-form-card textarea {
|
||||
min-height: 100px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
/* ---------- 记住我(自定义勾选,替代原生 checkbox) ---------- */
|
||||
.anlian-field-remember {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.anlian-switch {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.65rem;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.anlian-switch-input {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.anlian-switch-box {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
width: 1.35rem;
|
||||
height: 1.35rem;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border: 1px solid rgba(253, 189, 219, 0.5);
|
||||
box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4);
|
||||
transition: background var(--anlian-transition), border-color var(--anlian-transition),
|
||||
box-shadow var(--anlian-transition);
|
||||
}
|
||||
|
||||
.anlian-switch-box::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 45%;
|
||||
width: 0.3rem;
|
||||
height: 0.55rem;
|
||||
margin-left: -0.2rem;
|
||||
margin-top: -0.38rem;
|
||||
border: solid #fff;
|
||||
border-width: 0 2px 2px 0;
|
||||
transform: rotate(45deg) scale(0);
|
||||
opacity: 0;
|
||||
transition: transform 0.15s ease, opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.anlian-switch-input:checked + .anlian-switch-box {
|
||||
background: linear-gradient(135deg, rgba(253, 189, 219, 0.85), rgba(240, 168, 196, 0.9));
|
||||
border-color: rgba(240, 168, 196, 0.85);
|
||||
box-shadow: 0 2px 8px rgba(253, 189, 219, 0.35);
|
||||
}
|
||||
|
||||
.anlian-switch-input:checked + .anlian-switch-box::after {
|
||||
transform: rotate(45deg) scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.anlian-switch-input:focus-visible + .anlian-switch-box {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px rgba(253, 189, 219, 0.35);
|
||||
}
|
||||
|
||||
.anlian-switch-text {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--anlian-accent-text);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.anlian-switch:hover .anlian-switch-box {
|
||||
border-color: var(--anlian-accent-deep);
|
||||
background: rgba(255, 255, 255, 0.62);
|
||||
}
|
||||
|
||||
.anlian-switch:hover .anlian-switch-input:checked + .anlian-switch-box {
|
||||
background: linear-gradient(135deg, rgba(253, 189, 219, 0.95), rgba(240, 168, 196, 0.95));
|
||||
}
|
||||
|
||||
/* ---------- 匿名:分段切换 ---------- */
|
||||
.anlian-field-anon {
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
.anlian-pill-toggle {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.anlian-pill-input {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.anlian-pill-label {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
align-items: center;
|
||||
min-height: 2.5rem;
|
||||
padding: 4px;
|
||||
border-radius: var(--anlian-radius-pill);
|
||||
background: rgba(255, 255, 255, 0.32);
|
||||
border: 1px solid rgba(253, 189, 219, 0.45);
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.anlian-pill-thumb {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 4px;
|
||||
width: calc(50% - 4px);
|
||||
height: calc(100% - 8px);
|
||||
border-radius: var(--anlian-radius-pill);
|
||||
background: linear-gradient(135deg, rgba(253, 189, 219, 0.65), rgba(240, 168, 196, 0.75));
|
||||
box-shadow: 0 2px 10px rgba(253, 189, 219, 0.25);
|
||||
transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.anlian-pill-input:checked + .anlian-pill-label .anlian-pill-thumb {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
|
||||
.anlian-pill-option {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
text-align: center;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
color: var(--anlian-text-muted);
|
||||
padding: 0.35rem 0.5rem;
|
||||
transition: color var(--anlian-transition);
|
||||
}
|
||||
|
||||
.anlian-pill-input:not(:checked) + .anlian-pill-label .anlian-pill-option:first-child,
|
||||
.anlian-pill-input:checked + .anlian-pill-label .anlian-pill-option:last-child {
|
||||
color: var(--anlian-accent-text);
|
||||
}
|
||||
|
||||
.anlian-field-hint {
|
||||
margin: 0.4rem 0 0;
|
||||
font-size: 0.75rem;
|
||||
color: var(--anlian-text-muted);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* ---------- 验证码行 ---------- */
|
||||
.anlian-code-row {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.anlian-code-row input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.anlian-btn-send-code {
|
||||
flex-shrink: 0;
|
||||
align-self: stretch;
|
||||
padding: 0 1rem;
|
||||
border: 1px solid rgba(253, 189, 219, 0.5);
|
||||
border-radius: 12px;
|
||||
background: rgba(253, 189, 219, 0.32);
|
||||
color: var(--anlian-accent-text);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
transition: background var(--anlian-transition), transform var(--anlian-transition);
|
||||
}
|
||||
|
||||
.anlian-btn-send-code:hover:not(:disabled) {
|
||||
background: rgba(253, 189, 219, 0.48);
|
||||
}
|
||||
|
||||
.anlian-btn-send-code:disabled {
|
||||
opacity: 0.55;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* ---------- 主按钮 ---------- */
|
||||
.anlian-btn-primary,
|
||||
.anlian-form-card .anlian-btn-submit,
|
||||
.anlian-form-card #login-btn,
|
||||
.anlian-form-card #submit-btn,
|
||||
.anlian-form-card #submit-comment-btn {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 1.25rem;
|
||||
padding: 0.75rem 1.25rem;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--anlian-accent-text);
|
||||
background: linear-gradient(135deg, rgba(253, 189, 219, 0.55), rgba(240, 168, 196, 0.65));
|
||||
border: 1px solid rgba(240, 168, 196, 0.75);
|
||||
border-radius: var(--anlian-radius-pill);
|
||||
cursor: pointer;
|
||||
transition: transform var(--anlian-transition), box-shadow var(--anlian-transition),
|
||||
background var(--anlian-transition);
|
||||
box-shadow: 0 4px 16px rgba(253, 189, 219, 0.22);
|
||||
}
|
||||
|
||||
.anlian-btn-primary:hover,
|
||||
.anlian-form-card .anlian-btn-submit:hover,
|
||||
.anlian-form-card #login-btn:hover,
|
||||
.anlian-form-card #submit-btn:hover,
|
||||
.anlian-form-card #submit-comment-btn:hover {
|
||||
background: linear-gradient(135deg, rgba(253, 189, 219, 0.68), rgba(240, 168, 196, 0.78));
|
||||
box-shadow: 0 6px 22px rgba(253, 189, 219, 0.32);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* ---------- 提示与链接 ---------- */
|
||||
.anlian-alert {
|
||||
padding: 0.85rem 1rem;
|
||||
margin-bottom: 1rem;
|
||||
border-radius: 12px;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.anlian-alert-danger {
|
||||
background: rgba(220, 80, 100, 0.12);
|
||||
border: 1px solid rgba(220, 80, 100, 0.28);
|
||||
color: #9e3a4a;
|
||||
}
|
||||
|
||||
.anlian-alert p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.anlian-field-error {
|
||||
display: block;
|
||||
margin-top: 0.35rem;
|
||||
font-size: 0.8125rem;
|
||||
color: #b33a4d;
|
||||
}
|
||||
|
||||
.anlian-form-links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 1rem;
|
||||
margin-top: 1.25rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.anlian-form-links a {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--anlian-accent-text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.anlian-form-links a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* ---------- 富文本编辑器 ---------- */
|
||||
.anlian-editor-wrap {
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
border: 1px solid rgba(253, 189, 219, 0.35);
|
||||
background: rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
|
||||
.anlian-editor-wrap #editor {
|
||||
min-height: 360px;
|
||||
}
|
||||
|
||||
.anlian-editor-wrap .w-e-toolbar {
|
||||
background: rgba(255, 255, 255, 0.65) !important;
|
||||
border-bottom: 1px solid rgba(253, 189, 219, 0.3) !important;
|
||||
}
|
||||
|
||||
.anlian-editor-wrap .w-e-text-container {
|
||||
background: rgba(255, 255, 255, 0.35) !important;
|
||||
}
|
||||
|
||||
/* ---------- 评论表单区块 ---------- */
|
||||
.anlian-comment-form.anlian-form-card {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.anlian-form-card {
|
||||
padding: 1.35rem 1.15rem;
|
||||
border-radius: 18px;
|
||||
}
|
||||
|
||||
.anlian-page-title {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.anlian-code-row {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.anlian-btn-send-code {
|
||||
width: 100%;
|
||||
padding: 0.65rem;
|
||||
}
|
||||
}
|
||||
@@ -1,199 +0,0 @@
|
||||
/* API 自动化指南页 */
|
||||
.api-guide-page {
|
||||
max-width: 52rem;
|
||||
align-items: stretch;
|
||||
text-align: left;
|
||||
padding-bottom: 3rem;
|
||||
}
|
||||
|
||||
.api-guide-hero {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.api-guide-hero .api-guide-title {
|
||||
margin-top: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.api-guide-hero .anlian-page-lead {
|
||||
margin-bottom: 0;
|
||||
text-align: left;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.api-guide-toc {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.api-guide-toc-title {
|
||||
margin: 0 0 0.65rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 700;
|
||||
color: var(--anlian-text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.api-guide-toc ol {
|
||||
margin: 0;
|
||||
padding-left: 1.25rem;
|
||||
line-height: 1.85;
|
||||
}
|
||||
|
||||
.api-guide-toc a {
|
||||
color: var(--anlian-accent-text);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.api-guide-toc a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.api-guide-section {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.api-guide-section h2 {
|
||||
margin: 0 0 0.85rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: var(--anlian-text);
|
||||
border-bottom: 1px solid rgba(253, 189, 219, 0.45);
|
||||
padding-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
.api-guide-section h3 {
|
||||
margin: 1.1rem 0 0.5rem;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--anlian-text);
|
||||
}
|
||||
|
||||
.api-guide-section p,
|
||||
.api-guide-section li {
|
||||
font-size: 0.9375rem;
|
||||
line-height: 1.65;
|
||||
color: var(--anlian-text);
|
||||
}
|
||||
|
||||
.api-guide-steps {
|
||||
margin: 0 0 1rem;
|
||||
padding-left: 1.35rem;
|
||||
}
|
||||
|
||||
.api-guide-steps li {
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
.api-guide-list {
|
||||
margin: 0;
|
||||
padding-left: 1.25rem;
|
||||
}
|
||||
|
||||
.api-guide-list li {
|
||||
margin-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
.api-guide-note {
|
||||
margin: 0.75rem 0 0;
|
||||
padding: 0.65rem 0.85rem;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--anlian-text-muted);
|
||||
background: rgba(255, 255, 255, 0.35);
|
||||
border-radius: 10px;
|
||||
border-left: 3px solid var(--anlian-accent);
|
||||
}
|
||||
|
||||
.api-guide-warn {
|
||||
margin: 0.75rem 0 0;
|
||||
font-size: 0.875rem;
|
||||
color: #a85858;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.api-guide-code {
|
||||
margin: 0.5rem 0 1rem;
|
||||
padding: 0.85rem 1rem;
|
||||
overflow-x: auto;
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.55;
|
||||
background: rgba(30, 30, 40, 0.06);
|
||||
border: 1px solid rgba(0, 0, 0, 0.06);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.api-guide-code code {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
color: #333;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.api-guide-table {
|
||||
width: 100%;
|
||||
margin: 0.75rem 0 1rem;
|
||||
border-collapse: collapse;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.api-guide-table th,
|
||||
.api-guide-table td {
|
||||
padding: 0.5rem 0.65rem;
|
||||
border: 1px solid rgba(0, 0, 0, 0.08);
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.api-guide-table th {
|
||||
background: rgba(253, 189, 219, 0.2);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.api-guide-table code {
|
||||
font-size: 0.75rem;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.api-guide-section a:not(.api-guide-btn) {
|
||||
color: var(--anlian-accent-text);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.api-guide-btn {
|
||||
display: inline-block;
|
||||
margin-top: 0.75rem;
|
||||
padding: 0.45rem 1rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: #fff !important;
|
||||
text-decoration: none !important;
|
||||
background: var(--anlian-accent-text);
|
||||
border-radius: var(--anlian-radius-pill);
|
||||
}
|
||||
|
||||
.api-guide-btn:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.api-guide-back {
|
||||
margin: 0.5rem 0 0;
|
||||
text-align: center;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.api-guide-back a {
|
||||
color: var(--anlian-text-muted);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.api-guide-back a:hover {
|
||||
color: var(--anlian-accent-text);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.api-guide-table {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
}
|
||||
}
|
||||
@@ -1,393 +0,0 @@
|
||||
/*
|
||||
* @File: base.css
|
||||
* @Description: 网站全局基础样式文件,本次更新重点优化了导航栏的布局和美观度。
|
||||
* @Author: Your Name
|
||||
* @Date: 2023-10-27
|
||||
* @Update: 2023-10-28 - 优化导航栏颜色方案,并为Logo添加动画效果;新增左右留白容器的响应式样式;修复导航栏与主内容容器重叠问题。
|
||||
*/
|
||||
|
||||
/* --- 1. 全局盒模型与颜色变量设置 --- */
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
:root {
|
||||
--custom-primary: #ffffff; /* 主色调:柔和的蓝色 */
|
||||
--custom-primary-rgb: 93, 127, 229; /* 主色调的RGB值,用于透明度 */
|
||||
--custom-bg: rgba(255, 255, 255, 0.2); /* 导航栏背景色:半透明白色 */
|
||||
--custom-text: #333333; /* 主要文字颜色:深灰色,保证可读性 */
|
||||
--custom-link-hover: #fdbbdb; /* 链接悬停颜色:柔和的紫色 */
|
||||
--custom-btn-hover-bg: #fdbbdb; /* 按钮悬停背景色:柔和的蓝色 */
|
||||
/* 新增:宽屏时左右留白的宽度(可根据需求调整) */
|
||||
--side-gap-width: 120px;
|
||||
}
|
||||
|
||||
/* --- 2. 页面主体样式 --- */
|
||||
body {
|
||||
/* ========== 背景图:960w 优化版,避免全尺寸 1232px 浪费带宽 ========== */
|
||||
background-image: url("/static/img/bg-body-960.webp");
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
background-attachment: fixed;
|
||||
background-color: #f8f9fa;
|
||||
|
||||
/* ========== 核心修改:重构布局流 ========== */
|
||||
/* 从row改为column,让导航栏+内容区垂直排列 */
|
||||
display: flex;
|
||||
flex-direction: column; /* 关键修改1:垂直布局 */
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
/* ========== 毛玻璃效果遮罩层(保留) ========== */
|
||||
/* body::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
/* backdrop-filter: blur(1px); */
|
||||
/*background-color: rgba(255, 255, 255, 0.2);
|
||||
z-index: -1;
|
||||
background-attachment: fixed;
|
||||
} */
|
||||
|
||||
/* --- 3. 导航栏 (Navbar) 核心美化 --- */
|
||||
.navbar {
|
||||
background-color: var(--custom-bg) !important;
|
||||
backdrop-filter: blur(24px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.1);
|
||||
padding-top: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
position: relative;
|
||||
z-index: 1000;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.navbar-shell {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0.75rem;
|
||||
}
|
||||
|
||||
.navbar-start {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.navbar .navbar-collapse {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.navbar .navbar-collapse {
|
||||
display: flex !important;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-nav-main {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.navbar-end {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 0.75rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.navbar-end {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
width: auto;
|
||||
margin-left: auto;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-search {
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navbar-search .form-control {
|
||||
min-width: 120px;
|
||||
max-width: 180px;
|
||||
}
|
||||
|
||||
.navbar-auth {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.navbar-auth .nav-link-auth,
|
||||
.navbar-auth .nav-link-btn {
|
||||
padding: 0.35rem 0.85rem !important;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(var(--custom-primary-rgb), 0.45);
|
||||
background: rgba(var(--custom-primary-rgb), 0.12);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.navbar-auth .nav-link-auth:hover,
|
||||
.navbar-auth .nav-link-btn:hover {
|
||||
background: rgba(var(--custom-primary-rgb), 0.22);
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
color: var(--custom-primary) !important;
|
||||
font-weight: 700;
|
||||
margin-right: 2rem;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% { transform: scale(1); }
|
||||
50% { transform: scale(1.05); }
|
||||
100% { transform: scale(1); }
|
||||
}
|
||||
|
||||
.navbar-logo {
|
||||
padding-top: 0.3125rem;
|
||||
padding-bottom: 0.3125rem;
|
||||
padding-left: 0.75rem;
|
||||
padding-right: 0.25rem;
|
||||
animation: pulse 3s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.navbar-dark .nav-link {
|
||||
color: var(--custom-text) !important;
|
||||
margin-left: 0.5rem;
|
||||
margin-right: 0.5rem;
|
||||
transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.navbar-dark .nav-link:hover {
|
||||
color: var(--custom-link-hover) !important;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.navbar-search .form-control {
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-radius: 0.375rem;
|
||||
outline: none;
|
||||
transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.navbar-search .form-control:focus {
|
||||
border-color: rgba(var(--custom-primary-rgb), 0.5);
|
||||
box-shadow: 0 0 0 0.2rem rgba(var(--custom-primary-rgb), 0.25);
|
||||
}
|
||||
|
||||
.navbar-search .btn-outline-success {
|
||||
color: var(--custom-primary);
|
||||
border-color: var(--custom-primary);
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
white-space: nowrap;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.navbar-search .btn-outline-success:hover {
|
||||
background-color: var(--custom-btn-hover-bg);
|
||||
border-color: var(--custom-btn-hover-bg);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
.navbar-search {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.navbar-search .form-control {
|
||||
flex: 1;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.navbar-auth {
|
||||
justify-content: flex-start;
|
||||
padding-top: 0.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* --- 6. 主要内容区域样式 --- */
|
||||
/* .main-container {
|
||||
/* 调整:主内容容器在横向flex中占剩余空间 */
|
||||
/*flex: 1;
|
||||
/* 关键修改3:移除多余的padding-top,因为导航栏已回归文档流,无需遮挡补偿 */
|
||||
/*padding-bottom: 4rem;
|
||||
/* 限制主内容最大宽度,保证阅读体验 */
|
||||
/*max-width: 1200px;*/
|
||||
/* 让主内容在content-wrapper中居中(配合左右留白) */
|
||||
/*margin: 0 auto;
|
||||
/* 左右内边距,适配窄屏 */
|
||||
/* padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
/* 毛玻璃效果(保留) */
|
||||
/* background-color: rgba(255, 255, 255, 0.1);
|
||||
backdrop-filter: blur(0px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.1);
|
||||
border-radius: 4px;
|
||||
padding: 50px 100px; */
|
||||
/* 新增:给主内容容器添加顶部外边距,增加与导航栏的间距 */
|
||||
/*margin-top: 2rem; */
|
||||
/*} */
|
||||
|
||||
/* --- 7. 左右留白容器样式 (核心需求,适配新布局) ---
|
||||
.left-container, .right-container {
|
||||
/* 窄屏时宽度为0,不显示留白 */
|
||||
/*width: 0;
|
||||
/* 不占用空间 */
|
||||
/*flex-shrink: 0;
|
||||
/* 背景色和页面主体一致,视觉上是留白 */
|
||||
/*background-color: transparent;
|
||||
} */
|
||||
|
||||
/* 宽屏断点(和Bootstrap lg断点一致:992px) */
|
||||
/* @media (min-width: 992px) {
|
||||
/* 宽屏时显示左右留白 */
|
||||
/* .left-container, .right-container {
|
||||
/* 使用自定义变量设置留白宽度,可灵活调整 */
|
||||
/*width: var(--side-gap-width);
|
||||
background-color: transparent;
|
||||
/* 可选:添加轻微阴影,增强层次感 */
|
||||
/*box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.02);*/
|
||||
/*} */
|
||||
|
||||
/* 可选:超宽屏(比如1600px以上)时,限制留白最大宽度 */
|
||||
/*@media (min-width: 1600px) {
|
||||
.left-container, .right-container {
|
||||
width: calc((100vw - 1200px) / 2);
|
||||
max-width: 200px;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
/* 2. 主体容器样式:确保和footer分隔 */
|
||||
.main-container {
|
||||
/* 主体容器宽度自适应,可根据需求调整最大宽度 */
|
||||
width: 100%;
|
||||
/* 居中显示(可选) */
|
||||
margin: 0 auto;
|
||||
/* 关键:给主体底部加间距,和footer分开 */
|
||||
margin-bottom: 1rem;
|
||||
/* 主体内边距,防止内容贴边 */
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
/* --- 页脚 (Footer) 样式 - 毛玻璃效果 + 适配新增内容 --- */
|
||||
.footer {
|
||||
/* 核心毛玻璃效果 */
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px); /* 兼容webkit内核浏览器 */
|
||||
border: 1px solid rgba(255, 255, 255, 0.1); /* 浅白色边框增强质感 */
|
||||
box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05); /* 内阴影提升层次 */
|
||||
|
||||
/* 布局样式 - 回归文档流,不脱离 */
|
||||
position: static;
|
||||
width: 100%;
|
||||
padding: 1.5rem 1rem; /* 上下内边距充足,容纳多行内容 */
|
||||
margin-top: 2rem; /* 与上方内容分隔 */
|
||||
height: auto; /* 高度自适应内容,不挤压 */
|
||||
|
||||
/* 内容排版 - 垂直分布,居中对齐 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.75rem; /* 各子元素之间的间距 */
|
||||
|
||||
/* 文字基础样式 */
|
||||
color: #ffffff !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* footer logo样式 */
|
||||
.footer-logo {
|
||||
margin-bottom: 0.25rem; /* 与版权信息轻微分隔 */
|
||||
}
|
||||
|
||||
.footer-logo img {
|
||||
border-radius: 50%; /* logo圆形化(可选) */
|
||||
transition: transform 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.footer-logo img:hover {
|
||||
transform: scale(1.1); /* logo悬浮轻微放大 */
|
||||
}
|
||||
|
||||
/* 版权信息容器 */
|
||||
.footer-container {
|
||||
text-align: center;
|
||||
color: rgba(255, 255, 255, 0.9); /* 文字半透,更柔和 */
|
||||
}
|
||||
|
||||
/* 联系我们链接 */
|
||||
.footer-contact a {
|
||||
color: rgba(255, 255, 255, 0.9) !important;
|
||||
text-decoration: none;
|
||||
padding: 0.25rem 0.75rem;
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.footer-contact a:hover {
|
||||
color: #ffffff !important;
|
||||
background-color: rgba(255, 255, 255, 0.15);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 作者信息样式 */
|
||||
.footer-author {
|
||||
color: rgba(255, 255, 255, 0.7); /* 作者信息稍淡,突出层级 */
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.footer-author a {
|
||||
color: rgba(255, 255, 255, 0.85) !important;
|
||||
text-decoration: none;
|
||||
transition: color 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.footer-author a:hover {
|
||||
color: #ffffff !important;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 响应式适配 - 小屏幕优化 */
|
||||
@media (max-width: 575.98px) {
|
||||
.footer {
|
||||
padding: 1rem 0.5rem;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.footer-author {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
@@ -1,670 +0,0 @@
|
||||
/**
|
||||
* 聊天模块 — 与论坛 feed 粉色毛玻璃主题统一
|
||||
*/
|
||||
|
||||
.chat-page {
|
||||
--chat-accent: #fdbbdb;
|
||||
--chat-accent-text: #a85878;
|
||||
--chat-accent-muted: #c97a96;
|
||||
--chat-text: #333;
|
||||
--chat-text-muted: #666;
|
||||
--chat-glass: rgba(255, 255, 255, 0.32);
|
||||
--chat-glass-border: rgba(255, 255, 255, 0.45);
|
||||
--chat-shadow: 0 4px 16px rgba(253, 189, 219, 0.08);
|
||||
}
|
||||
|
||||
.chat-page .section-wrap.chat-stage {
|
||||
padding: 2rem 2.5rem 2.5rem;
|
||||
}
|
||||
|
||||
.chat-page .section-wrap.chat-stage-narrow {
|
||||
max-width: 640px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.feed-list-title.chat-room-title {
|
||||
margin-bottom: 0;
|
||||
text-align: left;
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.chat-page-lead {
|
||||
margin: 0.75rem 0 1rem;
|
||||
font-size: 0.9375rem;
|
||||
line-height: 1.65;
|
||||
color: var(--chat-text-muted);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.chat-room-desc {
|
||||
text-align: left;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.chat-breadcrumb {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--chat-text-muted);
|
||||
}
|
||||
|
||||
.chat-breadcrumb a {
|
||||
color: var(--chat-accent-muted);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.chat-breadcrumb a:hover {
|
||||
color: var(--chat-accent-text);
|
||||
}
|
||||
|
||||
.chat-breadcrumb-sep {
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
.chat-breadcrumb-current {
|
||||
color: var(--chat-text);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.chat-room-header {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 0.5rem;
|
||||
padding-bottom: 0.75rem;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
|
||||
.chat-room-meta {
|
||||
margin: 0 0 1.25rem;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--chat-text-muted);
|
||||
}
|
||||
|
||||
.chat-room-meta a {
|
||||
color: var(--chat-accent-text);
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.chat-room-meta a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.chat-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
justify-content: center;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.chat-room-search {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.65rem;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.chat-room-search-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
min-height: 42px;
|
||||
padding: 0.55rem 0.9rem;
|
||||
border: 1px solid rgba(253, 189, 219, 0.45);
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
color: var(--chat-text);
|
||||
font-size: 0.9375rem;
|
||||
}
|
||||
|
||||
.chat-room-search-input:focus {
|
||||
outline: none;
|
||||
border-color: rgba(253, 189, 219, 0.75);
|
||||
box-shadow: 0 0 0 3px rgba(253, 189, 219, 0.22);
|
||||
}
|
||||
|
||||
.chat-room-search-input::placeholder {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.chat-room-search-btn {
|
||||
flex-shrink: 0;
|
||||
padding: 0.55rem 1.1rem;
|
||||
border: 1px solid rgba(253, 189, 219, 0.55);
|
||||
border-radius: 999px;
|
||||
background: rgba(253, 189, 219, 0.35);
|
||||
color: var(--chat-accent-text);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
.chat-room-search-btn:hover {
|
||||
background: rgba(253, 189, 219, 0.5);
|
||||
}
|
||||
|
||||
.chat-list-footer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 1.5rem;
|
||||
padding-top: 1.25rem;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
|
||||
.chat-create-room-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.65rem;
|
||||
width: min(100%, 320px);
|
||||
padding: 0.85rem 1.35rem;
|
||||
border-radius: 999px;
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
border: 1px solid rgba(255, 255, 255, 0.35);
|
||||
background: linear-gradient(135deg, #f0a8c4 0%, #a85878 100%);
|
||||
box-shadow:
|
||||
0 6px 20px rgba(168, 88, 120, 0.28),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.25);
|
||||
transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
|
||||
}
|
||||
|
||||
.chat-create-room-btn:hover {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
transform: translateY(-1px);
|
||||
box-shadow:
|
||||
0 8px 24px rgba(168, 88, 120, 0.34),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.3);
|
||||
filter: brightness(1.03);
|
||||
}
|
||||
|
||||
.chat-create-room-btn:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.chat-create-room-btn__icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
border-radius: 50%;
|
||||
font-size: 0.8125rem;
|
||||
background: rgba(255, 255, 255, 0.22);
|
||||
}
|
||||
|
||||
.chat-search-empty {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.chat-action-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chat-ws-status {
|
||||
flex-shrink: 0;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
padding: 0.2rem 0.65rem;
|
||||
border-radius: 999px;
|
||||
color: var(--chat-accent-muted);
|
||||
background: rgba(255, 255, 255, 0.35);
|
||||
border: 1px solid rgba(253, 189, 219, 0.35);
|
||||
}
|
||||
|
||||
.chat-ws-status-ok {
|
||||
color: #3d7a52;
|
||||
background: rgba(144, 238, 144, 0.2);
|
||||
border-color: rgba(144, 238, 144, 0.45);
|
||||
}
|
||||
|
||||
.chat-ws-status-error {
|
||||
color: #a85858;
|
||||
background: rgba(255, 182, 193, 0.25);
|
||||
border-color: rgba(255, 160, 160, 0.45);
|
||||
}
|
||||
|
||||
.chat-ws-errors {
|
||||
margin: 0.5rem 0 0;
|
||||
color: #a85858;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
/* ---------- 消息区 ---------- */
|
||||
|
||||
.chat-messages {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.85rem;
|
||||
margin-bottom: 1.25rem;
|
||||
padding: 1rem;
|
||||
border-radius: 14px;
|
||||
background: var(--chat-glass);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid var(--chat-glass-border);
|
||||
box-shadow: var(--chat-shadow);
|
||||
min-height: 240px;
|
||||
max-height: min(60vh, 520px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.chat-message {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.chat-message-mine {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
.chat-message-mine .chat-message-body {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.chat-avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
flex-shrink: 0;
|
||||
border: 2px solid rgba(255, 255, 255, 0.65);
|
||||
box-shadow: 0 2px 8px rgba(253, 189, 219, 0.15);
|
||||
}
|
||||
|
||||
.chat-message-body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 0.6rem 0.75rem;
|
||||
border: 1px solid rgba(253, 189, 219, 0.4);
|
||||
border-radius: 10px;
|
||||
background: rgba(255, 255, 255, 0.35);
|
||||
}
|
||||
|
||||
.chat-message-mine .chat-message-body {
|
||||
border-color: rgba(240, 168, 196, 0.55);
|
||||
background: rgba(253, 189, 219, 0.22);
|
||||
}
|
||||
|
||||
.chat-message-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
color: var(--chat-text-muted);
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
.chat-message-mine .chat-message-meta {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.chat-author {
|
||||
color: var(--chat-text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.chat-profile-link {
|
||||
color: var(--chat-accent-text);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.chat-profile-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.chat-content {
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
font-size: 0.9375rem;
|
||||
line-height: 1.55;
|
||||
color: var(--chat-text);
|
||||
}
|
||||
|
||||
.chat-compose {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
/* ---------- 列表 / 分页 ---------- */
|
||||
|
||||
.chat-room-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.chat-room-card {
|
||||
display: block;
|
||||
padding: 1.15rem;
|
||||
border-radius: 14px;
|
||||
background: var(--chat-glass);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(253, 189, 219, 0.35);
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
transition: transform 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.chat-room-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 14px rgba(253, 189, 219, 0.2);
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.chat-room-card h2 {
|
||||
margin: 0 0 0.5rem;
|
||||
font-size: 1.05rem;
|
||||
color: var(--chat-text);
|
||||
}
|
||||
|
||||
.chat-room-card p {
|
||||
margin: 0;
|
||||
color: var(--chat-text-muted);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.chat-pagination {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.chat-pagination-link {
|
||||
padding: 0.35rem 0.85rem;
|
||||
border-radius: 999px;
|
||||
text-decoration: none;
|
||||
color: var(--chat-accent-text);
|
||||
background: rgba(253, 189, 219, 0.25);
|
||||
border: 1px solid rgba(253, 189, 219, 0.4);
|
||||
}
|
||||
|
||||
.chat-pagination-link:hover {
|
||||
background: rgba(253, 189, 219, 0.4);
|
||||
color: var(--chat-accent-text);
|
||||
}
|
||||
|
||||
.chat-pagination-info {
|
||||
color: var(--chat-text-muted);
|
||||
}
|
||||
|
||||
/* ---------- 私聊收件箱 ---------- */
|
||||
|
||||
.feed-list-title.chat-inbox-title {
|
||||
margin-bottom: 0;
|
||||
text-align: left;
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.chat-inbox-header {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 1.25rem;
|
||||
padding-bottom: 0.75rem;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
|
||||
.chat-inbox-new-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.45rem;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
color: var(--chat-accent-text);
|
||||
background: rgba(253, 189, 219, 0.28);
|
||||
border: 1px solid rgba(253, 189, 219, 0.45);
|
||||
transition: background 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.chat-inbox-new-btn:hover {
|
||||
color: var(--chat-accent-text);
|
||||
background: rgba(253, 189, 219, 0.42);
|
||||
box-shadow: 0 4px 12px rgba(253, 189, 219, 0.2);
|
||||
}
|
||||
|
||||
.chat-inbox-panel {
|
||||
padding: 0.85rem;
|
||||
border-radius: 14px;
|
||||
background: var(--chat-glass);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid var(--chat-glass-border);
|
||||
box-shadow: var(--chat-shadow);
|
||||
}
|
||||
|
||||
.chat-inbox-panel--compact {
|
||||
padding: 0.65rem;
|
||||
}
|
||||
|
||||
.chat-inbox-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.chat-inbox-list li + li {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.chat-inbox-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.75rem 0.85rem;
|
||||
border-radius: 12px;
|
||||
text-decoration: none;
|
||||
color: var(--chat-text);
|
||||
background: rgba(255, 255, 255, 0.28);
|
||||
border: 1px solid rgba(253, 189, 219, 0.22);
|
||||
transition: background 0.15s ease, border-color 0.15s ease;
|
||||
}
|
||||
|
||||
.chat-inbox-item:hover {
|
||||
background: rgba(253, 189, 219, 0.18);
|
||||
border-color: rgba(253, 189, 219, 0.38);
|
||||
color: var(--chat-text);
|
||||
}
|
||||
|
||||
.chat-inbox-avatar {
|
||||
flex-shrink: 0;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
border: 2px solid rgba(255, 255, 255, 0.7);
|
||||
box-shadow: 0 2px 8px rgba(253, 189, 219, 0.15);
|
||||
}
|
||||
|
||||
.chat-inbox-body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.2rem;
|
||||
}
|
||||
|
||||
.chat-inbox-top {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.chat-inbox-name {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
color: var(--chat-accent-text);
|
||||
}
|
||||
|
||||
.chat-inbox-time {
|
||||
flex-shrink: 0;
|
||||
font-size: 0.75rem;
|
||||
color: var(--chat-text-muted);
|
||||
}
|
||||
|
||||
.chat-inbox-preview {
|
||||
display: block;
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.45;
|
||||
color: var(--chat-text-muted);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.chat-inbox-arrow {
|
||||
flex-shrink: 0;
|
||||
font-size: 0.75rem;
|
||||
color: var(--chat-accent-muted);
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.chat-inbox-empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.65rem;
|
||||
padding: 2.5rem 1.25rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.chat-inbox-empty-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 3.25rem;
|
||||
height: 3.25rem;
|
||||
border-radius: 50%;
|
||||
font-size: 1.25rem;
|
||||
color: var(--chat-accent-muted);
|
||||
background: rgba(253, 189, 219, 0.22);
|
||||
border: 1px solid rgba(253, 189, 219, 0.35);
|
||||
}
|
||||
|
||||
.chat-inbox-empty-title {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--chat-text);
|
||||
}
|
||||
|
||||
.chat-inbox-empty-lead {
|
||||
margin: 0;
|
||||
max-width: 18rem;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.55;
|
||||
color: var(--chat-text-muted);
|
||||
}
|
||||
|
||||
.chat-inbox-empty-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.45rem;
|
||||
margin-top: 0.35rem;
|
||||
padding: 0.65rem 1.25rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #f0a8c4 0%, #a85878 100%);
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
box-shadow: 0 4px 14px rgba(168, 88, 120, 0.25);
|
||||
transition: transform 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.chat-inbox-empty-btn:hover {
|
||||
color: #fff;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 6px 18px rgba(168, 88, 120, 0.32);
|
||||
}
|
||||
|
||||
.chat-thread-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.chat-thread-list li + li {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.chat-thread-list a {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.85rem 1rem;
|
||||
border-radius: 12px;
|
||||
background: var(--chat-glass);
|
||||
border: 1px solid rgba(253, 189, 219, 0.3);
|
||||
color: var(--chat-text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.chat-thread-list a:hover {
|
||||
background: rgba(253, 189, 219, 0.2);
|
||||
}
|
||||
|
||||
.chat-thread-time {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--chat-text-muted);
|
||||
}
|
||||
|
||||
.chat-empty,
|
||||
.chat-login-hint {
|
||||
color: var(--chat-text-muted);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.chat-empty a,
|
||||
.chat-login-hint a {
|
||||
color: var(--chat-accent-text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.chat-page .section-wrap.chat-stage {
|
||||
padding: 1.5rem 1.25rem 2rem;
|
||||
}
|
||||
|
||||
.feed-list-title.chat-room-title {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.chat-messages {
|
||||
max-height: none;
|
||||
}
|
||||
}
|
||||
@@ -1,212 +0,0 @@
|
||||
/* 详情页:箭头上一篇/下一篇 + 推荐阅读轮播 */
|
||||
|
||||
.detail-reading-extras {
|
||||
margin-bottom: 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
.detail-adjacent-nav,
|
||||
.detail-recommend {
|
||||
padding: 1rem 1.25rem !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
/* --- 上一篇 / 下一篇:左右箭头 --- */
|
||||
.detail-adjacent-bar {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.detail-adjacent-side {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.detail-adjacent-side-prev {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.detail-adjacent-side-next {
|
||||
justify-content: flex-end;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.detail-arrow-btn {
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(145deg, #fdbbdb, #f0a8c4);
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
box-shadow: 0 2px 8px rgba(168, 88, 120, 0.25);
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.detail-arrow-btn:hover {
|
||||
transform: scale(1.06);
|
||||
box-shadow: 0 4px 12px rgba(168, 88, 120, 0.35);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.detail-arrow-btn.is-disabled {
|
||||
background: rgba(0, 0, 0, 0.08);
|
||||
color: #bbb;
|
||||
box-shadow: none;
|
||||
cursor: default;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.detail-adjacent-title {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.4;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.detail-adjacent-title:hover {
|
||||
color: #a85878;
|
||||
}
|
||||
|
||||
/* --- 推荐阅读轮播 --- */
|
||||
.detail-recommend-heading {
|
||||
margin: 0 0 0.85rem;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 700;
|
||||
color: #a85878;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.detail-recommend-viewport {
|
||||
overflow: hidden;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.detail-recommend-track {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.detail-recommend-slide {
|
||||
flex: 0 0 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0 0.15rem;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.detail-recommend-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
gap: 0.35rem;
|
||||
padding: 1rem 1.1rem;
|
||||
border-radius: 12px;
|
||||
background: rgba(255, 255, 255, 0.55);
|
||||
border: 1px solid rgba(255, 255, 255, 0.65);
|
||||
text-decoration: none;
|
||||
transition: background 0.2s ease, border-color 0.2s ease;
|
||||
}
|
||||
|
||||
.detail-recommend-card:hover {
|
||||
background: rgba(255, 255, 255, 0.82);
|
||||
border-color: rgba(253, 187, 219, 0.8);
|
||||
}
|
||||
|
||||
.detail-recommend-card-title {
|
||||
flex: 1 1 auto;
|
||||
color: #222;
|
||||
font-weight: 600;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.45;
|
||||
/* 固定两行高度,短标题与长标题卡片等高 */
|
||||
min-height: calc(0.95rem * 1.45 * 2);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.detail-recommend-card-meta {
|
||||
flex-shrink: 0;
|
||||
margin-top: auto;
|
||||
font-size: 0.78rem;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.detail-recommend-dots {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 0.45rem;
|
||||
margin-top: 0.85rem;
|
||||
padding-bottom: 0.15rem;
|
||||
}
|
||||
|
||||
.detail-recommend-dot {
|
||||
width: 0.45rem;
|
||||
height: 0.45rem;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
background: rgba(168, 88, 120, 0.25);
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease, background 0.2s ease;
|
||||
}
|
||||
|
||||
.detail-recommend-dot:hover {
|
||||
background: rgba(168, 88, 120, 0.45);
|
||||
}
|
||||
|
||||
.detail-recommend-dot.is-active {
|
||||
background: #a85878;
|
||||
transform: scale(1.25);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.detail-recommend-slide {
|
||||
flex: 0 0 50%;
|
||||
}
|
||||
|
||||
.detail-adjacent-title {
|
||||
font-size: 0.92rem;
|
||||
-webkit-line-clamp: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.detail-adjacent-bar {
|
||||
flex-direction: column;
|
||||
gap: 0.65rem;
|
||||
}
|
||||
|
||||
.detail-adjacent-side-next {
|
||||
text-align: left;
|
||||
justify-content: flex-start;
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
.detail-adjacent-side-prev {
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
||||
@@ -1,459 +0,0 @@
|
||||
/**
|
||||
* 帖子/新闻列表共用:粉色毛玻璃分段板块 + 横向卡片
|
||||
* 用于首页 .home-posts 与独立列表页 .feed-list-page
|
||||
*/
|
||||
|
||||
.home-posts,
|
||||
.feed-list-page {
|
||||
--post-accent: #fdbbdb;
|
||||
--post-accent-deep: #f0a8c4;
|
||||
--post-accent-text: #a85878;
|
||||
--post-accent-muted: #c97a96;
|
||||
--post-accent-bg: rgba(253, 189, 219, 0.48);
|
||||
}
|
||||
|
||||
/* ---------- 板块栏(强制单行:左箭头 | 可滚动 Tab | 右箭头) ---------- */
|
||||
.home-posts-board-bar,
|
||||
.feed-list-page .feed-board-bar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 1.25rem;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.home-posts-segment-outer,
|
||||
.feed-list-page .feed-segment-outer {
|
||||
flex: 1 1 0%;
|
||||
min-width: 0;
|
||||
width: 0;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.home-posts-segment,
|
||||
.feed-list-page .feed-segment {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
box-sizing: border-box;
|
||||
padding: 4px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.28);
|
||||
backdrop-filter: blur(18px);
|
||||
-webkit-backdrop-filter: blur(18px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
box-shadow:
|
||||
0 4px 20px rgba(253, 189, 219, 0.12),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.35);
|
||||
}
|
||||
|
||||
.home-posts-spotlight,
|
||||
.feed-list-page .feed-spotlight {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
bottom: 4px;
|
||||
left: 0;
|
||||
width: var(--spot-w, 4rem);
|
||||
border-radius: 999px;
|
||||
background: var(--post-accent-bg);
|
||||
border: 1px solid rgba(240, 168, 196, 0.55);
|
||||
box-shadow: 0 2px 14px rgba(253, 189, 219, 0.35);
|
||||
transform: translateX(var(--spot-l, 0));
|
||||
transition:
|
||||
transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1),
|
||||
width 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.home-posts-tabs-scroll,
|
||||
.feed-list-page .feed-tabs-scroll {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
max-width: 100%;
|
||||
scroll-behavior: smooth;
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
mask-image: linear-gradient(
|
||||
to right,
|
||||
transparent,
|
||||
#000 12px,
|
||||
#000 calc(100% - 12px),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.home-posts-tabs-scroll::-webkit-scrollbar,
|
||||
.feed-list-page .feed-tabs-scroll::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.home-posts-tabs,
|
||||
.feed-list-page .feed-tabs {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
gap: 2px;
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
.home-posts-tab,
|
||||
.feed-list-page .feed-tab {
|
||||
flex-shrink: 0;
|
||||
padding: 0.4rem 1rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
text-decoration: none;
|
||||
color: #555;
|
||||
background: transparent;
|
||||
border: 1px solid transparent;
|
||||
transition: color 0.2s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.home-posts-tab:hover,
|
||||
.feed-list-page .feed-tab:hover {
|
||||
color: var(--post-accent-text);
|
||||
}
|
||||
|
||||
.home-posts-tab.active,
|
||||
.feed-list-page .feed-tab.active {
|
||||
color: var(--post-accent-text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.home-posts-tab-more {
|
||||
background: rgba(253, 189, 219, 0.32);
|
||||
border-color: rgba(253, 189, 219, 0.45);
|
||||
color: var(--post-accent-text);
|
||||
}
|
||||
|
||||
.home-posts-tab-more:hover {
|
||||
background: rgba(253, 189, 219, 0.48);
|
||||
color: var(--post-accent-text);
|
||||
}
|
||||
|
||||
.home-posts-scroll,
|
||||
.feed-list-page .feed-scroll {
|
||||
flex: 0 0 32px;
|
||||
width: 32px;
|
||||
min-width: 32px;
|
||||
max-width: 32px;
|
||||
height: 32px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.35);
|
||||
backdrop-filter: blur(10px);
|
||||
color: var(--post-accent-text);
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, transform 0.2s, opacity 0.2s;
|
||||
box-sizing: border-box;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.home-posts-scroll:hover,
|
||||
.feed-list-page .feed-scroll:hover {
|
||||
background: rgba(253, 189, 219, 0.35);
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.home-posts-scroll:disabled,
|
||||
.home-posts-scroll.is-hidden,
|
||||
.feed-list-page .feed-scroll.is-hidden {
|
||||
opacity: 0.3;
|
||||
pointer-events: none;
|
||||
transform: none;
|
||||
/* 仍占位,避免板块栏折行 */
|
||||
visibility: visible;
|
||||
flex: 0 0 32px;
|
||||
width: 32px;
|
||||
min-width: 32px;
|
||||
}
|
||||
|
||||
/* ---------- 帖子卡片列表 ---------- */
|
||||
.home-posts-list,
|
||||
.feed-list-page .feed-posts-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.65rem;
|
||||
}
|
||||
|
||||
.home-post-card,
|
||||
.feed-list-page .feed-post-card {
|
||||
border-radius: 14px;
|
||||
background: rgba(255, 255, 255, 0.32);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.42);
|
||||
box-shadow: 0 4px 16px rgba(253, 189, 219, 0.08);
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
|
||||
}
|
||||
|
||||
.home-post-card:hover,
|
||||
.feed-list-page .feed-post-card:hover {
|
||||
transform: translateY(-2px);
|
||||
background: rgba(255, 255, 255, 0.42);
|
||||
box-shadow: 0 8px 24px rgba(253, 189, 219, 0.18);
|
||||
}
|
||||
|
||||
.home-post-card-link,
|
||||
.feed-list-page .feed-post-card-link {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
align-items: center;
|
||||
gap: 0.75rem 1rem;
|
||||
padding: 0.75rem 1rem;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.home-post-board,
|
||||
.feed-list-page .feed-post-board {
|
||||
flex-shrink: 0;
|
||||
padding: 0.2rem 0.55rem;
|
||||
border-radius: 6px;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 600;
|
||||
color: var(--post-accent-text);
|
||||
background: rgba(253, 189, 219, 0.28);
|
||||
white-space: nowrap;
|
||||
max-width: 5rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.home-post-body,
|
||||
.feed-list-page .feed-post-body {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.home-post-title,
|
||||
.feed-list-page .feed-post-title {
|
||||
margin: 0 0 0.3rem;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
color: #222;
|
||||
line-height: 1.35;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.home-post-meta,
|
||||
.feed-list-page .feed-post-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.5rem 0.85rem;
|
||||
font-size: 0.75rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.home-post-meta-item,
|
||||
.feed-list-page .feed-post-meta-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.home-post-meta i,
|
||||
.feed-list-page .feed-post-meta i {
|
||||
font-size: 0.7rem;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.home-post-meta time,
|
||||
.feed-list-page .feed-post-meta time {
|
||||
color: var(--post-accent-muted);
|
||||
}
|
||||
|
||||
.home-post-arrow,
|
||||
.feed-list-page .feed-post-arrow {
|
||||
color: rgba(253, 189, 219, 0.9);
|
||||
font-size: 0.75rem;
|
||||
opacity: 0.7;
|
||||
transition: opacity 0.2s, transform 0.2s;
|
||||
}
|
||||
|
||||
.home-post-card:hover .home-post-arrow,
|
||||
.feed-list-page .feed-post-card:hover .feed-post-arrow {
|
||||
opacity: 1;
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
.home-posts-empty,
|
||||
.feed-list-page .feed-empty {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.home-posts-more-link {
|
||||
display: block;
|
||||
width: fit-content;
|
||||
margin: 1rem auto 0;
|
||||
padding: 0.45rem 1.25rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
color: var(--post-accent-text);
|
||||
background: rgba(253, 189, 219, 0.35);
|
||||
border: 1px solid rgba(253, 189, 219, 0.55);
|
||||
transition: background 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.home-posts-more-link:hover {
|
||||
background: rgba(253, 189, 219, 0.5);
|
||||
box-shadow: 0 4px 14px rgba(253, 189, 219, 0.25);
|
||||
}
|
||||
|
||||
/* ---------- 新闻列表卡片(横向胶囊风格,静态列表) ---------- */
|
||||
.feed-list-page .feed-news-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.65rem;
|
||||
}
|
||||
|
||||
.feed-list-page .feed-news-card {
|
||||
border-radius: 14px;
|
||||
background: rgba(255, 255, 255, 0.32);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.42);
|
||||
box-shadow: 0 4px 16px rgba(253, 189, 219, 0.08);
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
|
||||
}
|
||||
|
||||
.feed-list-page .feed-news-card:hover {
|
||||
transform: translateY(-2px);
|
||||
background: rgba(255, 255, 255, 0.42);
|
||||
box-shadow: 0 8px 24px rgba(253, 189, 219, 0.18);
|
||||
}
|
||||
|
||||
.feed-list-page .feed-news-card-link {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
align-items: center;
|
||||
gap: 0.75rem 1rem;
|
||||
padding: 0.75rem 1rem;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.feed-list-page .feed-news-side {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 0.15rem;
|
||||
padding-right: 0.65rem;
|
||||
border-right: 1px solid rgba(253, 189, 219, 0.35);
|
||||
min-width: 4.5rem;
|
||||
}
|
||||
|
||||
.feed-list-page .feed-news-date {
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 700;
|
||||
color: var(--post-accent-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.feed-list-page .feed-news-board {
|
||||
font-size: 0.625rem;
|
||||
font-weight: 600;
|
||||
color: var(--post-accent-text);
|
||||
background: rgba(253, 189, 219, 0.22);
|
||||
padding: 0.12rem 0.35rem;
|
||||
border-radius: 3px;
|
||||
max-width: 5.5rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.home-posts-board-bar,
|
||||
.feed-list-page .feed-board-bar {
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.home-posts-scroll,
|
||||
.feed-list-page .feed-scroll {
|
||||
flex: 0 0 28px;
|
||||
width: 28px;
|
||||
min-width: 28px;
|
||||
max-width: 28px;
|
||||
height: 28px;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.home-posts-scroll.is-hidden,
|
||||
.feed-list-page .feed-scroll.is-hidden {
|
||||
flex: 0 0 28px;
|
||||
width: 28px;
|
||||
min-width: 28px;
|
||||
}
|
||||
|
||||
.home-posts-tab,
|
||||
.feed-list-page .feed-tab {
|
||||
padding: 0.35rem 0.7rem;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.home-post-card-link,
|
||||
.feed-list-page .feed-post-card-link,
|
||||
.feed-list-page .feed-news-card-link {
|
||||
grid-template-columns: 1fr auto;
|
||||
grid-template-rows: auto auto;
|
||||
}
|
||||
|
||||
.home-post-board,
|
||||
.feed-list-page .feed-post-board,
|
||||
.feed-list-page .feed-news-side {
|
||||
grid-column: 1;
|
||||
justify-self: start;
|
||||
border-right: none;
|
||||
padding-right: 0;
|
||||
flex-direction: row;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.home-post-body,
|
||||
.feed-list-page .feed-post-body {
|
||||
grid-column: 1;
|
||||
}
|
||||
|
||||
.home-post-arrow,
|
||||
.feed-list-page .feed-post-arrow {
|
||||
grid-column: 2;
|
||||
grid-row: 1 / span 2;
|
||||
align-self: center;
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
/**
|
||||
* 帖子/新闻独立列表页布局(与首页 section-wrap 宽度一致)
|
||||
* 不依赖 index.css(首页 hero/notice 专用)
|
||||
*/
|
||||
|
||||
section.feed-list-page {
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.feed-list-page {
|
||||
padding: 2rem 0 3rem;
|
||||
}
|
||||
|
||||
.feed-list-page .section-wrap.feed-list-stage {
|
||||
display: block;
|
||||
width: 90%;
|
||||
max-width: none;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
box-sizing: border-box;
|
||||
background-color: rgba(255, 255, 255, 0.14);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.1);
|
||||
border-radius: 30px;
|
||||
backdrop-filter: blur(12px);
|
||||
padding: 2rem 2.5rem 2.5rem;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
max-height: none;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.feed-list-body {
|
||||
width: 100%;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.feed-list-title {
|
||||
margin: 0 0 1.25rem;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
color: #111;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.45);
|
||||
padding-bottom: 0.65rem;
|
||||
}
|
||||
|
||||
.feed-list-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.feed-list-actions .feed-action-link {
|
||||
padding: 0.4rem 1rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
color: var(--post-accent-text);
|
||||
background: rgba(253, 189, 219, 0.35);
|
||||
border: 1px solid rgba(253, 189, 219, 0.55);
|
||||
transition: background 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.feed-list-actions .feed-action-link:hover {
|
||||
background: rgba(253, 189, 219, 0.5);
|
||||
box-shadow: 0 4px 14px rgba(253, 189, 219, 0.25);
|
||||
}
|
||||
|
||||
.feed-list-page .feed-pagination {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.feed-list-page .feed-pagination .page-link {
|
||||
color: var(--post-accent-text);
|
||||
background: rgba(255, 255, 255, 0.32);
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(253, 189, 219, 0.4);
|
||||
border-radius: 8px;
|
||||
margin: 0 0.2rem;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.feed-list-page .feed-pagination .page-link:hover {
|
||||
background: rgba(253, 189, 219, 0.35);
|
||||
}
|
||||
|
||||
.feed-list-page .feed-pagination .page-item.active .page-link {
|
||||
background: rgba(253, 189, 219, 0.55);
|
||||
border-color: rgba(240, 168, 196, 0.75);
|
||||
color: var(--post-accent-text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
section.feed-list-page,
|
||||
.feed-list-page {
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.feed-list-page .section-wrap.feed-list-stage {
|
||||
width: 95%;
|
||||
border-radius: 20px;
|
||||
padding: 1.25rem 1.5rem 1.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.feed-list-page .section-wrap.feed-list-stage {
|
||||
width: 98%;
|
||||
padding: 1rem 1.15rem 1.5rem;
|
||||
}
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
/* 全站页脚:白色毛玻璃,与导航/首页区块风格一致 */
|
||||
.site-footer {
|
||||
margin-top: 2rem;
|
||||
padding: 2.25rem 1.5rem 2.75rem;
|
||||
background: rgba(255, 255, 255, 0.28);
|
||||
backdrop-filter: blur(14px);
|
||||
-webkit-backdrop-filter: blur(14px);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.45);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.site-footer-inner {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 2rem 3rem;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.footer-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* ---------- 左栏:站点信息(居中 + 字号层级) ---------- */
|
||||
.footer-site-logo {
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.footer-site-name {
|
||||
margin: 0 0 0.35rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: #111;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.footer-site-tagline {
|
||||
margin: 0 0 0.75rem;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 400;
|
||||
color: #555;
|
||||
line-height: 1.5;
|
||||
max-width: 22rem;
|
||||
}
|
||||
|
||||
.footer-copy {
|
||||
margin: 0 0 0.5rem;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 500;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.footer-meta-sm {
|
||||
margin: 0.2rem 0;
|
||||
font-size: 0.8125rem;
|
||||
color: #666;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.footer-meta-label {
|
||||
display: inline;
|
||||
margin-right: 0.35rem;
|
||||
font-size: 0.75rem;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.footer-meta-label::after {
|
||||
content: ":";
|
||||
}
|
||||
|
||||
.footer-col-site a {
|
||||
color: #2a5db0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.footer-col-site a:hover {
|
||||
color: #0d47a1;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.footer-api-guide {
|
||||
margin-top: 0.45rem;
|
||||
}
|
||||
|
||||
.footer-guide-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
padding: 0.28rem 0.65rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: #555 !important;
|
||||
text-decoration: none !important;
|
||||
background: rgba(255, 255, 255, 0.45);
|
||||
border: 1px solid rgba(0, 0, 0, 0.08);
|
||||
border-radius: 999px;
|
||||
transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
|
||||
}
|
||||
|
||||
.footer-guide-btn:hover {
|
||||
color: #2a5db0 !important;
|
||||
background: rgba(255, 255, 255, 0.75);
|
||||
border-color: rgba(42, 93, 176, 0.25);
|
||||
}
|
||||
|
||||
.footer-guide-btn .anlian-icon {
|
||||
font-size: 0.7rem;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.footer-beian {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 0.35rem 0.85rem;
|
||||
margin-top: 0.65rem;
|
||||
}
|
||||
|
||||
.footer-beian-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.3rem;
|
||||
font-size: 0.75rem;
|
||||
color: #777 !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.footer-beian-link:hover {
|
||||
color: #333 !important;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.beian-icon {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* ---------- 右栏:作者(头像在上,信息居中,无卡片) ---------- */
|
||||
.footer-col-author {
|
||||
gap: 0.65rem;
|
||||
}
|
||||
|
||||
.footer-author-avatar {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
border: 2px solid rgba(255, 255, 255, 0.85);
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.footer-author-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.2rem;
|
||||
width: 100%;
|
||||
max-width: 16rem;
|
||||
}
|
||||
|
||||
.footer-author-name {
|
||||
margin: 0;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 700;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
.footer-author-name a {
|
||||
color: #111;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.footer-author-name a:hover {
|
||||
color: #111;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.footer-author-title {
|
||||
margin: 0;
|
||||
font-size: 0.875rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.footer-author-meta {
|
||||
margin: 0.1rem 0;
|
||||
font-size: 0.8125rem;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.footer-author-meta a {
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.footer-author-meta a:hover {
|
||||
color: #333;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 个人主页:白色加粗,悬浮白色下划线(与全站毛玻璃主题一致) */
|
||||
.footer-author-home a {
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.footer-author-home a:hover,
|
||||
.footer-author-home a:focus-visible {
|
||||
color: #fff;
|
||||
text-decoration: underline;
|
||||
text-decoration-color: #fff;
|
||||
text-underline-offset: 0.2em;
|
||||
}
|
||||
|
||||
/* ---------- 首页与其它页面共用 ---------- */
|
||||
.page-home .main-container {
|
||||
max-width: none;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
.hero .social a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.hero .social a:hover {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.site-footer-inner {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.footer-col-author {
|
||||
padding-top: 0.5rem;
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
.anlian-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
vertical-align: -0.125em;
|
||||
fill: currentColor;
|
||||
flex-shrink: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.anlian-icon svg {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
@@ -1,180 +0,0 @@
|
||||
/* ========== 原有基础样式保留(略作优化) ========== */
|
||||
/* 针对section的css样式 */
|
||||
section,
|
||||
.right,
|
||||
.left,
|
||||
.social,
|
||||
.social .anlian-icon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
section {
|
||||
height: 100vh;
|
||||
/* 新增:确保小屏幕也能完整显示内容,避免溢出 */
|
||||
min-height: 600px;
|
||||
padding: 20px 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.section-wrap {
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
height: 80vh;
|
||||
min-height: 500px; /* 新增:最小高度,避免小屏幕塌陷 */
|
||||
width: 90%;
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.1);
|
||||
border-radius: 30px;
|
||||
backdrop-filter: blur(12px);
|
||||
padding: 50px 100px;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box; /* 新增:内边距计入宽度 */
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.section-wrap {
|
||||
padding: 30px 50px; /* 减小内边距 */
|
||||
height: 85vh; /* 增加高度占比,容纳内容 */
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
section {
|
||||
height: auto; /* 取消固定高度,自适应内容 */
|
||||
min-height: 100vh; /* 确保至少占满视窗 */
|
||||
padding: 40px 0;
|
||||
}
|
||||
|
||||
.section-wrap {
|
||||
height: auto; /* 取消固定高度 */
|
||||
/* min-height: auto; */
|
||||
padding: 20px 30px;
|
||||
width: 95%; /* 增加宽度占比 */
|
||||
border-radius: 20px; /* 减小圆角,适配小屏 */
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.section-wrap {
|
||||
padding: 15px 20px;
|
||||
width: 98%;
|
||||
}
|
||||
}
|
||||
|
||||
/* 内容型区块:取消 100vh + flex 居中,避免列表被压扁裁切(桌面端亦生效) */
|
||||
section.feed-list-page,
|
||||
.page-home section.home-posts,
|
||||
.page-home section.home-news {
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
/* 公告 / 新闻 / 帖子 / 列表页:统一宽度 */
|
||||
.page-home section.notice > .section-wrap,
|
||||
.page-home section.home-news > .section-wrap,
|
||||
.page-home section.home-posts > .section-wrap,
|
||||
section.feed-list-page > .section-wrap.feed-list-stage {
|
||||
width: 90%;
|
||||
max-width: none;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 公告:保留轮播区高度(勿用 min-height:0,否则绝对定位容器坍塌) */
|
||||
.page-home section.notice > .section-wrap {
|
||||
position: relative;
|
||||
min-height: clamp(380px, 52vh, 560px);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 新闻 / 帖子 / 列表:高度随内容,覆盖全局 80vh + overflow:hidden */
|
||||
.page-home section.home-news > .section-wrap,
|
||||
.page-home section.home-posts > .section-wrap,
|
||||
section.feed-list-page > .section-wrap.feed-list-stage {
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
max-height: none;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/* 首页 Hero:全屏感 + 与其它区块统一宽度 */
|
||||
.page-home section.hero {
|
||||
height: auto;
|
||||
min-height: 100vh;
|
||||
align-items: stretch;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.page-home section.hero > .section-wrap {
|
||||
width: 90%;
|
||||
max-width: none;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
height: auto;
|
||||
min-height: clamp(520px, 82vh, 760px);
|
||||
overflow: visible;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.page-home section.hero {
|
||||
min-height: auto;
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.page-home section.hero > .section-wrap {
|
||||
min-height: clamp(460px, 75vh, 680px);
|
||||
padding: 28px 40px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.page-home section.hero,
|
||||
.page-home section.home-posts,
|
||||
.page-home section.home-news,
|
||||
.page-home section.notice,
|
||||
section.feed-list-page {
|
||||
min-height: auto;
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.page-home section.notice > .section-wrap,
|
||||
.page-home section.home-news > .section-wrap,
|
||||
.page-home section.home-posts > .section-wrap,
|
||||
section.feed-list-page > .section-wrap.feed-list-stage,
|
||||
.page-home section.hero > .section-wrap {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.page-home section.hero > .section-wrap {
|
||||
min-height: auto;
|
||||
padding: 20px 24px;
|
||||
}
|
||||
|
||||
.page-home section.notice > .section-wrap {
|
||||
min-height: clamp(340px, 58vh, 480px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.page-home section.notice > .section-wrap,
|
||||
.page-home section.home-news > .section-wrap,
|
||||
.page-home section.home-posts > .section-wrap,
|
||||
section.feed-list-page > .section-wrap.feed-list-stage,
|
||||
.page-home section.hero > .section-wrap {
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
.page-home section.hero > .section-wrap {
|
||||
padding: 16px 18px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.page-home section.notice > .section-wrap {
|
||||
min-height: clamp(300px, 62vh, 420px);
|
||||
}
|
||||
}
|
||||
@@ -1,276 +0,0 @@
|
||||
/**
|
||||
* 首页 Hero(暗恋见君)
|
||||
* 断点:台式 ≥1025px | 平板 768–1024px | 手机 ≤767px
|
||||
*/
|
||||
|
||||
@keyframes heroImageFloat {
|
||||
0%,
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
transform: scale(1.04);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 区块与容器 ---------- */
|
||||
section.hero {
|
||||
align-items: stretch;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hero .section-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
gap: 1.25rem;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* ---------- 顶栏 Logo ---------- */
|
||||
.hero header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 0.65rem;
|
||||
width: 100%;
|
||||
padding-bottom: 0.75rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.hero header img {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
flex-shrink: 0;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.head-logo {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.head-logo span {
|
||||
color: #ffd0d0;
|
||||
}
|
||||
|
||||
/* ---------- 主内容区 ---------- */
|
||||
.hero-content {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: 2rem;
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.hero .left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.hero .right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.main-text {
|
||||
margin: 0 0 1.875rem;
|
||||
font-size: 6rem;
|
||||
font-weight: 800;
|
||||
line-height: 1.2;
|
||||
text-transform: uppercase;
|
||||
color: #111;
|
||||
word-break: break-word;
|
||||
overflow-wrap: anywhere;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.main-text span {
|
||||
color: #ffd0d0;
|
||||
}
|
||||
|
||||
.sub-text {
|
||||
margin: 0 0 3.125rem;
|
||||
font-size: 1.2rem;
|
||||
letter-spacing: 1px;
|
||||
font-weight: 400;
|
||||
color: rgba(60, 60, 60, 0.85);
|
||||
line-height: 1.5;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.hero .right img {
|
||||
display: block;
|
||||
width: 85%;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
filter: drop-shadow(0 0 20px rgba(255, 208, 208, 0.45));
|
||||
animation: heroImageFloat 30s linear infinite;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* ---------- 社交链接 ---------- */
|
||||
.hero .social {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 0.5rem;
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
padding-top: 0.25rem;
|
||||
}
|
||||
|
||||
.hero .social a {
|
||||
display: inline-flex;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.hero .social .anlian-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
font-size: 1.1rem;
|
||||
border: 1px solid rgba(241, 248, 233, 0.9);
|
||||
border-radius: 50%;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s, color 0.25s;
|
||||
}
|
||||
|
||||
.hero .social .anlian-icon:hover {
|
||||
border-color: #ffd0d0;
|
||||
box-shadow: 0 0 20px rgba(255, 208, 208, 0.45);
|
||||
color: #ffd0d0;
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
|
||||
/* ========== 平板(768px–1024px) ========== */
|
||||
@media (max-width: 1024px) {
|
||||
.head-logo {
|
||||
font-size: 1.8rem;
|
||||
letter-spacing: 0.08em;
|
||||
}
|
||||
|
||||
.hero-content {
|
||||
grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
.main-text {
|
||||
font-size: clamp(2.5rem, 4.5vw, 4rem);
|
||||
margin-bottom: 1.25rem;
|
||||
line-height: 1.15;
|
||||
}
|
||||
|
||||
.sub-text {
|
||||
font-size: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.hero .right img {
|
||||
width: min(90%, 340px);
|
||||
}
|
||||
}
|
||||
|
||||
/* ========== 手机(≤767px) ========== */
|
||||
@media (max-width: 767px) {
|
||||
.hero .section-wrap {
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.hero header {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hero-content {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: auto auto;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.hero .left {
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
order: 1;
|
||||
}
|
||||
|
||||
.hero .right {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.main-text {
|
||||
font-size: clamp(1.85rem, 8vw, 2.75rem);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sub-text {
|
||||
text-align: center;
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
|
||||
.hero .right img {
|
||||
width: min(72%, 280px);
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.hero .social {
|
||||
justify-content: center;
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
||||
.hero .social .anlian-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.hero header img {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.main-text {
|
||||
font-size: clamp(1.65rem, 9vw, 2.2rem);
|
||||
}
|
||||
|
||||
.sub-text {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.hero .right img {
|
||||
width: min(78%, 240px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.hero .right img {
|
||||
animation: none;
|
||||
}
|
||||
|
||||
.hero .social .anlian-icon:hover {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
@@ -1,461 +0,0 @@
|
||||
/**
|
||||
* 首页新闻时间轴
|
||||
* - 台式(≥1025px):横向轨道,五条均分,卡片上下交错
|
||||
* - 平板(768–1024px):横向轨道,卡片横向滑动
|
||||
* - 手机(≤767px):竖向轨道,卡片左右交错
|
||||
*/
|
||||
|
||||
.home-news {
|
||||
--news-accent: #fdbbdb;
|
||||
--news-accent-deep: #f0a8c4;
|
||||
--news-accent-text: #a85878;
|
||||
--news-accent-muted: #c97a96;
|
||||
--timeline-axis-offset: 50%;
|
||||
--bp-tablet: 1024px;
|
||||
--bp-mobile: 767px;
|
||||
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
section.home-news {
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.home-news .section-wrap.home-news-stage {
|
||||
display: block;
|
||||
position: relative;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
max-height: none;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-panel,
|
||||
.home-news .news-timeline-wrap,
|
||||
.home-news .news-timeline {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.home-news .news-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 1rem;
|
||||
color: #111;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
|
||||
padding-bottom: 0.5rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.home-news .home-news-board-bar {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
/* ---------- 时间轴容器 ---------- */
|
||||
.home-news .news-timeline-wrap {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
margin: 2rem 0 0;
|
||||
padding: 0.5rem 0 1.5rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-panel {
|
||||
contain: layout style;
|
||||
}
|
||||
|
||||
.home-news .news-timeline {
|
||||
position: relative;
|
||||
min-height: 13.5rem;
|
||||
height: auto;
|
||||
padding: 0.5rem 0 0;
|
||||
}
|
||||
|
||||
/* ---------- 横向轨道(台式 + 平板) ---------- */
|
||||
.home-news .news-timeline-rail {
|
||||
position: absolute;
|
||||
left: 1.25rem;
|
||||
right: 1.25rem;
|
||||
top: var(--timeline-axis-offset);
|
||||
transform: translateY(-50%);
|
||||
height: 3px;
|
||||
width: auto;
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-line {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(253, 189, 219, 0.35) 0%,
|
||||
rgba(253, 189, 219, 0.75) 55%,
|
||||
rgba(240, 168, 196, 0.9) 100%
|
||||
);
|
||||
box-shadow: 0 0 10px rgba(253, 189, 219, 0.25);
|
||||
}
|
||||
|
||||
.home-news .news-timeline-arrow {
|
||||
position: absolute;
|
||||
right: -0.35rem;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--news-accent-deep);
|
||||
font-size: 0.85rem;
|
||||
filter: drop-shadow(0 1px 3px rgba(253, 189, 219, 0.45));
|
||||
}
|
||||
|
||||
.home-news .news-timeline-arrow .news-timeline-arrow-icon--down {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-items {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 0.5rem;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
justify-content: space-between;
|
||||
gap: 0.65rem;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
min-height: 13.5rem;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
max-width: 11.5rem;
|
||||
display: grid;
|
||||
grid-template-rows: 1fr auto 1fr;
|
||||
grid-template-columns: none;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-node {
|
||||
grid-row: 2;
|
||||
grid-column: auto;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
border: 2px solid var(--news-accent-deep);
|
||||
box-shadow:
|
||||
0 0 0 3px rgba(253, 189, 219, 0.25),
|
||||
0 2px 8px rgba(253, 189, 219, 0.35);
|
||||
flex-shrink: 0;
|
||||
z-index: 2;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item:nth-child(odd) .news-timeline-card {
|
||||
grid-row: 1;
|
||||
grid-column: auto;
|
||||
align-self: end;
|
||||
margin: 0 0 0.45rem;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item:nth-child(even) .news-timeline-card {
|
||||
grid-row: 3;
|
||||
grid-column: auto;
|
||||
align-self: start;
|
||||
margin: 0.45rem 0 0;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item:hover .news-timeline-node {
|
||||
transform: scale(1.15);
|
||||
box-shadow:
|
||||
0 0 0 4px rgba(253, 189, 219, 0.35),
|
||||
0 4px 12px rgba(253, 189, 219, 0.4);
|
||||
}
|
||||
|
||||
.home-news .news-timeline-card {
|
||||
width: 100%;
|
||||
padding: 0.65rem 0.75rem;
|
||||
border-radius: 14px;
|
||||
background: rgba(255, 255, 255, 0.38);
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.42);
|
||||
box-shadow: 0 6px 20px rgba(253, 189, 219, 0.12);
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item:nth-child(odd):hover .news-timeline-card {
|
||||
transform: translateY(-4px);
|
||||
background: rgba(255, 255, 255, 0.52);
|
||||
box-shadow: 0 10px 28px rgba(253, 189, 219, 0.22);
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item:nth-child(even):hover .news-timeline-card {
|
||||
transform: translateY(4px);
|
||||
background: rgba(255, 255, 255, 0.52);
|
||||
box-shadow: 0 10px 28px rgba(253, 189, 219, 0.22);
|
||||
}
|
||||
|
||||
.home-news .news-timeline-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.35rem 0.5rem;
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-date {
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 700;
|
||||
color: var(--news-accent-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-board {
|
||||
font-size: 0.625rem;
|
||||
font-weight: 600;
|
||||
color: var(--news-accent-text);
|
||||
background: rgba(253, 189, 219, 0.22);
|
||||
padding: 0.1rem 0.35rem;
|
||||
border-radius: 3px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-title {
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-link {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.35;
|
||||
color: #222;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-link:hover {
|
||||
color: var(--news-accent-text);
|
||||
}
|
||||
|
||||
.home-news .news-timeline-empty {
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
color: #666;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item-empty {
|
||||
flex: 1 1 100%;
|
||||
max-width: none;
|
||||
grid-template-rows: auto;
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item-empty .news-timeline-card {
|
||||
grid-row: 1;
|
||||
grid-column: 1;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-wrap::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 5%;
|
||||
right: 5%;
|
||||
top: var(--timeline-axis-offset);
|
||||
transform: translateY(-50%);
|
||||
height: 70%;
|
||||
background: radial-gradient(
|
||||
ellipse 85% 100% at 50% 50%,
|
||||
rgba(253, 189, 219, 0.18) 0%,
|
||||
transparent 72%
|
||||
);
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
/* ========== 平板(768px–1024px):横向轨道 + 卡片横滑 ========== */
|
||||
@media (max-width: 1024px) {
|
||||
.home-news .news-timeline-wrap {
|
||||
margin-top: 1.75rem;
|
||||
}
|
||||
|
||||
.home-news .news-timeline {
|
||||
min-height: 12rem;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-items {
|
||||
justify-content: flex-start;
|
||||
flex-wrap: nowrap;
|
||||
gap: 0.75rem;
|
||||
min-height: 12rem;
|
||||
overflow-x: auto;
|
||||
overflow-y: visible;
|
||||
scroll-snap-type: x proximity;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
padding: 0 0.5rem 0.5rem;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: rgba(253, 189, 219, 0.5) transparent;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-items::-webkit-scrollbar {
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-items::-webkit-scrollbar-thumb {
|
||||
background: rgba(253, 189, 219, 0.45);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item {
|
||||
flex: 0 0 auto;
|
||||
width: min(10.5rem, 38vw);
|
||||
max-width: 11rem;
|
||||
scroll-snap-align: center;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-rail {
|
||||
left: 0.75rem;
|
||||
right: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========== 手机(≤767px):竖向时间轴 ========== */
|
||||
@media (max-width: 767px) {
|
||||
.home-news .news-timeline-wrap {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-wrap::before {
|
||||
left: 50%;
|
||||
right: auto;
|
||||
top: 4%;
|
||||
bottom: 4%;
|
||||
width: min(18rem, 72%);
|
||||
height: auto;
|
||||
transform: translateX(-50%);
|
||||
background: radial-gradient(
|
||||
ellipse 70% 90% at 50% 50%,
|
||||
rgba(253, 189, 219, 0.2) 0%,
|
||||
transparent 72%
|
||||
);
|
||||
}
|
||||
|
||||
.home-news .news-timeline {
|
||||
min-height: 0;
|
||||
padding: 0.25rem 0 0.5rem;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-rail {
|
||||
left: 50%;
|
||||
right: auto;
|
||||
top: 0.35rem;
|
||||
bottom: 0.65rem;
|
||||
width: 3px;
|
||||
height: auto;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.home-news .news-timeline-line {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(253, 189, 219, 0.35) 0%,
|
||||
rgba(253, 189, 219, 0.75) 55%,
|
||||
rgba(240, 168, 196, 0.9) 100%
|
||||
);
|
||||
}
|
||||
|
||||
.home-news .news-timeline-arrow {
|
||||
left: 50%;
|
||||
right: auto;
|
||||
top: auto;
|
||||
bottom: -0.6rem;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.home-news .news-timeline-arrow .news-timeline-arrow-icon--right {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-arrow .news-timeline-arrow-icon--down {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-items {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 1.25rem;
|
||||
min-height: 0;
|
||||
padding: 0.35rem 0.5rem 1.25rem;
|
||||
overflow: visible;
|
||||
scroll-snap-type: none;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
|
||||
grid-template-rows: auto;
|
||||
column-gap: 0.55rem;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-node {
|
||||
grid-row: 1;
|
||||
grid-column: 2;
|
||||
justify-self: center;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item:nth-child(odd) .news-timeline-card {
|
||||
grid-row: 1;
|
||||
grid-column: 3;
|
||||
align-self: center;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item:nth-child(even) .news-timeline-card {
|
||||
grid-row: 1;
|
||||
grid-column: 1;
|
||||
align-self: center;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item:nth-child(odd):hover .news-timeline-card {
|
||||
transform: translateX(4px);
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item:nth-child(even):hover .news-timeline-card {
|
||||
transform: translateX(-4px);
|
||||
}
|
||||
|
||||
.home-news .news-timeline-item-empty {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-card {
|
||||
padding: 0.6rem 0.65rem;
|
||||
}
|
||||
|
||||
.home-news .news-timeline-link {
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/**
|
||||
* 首页「论坛交流」区块(共用样式见 feed_common.css,由模板单独引入)
|
||||
*/
|
||||
|
||||
/* 覆盖 index.css 的 100vh / 80vh,使 10 条帖子完整展示 */
|
||||
section.home-posts {
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.home-posts {
|
||||
padding: 20px 0 28px;
|
||||
}
|
||||
|
||||
.home-posts .section-wrap.home-posts-stage {
|
||||
display: block;
|
||||
background-color: rgba(255, 255, 255, 0.14);
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
max-height: none;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.home-posts-panel,
|
||||
#tenPostContainer {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.home-posts-title {
|
||||
margin: 0 0 1.25rem;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
color: #111;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.45);
|
||||
padding-bottom: 0.65rem;
|
||||
}
|
||||
|
||||
.home-posts-board-bar {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.home-posts-panel {
|
||||
contain: layout style;
|
||||
}
|
||||
@@ -1,349 +0,0 @@
|
||||
/* ========== 原有基础样式保留(略作优化) ========== */
|
||||
/* 公告标题样式 */
|
||||
.notice-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 1.5rem;
|
||||
color: #212529;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
|
||||
padding-bottom: 0.5rem;
|
||||
text-align: center;
|
||||
/* 新增:确保标题在小屏不溢出 */
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 公告内容article样式 - 居中显示 */
|
||||
.notice-item>article {
|
||||
text-align: center;
|
||||
padding: 1.5rem;
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 0.5rem;
|
||||
word-wrap: break-word;
|
||||
min-height: 100px;
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
margin-bottom: 0;
|
||||
box-sizing: border-box; /* 新增:内边距计入宽度 */
|
||||
}
|
||||
|
||||
/* 确保article内部HTML内容正常显示 */
|
||||
.notice-item>article * {
|
||||
text-align: center;
|
||||
margin: 0.5rem 0;
|
||||
max-width: 100%;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
/* 为article内部元素添加基础样式 */
|
||||
.notice-item>article p {
|
||||
line-height: 1.6;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.notice-item>article h1,
|
||||
.notice-item>article h2,
|
||||
.notice-item>article h3 {
|
||||
font-weight: 600;
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.notice-item>article ul,
|
||||
.notice-item>article ol {
|
||||
padding-left: 1.5rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.notice-item>article li {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
/* 公告时间样式 - 放在右下角 */
|
||||
.notice-item>.notice-create-time {
|
||||
font-size: 0.85rem;
|
||||
color: #6c757d;
|
||||
margin-bottom: 0;
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
right: 1rem;
|
||||
white-space: nowrap;
|
||||
/* 新增:小屏时调整位置,避免溢出 */
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
/* 定义外层容器样式 */
|
||||
.notice-content-container {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
/* 初始尺寸(大屏) */
|
||||
width: 60vw;
|
||||
height: 50vw;
|
||||
margin: 0;
|
||||
color: rgb(0, 0, 0);
|
||||
perspective: 1000px;
|
||||
transform-origin: center;
|
||||
/* 新增:确保容器不会溢出父元素 */
|
||||
max-width: 600px;
|
||||
max-height: 500px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 定义内容容器样式 */
|
||||
.notice-list {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transform-origin: center;
|
||||
transform-style: preserve-3d;
|
||||
transform: translateZ(-30vw) rotateY(0);
|
||||
animation: carousel 9s infinite cubic-bezier(0.77, 0, 0.175, 1) forwards;
|
||||
}
|
||||
|
||||
/* 定义项目样式 */
|
||||
.notice-item {
|
||||
position: absolute;
|
||||
/* 初始尺寸(大屏) */
|
||||
width: 60vw;
|
||||
height: 40vw;
|
||||
max-width: 380px;
|
||||
max-height: 250px;
|
||||
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 6px;
|
||||
background-size: cover;
|
||||
-webkit-box-reflect: below 25px -webkit-linear-gradient(transparent 50%, rgba(255, 255, 255, 0.3));
|
||||
/* 新增:小屏时调整倒影,避免遮挡 */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 第一个项目样式 */
|
||||
.notice-item:nth-child(1) {
|
||||
transform: rotateY(0) translateZ(35vw);
|
||||
}
|
||||
|
||||
/* 第二个项目样式 */
|
||||
.notice-item:nth-child(2) {
|
||||
transform: rotateY(120deg) translateZ(35vw);
|
||||
}
|
||||
|
||||
/* 第三个项目样式 */
|
||||
.notice-item:nth-child(3) {
|
||||
transform: rotateY(240deg) translateZ(35vw);
|
||||
}
|
||||
|
||||
/* 定义动画 */
|
||||
@keyframes carousel {
|
||||
0%,
|
||||
17.5% {
|
||||
transform: translateZ(-35vw) rotateY(0);
|
||||
}
|
||||
27.5%,
|
||||
45% {
|
||||
transform: translateZ(-35vw) rotateY(-120deg);
|
||||
}
|
||||
55%,
|
||||
72.5% {
|
||||
transform: translateZ(-35vw) rotateY(-240deg);
|
||||
}
|
||||
82.5%,
|
||||
100% {
|
||||
transform: translateZ(-35vw) rotateY(-360deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* ========== 新增响应式设计(核心) ========== */
|
||||
/* 1. 平板横向/大屏手机 (≤ 992px) */
|
||||
@media (max-width: 992px) {
|
||||
/* 调整公告容器尺寸 */
|
||||
.notice-content-container {
|
||||
width: 70vw;
|
||||
height: 60vw;
|
||||
max-width: 500px;
|
||||
max-height: 400px;
|
||||
}
|
||||
|
||||
/* 调整轮播项尺寸 */
|
||||
.notice-item {
|
||||
width: 70vw;
|
||||
height: 45vw;
|
||||
max-width: 350px;
|
||||
max-height: 220px;
|
||||
}
|
||||
|
||||
/* 调整3D平移距离,适配尺寸 */
|
||||
.notice-list {
|
||||
transform: translateZ(-35vw) rotateY(0);
|
||||
}
|
||||
.notice-item:nth-child(1),
|
||||
.notice-item:nth-child(2),
|
||||
.notice-item:nth-child(3) {
|
||||
transform: rotateY(var(--rotate-deg)) translateZ(40vw);
|
||||
}
|
||||
@keyframes carousel {
|
||||
0%, 17.5% { transform: translateZ(-40vw) rotateY(0); }
|
||||
27.5%, 45% { transform: translateZ(-40vw) rotateY(-120deg); }
|
||||
55%, 72.5% { transform: translateZ(-40vw) rotateY(-240deg); }
|
||||
82.5%, 100% { transform: translateZ(-40vw) rotateY(-360deg); }
|
||||
}
|
||||
|
||||
/* 调整标题和内容字体 */
|
||||
.notice-title {
|
||||
font-size: 1.3rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.notice-item>article {
|
||||
padding: 1.2rem;
|
||||
min-height: 80px;
|
||||
}
|
||||
.notice-item>article p {
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.notice-create-time {
|
||||
font-size: 0.8rem;
|
||||
bottom: 0.8rem;
|
||||
right: 0.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* 2. 平板竖向/中屏手机 (≤ 768px) */
|
||||
@media (max-width: 768px) {
|
||||
/* 进一步调整容器尺寸 */
|
||||
.notice-content-container {
|
||||
width: 80vw;
|
||||
height: 70vw;
|
||||
max-width: 400px;
|
||||
max-height: 350px;
|
||||
/* 小屏时微调定位,避免偏上 */
|
||||
top: 55%;
|
||||
}
|
||||
|
||||
/* 调整轮播项尺寸 */
|
||||
.notice-item {
|
||||
width: 80vw;
|
||||
height: 50vw;
|
||||
max-width: 320px;
|
||||
max-height: 200px;
|
||||
/* 减小阴影,适配小屏 */
|
||||
box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
|
||||
/* 减小倒影高度,避免遮挡 */
|
||||
-webkit-box-reflect: below 15px -webkit-linear-gradient(transparent 60%, rgba(255, 255, 255, 0.2));
|
||||
}
|
||||
|
||||
/* 调整3D平移距离 */
|
||||
.notice-list {
|
||||
transform: translateZ(-40vw) rotateY(0);
|
||||
}
|
||||
.notice-item:nth-child(1),
|
||||
.notice-item:nth-child(2),
|
||||
.notice-item:nth-child(3) {
|
||||
transform: rotateY(var(--rotate-deg)) translateZ(45vw);
|
||||
}
|
||||
@keyframes carousel {
|
||||
0%, 17.5% { transform: translateZ(-45vw) rotateY(0); }
|
||||
27.5%, 45% { transform: translateZ(-45vw) rotateY(-120deg); }
|
||||
55%, 72.5% { transform: translateZ(-45vw) rotateY(-240deg); }
|
||||
82.5%, 100% { transform: translateZ(-45vw) rotateY(-360deg); }
|
||||
}
|
||||
|
||||
/* 调整文字样式 */
|
||||
.notice-title {
|
||||
font-size: 1.2rem;
|
||||
padding-bottom: 0.4rem;
|
||||
}
|
||||
.notice-item>article {
|
||||
padding: 1rem;
|
||||
min-height: 70px;
|
||||
}
|
||||
.notice-item>article h1,
|
||||
.notice-item>article h2,
|
||||
.notice-item>article h3 {
|
||||
font-size: 1.1rem;
|
||||
margin-top: 0.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* 3. 小屏手机 (≤ 576px) */
|
||||
@media (max-width: 576px) {
|
||||
/* 极致适配小屏 */
|
||||
.notice-content-container {
|
||||
width: 90vw;
|
||||
height: 80vw;
|
||||
max-width: 350px;
|
||||
max-height: 300px;
|
||||
top: 55%;
|
||||
/* 减小透视距离,避免轮播项超出屏幕 */
|
||||
perspective: 800px;
|
||||
}
|
||||
|
||||
/* 轮播项适配 */
|
||||
.notice-item {
|
||||
width: 90vw;
|
||||
height: 55vw;
|
||||
max-width: 300px;
|
||||
max-height: 180px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
|
||||
-webkit-box-reflect: below 10px -webkit-linear-gradient(transparent 70%, rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
|
||||
/* 调整3D平移距离(关键:避免轮播项出屏) */
|
||||
.notice-list {
|
||||
transform: translateZ(-45vw) rotateY(0);
|
||||
}
|
||||
.notice-item:nth-child(1) {
|
||||
transform: rotateY(0) translateZ(50vw);
|
||||
}
|
||||
.notice-item:nth-child(2) {
|
||||
transform: rotateY(120deg) translateZ(50vw);
|
||||
}
|
||||
.notice-item:nth-child(3) {
|
||||
transform: rotateY(240deg) translateZ(50vw);
|
||||
}
|
||||
@keyframes carousel {
|
||||
0%, 17.5% { transform: translateZ(-50vw) rotateY(0); }
|
||||
27.5%, 45% { transform: translateZ(-50vw) rotateY(-120deg); }
|
||||
55%, 72.5% { transform: translateZ(-50vw) rotateY(-240deg); }
|
||||
82.5%, 100% { transform: translateZ(-50vw) rotateY(-360deg); }
|
||||
}
|
||||
|
||||
/* 文字极致适配 */
|
||||
.notice-title {
|
||||
font-size: 1.1rem;
|
||||
margin-bottom: 0.8rem;
|
||||
}
|
||||
.notice-item>article {
|
||||
padding: 0.8rem;
|
||||
min-height: 60px;
|
||||
border-radius: 0.3rem;
|
||||
}
|
||||
.notice-item>article p {
|
||||
font-size: 0.85rem;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 0.8rem;
|
||||
}
|
||||
.notice-create-time {
|
||||
font-size: 0.75rem;
|
||||
bottom: 0.5rem;
|
||||
right: 0.5rem;
|
||||
/* 小屏时背景半透,避免文字看不清 */
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
padding: 0.2rem 0.4rem;
|
||||
border-radius: 0.2rem;
|
||||
}
|
||||
/* 隐藏过长的列表项符号,避免溢出 */
|
||||
.notice-item>article ul,
|
||||
.notice-item>article ol {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* 补充:修复CSS变量(可选,增强兼容性) */
|
||||
.notice-item:nth-child(1) { --rotate-deg: 0deg; }
|
||||
.notice-item:nth-child(2) { --rotate-deg: 120deg; }
|
||||
.notice-item:nth-child(3) { --rotate-deg: 240deg; }
|
||||
@@ -1,128 +0,0 @@
|
||||
/* 登录 / 注册页:在 anlian_forms.css 之上的薄封装 */
|
||||
|
||||
.page-title {
|
||||
margin: 0 0 1.25rem;
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
color: var(--anlian-text, #222);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
width: 100%;
|
||||
max-width: 440px;
|
||||
}
|
||||
|
||||
.text-center.text-muted,
|
||||
.anlian-page-lead {
|
||||
margin: -0.25rem 0 1.25rem;
|
||||
font-size: 0.9rem;
|
||||
color: var(--anlian-text-muted, #666);
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.mb-3 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
/* 注册页旧类名兼容 */
|
||||
.auth-code-row,
|
||||
.anlian-code-row {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.auth-code-row .form-control,
|
||||
.anlian-code-row input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.btn-send-code,
|
||||
.anlian-btn-send-code {
|
||||
flex-shrink: 0;
|
||||
align-self: stretch;
|
||||
padding: 0 1rem;
|
||||
border: 1px solid rgba(253, 189, 219, 0.5);
|
||||
border-radius: 12px;
|
||||
background: rgba(253, 189, 219, 0.32);
|
||||
color: var(--anlian-accent-text, #a85878);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
.btn-send-code:hover:not(:disabled),
|
||||
.anlian-btn-send-code:hover:not(:disabled) {
|
||||
background: rgba(253, 189, 219, 0.48);
|
||||
}
|
||||
|
||||
.btn-send-code:disabled,
|
||||
.anlian-btn-send-code:disabled {
|
||||
opacity: 0.55;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.field-hint,
|
||||
.anlian-field-hint {
|
||||
display: block;
|
||||
margin-top: 0.35rem;
|
||||
font-size: 0.75rem;
|
||||
color: var(--anlian-text-muted, #666);
|
||||
}
|
||||
|
||||
.field-error,
|
||||
.anlian-field-error {
|
||||
display: block;
|
||||
margin-top: 0.35rem;
|
||||
font-size: 0.8125rem;
|
||||
color: #b33a4d;
|
||||
}
|
||||
|
||||
.alert-danger,
|
||||
.anlian-alert-danger {
|
||||
padding: 0.85rem 1rem;
|
||||
margin-bottom: 1rem;
|
||||
border-radius: 12px;
|
||||
font-size: 0.875rem;
|
||||
background: rgba(220, 80, 100, 0.12);
|
||||
border: 1px solid rgba(220, 80, 100, 0.28);
|
||||
color: #9e3a4a;
|
||||
}
|
||||
|
||||
.form-links,
|
||||
.anlian-form-links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 1rem;
|
||||
margin-top: 1.25rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.form-links a,
|
||||
.anlian-form-links a {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--anlian-accent-text, #a85878);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.form-links a:hover,
|
||||
.anlian-form-links a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.auth-code-row {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.btn-send-code {
|
||||
width: 100%;
|
||||
padding: 0.65rem;
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
/**
|
||||
* 导航栏搜索框 — 粉色主题
|
||||
*/
|
||||
|
||||
.navbar-search {
|
||||
gap: 0.45rem;
|
||||
align-items: stretch;
|
||||
flex-shrink: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.navbar-search .form-control {
|
||||
min-width: 8.5rem;
|
||||
max-width: 11.5rem;
|
||||
padding: 0.45rem 0.85rem;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.35;
|
||||
color: #f5f5f5;
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
border: 1px solid rgba(253, 189, 219, 0.45);
|
||||
border-radius: 999px;
|
||||
transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.navbar-search .form-control::placeholder {
|
||||
color: rgba(255, 255, 255, 0.55);
|
||||
}
|
||||
|
||||
.navbar-search .form-control:focus {
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, 0.22);
|
||||
border-color: rgba(253, 189, 219, 0.75);
|
||||
box-shadow: 0 0 0 2px rgba(253, 189, 219, 0.28);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.navbar-search .btn-search-submit {
|
||||
flex-shrink: 0;
|
||||
padding: 0.45rem 0.95rem;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.35;
|
||||
color: #a85878;
|
||||
white-space: nowrap;
|
||||
background: linear-gradient(135deg, rgba(253, 189, 219, 0.92), rgba(240, 168, 196, 0.95));
|
||||
border: 1px solid rgba(255, 255, 255, 0.35);
|
||||
border-radius: 999px;
|
||||
transition: box-shadow 0.2s ease, transform 0.2s ease, filter 0.2s ease;
|
||||
}
|
||||
|
||||
.navbar-search .btn-search-submit:hover {
|
||||
color: #8a4560;
|
||||
background: linear-gradient(135deg, rgba(253, 189, 219, 1), rgba(240, 168, 196, 1));
|
||||
border-color: rgba(255, 255, 255, 0.5);
|
||||
box-shadow: 0 3px 14px rgba(253, 189, 219, 0.35);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
.navbar-search {
|
||||
width: 100%;
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
|
||||
.navbar-search .form-control {
|
||||
flex: 1;
|
||||
max-width: none;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.navbar-search .btn-search-submit {
|
||||
padding: 0.45rem 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.navbar-search .btn-search-submit {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
@@ -1,289 +0,0 @@
|
||||
/*
|
||||
* @File: post_detail.css
|
||||
* @Description: 帖子详情页专用样式文件,实现了内容的清晰排版、评论区美化及响应式适配。
|
||||
* @Author: Your Name
|
||||
* @Date: 2023-10-27
|
||||
*/
|
||||
|
||||
:root {
|
||||
--bs-heading-color: #1a1a1a;
|
||||
--post-detail-sidebar-break: 1200px;
|
||||
}
|
||||
|
||||
/* 宽屏:左作者卡片 + 居中正文(右侧留空平衡) */
|
||||
body.page-post-detail .main-container {
|
||||
max-width: none;
|
||||
width: 100%;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.post-detail-shell {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr min(900px, 100%) 1fr;
|
||||
align-items: start;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.post-detail-aside {
|
||||
grid-column: 1;
|
||||
justify-self: end;
|
||||
width: min(268px, 100%);
|
||||
margin-top: 2rem;
|
||||
padding-right: 1.5rem;
|
||||
position: sticky;
|
||||
top: 1.25rem;
|
||||
}
|
||||
|
||||
/* 作者卡片:玻璃质感 + 纵向对齐,hover 仅上浮不做倾斜 */
|
||||
.post-author-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 0.7rem;
|
||||
width: 100%;
|
||||
padding: 1.35rem 1.15rem 1.2rem;
|
||||
border-radius: 20px;
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.75);
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.75);
|
||||
box-shadow: 0 22px 42px rgba(0, 0, 0, 0.07);
|
||||
font-family: 'Poppins', sans-serif;
|
||||
transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
|
||||
box-shadow 0.45s ease,
|
||||
background 0.35s ease;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.post-author-card__quote {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border-radius: 10px;
|
||||
background: rgba(255, 255, 255, 0.1) url(https://s3.cflmy.cn/cflmy/left-quote.png) center / 40px no-repeat;
|
||||
border: 1px solid rgba(255, 255, 255, 0.45);
|
||||
opacity: 0;
|
||||
transition: opacity 0.4s ease;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.post-author-card__avatar {
|
||||
align-self: center;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 9px;
|
||||
border-radius: 14px;
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
backdrop-filter: blur(6px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.55);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.75);
|
||||
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
|
||||
transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
|
||||
box-shadow 0.45s ease;
|
||||
}
|
||||
|
||||
.post-author-card__avatar--link {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.post-author-card__avatar--link:focus-visible {
|
||||
outline: 2px solid rgba(168, 88, 120, 0.75);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
.post-author-card__avatar img {
|
||||
display: block;
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
border-radius: 10px;
|
||||
object-fit: cover;
|
||||
border: 1px solid rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
|
||||
.post-author-card__name {
|
||||
margin: 0;
|
||||
padding: 0.15rem 0.25rem 0;
|
||||
text-align: center;
|
||||
font-size: 1.05rem;
|
||||
font-weight: 600;
|
||||
color: #644651;
|
||||
word-break: break-word;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.post-author-card__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 0.25rem 0.15rem;
|
||||
text-align: center;
|
||||
transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
|
||||
}
|
||||
|
||||
.post-author-card__signature {
|
||||
margin: 0;
|
||||
color: #644651;
|
||||
font-size: 0.82rem;
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
.post-author-card__signature--empty {
|
||||
color: #9a8490;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.post-author-card:hover {
|
||||
transform: translateY(-7px);
|
||||
background: rgba(255, 255, 255, 0.16);
|
||||
box-shadow: 0 30px 52px rgba(0, 0, 0, 0.11);
|
||||
}
|
||||
|
||||
.post-author-card:hover .post-author-card__quote {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.post-author-card:hover .post-author-card__avatar {
|
||||
transform: translateY(-5px) scale(1.03);
|
||||
box-shadow: 0 18px 34px rgba(0, 0, 0, 0.11);
|
||||
}
|
||||
|
||||
.post-author-card:hover .post-author-card__name {
|
||||
color: #4a3340;
|
||||
}
|
||||
|
||||
.post-author-card:hover .post-author-card__body {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.post-author-card:hover .post-author-card__signature {
|
||||
color: #4a3340;
|
||||
}
|
||||
|
||||
/* --- 1. 页面布局与容器样式 --- */
|
||||
.main-container {
|
||||
width: 100%;
|
||||
max-width: 900px;
|
||||
margin: 2rem auto;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
body.page-post-detail .main-container {
|
||||
margin-top: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.post-detail {
|
||||
grid-column: 2;
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
backdrop-filter: blur(24px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.1);
|
||||
border-radius: 30px;
|
||||
padding: 50px 100px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
/* --- 2. 帖子头部元信息(非主体)样式 --- */
|
||||
.post-detail h2 {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: #212529; /* 标题偏深但非纯黑,低于主体优先级 */
|
||||
margin-bottom: 1.5rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* 详情页顶栏元信息(仅直接子级 p,勿用 :first-of-type,否则会误伤 article) */
|
||||
.post-detail > p.post-content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem 1.5rem;
|
||||
font-size: 0.9rem;
|
||||
margin-bottom: 2rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.post-author-profile a {
|
||||
color: #a85878;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.post-author-profile a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* --- 3. 帖子/新闻正文卡片 --- */
|
||||
article.anlian-rich-content,
|
||||
article.post-content.anlian-rich-content,
|
||||
article.news-content.anlian-rich-content {
|
||||
display: block;
|
||||
margin-bottom: 3rem;
|
||||
background-color: rgba(255, 255, 255, 0.45);
|
||||
padding: 2.2rem;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
/* 主体内图片样式见 rich_content.css */
|
||||
|
||||
/* 评论表单由 anlian_forms.css 统一;此处仅保留错误列表 */
|
||||
.post-detail .error-messages {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 0 1rem;
|
||||
color: #b33a4d;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.post-detail .text-muted a {
|
||||
color: #a85878;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.post-detail .anlian-comment-form {
|
||||
margin-bottom: 1.75rem;
|
||||
}
|
||||
|
||||
/* --- 5. 响应式适配:主体字号同步调整,保持区分度 --- */
|
||||
@media (max-width: 1199.98px) {
|
||||
.post-detail-aside {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.post-detail-shell {
|
||||
display: block;
|
||||
}
|
||||
|
||||
body.page-post-detail .main-container {
|
||||
max-width: 900px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.main-container {
|
||||
margin: 1rem auto;
|
||||
}
|
||||
.post-detail {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.post-detail h2 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
|
||||
/* 移动端正文卡片 */
|
||||
article.anlian-rich-content,
|
||||
article.post-content.anlian-rich-content {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
/* 发帖 / 发新闻编辑页 */
|
||||
|
||||
.anlian-publish-page {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 1.5rem 1rem 2.5rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.anlian-publish-page .anlian-page-title {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.anlian-publish-page .anlian-form-card {
|
||||
padding: 2rem 1.75rem;
|
||||
}
|
||||
|
||||
.anlian-publish-page .anlian-editor-wrap {
|
||||
margin-top: 0.25rem;
|
||||
min-height: 360px;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.anlian-publish-page .anlian-form-card {
|
||||
padding: 1.35rem 1.15rem;
|
||||
}
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
/**
|
||||
* 富文本正文 — 编辑器与详情页共用,保证 Enter 换行所见即所得
|
||||
*/
|
||||
|
||||
:root {
|
||||
--anlian-rich-font-size: 1.2rem;
|
||||
--anlian-rich-line-height: 1.85;
|
||||
--anlian-rich-color: #000;
|
||||
--anlian-rich-weight: 450;
|
||||
/* Enter 新段落:约半行间距,接近自然换行 */
|
||||
--anlian-rich-p-gap: 0.28em;
|
||||
/* 空行(<p><br></p>):略大于段内换行 */
|
||||
--anlian-rich-blank-gap: 0.55em;
|
||||
}
|
||||
|
||||
/* 详情页正文 + wangEditor 编辑区 */
|
||||
.anlian-rich-content,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text {
|
||||
display: block;
|
||||
font-size: var(--anlian-rich-font-size) !important;
|
||||
line-height: var(--anlian-rich-line-height) !important;
|
||||
color: var(--anlian-rich-color) !important;
|
||||
font-weight: var(--anlian-rich-weight);
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.anlian-rich-content p,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text p {
|
||||
display: block;
|
||||
margin: 0 0 var(--anlian-rich-p-gap);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.anlian-rich-content p:last-child,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* 连按 Enter 产生的空行 */
|
||||
.anlian-rich-content p:empty,
|
||||
.anlian-rich-content p:has(> br:only-child),
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text p:empty,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text p:has(> br:only-child) {
|
||||
margin: 0 0 var(--anlian-rich-blank-gap);
|
||||
min-height: var(--anlian-rich-blank-gap);
|
||||
line-height: var(--anlian-rich-blank-gap);
|
||||
}
|
||||
|
||||
.anlian-rich-content h1,
|
||||
.anlian-rich-content h2,
|
||||
.anlian-rich-content h3,
|
||||
.anlian-rich-content h4,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text h1,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text h2,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text h3,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text h4 {
|
||||
display: block;
|
||||
margin: 0.75em 0 0.35em;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
color: var(--anlian-rich-color);
|
||||
}
|
||||
|
||||
.anlian-rich-content h1:first-child,
|
||||
.anlian-rich-content h2:first-child,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text h1:first-child,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text h2:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.anlian-rich-content a,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text a {
|
||||
color: #a85878;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.anlian-rich-content blockquote,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text blockquote {
|
||||
margin: 0.5em 0;
|
||||
padding: 0.35em 0 0.35em 1em;
|
||||
border-left: 3px solid rgba(253, 189, 219, 0.85);
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.anlian-rich-content ul,
|
||||
.anlian-rich-content ol,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text ul,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text ol {
|
||||
margin: 0.35em 0;
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
|
||||
.anlian-rich-content li,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text li {
|
||||
margin: 0.15em 0;
|
||||
}
|
||||
|
||||
.anlian-rich-content img,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text img {
|
||||
max-width: 80%;
|
||||
max-height: 600px;
|
||||
height: auto;
|
||||
display: block;
|
||||
margin: 1em auto;
|
||||
border-radius: 0.8rem;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 编辑区内边距,接近详情页正文卡片 */
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text {
|
||||
padding: 1.25rem 1.5rem !important;
|
||||
min-height: 280px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
:root {
|
||||
--anlian-rich-font-size: 1.15rem;
|
||||
}
|
||||
|
||||
.anlian-rich-content img,
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text img {
|
||||
max-width: 95%;
|
||||
}
|
||||
|
||||
.anlian-editor-wrap .w-e-text-container .w-e-text {
|
||||
padding: 1rem 1.1rem !important;
|
||||
min-height: 240px;
|
||||
}
|
||||
}
|
||||
@@ -1,363 +0,0 @@
|
||||
/**
|
||||
* 全站搜索页 — 粉色毛玻璃主题(与 anlian_forms / feed 一致)
|
||||
*/
|
||||
|
||||
.search-page {
|
||||
--search-accent: #fdbbdb;
|
||||
--search-accent-deep: #f0a8c4;
|
||||
--search-accent-text: #a85878;
|
||||
--search-muted: #888;
|
||||
--search-radius: 18px;
|
||||
--search-glass: rgba(255, 255, 255, 0.42);
|
||||
--search-ring: rgba(253, 189, 219, 0.48);
|
||||
|
||||
width: min(100% - 2rem, 920px);
|
||||
margin: 0 auto;
|
||||
padding: 1.25rem 0 2.5rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* —— 顶部搜索框(页内) —— */
|
||||
.search-header {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
padding: 1.35rem 1.5rem;
|
||||
margin-bottom: 1rem;
|
||||
border-radius: var(--search-radius);
|
||||
background: transparent;
|
||||
border: none;
|
||||
box-shadow: 0 8px 28px rgba(253, 189, 219, 0.12);
|
||||
}
|
||||
|
||||
.search-header::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
border-radius: inherit;
|
||||
background: var(--search-glass);
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
.search-header::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
border-radius: inherit;
|
||||
box-shadow: inset 0 0 0 1px var(--search-ring);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.search-header > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.search-title {
|
||||
margin: 0 0 1rem;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--search-accent-text);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
display: flex;
|
||||
gap: 0.55rem;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 0.72rem 1rem;
|
||||
font-size: 1rem;
|
||||
border: 1px solid rgba(253, 189, 219, 0.45);
|
||||
border-radius: 12px;
|
||||
background: rgba(255, 255, 255, 0.58);
|
||||
color: #222;
|
||||
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.search-input::placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.search-input:focus {
|
||||
outline: none;
|
||||
border-color: var(--search-accent-deep);
|
||||
box-shadow: 0 0 0 3px rgba(253, 189, 219, 0.28);
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
}
|
||||
|
||||
.search-submit {
|
||||
flex-shrink: 0;
|
||||
padding: 0 1.4rem;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
color: var(--search-accent-text);
|
||||
background: linear-gradient(135deg, rgba(253, 189, 219, 0.58), rgba(240, 168, 196, 0.68));
|
||||
border: 1px solid rgba(240, 168, 196, 0.75);
|
||||
border-radius: 999px;
|
||||
cursor: pointer;
|
||||
transition: box-shadow 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.search-submit:hover {
|
||||
box-shadow: 0 5px 18px rgba(253, 189, 219, 0.32);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* —— 结果总栏(含「共找到」) —— */
|
||||
.search-panel {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
padding: 1.25rem 1.35rem 1.35rem;
|
||||
border-radius: var(--search-radius);
|
||||
background: transparent;
|
||||
box-shadow: 0 6px 26px rgba(253, 189, 219, 0.1);
|
||||
}
|
||||
|
||||
.search-panel::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
border-radius: inherit;
|
||||
background: var(--search-glass);
|
||||
backdrop-filter: blur(14px);
|
||||
-webkit-backdrop-filter: blur(14px);
|
||||
}
|
||||
|
||||
.search-panel::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
border-radius: inherit;
|
||||
box-shadow: inset 0 0 0 1px var(--search-ring);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.search-panel > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.search-panel--message {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.search-panel__head {
|
||||
margin-bottom: 1.15rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid rgba(253, 189, 219, 0.35);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.search-panel__title {
|
||||
margin: 0 0 0.5rem;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 700;
|
||||
color: var(--search-accent-text);
|
||||
}
|
||||
|
||||
.search-summary {
|
||||
margin: 0;
|
||||
font-size: 0.9375rem;
|
||||
color: #444;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.search-summary strong {
|
||||
color: var(--search-accent-text);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.search-sort-hint {
|
||||
margin: 0.45rem 0 0;
|
||||
font-size: 0.75rem;
|
||||
color: var(--search-muted);
|
||||
}
|
||||
|
||||
.search-hint,
|
||||
.search-empty {
|
||||
margin: 0;
|
||||
font-size: 0.9375rem;
|
||||
color: var(--search-muted);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* —— 分类区块 —— */
|
||||
.search-block {
|
||||
margin-top: 1.15rem;
|
||||
padding-top: 1rem;
|
||||
border-top: 1px dashed rgba(253, 189, 219, 0.35);
|
||||
}
|
||||
|
||||
.search-block:first-of-type {
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.search-block__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 0.85rem;
|
||||
}
|
||||
|
||||
.search-block__title {
|
||||
margin: 0;
|
||||
font-size: 1.05rem;
|
||||
font-weight: 700;
|
||||
color: var(--search-accent-text);
|
||||
}
|
||||
|
||||
.search-block__badge {
|
||||
flex-shrink: 0;
|
||||
padding: 0.2rem 0.65rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--search-accent-text);
|
||||
background: rgba(253, 189, 219, 0.32);
|
||||
border: 1px solid rgba(253, 189, 219, 0.45);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.search-result-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.65rem;
|
||||
}
|
||||
|
||||
/* —— 单条结果卡片(边框区分) —— */
|
||||
.search-card {
|
||||
padding: 0.9rem 1rem;
|
||||
border-radius: 14px;
|
||||
background: rgba(255, 255, 255, 0.48);
|
||||
border: 1px solid rgba(253, 189, 219, 0.42);
|
||||
box-shadow: 0 2px 12px rgba(253, 189, 219, 0.08);
|
||||
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.search-card:hover {
|
||||
border-color: rgba(240, 168, 196, 0.65);
|
||||
box-shadow: 0 6px 20px rgba(253, 189, 219, 0.16);
|
||||
}
|
||||
|
||||
.search-card--user {
|
||||
padding: 0.75rem 1rem;
|
||||
}
|
||||
|
||||
.search-card__title {
|
||||
display: block;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: #222;
|
||||
text-decoration: none;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.search-card__title:hover {
|
||||
color: var(--search-accent-text);
|
||||
}
|
||||
|
||||
.search-card__meta {
|
||||
margin: 0.35rem 0 0;
|
||||
font-size: 0.78rem;
|
||||
color: var(--search-muted);
|
||||
}
|
||||
|
||||
.search-card__snippet {
|
||||
margin: 0.45rem 0 0;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.55;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.search-block__footer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.search-action-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 2.5rem;
|
||||
padding: 0.5rem 1.35rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--search-accent-text);
|
||||
text-decoration: none;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(240, 168, 196, 0.65);
|
||||
background: linear-gradient(135deg, rgba(253, 189, 219, 0.45), rgba(240, 168, 196, 0.52));
|
||||
box-shadow: 0 3px 12px rgba(253, 189, 219, 0.18);
|
||||
transition: box-shadow 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.search-action-btn:hover {
|
||||
text-decoration: none;
|
||||
color: var(--search-accent-text);
|
||||
box-shadow: 0 5px 18px rgba(253, 189, 219, 0.28);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* —— 分页 —— */
|
||||
.search-pagination {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.search-pagination .page-link {
|
||||
color: var(--search-accent-text);
|
||||
background: rgba(255, 255, 255, 0.45);
|
||||
border: 1px solid rgba(253, 189, 219, 0.4);
|
||||
border-radius: 8px;
|
||||
margin: 0.15rem;
|
||||
}
|
||||
|
||||
.search-pagination .page-link:hover {
|
||||
background: rgba(253, 189, 219, 0.35);
|
||||
color: var(--search-accent-text);
|
||||
}
|
||||
|
||||
.search-pagination .page-item.active .page-link {
|
||||
background: rgba(253, 189, 219, 0.55);
|
||||
border-color: rgba(240, 168, 196, 0.6);
|
||||
color: var(--search-accent-text);
|
||||
}
|
||||
|
||||
.search-pagination .page-item.disabled .page-link {
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.search-page {
|
||||
width: min(100% - 1rem, 920px);
|
||||
}
|
||||
|
||||
.search-form {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.search-submit {
|
||||
width: 100%;
|
||||
padding: 0.68rem;
|
||||
}
|
||||
|
||||
.search-block__head {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
@@ -1,215 +0,0 @@
|
||||
/**
|
||||
* 专题书架 — 书本式卡片
|
||||
*/
|
||||
|
||||
.topic-shelf-page .topic-shelf-header {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.topic-shelf-lead {
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
font-size: 0.95rem;
|
||||
color: rgba(17, 17, 17, 0.75);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.topic-book-grid {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
|
||||
gap: 2.25rem 1.75rem;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.topic-book-item {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.topic-book {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
transition: transform 0.35s ease;
|
||||
}
|
||||
|
||||
.topic-book:hover,
|
||||
.topic-book:focus-visible {
|
||||
transform: translateY(-6px);
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.topic-book__volume {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
width: 12.5rem;
|
||||
height: 17.5rem;
|
||||
margin-bottom: 1.1rem;
|
||||
perspective: 900px;
|
||||
filter: drop-shadow(0 14px 28px rgba(61, 32, 64, 0.35));
|
||||
}
|
||||
|
||||
.topic-book__spine {
|
||||
width: 1.65rem;
|
||||
flex-shrink: 0;
|
||||
background: linear-gradient(180deg, #5c2d4a 0%, #3d2040 55%, #2a1528 100%);
|
||||
border-radius: 4px 0 0 4px;
|
||||
box-shadow: inset -2px 0 6px rgba(0, 0, 0, 0.25);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.65rem 0.15rem;
|
||||
}
|
||||
|
||||
/* 书脊竖排:汉字正向自上而下(勿 rotate 180°) */
|
||||
.topic-book__spine-title {
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: upright;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.12em;
|
||||
color: rgba(255, 232, 245, 0.92);
|
||||
line-height: 1.45;
|
||||
max-height: 14rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.topic-book__cover {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
border-radius: 0 6px 6px 0;
|
||||
background: #2a1528;
|
||||
transform-origin: left center;
|
||||
transition: transform 0.4s ease;
|
||||
}
|
||||
|
||||
.topic-book:hover .topic-book__cover {
|
||||
transform: rotateY(-8deg);
|
||||
}
|
||||
|
||||
.topic-book__cover img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.topic-book__shine {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(
|
||||
125deg,
|
||||
rgba(255, 255, 255, 0.28) 0%,
|
||||
transparent 42%,
|
||||
transparent 58%,
|
||||
rgba(253, 189, 219, 0.12) 100%
|
||||
);
|
||||
}
|
||||
|
||||
.topic-book__info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
width: 14rem;
|
||||
min-height: 10.5rem;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.topic-book__title {
|
||||
margin: 0 0 0.5rem;
|
||||
min-height: 2.85rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1.05rem;
|
||||
font-weight: 600;
|
||||
color: #1a1020;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.topic-book__summary {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
min-height: 3.9rem;
|
||||
margin: 0 0 0.75rem;
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.55;
|
||||
color: rgba(26, 16, 32, 0.72);
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.topic-book__summary:empty::before {
|
||||
content: '\00a0';
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.topic-book__cta {
|
||||
display: inline-block;
|
||||
margin-top: auto;
|
||||
flex-shrink: 0;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.04em;
|
||||
color: #6b3458;
|
||||
padding: 0.28rem 0.85rem;
|
||||
border-radius: 999px;
|
||||
background: rgba(253, 189, 219, 0.35);
|
||||
border: 1px solid rgba(253, 189, 219, 0.55);
|
||||
transition: background 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.topic-book:hover .topic-book__cta {
|
||||
background: rgba(253, 189, 219, 0.55);
|
||||
box-shadow: 0 4px 12px rgba(253, 189, 219, 0.3);
|
||||
}
|
||||
|
||||
.topic-shelf-empty {
|
||||
text-align: center;
|
||||
padding: 3rem 1rem;
|
||||
color: rgba(17, 17, 17, 0.65);
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.topic-book-grid {
|
||||
grid-template-columns: 1fr;
|
||||
justify-items: center;
|
||||
}
|
||||
|
||||
.topic-book__volume {
|
||||
width: 11rem;
|
||||
height: 15.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.topic-book,
|
||||
.topic-book__cover {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.topic-book:hover,
|
||||
.topic-book:focus-visible {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.topic-book:hover .topic-book__cover {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 436 B |
|
Before Width: | Height: | Size: 631 B |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 436 B |
@@ -1,101 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" width="64" height="64" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges">
|
||||
<rect x="16" y="16" width="32" height="1" fill="#000000"/>
|
||||
<rect x="16" y="17" width="32" height="1" fill="#000000"/>
|
||||
<rect x="16" y="18" width="32" height="1" fill="#000000"/>
|
||||
<rect x="16" y="19" width="3" height="1" fill="#000000"/>
|
||||
<rect x="16" y="20" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="20" width="11" height="1" fill="#000000"/>
|
||||
<rect x="33" y="20" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="21" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="21" width="11" height="1" fill="#000000"/>
|
||||
<rect x="33" y="21" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="22" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="22" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="22" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="23" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="23" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="23" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="24" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="24" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="24" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="25" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="25" width="9" height="1" fill="#000000"/>
|
||||
<rect x="33" y="25" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="26" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="26" width="9" height="1" fill="#000000"/>
|
||||
<rect x="33" y="26" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="27" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="27" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="27" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="28" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="28" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="28" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="29" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="29" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="29" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="30" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="30" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="30" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="31" width="3" height="1" fill="#000000"/>
|
||||
<rect x="16" y="32" width="3" height="1" fill="#000000"/>
|
||||
<rect x="16" y="33" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="33" width="11" height="1" fill="#000000"/>
|
||||
<rect x="33" y="33" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="33" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="34" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="34" width="11" height="1" fill="#000000"/>
|
||||
<rect x="33" y="34" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="34" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="35" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="35" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="35" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="35" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="35" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="35" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="36" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="36" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="36" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="36" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="36" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="36" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="37" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="37" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="37" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="37" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="37" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="38" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="38" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="38" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="38" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="38" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="39" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="39" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="39" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="39" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="39" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="40" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="40" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="40" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="40" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="40" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="41" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="41" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="41" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="41" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="41" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="42" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="42" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="42" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="42" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="42" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="43" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="43" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="43" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="43" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="43" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="44" width="3" height="1" fill="#000000"/>
|
||||
<rect x="16" y="45" width="32" height="1" fill="#000000"/>
|
||||
<rect x="16" y="46" width="32" height="1" fill="#000000"/>
|
||||
<rect x="16" y="47" width="32" height="1" fill="#000000"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 19 KiB |
@@ -1,117 +0,0 @@
|
||||
/**
|
||||
* 列表页局部刷新:板块切换与分页,无全页重载、无加载动画。
|
||||
*/
|
||||
(function () {
|
||||
const AJAX_HEADERS = { 'X-Requested-With': 'XMLHttpRequest' };
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
initFeedListPartial();
|
||||
initCommentListPartial();
|
||||
});
|
||||
|
||||
function initFeedListPartial() {
|
||||
const page = document.querySelector('.feed-list-page[data-partial-feed]');
|
||||
if (!page) return;
|
||||
|
||||
page.addEventListener('click', function (event) {
|
||||
const tab = event.target.closest('.feed-tab');
|
||||
const pageLink = event.target.closest('.feed-pagination .page-link[href]');
|
||||
const link = tab || pageLink;
|
||||
if (!link || link.classList.contains('disabled')) return;
|
||||
event.preventDefault();
|
||||
loadFeedPartial(page, link.href);
|
||||
});
|
||||
}
|
||||
|
||||
async function loadFeedPartial(page, url) {
|
||||
const body = page.querySelector('.feed-list-body');
|
||||
if (!body) return;
|
||||
|
||||
try {
|
||||
const response = await fetch(url, { headers: AJAX_HEADERS });
|
||||
if (!response.ok) throw new Error(String(response.status));
|
||||
const html = await response.text();
|
||||
const doc = new DOMParser().parseFromString(html, 'text/html');
|
||||
const newBody = doc.querySelector('.feed-list-body');
|
||||
const newPagination = doc.querySelector('.feed-pagination');
|
||||
if (newBody) body.innerHTML = newBody.innerHTML;
|
||||
|
||||
let pagination = page.querySelector('.feed-pagination');
|
||||
if (newPagination) {
|
||||
if (pagination) {
|
||||
pagination.replaceWith(newPagination);
|
||||
} else {
|
||||
body.insertAdjacentElement('afterend', newPagination);
|
||||
}
|
||||
pagination = newPagination;
|
||||
} else if (pagination) {
|
||||
pagination.remove();
|
||||
}
|
||||
|
||||
syncFeedTabsFromUrl(page, url);
|
||||
history.pushState(null, '', url);
|
||||
page.scrollIntoView({ block: 'nearest', behavior: 'instant' in window ? 'instant' : 'auto' });
|
||||
} catch (err) {
|
||||
console.error('列表局部刷新失败', err);
|
||||
}
|
||||
}
|
||||
|
||||
function syncFeedTabsFromUrl(page, url) {
|
||||
const parsed = new URL(url, window.location.origin);
|
||||
const boardId = parsed.searchParams.get('board_id')
|
||||
|| parsed.searchParams.get('news_board_id')
|
||||
|| '';
|
||||
const param = parsed.searchParams.has('news_board_id') ? 'news_board_id' : 'board_id';
|
||||
|
||||
page.querySelectorAll('.feed-tab').forEach((tab) => {
|
||||
const tabUrl = new URL(tab.href, window.location.origin);
|
||||
const tabBoard = tabUrl.searchParams.get(param) || '';
|
||||
const isActive = tabBoard === boardId;
|
||||
tab.classList.toggle('active', isActive);
|
||||
});
|
||||
|
||||
const activeTab = page.querySelector('.feed-tab.active');
|
||||
const bar = page.querySelector('[data-feed-board]');
|
||||
if (activeTab && bar && typeof initFeedBoardUI === 'function') {
|
||||
initFeedBoardUI(bar);
|
||||
}
|
||||
}
|
||||
|
||||
function initCommentListPartial() {
|
||||
const root = document.querySelector('[data-partial-comments]');
|
||||
if (!root) return;
|
||||
|
||||
root.addEventListener('click', function (event) {
|
||||
const link = event.target.closest('.comment-pagination .page-link[href]');
|
||||
if (!link) return;
|
||||
event.preventDefault();
|
||||
loadCommentPartial(root, link.href);
|
||||
});
|
||||
}
|
||||
|
||||
async function loadCommentPartial(root, url) {
|
||||
const list = root.querySelector('.comment-list-container');
|
||||
const pagination = root.querySelector('.comment-pagination');
|
||||
if (!list) return;
|
||||
|
||||
try {
|
||||
const response = await fetch(url, { headers: AJAX_HEADERS });
|
||||
if (!response.ok) throw new Error(String(response.status));
|
||||
const html = await response.text();
|
||||
const doc = new DOMParser().parseFromString(html, 'text/html');
|
||||
const newList = doc.querySelector('.comment-list-container');
|
||||
const newPagination = doc.querySelector('.comment-pagination');
|
||||
if (newList) list.innerHTML = newList.innerHTML;
|
||||
if (newPagination && pagination) {
|
||||
pagination.replaceWith(newPagination);
|
||||
} else if (newPagination) {
|
||||
list.insertAdjacentElement('afterend', newPagination);
|
||||
} else if (pagination) {
|
||||
pagination.remove();
|
||||
}
|
||||
history.replaceState(null, '', url);
|
||||
} catch (err) {
|
||||
console.error('评论分页刷新失败', err);
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -1,35 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var input = document.getElementById('chat-room-search-input');
|
||||
var grid = document.getElementById('chat-room-grid');
|
||||
var emptyHint = document.getElementById('chat-search-empty');
|
||||
if (!input || !grid) {
|
||||
return;
|
||||
}
|
||||
|
||||
var cards = grid.querySelectorAll('.chat-room-card');
|
||||
|
||||
function filterRooms() {
|
||||
var query = input.value.trim().toLowerCase();
|
||||
var visibleCount = 0;
|
||||
|
||||
cards.forEach(function (card) {
|
||||
var haystack = (card.dataset.search || '').toLowerCase();
|
||||
var match = !query || haystack.indexOf(query) !== -1;
|
||||
card.hidden = !match;
|
||||
if (match) {
|
||||
visibleCount += 1;
|
||||
}
|
||||
});
|
||||
|
||||
if (emptyHint) {
|
||||
emptyHint.hidden = visibleCount > 0 || !query;
|
||||
}
|
||||
}
|
||||
|
||||
input.addEventListener('input', filterRooms);
|
||||
filterRooms();
|
||||
});
|
||||
})();
|
||||
@@ -1,286 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function wsBaseUrl() {
|
||||
var scheme = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
return scheme + '//' + window.location.host;
|
||||
}
|
||||
|
||||
function escapeHtml(text) {
|
||||
var div = document.createElement('div');
|
||||
div.textContent = text;
|
||||
return div.innerHTML;
|
||||
}
|
||||
|
||||
function formatContent(text) {
|
||||
return escapeHtml(text).replace(/\n/g, '<br>');
|
||||
}
|
||||
|
||||
function scrollToBottom(container) {
|
||||
if (!container) {
|
||||
return;
|
||||
}
|
||||
container.scrollTop = container.scrollHeight;
|
||||
}
|
||||
|
||||
function removeEmptyHint(container) {
|
||||
var empty = container.querySelector('.chat-empty');
|
||||
if (empty) {
|
||||
empty.remove();
|
||||
}
|
||||
}
|
||||
|
||||
function buildRoomMessageNode(data, profileBase) {
|
||||
var article = document.createElement('article');
|
||||
article.className = 'chat-message' + (data.is_mine ? ' chat-message-mine' : '');
|
||||
article.dataset.messageId = String(data.id);
|
||||
|
||||
var profileLink = '';
|
||||
if (!data.is_anonymous && data.author_username) {
|
||||
profileLink =
|
||||
'<a class="chat-profile-link" href="' +
|
||||
profileBase +
|
||||
encodeURIComponent(data.author_username) +
|
||||
'/">主页</a>';
|
||||
}
|
||||
|
||||
article.innerHTML =
|
||||
'<img class="chat-avatar" src="' +
|
||||
escapeHtml(data.author_avatar_url) +
|
||||
'" alt="" width="40" height="40" loading="lazy" decoding="async">' +
|
||||
'<div class="chat-message-body">' +
|
||||
'<header class="chat-message-meta">' +
|
||||
'<strong class="chat-author">' +
|
||||
escapeHtml(data.author_display) +
|
||||
'</strong>' +
|
||||
profileLink +
|
||||
'<time datetime="' +
|
||||
escapeHtml(data.create_time_iso || '') +
|
||||
'">' +
|
||||
escapeHtml(data.create_time || '') +
|
||||
'</time>' +
|
||||
'</header>' +
|
||||
'<p class="chat-content">' +
|
||||
formatContent(data.content) +
|
||||
'</p>' +
|
||||
'</div>';
|
||||
|
||||
return article;
|
||||
}
|
||||
|
||||
function buildDirectMessageNode(data) {
|
||||
var article = document.createElement('article');
|
||||
article.className = 'chat-message' + (data.is_mine ? ' chat-message-mine' : '');
|
||||
article.dataset.messageId = String(data.id);
|
||||
|
||||
article.innerHTML =
|
||||
'<img class="chat-avatar" src="' +
|
||||
escapeHtml(data.author_avatar_url) +
|
||||
'" alt="" width="40" height="40" loading="lazy" decoding="async">' +
|
||||
'<div class="chat-message-body">' +
|
||||
'<header class="chat-message-meta">' +
|
||||
'<strong class="chat-author">' +
|
||||
escapeHtml(data.author_display) +
|
||||
'</strong>' +
|
||||
'<time datetime="' +
|
||||
escapeHtml(data.create_time_iso || '') +
|
||||
'">' +
|
||||
escapeHtml(data.create_time || '') +
|
||||
'</time>' +
|
||||
'</header>' +
|
||||
'<p class="chat-content">' +
|
||||
formatContent(data.content) +
|
||||
'</p>' +
|
||||
'</div>';
|
||||
|
||||
return article;
|
||||
}
|
||||
|
||||
function appendMessage(container, node) {
|
||||
removeEmptyHint(container);
|
||||
if (container.querySelector('[data-message-id="' + node.dataset.messageId + '"]')) {
|
||||
return;
|
||||
}
|
||||
container.appendChild(node);
|
||||
scrollToBottom(container);
|
||||
}
|
||||
|
||||
function setStatus(root, text, isError) {
|
||||
var status = root.querySelector('.chat-ws-status');
|
||||
if (!status) {
|
||||
return;
|
||||
}
|
||||
status.textContent = text;
|
||||
status.classList.toggle('chat-ws-status-error', !!isError);
|
||||
status.classList.toggle('chat-ws-status-ok', !isError);
|
||||
}
|
||||
|
||||
function initChatApp(root) {
|
||||
var wsPath = root.dataset.wsPath;
|
||||
var kind = root.dataset.chatKind || 'room';
|
||||
var canSend = root.dataset.canSend === '1';
|
||||
var profileBase = root.dataset.profileBase || '/user/';
|
||||
var messagesEl = root.querySelector('#chat-messages');
|
||||
var form = root.querySelector('.chat-compose');
|
||||
var textarea = form ? form.querySelector('textarea[name="content"]') : null;
|
||||
var anonInput = form ? form.querySelector('input[name="is_anonymous"]') : null;
|
||||
var errorBox = root.querySelector('.chat-ws-errors');
|
||||
var socket = null;
|
||||
var reconnectTimer = null;
|
||||
var reconnectDelay = 1000;
|
||||
var reconnectAttempts = 0;
|
||||
var maxReconnectAttempts = 12;
|
||||
|
||||
if (!wsPath || !messagesEl) {
|
||||
return;
|
||||
}
|
||||
|
||||
function showError(detail) {
|
||||
if (!errorBox) {
|
||||
return;
|
||||
}
|
||||
errorBox.textContent = detail;
|
||||
errorBox.hidden = false;
|
||||
}
|
||||
|
||||
function clearError() {
|
||||
if (errorBox) {
|
||||
errorBox.hidden = true;
|
||||
errorBox.textContent = '';
|
||||
}
|
||||
}
|
||||
|
||||
function connect() {
|
||||
if (socket && (socket.readyState === WebSocket.OPEN || socket.readyState === WebSocket.CONNECTING)) {
|
||||
return;
|
||||
}
|
||||
|
||||
setStatus(root, '连接中…', false);
|
||||
socket = new WebSocket(wsBaseUrl() + wsPath);
|
||||
|
||||
socket.addEventListener('open', function () {
|
||||
reconnectDelay = 1000;
|
||||
reconnectAttempts = 0;
|
||||
setStatus(root, '已连接', false);
|
||||
clearError();
|
||||
});
|
||||
|
||||
socket.addEventListener('message', function (event) {
|
||||
var payload;
|
||||
try {
|
||||
payload = JSON.parse(event.data);
|
||||
} catch (err) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (payload.event === 'connected') {
|
||||
setStatus(root, '已连接', false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (payload.event === 'error') {
|
||||
showError(payload.detail || '发送失败');
|
||||
return;
|
||||
}
|
||||
|
||||
if (payload.event === 'message' && payload.message) {
|
||||
clearError();
|
||||
var node =
|
||||
kind === 'direct'
|
||||
? buildDirectMessageNode(payload.message)
|
||||
: buildRoomMessageNode(payload.message, profileBase);
|
||||
appendMessage(messagesEl, node);
|
||||
}
|
||||
});
|
||||
|
||||
socket.addEventListener('close', function () {
|
||||
socket = null;
|
||||
reconnectAttempts += 1;
|
||||
if (reconnectAttempts >= maxReconnectAttempts) {
|
||||
setStatus(root, '连接失败', true);
|
||||
showError('无法连接聊天服务器,请刷新页面后重试');
|
||||
return;
|
||||
}
|
||||
setStatus(root, '连接已断开,正在重连…', true);
|
||||
reconnectTimer = window.setTimeout(function () {
|
||||
reconnectDelay = Math.min(reconnectDelay * 2, 15000);
|
||||
connect();
|
||||
}, reconnectDelay);
|
||||
});
|
||||
|
||||
socket.addEventListener('error', function () {
|
||||
setStatus(root, '连接异常', true);
|
||||
});
|
||||
}
|
||||
|
||||
if (form && canSend) {
|
||||
form.addEventListener('submit', function (event) {
|
||||
event.preventDefault();
|
||||
clearError();
|
||||
|
||||
if (!socket || socket.readyState !== WebSocket.OPEN) {
|
||||
showError('尚未连接到服务器,请稍候再试');
|
||||
connect();
|
||||
return;
|
||||
}
|
||||
|
||||
var content = (textarea && textarea.value ? textarea.value : '').trim();
|
||||
if (!content) {
|
||||
showError('消息不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
socket.send(
|
||||
JSON.stringify({
|
||||
action: 'send',
|
||||
content: content,
|
||||
is_anonymous: !!(anonInput && anonInput.checked),
|
||||
})
|
||||
);
|
||||
if (textarea) {
|
||||
textarea.value = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
scrollToBottom(messagesEl);
|
||||
|
||||
function scheduleConnect() {
|
||||
var started = false;
|
||||
function run() {
|
||||
if (started) {
|
||||
return;
|
||||
}
|
||||
started = true;
|
||||
connect();
|
||||
}
|
||||
if (form) {
|
||||
form.addEventListener('focusin', run, { once: true });
|
||||
}
|
||||
if ('requestIdleCallback' in window) {
|
||||
requestIdleCallback(run, { timeout: 2500 });
|
||||
} else {
|
||||
setTimeout(run, 100);
|
||||
}
|
||||
}
|
||||
|
||||
setStatus(root, '待连接', false);
|
||||
scheduleConnect();
|
||||
|
||||
window.addEventListener('beforeunload', function () {
|
||||
if (reconnectTimer) {
|
||||
window.clearTimeout(reconnectTimer);
|
||||
}
|
||||
if (socket) {
|
||||
socket.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var root = document.getElementById('chat-app');
|
||||
if (root) {
|
||||
initChatApp(root);
|
||||
}
|
||||
});
|
||||
})();
|
||||
@@ -1,98 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function perView() {
|
||||
return window.matchMedia('(min-width: 768px)').matches ? 2 : 1;
|
||||
}
|
||||
|
||||
function pageCount(total, pv) {
|
||||
if (total <= 0) return 0;
|
||||
return Math.max(1, total - pv + 1);
|
||||
}
|
||||
|
||||
function initCarousel(root) {
|
||||
var track = root.querySelector('.detail-recommend-track');
|
||||
var dotsWrap = root.querySelector('.detail-recommend-dots');
|
||||
if (!track || !dotsWrap) return;
|
||||
|
||||
var slides = track.querySelectorAll('.detail-recommend-slide');
|
||||
var total = slides.length;
|
||||
if (total === 0) return;
|
||||
|
||||
var index = 0;
|
||||
var timer = null;
|
||||
var pv = perView();
|
||||
var pages = pageCount(total, pv);
|
||||
|
||||
function renderDots() {
|
||||
dotsWrap.innerHTML = '';
|
||||
for (var i = 0; i < pages; i++) {
|
||||
var btn = document.createElement('button');
|
||||
btn.type = 'button';
|
||||
btn.className = 'detail-recommend-dot' + (i === index ? ' is-active' : '');
|
||||
btn.setAttribute('aria-label', '第 ' + (i + 1) + ' 组推荐');
|
||||
btn.setAttribute('aria-selected', i === index ? 'true' : 'false');
|
||||
btn.dataset.page = String(i);
|
||||
btn.addEventListener('click', function () {
|
||||
goTo(parseInt(this.dataset.page, 10));
|
||||
restartAuto();
|
||||
});
|
||||
dotsWrap.appendChild(btn);
|
||||
}
|
||||
}
|
||||
|
||||
function applyTransform() {
|
||||
var slidePct = 100 / pv;
|
||||
track.style.transform = 'translateX(-' + index * slidePct + '%)';
|
||||
var dotEls = dotsWrap.querySelectorAll('.detail-recommend-dot');
|
||||
dotEls.forEach(function (el, i) {
|
||||
el.classList.toggle('is-active', i === index);
|
||||
el.setAttribute('aria-selected', i === index ? 'true' : 'false');
|
||||
});
|
||||
}
|
||||
|
||||
function goTo(i) {
|
||||
index = Math.max(0, Math.min(i, pages - 1));
|
||||
applyTransform();
|
||||
}
|
||||
|
||||
function restartAuto() {
|
||||
if (timer) clearInterval(timer);
|
||||
if (pages <= 1) return;
|
||||
timer = setInterval(function () {
|
||||
goTo((index + 1) % pages);
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
var newPv = perView();
|
||||
if (newPv !== pv) {
|
||||
pv = newPv;
|
||||
pages = pageCount(total, pv);
|
||||
if (index >= pages) index = pages - 1;
|
||||
renderDots();
|
||||
}
|
||||
applyTransform();
|
||||
}
|
||||
|
||||
renderDots();
|
||||
applyTransform();
|
||||
restartAuto();
|
||||
window.addEventListener('resize', onResize);
|
||||
|
||||
root.addEventListener('mouseenter', function () {
|
||||
if (timer) clearInterval(timer);
|
||||
});
|
||||
root.addEventListener('mouseleave', restartAuto);
|
||||
}
|
||||
|
||||
function boot() {
|
||||
document.querySelectorAll('[data-recommend-carousel]').forEach(initCarousel);
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', boot);
|
||||
} else {
|
||||
boot();
|
||||
}
|
||||
})();
|
||||
@@ -1,62 +0,0 @@
|
||||
/**
|
||||
* 分段板块栏:横向滚动 + 滑动光晕(首页与列表页共用)
|
||||
*/
|
||||
function initFeedBoardUI(root) {
|
||||
if (!root) return;
|
||||
|
||||
const scrollWrap = root.querySelector('.home-posts-tabs-scroll, .feed-tabs-scroll');
|
||||
const scrollLeft = root.querySelector('.home-posts-scroll-left, .feed-scroll-left');
|
||||
const scrollRight = root.querySelector('.home-posts-scroll-right, .feed-scroll-right');
|
||||
const spotlight = root.querySelector('.home-posts-spotlight, .feed-spotlight');
|
||||
const segment = root.querySelector('.home-posts-segment, .feed-segment');
|
||||
|
||||
if (scrollWrap && scrollLeft && scrollRight) {
|
||||
const scrollAmount = 140;
|
||||
scrollLeft.addEventListener('click', function () {
|
||||
scrollWrap.scrollBy({ left: -scrollAmount, behavior: 'smooth' });
|
||||
});
|
||||
scrollRight.addEventListener('click', function () {
|
||||
scrollWrap.scrollBy({ left: scrollAmount, behavior: 'smooth' });
|
||||
});
|
||||
|
||||
function updateScrollButtons() {
|
||||
const max = scrollWrap.scrollWidth - scrollWrap.clientWidth;
|
||||
const atStart = scrollWrap.scrollLeft <= 4;
|
||||
const atEnd = scrollWrap.scrollLeft >= max - 4;
|
||||
scrollLeft.classList.toggle('is-hidden', atStart);
|
||||
scrollRight.classList.toggle('is-hidden', atEnd);
|
||||
}
|
||||
|
||||
updateScrollButtons();
|
||||
scrollWrap.addEventListener('scroll', updateScrollButtons);
|
||||
window.addEventListener('resize', updateScrollButtons);
|
||||
}
|
||||
|
||||
if (spotlight && segment) {
|
||||
const tabSelector = '.home-posts-tab, .feed-tab';
|
||||
const moveSpotlight = (tab) => {
|
||||
if (!tab) return;
|
||||
const pad = segment.getBoundingClientRect();
|
||||
const rect = tab.getBoundingClientRect();
|
||||
const left = rect.left - pad.left;
|
||||
spotlight.style.setProperty('--spot-l', `${left}px`);
|
||||
spotlight.style.setProperty('--spot-w', `${rect.width}px`);
|
||||
};
|
||||
|
||||
moveSpotlight(root.querySelector(`${tabSelector}.active`));
|
||||
|
||||
root.querySelectorAll(tabSelector).forEach((tab) => {
|
||||
tab.addEventListener('click', () => {
|
||||
requestAnimationFrame(() => moveSpotlight(tab));
|
||||
});
|
||||
});
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
moveSpotlight(root.querySelector(`${tabSelector}.active`));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.querySelectorAll('[data-feed-board]').forEach(initFeedBoardUI);
|
||||
});
|
||||
@@ -1,99 +0,0 @@
|
||||
/**
|
||||
* 首页:新闻/帖子板块 AJAX(板块栏交互见 feed_board.js)
|
||||
*/
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
if (document.body.classList.contains('page-home')) {
|
||||
initHomePanelSwap();
|
||||
}
|
||||
});
|
||||
|
||||
function initHomePanelSwap() {
|
||||
const newsPanel = document.getElementById('homeNewsPanel');
|
||||
const postPanel = document.getElementById('tenPostContainer');
|
||||
|
||||
bindPanelTabs({
|
||||
tabSelector: '.js-home-news-tab',
|
||||
panel: newsPanel,
|
||||
queryKey: 'news_board_id',
|
||||
getBoardId: (el) => el.dataset.newsBoard || '0',
|
||||
onAfterActive: (tab) => syncFeedBoardSpotlight('.home-news-board-bar', tab),
|
||||
});
|
||||
|
||||
bindPanelTabs({
|
||||
tabSelector: '.js-home-post-tab',
|
||||
panel: postPanel,
|
||||
queryKey: 'board_id',
|
||||
getBoardId: (el) => el.dataset.board || '0',
|
||||
onAfterActive: (tab) => syncFeedBoardSpotlight('.home-posts-board-bar', tab),
|
||||
});
|
||||
}
|
||||
|
||||
function bindPanelTabs({ tabSelector, panel, queryKey, getBoardId, onSwapped, onAfterActive }) {
|
||||
if (!panel) return;
|
||||
|
||||
document.addEventListener('click', function (e) {
|
||||
const tab = e.target.closest(tabSelector);
|
||||
if (!tab) return;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if (tab.classList.contains('active')) return;
|
||||
|
||||
const boardId = getBoardId(tab);
|
||||
const requestUrl = tab.getAttribute('href');
|
||||
|
||||
setActiveTab(tabSelector, tab);
|
||||
if (typeof onAfterActive === 'function') {
|
||||
onAfterActive(tab);
|
||||
}
|
||||
swapPanelHtml(panel, requestUrl, onSwapped);
|
||||
updateHomeUrlParam(queryKey, boardId);
|
||||
});
|
||||
}
|
||||
|
||||
function setActiveTab(tabSelector, activeTab) {
|
||||
const root = activeTab.closest('.home-posts-tabs');
|
||||
if (!root) return;
|
||||
root.querySelectorAll(tabSelector).forEach((el) => el.classList.remove('active'));
|
||||
activeTab.classList.add('active');
|
||||
}
|
||||
|
||||
function syncFeedBoardSpotlight(barSelector, tab) {
|
||||
const root = document.querySelector(barSelector);
|
||||
if (!root || !tab) return;
|
||||
const spotlight = root.querySelector('.home-posts-spotlight');
|
||||
const segment = root.querySelector('.home-posts-segment');
|
||||
if (!spotlight || !segment) return;
|
||||
const pad = segment.getBoundingClientRect();
|
||||
const rect = tab.getBoundingClientRect();
|
||||
spotlight.style.setProperty('--spot-l', `${rect.left - pad.left}px`);
|
||||
spotlight.style.setProperty('--spot-w', `${rect.width}px`);
|
||||
}
|
||||
|
||||
async function swapPanelHtml(panel, url, onSwapped) {
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
||||
});
|
||||
if (!response.ok) throw new Error(response.status);
|
||||
const html = await response.text();
|
||||
panel.innerHTML = html;
|
||||
if (typeof onSwapped === 'function') {
|
||||
onSwapped(panel);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('板块内容加载失败', err);
|
||||
panel.innerHTML =
|
||||
'<p class="home-panel-error text-muted text-center py-3">加载失败,请稍后重试</p>';
|
||||
}
|
||||
}
|
||||
|
||||
function updateHomeUrlParam(key, value) {
|
||||
const url = new URL(window.location.href);
|
||||
if (value === '0') {
|
||||
url.searchParams.delete(key);
|
||||
} else {
|
||||
url.searchParams.set(key, value);
|
||||
}
|
||||
history.replaceState(null, '', url.pathname + url.search);
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" width="64" height="64" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges">
|
||||
<rect x="16" y="16" width="32" height="1" fill="#000000"/>
|
||||
<rect x="16" y="17" width="32" height="1" fill="#000000"/>
|
||||
<rect x="16" y="18" width="32" height="1" fill="#000000"/>
|
||||
<rect x="16" y="19" width="3" height="1" fill="#000000"/>
|
||||
<rect x="16" y="20" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="20" width="11" height="1" fill="#000000"/>
|
||||
<rect x="33" y="20" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="21" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="21" width="11" height="1" fill="#000000"/>
|
||||
<rect x="33" y="21" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="22" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="22" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="22" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="23" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="23" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="23" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="24" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="24" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="24" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="25" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="25" width="9" height="1" fill="#000000"/>
|
||||
<rect x="33" y="25" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="26" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="26" width="9" height="1" fill="#000000"/>
|
||||
<rect x="33" y="26" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="27" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="27" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="27" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="28" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="28" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="28" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="29" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="29" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="29" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="30" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="30" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="30" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="31" width="3" height="1" fill="#000000"/>
|
||||
<rect x="16" y="32" width="3" height="1" fill="#000000"/>
|
||||
<rect x="16" y="33" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="33" width="11" height="1" fill="#000000"/>
|
||||
<rect x="33" y="33" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="33" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="34" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="34" width="11" height="1" fill="#000000"/>
|
||||
<rect x="33" y="34" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="34" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="35" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="35" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="35" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="35" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="35" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="35" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="36" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="36" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="36" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="36" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="36" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="36" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="37" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="37" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="37" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="37" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="37" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="38" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="38" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="38" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="38" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="38" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="39" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="39" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="39" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="39" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="39" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="40" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="40" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="40" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="40" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="40" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="41" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="41" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="41" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="41" width="2" height="1" fill="#000000"/>
|
||||
<rect x="43" y="41" width="2" height="1" fill="#000000"/>
|
||||
<rect x="16" y="42" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="42" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="42" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="42" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="42" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="43" width="3" height="1" fill="#000000"/>
|
||||
<rect x="20" y="43" width="2" height="1" fill="#000000"/>
|
||||
<rect x="24" y="43" width="3" height="1" fill="#000000"/>
|
||||
<rect x="29" y="43" width="2" height="1" fill="#000000"/>
|
||||
<rect x="33" y="43" width="12" height="1" fill="#000000"/>
|
||||
<rect x="16" y="44" width="3" height="1" fill="#000000"/>
|
||||
<rect x="16" y="45" width="32" height="1" fill="#000000"/>
|
||||
<rect x="16" y="46" width="32" height="1" fill="#000000"/>
|
||||
<rect x="16" y="47" width="32" height="1" fill="#000000"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.7 KiB |
@@ -1 +0,0 @@
|
||||
:root,[data-bs-theme=light]{--bs-blue: #0d6efd;--bs-indigo: #6610f2;--bs-purple: #6f42c1;--bs-pink: #d63384;--bs-red: #dc3545;--bs-orange: #fd7e14;--bs-yellow: #ffc107;--bs-green: #198754;--bs-teal: #20c997;--bs-cyan: #0dcaf0;--bs-black: #000;--bs-white: #fff;--bs-gray: #6c757d;--bs-gray-dark: #343a40;--bs-gray-100: #f8f9fa;--bs-gray-200: #e9ecef;--bs-gray-300: #dee2e6;--bs-gray-400: #ced4da;--bs-gray-500: #adb5bd;--bs-gray-600: #6c757d;--bs-gray-700: #495057;--bs-gray-800: #343a40;--bs-gray-900: #212529;--bs-primary: #0d6efd;--bs-secondary: #6c757d;--bs-success: #198754;--bs-info: #0dcaf0;--bs-warning: #ffc107;--bs-danger: #dc3545;--bs-light: #f8f9fa;--bs-dark: #212529;--bs-primary-rgb: 13, 110, 253;--bs-secondary-rgb: 108, 117, 125;--bs-success-rgb: 25, 135, 84;--bs-info-rgb: 13, 202, 240;--bs-warning-rgb: 255, 193, 7;--bs-danger-rgb: 220, 53, 69;--bs-light-rgb: 248, 249, 250;--bs-dark-rgb: 33, 37, 41;--bs-primary-text-emphasis: #052c65;--bs-secondary-text-emphasis: #2b2f32;--bs-success-text-emphasis: #0a3622;--bs-info-text-emphasis: #055160;--bs-warning-text-emphasis: #664d03;--bs-danger-text-emphasis: #58151c;--bs-light-text-emphasis: #495057;--bs-dark-text-emphasis: #495057;--bs-primary-bg-subtle: #cfe2ff;--bs-secondary-bg-subtle: #e2e3e5;--bs-success-bg-subtle: #d1e7dd;--bs-info-bg-subtle: #cff4fc;--bs-warning-bg-subtle: #fff3cd;--bs-danger-bg-subtle: #f8d7da;--bs-light-bg-subtle: #fcfcfd;--bs-dark-bg-subtle: #ced4da;--bs-primary-border-subtle: #9ec5fe;--bs-secondary-border-subtle: #c4c8cb;--bs-success-border-subtle: #a3cfbb;--bs-info-border-subtle: #9eeaf9;--bs-warning-border-subtle: #ffe69c;--bs-danger-border-subtle: #f1aeb5;--bs-light-border-subtle: #e9ecef;--bs-dark-border-subtle: #adb5bd;--bs-white-rgb: 255, 255, 255;--bs-black-rgb: 0, 0, 0;--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family: var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight: 400;--bs-body-line-height: 1.5;--bs-body-color: #212529;--bs-body-color-rgb: 33, 37, 41;--bs-body-bg: #fff;--bs-body-bg-rgb: 255, 255, 255;--bs-emphasis-color: #000;--bs-emphasis-color-rgb: 0, 0, 0;--bs-secondary-color: rgba(33, 37, 41, 0.75);--bs-secondary-color-rgb: 33, 37, 41;--bs-secondary-bg: #e9ecef;--bs-secondary-bg-rgb: 233, 236, 239;--bs-tertiary-color: rgba(33, 37, 41, 0.5);--bs-tertiary-color-rgb: 33, 37, 41;--bs-tertiary-bg: #f8f9fa;--bs-tertiary-bg-rgb: 248, 249, 250;--bs-heading-color: inherit;--bs-link-color: #0d6efd;--bs-link-color-rgb: 13, 110, 253;--bs-link-decoration: underline;--bs-link-hover-color: #0a58ca;--bs-link-hover-color-rgb: 10, 88, 202;--bs-code-color: #d63384;--bs-highlight-color: #212529;--bs-highlight-bg: #fff3cd;--bs-border-width: 1px;--bs-border-style: solid;--bs-border-color: #dee2e6;--bs-border-color-translucent: rgba(0, 0, 0, 0.175);--bs-border-radius: 0.375rem;--bs-border-radius-sm: 0.25rem;--bs-border-radius-lg: 0.5rem;--bs-border-radius-xl: 1rem;--bs-border-radius-xxl: 2rem;--bs-border-radius-2xl: var(--bs-border-radius-xxl);--bs-border-radius-pill: 50rem;--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width: 0.25rem;--bs-focus-ring-opacity: 0.25;--bs-focus-ring-color: rgba(13, 110, 253, 0.25);--bs-form-valid-color: #198754;--bs-form-valid-border-color: #198754;--bs-form-invalid-color: #dc3545;--bs-form-invalid-border-color: #dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color: #dee2e6;--bs-body-color-rgb: 222, 226, 230;--bs-body-bg: #212529;--bs-body-bg-rgb: 33, 37, 41;--bs-emphasis-color: #fff;--bs-emphasis-color-rgb: 255, 255, 255;--bs-secondary-color: rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb: 222, 226, 230;--bs-secondary-bg: #343a40;--bs-secondary-bg-rgb: 52, 58, 64;--bs-tertiary-color: rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb: 222, 226, 230;--bs-tertiary-bg: #2b3035;--bs-tertiary-bg-rgb: 43, 48, 53;--bs-primary-text-emphasis: #6ea8fe;--bs-secondary-text-emphasis: #a7acb1;--bs-success-text-emphasis: #75b798;--bs-info-text-emphasis: #6edff6;--bs-warning-text-emphasis: #ffda6a;--bs-danger-text-emphasis: #ea868f;--bs-light-text-emphasis: #f8f9fa;--bs-dark-text-emphasis: #dee2e6;--bs-primary-bg-subtle: #031633;--bs-secondary-bg-subtle: #161719;--bs-success-bg-subtle: #051b11;--bs-info-bg-subtle: #032830;--bs-warning-bg-subtle: #332701;--bs-danger-bg-subtle: #2c0b0e;--bs-light-bg-subtle: #343a40;--bs-dark-bg-subtle: #1a1d20;--bs-primary-border-subtle: #084298;--bs-secondary-border-subtle: #41464b;--bs-suLine truncated
|
||||
@@ -1,7 +0,0 @@
|
||||
/*!
|
||||
* Bootstrap v5.3.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i="transitionend",n=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),s=t=>{t.dispatchEvent(new Event(i))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(n(t)):null,a=t=>{if(!o(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},l=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),c=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c(t.parentNode):null},h=()=>{},d=t=>{t.offsetHeight},u=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,f=[],p=()=>"rtl"===document.documentElement.dir,m=t=>{var e;e=()=>{const e=u();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of f)t()})),f.push(e)):e()},g=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,_=(t,e,n=!0)=>{if(!n)return void g(t);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:n})=>{n===e&&(r=!0,e.removeEventListener(i,a),g(t))};e.addEventListener(i,a),setTimeout((()=>{r||s(e)}),o)},b=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},v=/[^.]*(?=\..*)\.|.*/,y=/\..*/,w=/::\d+$/,A={};let E=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function x(t){const e=O(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function k(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function L(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=I(t);return C.has(o)||(o=t),[n,s,o]}function S(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=L(e,i,n);if(e in T){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=x(t),c=l[a]||(l[a]={}),h=k(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=O(r,e.replace(v,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return P(s,{delegateTarget:r}),n.oneOff&&N.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return P(n,{delegateTarget:t}),i.oneOff&&N.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function D(t,e,i,n,s){const o=k(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function $(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&D(t,e,i,r.callable,r.delegationSelector)}function I(t){return t=t.replace(y,""),T[t]||t}const N={on(t,e,i,n){S(t,e,i,n,!1)},one(t,e,i,n){S(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=L(e,i,n),a=r!==e,l=x(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))$(t,l,i,e.slLine truncated
|
||||
//# sourceMappingURL=bootstrap.bundle.min.js.map
|
||||
@@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# 暗恋见君 Marqdo 切片冒烟(需先启动 index.mq.md)。
|
||||
set -uo pipefail
|
||||
BASE="http://127.0.0.1:18180"
|
||||
PASS=0; FAIL=0
|
||||
ok() { echo " ok: $1"; PASS=$((PASS+1)); }
|
||||
bad() { echo " FAIL: $1"; FAIL=$((FAIL+1)); }
|
||||
|
||||
echo "== 首页 =="
|
||||
code=$(curl -s -o /dev/null -w "%{http_code}" "$BASE/")
|
||||
[ "$code" = "200" ] && ok "GET /" || bad "GET / -> $code"
|
||||
curl -s "$BASE/" | grep -q '暗恋见君' && ok "品牌" || bad "品牌"
|
||||
curl -s "$BASE/" | grep -q 'class="hero"' && ok "Hero" || bad "Hero"
|
||||
curl -s "$BASE/" | grep -q 'notice-title\|公告信息' && ok "公告" || bad "公告"
|
||||
curl -s "$BASE/" | grep -q 'news-timeline\|新闻动态' && ok "新闻时间线" || bad "新闻时间线"
|
||||
curl -s "$BASE/" | grep -q 'home-posts\|论坛交流' && ok "帖子区" || bad "帖子区"
|
||||
curl -s "$BASE/" | grep -q 'bg-body-960\|/static/css/base.css' && ok "原站 CSS/背景" || bad "原站 CSS/背景"
|
||||
curl -s -o /dev/null -w "%{http_code}" "$BASE/static/css/base.css" | grep -q 200 && ok "base.css" || bad "base.css"
|
||||
|
||||
echo "== 列表 / 详情 =="
|
||||
curl -s "$BASE/post" | grep -q 'welcome\|欢迎\|论坛交流' && ok "帖子列表" || bad "帖子列表"
|
||||
code=$(curl -s -o /dev/null -w "%{http_code}" "$BASE/post/welcome")
|
||||
[ "$code" = "200" ] && ok "帖子详情" || bad "帖子详情 -> $code"
|
||||
curl -s "$BASE/news" | grep -q 'migrate\|迁往\|新闻' && ok "新闻列表" || bad "新闻列表"
|
||||
|
||||
echo "== 片段 API =="
|
||||
curl -s "$BASE/post/ten" | grep -q 'home-post-card\|欢迎' && ok "/post/ten" || bad "/post/ten"
|
||||
curl -s "$BASE/news/five" | grep -q 'news-timeline\|迁往\|站点' && ok "/news/five" || bad "/news/five"
|
||||
|
||||
echo "== 其它页 =="
|
||||
code=$(curl -s -o /dev/null -w "%{http_code}" "$BASE/topics")
|
||||
[ "$code" = "200" ] && ok "专题" || bad "专题 -> $code"
|
||||
code=$(curl -s -o /dev/null -w "%{http_code}" "$BASE/chat")
|
||||
[ "$code" = "200" ] && ok "聊天列表" || bad "聊天列表 -> $code"
|
||||
code=$(curl -s -o /dev/null -w "%{http_code}" "$BASE/guide/automation-api")
|
||||
[ "$code" = "200" ] && ok "API 指南" || bad "API 指南 -> $code"
|
||||
code=$(curl -s -o /dev/null -w "%{http_code}" "$BASE/sitemap.xml")
|
||||
[ "$code" = "200" ] && ok "sitemap" || bad "sitemap -> $code"
|
||||
|
||||
echo "== 门禁 / 登录 =="
|
||||
code=$(curl -s -o /dev/null -w "%{http_code}" "$BASE/post/public")
|
||||
[ "$code" = "303" ] || [ "$code" = "302" ] && ok "未登录发帖重定向" || bad "发帖 -> $code"
|
||||
rm -f /tmp/anlian_mq_hdr.txt
|
||||
curl -s -D /tmp/anlian_mq_hdr.txt -o /dev/null -d "username=admin&password=anlian" "$BASE/accounts/login"
|
||||
sid=$(grep -i "set-cookie" /tmp/anlian_mq_hdr.txt | sed 's/.*marqdo_sid=\([^;]*\).*/\1/' | head -1)
|
||||
[ -n "$sid" ] && ok "会话 cookie" || bad "无 cookie"
|
||||
code=$(curl -s -b "marqdo_sid=$sid" -o /dev/null -w "%{http_code}" "$BASE/post/public")
|
||||
[ "$code" = "200" ] && ok "登录后发帖" || bad "登录后发帖 -> $code"
|
||||
|
||||
echo "== WS =="
|
||||
wsok=$(python3 -c "
|
||||
import socket, base64, os
|
||||
s = socket.create_connection(('127.0.0.1', 18180), timeout=3)
|
||||
key = base64.b64encode(os.urandom(16)).decode()
|
||||
s.sendall((f'GET /chat/ws HTTP/1.1\r\nHost: x\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Key: {key}\r\nSec-WebSocket-Version: 13\r\n\r\n').encode())
|
||||
r = s.recv(1024).decode(errors='replace')
|
||||
print('OK' if '101' in r.split('\r\n')[0] else 'NO')
|
||||
s.close()
|
||||
" 2>/dev/null)
|
||||
[ "$wsok" = "OK" ] && ok "WebSocket" || bad "WebSocket $wsok"
|
||||
|
||||
echo
|
||||
echo "通过 $PASS / $((PASS+FAIL))"
|
||||
[ "$FAIL" = "0" ] || exit 1
|
||||
@@ -1,431 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: styles/shell
|
||||
description: 暗恋见君壳样式——对照 Django 原站粉玻璃 + 动效,用表格声明。
|
||||
导入:
|
||||
网页: ext/web/网页.mq.md
|
||||
text: lib/text.mq.md
|
||||
---
|
||||
|
||||
对照原站 `config/static/front/css/{base,feed_common,footer,index/hero}.css`:
|
||||
固定背景图、毛玻璃顶栏、Logo 呼吸、Hero 漂浮、粉玻璃卡片与页脚。
|
||||
|
||||
## 基础
|
||||
|
||||
品牌色与全站底:固定摄影背景 + 粉玻璃变量。
|
||||
|
||||
`基础` =
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| :root | --ink | #333333 |
|
||||
| :root | --ink-strong | #111111 |
|
||||
| :root | --muted | #666666 |
|
||||
| :root | --paper | #f8f9fa |
|
||||
| :root | --glass | rgba(255,255,255,0.28) |
|
||||
| :root | --glass-strong | rgba(255,255,255,0.42) |
|
||||
| :root | --glass-border | rgba(255,255,255,0.5) |
|
||||
| :root | --accent | #fdbbdb |
|
||||
| :root | --accent-deep | #f0a8c4 |
|
||||
| :root | --accent-text | #a85878 |
|
||||
| :root | --accent-muted | #c97a96 |
|
||||
| :root | --accent-bg | rgba(253,189,219,0.48) |
|
||||
| :root | --hero-pink | #ffd0d0 |
|
||||
| :root | --radius | 14px |
|
||||
| :root | --sans | "Noto Sans SC", "IBM Plex Sans", system-ui, sans-serif |
|
||||
| * | box-sizing | border-box |
|
||||
| html | scroll-behavior | smooth |
|
||||
| body | margin | "0" |
|
||||
| body | min-height | 100vh |
|
||||
| body | font-family | var(--sans) |
|
||||
| body | color | var(--ink) |
|
||||
| body | line-height | "1.6" |
|
||||
| body | background-color | var(--paper) |
|
||||
| body | background-image | url("/static/bg-body-960.webp") |
|
||||
| body | background-repeat | no-repeat |
|
||||
| body | background-size | cover |
|
||||
| body | background-position | center center |
|
||||
| body | background-attachment | fixed |
|
||||
| body | overflow-x | hidden |
|
||||
| a | color | var(--accent-text) |
|
||||
| a | text-decoration | none |
|
||||
| a:hover | color | var(--accent-deep) |
|
||||
| ::selection | background | rgba(253,189,219,0.45) |
|
||||
| main.main | padding | 0 0 3rem |
|
||||
| .main-intro | max-width | 72rem |
|
||||
| .main-intro | margin | 0 auto |
|
||||
| .main-intro | padding | 1.25rem 1.5rem 0 |
|
||||
|
||||
*`基础`*
|
||||
|
||||
## 动效
|
||||
|
||||
原站 `pulse`(Logo)与 `heroImageFloat`(主图);尊重减动偏好。
|
||||
|
||||
`动效` =
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| @keyframes pulse 0% | transform | scale(1) |
|
||||
| @keyframes pulse 50% | transform | scale(1.05) |
|
||||
| @keyframes pulse 100% | transform | scale(1) |
|
||||
| @keyframes heroImageFloat 0% | transform | scale(1) |
|
||||
| @keyframes heroImageFloat 50% | transform | scale(1.04) |
|
||||
| @keyframes heroImageFloat 100% | transform | scale(1) |
|
||||
| @keyframes cardRise 0% | opacity | "0" |
|
||||
| @keyframes cardRise 0% | transform | translateY(10px) |
|
||||
| @keyframes cardRise 100% | opacity | "1" |
|
||||
| @keyframes cardRise 100% | transform | translateY(0) |
|
||||
|
||||
*`动效`*
|
||||
|
||||
## 顶栏
|
||||
|
||||
毛玻璃导航;首项品牌带 Logo 呼吸动画。
|
||||
|
||||
`顶栏` =
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| header.topnav | grid-area | top |
|
||||
| header.topnav | position | sticky |
|
||||
| header.topnav | top | "0" |
|
||||
| header.topnav | z-index | "1000" |
|
||||
| header.topnav | width | 100% |
|
||||
| header.topnav | padding | 0.75rem 1.25rem |
|
||||
| header.topnav | background | rgba(255,255,255,0.2) |
|
||||
| header.topnav | backdrop-filter | blur(24px) |
|
||||
| header.topnav | -webkit-backdrop-filter | blur(24px) |
|
||||
| header.topnav | border-bottom | 1px solid rgba(255,255,255,0.2) |
|
||||
| header.topnav | box-shadow | inset 0 0 5px rgba(255,255,255,0.1) |
|
||||
| ul.nav | list-style | none |
|
||||
| ul.nav | margin | "0" |
|
||||
| ul.nav | padding | "0" |
|
||||
| ul.nav | display | flex |
|
||||
| ul.nav | flex-wrap | wrap |
|
||||
| ul.nav | align-items | center |
|
||||
| ul.nav | gap | 0.35rem 0.5rem |
|
||||
| ul.nav a | display | inline-flex |
|
||||
| ul.nav a | align-items | center |
|
||||
| ul.nav a | gap | 0.45rem |
|
||||
| ul.nav a | padding | 0.4rem 0.85rem |
|
||||
| ul.nav a | border-radius | 999px |
|
||||
| ul.nav a | color | var(--ink) |
|
||||
| ul.nav a | font-weight | "600" |
|
||||
| ul.nav a | transition | color 0.2s ease, transform 0.2s ease, background 0.2s ease |
|
||||
| ul.nav a:hover | color | var(--accent-text) |
|
||||
| ul.nav a:hover | transform | translateY(-2px) |
|
||||
| ul.nav a:hover | background | rgba(253,189,219,0.22) |
|
||||
| ul.nav li:first-child a | font-size | 1.05rem |
|
||||
| ul.nav li:first-child a | font-weight | "700" |
|
||||
| ul.nav li:first-child a | letter-spacing | 0.04em |
|
||||
| ul.nav li:first-child a | padding-left | 0.35rem |
|
||||
| ul.nav li:first-child a::before | content | "" |
|
||||
| ul.nav li:first-child a::before | width | 28px |
|
||||
| ul.nav li:first-child a::before | height | 28px |
|
||||
| ul.nav li:first-child a::before | background | url("/static/logo.svg") center / contain no-repeat |
|
||||
| ul.nav li:first-child a::before | animation | pulse 3s ease-in-out infinite |
|
||||
| ul.nav li:first-child a:hover | transform | none |
|
||||
| ul.nav li:first-child a:hover | background | transparent |
|
||||
|
||||
*`顶栏`*
|
||||
|
||||
## Hero
|
||||
|
||||
首页双栏英雄区:大标题粉强调 + 主图漂浮。
|
||||
|
||||
`Hero` =
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| .hero | max-width | 72rem |
|
||||
| .hero | margin | 0 auto 1.5rem |
|
||||
| .hero | padding | 1.5rem 0.5rem 0.5rem |
|
||||
| .hero-content | display | grid |
|
||||
| .hero-content | grid-template-columns | minmax(0,1fr) minmax(0,1fr) |
|
||||
| .hero-content | align-items | center |
|
||||
| .hero-content | gap | 2rem |
|
||||
| .hero-left | display | flex |
|
||||
| .hero-left | flex-direction | column |
|
||||
| .hero-left | align-items | flex-start |
|
||||
| .hero-brand | display | inline-flex |
|
||||
| .hero-brand | align-items | center |
|
||||
| .hero-brand | gap | 0.55rem |
|
||||
| .hero-brand | margin | 0 0 1rem |
|
||||
| .hero-brand | font-size | 1.35rem |
|
||||
| .hero-brand | font-weight | "700" |
|
||||
| .hero-brand | letter-spacing | 0.08em |
|
||||
| .hero-brand | text-transform | uppercase |
|
||||
| .hero-brand | color | var(--ink-strong) |
|
||||
| .hero-logo | width | 30px |
|
||||
| .hero-logo | height | 30px |
|
||||
| .hero-logo | animation | pulse 3s ease-in-out infinite |
|
||||
| .hero-pink | color | var(--hero-pink) |
|
||||
| .main-text | margin | 0 0 1.25rem |
|
||||
| .main-text | font-size | clamp(2.4rem, 5.5vw, 5.2rem) |
|
||||
| .main-text | font-weight | "800" |
|
||||
| .main-text | line-height | "1.15" |
|
||||
| .main-text | color | var(--ink-strong) |
|
||||
| .sub-text | margin | 0 0 1.75rem |
|
||||
| .sub-text | max-width | 34rem |
|
||||
| .sub-text | font-size | 1.05rem |
|
||||
| .sub-text | letter-spacing | 0.02em |
|
||||
| .sub-text | color | rgba(60,60,60,0.85) |
|
||||
| .hero-cta | display | flex |
|
||||
| .hero-cta | flex-wrap | wrap |
|
||||
| .hero-cta | gap | 0.65rem |
|
||||
| .hero-btn | display | inline-flex |
|
||||
| .hero-btn | align-items | center |
|
||||
| .hero-btn | padding | 0.55rem 1.2rem |
|
||||
| .hero-btn | border-radius | 999px |
|
||||
| .hero-btn | font-weight | "600" |
|
||||
| .hero-btn | color | #fff |
|
||||
| .hero-btn | background | linear-gradient(120deg, var(--accent-deep), var(--accent)) |
|
||||
| .hero-btn | box-shadow | 0 6px 18px rgba(253,189,219,0.45) |
|
||||
| .hero-btn | transition | transform 0.2s ease, box-shadow 0.2s ease |
|
||||
| .hero-btn:hover | transform | translateY(-2px) |
|
||||
| .hero-btn:hover | color | #fff |
|
||||
| .hero-btn:hover | box-shadow | 0 10px 24px rgba(253,189,219,0.55) |
|
||||
| .hero-btn.ghost | background | rgba(255,255,255,0.35) |
|
||||
| .hero-btn.ghost | color | var(--accent-text) |
|
||||
| .hero-btn.ghost | border | 1px solid var(--glass-border) |
|
||||
| .hero-btn.ghost | box-shadow | none |
|
||||
| .hero-btn.ghost:hover | background | rgba(255,255,255,0.55) |
|
||||
| .hero-btn.ghost:hover | color | var(--accent-text) |
|
||||
| .hero-right | display | flex |
|
||||
| .hero-right | align-items | center |
|
||||
| .hero-right | justify-content | center |
|
||||
| .hero-art | display | block |
|
||||
| .hero-art | width | 85% |
|
||||
| .hero-art | max-width | 420px |
|
||||
| .hero-art | height | auto |
|
||||
| .hero-art | filter | drop-shadow(0 0 20px rgba(255,208,208,0.45)) |
|
||||
| .hero-art | animation | heroImageFloat 30s linear infinite |
|
||||
| .hero-art | pointer-events | none |
|
||||
| .home-feed-head | max-width | 52rem |
|
||||
| .home-feed-head | margin | 0.5rem auto 0 |
|
||||
| .home-feed-head | padding | 0 1.25rem |
|
||||
| .home-feed-head h2 | margin | 0 0 0.35rem |
|
||||
| .home-feed-head h2 | font-size | 1.35rem |
|
||||
| .home-feed-head h2 | color | var(--accent-text) |
|
||||
| .home-feed-head p | margin | "0" |
|
||||
| .home-feed-head p | color | var(--muted) |
|
||||
| .home-feed-head p | font-size | 0.92rem |
|
||||
| .page-stage | max-width | 52rem |
|
||||
| .page-stage | margin | 1.25rem auto 0 |
|
||||
| .page-stage | padding | 1.25rem 1.35rem |
|
||||
| .page-stage | border-radius | var(--radius) |
|
||||
| .page-stage | background | var(--glass) |
|
||||
| .page-stage | backdrop-filter | blur(14px) |
|
||||
| .page-stage | -webkit-backdrop-filter | blur(14px) |
|
||||
| .page-stage | border | 1px solid var(--glass-border) |
|
||||
| .page-stage h1 | margin | 0 0 0.35rem |
|
||||
| .page-stage h1 | font-size | 1.6rem |
|
||||
| .page-stage h1 | color | var(--ink-strong) |
|
||||
| .page-stage p | margin | "0" |
|
||||
| .page-stage p | color | var(--muted) |
|
||||
|
||||
*`Hero`*
|
||||
|
||||
## 卡片
|
||||
|
||||
粉玻璃帖子/新闻卡:悬停上浮(对齐 `.home-post-card`)。
|
||||
|
||||
`卡片` =
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| .content.cards | max-width | 52rem |
|
||||
| .content.cards | margin | 1rem auto 0 |
|
||||
| .content.cards | padding | 0 1.25rem |
|
||||
| .content.cards | display | flex |
|
||||
| .content.cards | flex-direction | column |
|
||||
| .content.cards | gap | 0.65rem |
|
||||
| article.card | border-radius | var(--radius) |
|
||||
| article.card | background | rgba(255,255,255,0.32) |
|
||||
| article.card | backdrop-filter | blur(12px) |
|
||||
| article.card | -webkit-backdrop-filter | blur(12px) |
|
||||
| article.card | border | 1px solid rgba(255,255,255,0.42) |
|
||||
| article.card | box-shadow | 0 4px 16px rgba(253,189,219,0.08) |
|
||||
| article.card | transition | transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease |
|
||||
| article.card | animation | cardRise 0.45s ease both |
|
||||
| article.card:nth-child(2) | animation-delay | 0.05s |
|
||||
| article.card:nth-child(3) | animation-delay | 0.1s |
|
||||
| article.card:nth-child(4) | animation-delay | 0.15s |
|
||||
| article.card:hover | transform | translateY(-2px) |
|
||||
| article.card:hover | background | rgba(255,255,255,0.42) |
|
||||
| article.card:hover | box-shadow | 0 8px 24px rgba(253,189,219,0.18) |
|
||||
| a.card-link | display | grid |
|
||||
| a.card-link | grid-template-columns | auto 1fr |
|
||||
| a.card-link | grid-template-areas | "meta title" "meta body" |
|
||||
| a.card-link | gap | 0.35rem 1rem |
|
||||
| a.card-link | align-items | start |
|
||||
| a.card-link | padding | 0.85rem 1rem |
|
||||
| a.card-link | color | inherit |
|
||||
| a.card-link | text-decoration | none |
|
||||
| .card-meta | grid-area | meta |
|
||||
| .card-meta | align-self | center |
|
||||
| .card-meta | padding | 0.2rem 0.55rem |
|
||||
| .card-meta | border-radius | 6px |
|
||||
| .card-meta | font-size | 0.6875rem |
|
||||
| .card-meta | font-weight | "600" |
|
||||
| .card-meta | color | var(--accent-text) |
|
||||
| .card-meta | background | rgba(253,189,219,0.28) |
|
||||
| .card-meta | white-space | nowrap |
|
||||
| .card-meta | max-width | 5rem |
|
||||
| .card-meta | overflow | hidden |
|
||||
| .card-meta | text-overflow | ellipsis |
|
||||
| article.card h2 | grid-area | title |
|
||||
| article.card h2 | margin | "0" |
|
||||
| article.card h2 | font-size | 0.95rem |
|
||||
| article.card h2 | font-weight | "600" |
|
||||
| article.card h2 | color | #222 |
|
||||
| article.card h2 | line-height | "1.35" |
|
||||
| article.card p | grid-area | body |
|
||||
| article.card p | margin | "0" |
|
||||
| article.card p | font-size | 0.82rem |
|
||||
| article.card p | color | #666 |
|
||||
| article.card p | line-height | "1.45" |
|
||||
| article.article | max-width | 42rem |
|
||||
| article.article | margin | 1.5rem auto |
|
||||
| article.article | padding | 1.5rem 1.6rem |
|
||||
| article.article | border-radius | var(--radius) |
|
||||
| article.article | background | rgba(255,255,255,0.55) |
|
||||
| article.article | backdrop-filter | blur(16px) |
|
||||
| article.article | -webkit-backdrop-filter | blur(16px) |
|
||||
| article.article | border | 1px solid var(--glass-border) |
|
||||
| article.article | box-shadow | 0 8px 28px rgba(253,189,219,0.12) |
|
||||
| .article-meta | color | var(--accent-text) |
|
||||
| .article-meta | font-size | 0.85rem |
|
||||
| .article-meta | font-weight | "600" |
|
||||
| .article-meta | margin-bottom | 0.5rem |
|
||||
| .article-title | margin | 0 0 1rem |
|
||||
| .article-title | font-size | 1.75rem |
|
||||
| .article-title | color | var(--ink-strong) |
|
||||
| .article-body | color | var(--ink) |
|
||||
| .article-body | line-height | "1.75" |
|
||||
| .site-form | max-width | 34rem |
|
||||
| .site-form | margin | 1.5rem auto |
|
||||
| .site-form | padding | 1.5rem |
|
||||
| .site-form | border-radius | var(--radius) |
|
||||
| .site-form | background | rgba(255,255,255,0.45) |
|
||||
| .site-form | backdrop-filter | blur(14px) |
|
||||
| .site-form | border | 1px solid var(--glass-border) |
|
||||
| .chat-box | max-width | 42rem |
|
||||
| .chat-box | margin | 1rem auto |
|
||||
| .chat-box | padding | 1rem 1.15rem |
|
||||
| .chat-box | border-radius | var(--radius) |
|
||||
| .chat-box | background | rgba(255,255,255,0.4) |
|
||||
| .chat-box | backdrop-filter | blur(12px) |
|
||||
| .chat-box | border | 1px solid var(--glass-border) |
|
||||
| .chat-log | min-height | 12rem |
|
||||
| .chat-log | font-family | ui-monospace, monospace |
|
||||
| .chat-log | font-size | 0.9rem |
|
||||
| .chat-log | white-space | pre-wrap |
|
||||
| .search-bar | display | flex |
|
||||
| .search-bar | gap | 0.5rem |
|
||||
| .search-bar | margin-top | 0.85rem |
|
||||
| .search-bar input | flex | "1" |
|
||||
| .search-bar input | padding | 0.55rem 0.8rem |
|
||||
| .search-bar input | border-radius | 999px |
|
||||
| .search-bar input | border | 1px solid rgba(253,189,219,0.55) |
|
||||
| .search-bar input | background | rgba(255,255,255,0.65) |
|
||||
| .search-bar button | padding | 0.55rem 1.1rem |
|
||||
| .search-bar button | border | "0" |
|
||||
| .search-bar button | border-radius | 999px |
|
||||
| .search-bar button | background | var(--accent) |
|
||||
| .search-bar button | color | var(--accent-text) |
|
||||
| .search-bar button | font-weight | "600" |
|
||||
| .search-bar button | cursor | pointer |
|
||||
|
||||
*`卡片`*
|
||||
|
||||
## 页脚
|
||||
|
||||
双栏粉玻璃页脚。
|
||||
|
||||
`页脚` =
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| footer.foot | grid-area | foot |
|
||||
| footer.foot | margin-top | 2rem |
|
||||
| footer.foot | padding | 2rem 1.5rem 2.5rem |
|
||||
| footer.foot | background | rgba(255,255,255,0.28) |
|
||||
| footer.foot | backdrop-filter | blur(14px) |
|
||||
| footer.foot | -webkit-backdrop-filter | blur(14px) |
|
||||
| footer.foot | border-top | 1px solid rgba(255,255,255,0.45) |
|
||||
| footer.foot | box-shadow | inset 0 1px 0 rgba(255,255,255,0.35) |
|
||||
| ul.foot-nav | list-style | none |
|
||||
| ul.foot-nav | margin | 0 auto |
|
||||
| ul.foot-nav | padding | "0" |
|
||||
| ul.foot-nav | max-width | 52rem |
|
||||
| ul.foot-nav | display | flex |
|
||||
| ul.foot-nav | flex-wrap | wrap |
|
||||
| ul.foot-nav | justify-content | center |
|
||||
| ul.foot-nav | gap | 0.75rem 1.5rem |
|
||||
| ul.foot-nav a | color | #444 |
|
||||
| ul.foot-nav a | font-weight | "500" |
|
||||
| ul.foot-nav a:hover | color | var(--accent-text) |
|
||||
|
||||
*`页脚`*
|
||||
|
||||
## 响应式
|
||||
|
||||
平板收窄标题;手机 Hero 单栏。
|
||||
|
||||
`响应式` =
|
||||
|
||||
| 媒体 | 选择器 | 属性 | 值 |
|
||||
|------|--------|------|-----|
|
||||
| (max-width: 1024px) | .hero-content | gap | 1.25rem |
|
||||
| (max-width: 1024px) | .main-text | font-size | clamp(2.2rem, 4.5vw, 3.6rem) |
|
||||
| (max-width: 1024px) | .hero-art | width | min(90%, 340px) |
|
||||
| (max-width: 767px) | .hero-content | grid-template-columns | 1fr |
|
||||
| (max-width: 767px) | .hero-left | align-items | center |
|
||||
| (max-width: 767px) | .hero-left | text-align | center |
|
||||
| (max-width: 767px) | .sub-text | text-align | center |
|
||||
| (max-width: 767px) | .hero-cta | justify-content | center |
|
||||
| (max-width: 767px) | .hero-right | order | "2" |
|
||||
| (max-width: 767px) | .hero-left | order | "1" |
|
||||
| (max-width: 767px) | header.topnav | padding | 0.65rem 0.85rem |
|
||||
| (max-width: 767px) | ul.nav | gap | 0.25rem |
|
||||
| (prefers-reduced-motion: reduce) | .hero-art | animation | none |
|
||||
| (prefers-reduced-motion: reduce) | .hero-logo | animation | none |
|
||||
| (prefers-reduced-motion: reduce) | ul.nav li:first-child a::before | animation | none |
|
||||
| (prefers-reduced-motion: reduce) | article.card | animation | none |
|
||||
|
||||
*`响应式`*
|
||||
|
||||
## 全局
|
||||
|
||||
**基础表 = > 基础**
|
||||
**动效表 = > 动效**
|
||||
**顶栏表 = > 顶栏**
|
||||
**Hero表 = > Hero**
|
||||
**卡片表 = > 卡片**
|
||||
**页脚表 = > 页脚**
|
||||
**响应式表 = > 响应式**
|
||||
|
||||
**css基础 = > 网页.样式装配 名="基础" 表=`基础表`**
|
||||
**css动效 = > 网页.样式装配 名="动效" 表=`动效表`**
|
||||
**css顶栏 = > 网页.样式装配 名="顶栏" 表=`顶栏表`**
|
||||
**cssHero = > 网页.样式装配 名="Hero" 表=`Hero表`**
|
||||
**css卡片 = > 网页.样式装配 名="卡片" 表=`卡片表`**
|
||||
**css页脚 = > 网页.样式装配 名="页脚" 表=`页脚表`**
|
||||
**css响应式 = > 网页.样式装配 名="响应式" 表=`响应式表`**
|
||||
|
||||
`css段` =
|
||||
|
||||
| css |
|
||||
|-----|
|
||||
| `css基础` |
|
||||
| `css动效` |
|
||||
| `css顶栏` |
|
||||
| `cssHero` |
|
||||
| `css卡片` |
|
||||
| `css页脚` |
|
||||
| `css响应式` |
|
||||
|
||||
**css = > text.str_join xs=`css段` sep=""**
|
||||
*css*
|
||||
@@ -1,21 +1,33 @@
|
||||
# browser-app(路线 E)
|
||||
# browser-app:可读源码中的浏览器工程
|
||||
|
||||
作者**零业务 JS**;逻辑用 **GFM 表格 + `lib/browser`**(无 `json.set` 链)。
|
||||
从 [index.mq.md](index.mq.md) 开始阅读和执行,再沿 [组件入口](components/index.mq.md) 查看布局。首页拆成列表与计时,网络页再拆成输出、批量请求和 WebSocket 控件;内容在 content 中保留普通 Markdown,控件叶子使用原生 View 节点。
|
||||
|
||||
| 能力 | 演示 |
|
||||
|------|------|
|
||||
| 列表 CRUD | 添加 / 委托删除(`bag` + `set_html`) |
|
||||
| storage | 草稿 localStorage |
|
||||
| navigate | `/` `/about` `/net` + `popstate` |
|
||||
| interval | 计时起停 |
|
||||
| fetch_all | 并行两个 uuid |
|
||||
| ws | `wss://echo.websocket.events`(依赖外网) |
|
||||
| clipboard / download | 复制/下载列表文本 |
|
||||
浏览器程序是 [static/app.mq.md](static/app.mq.md)。事件表、参数与返回契约就在回调旁边;操作用可读标签表达,列表文本始终保留为数据。样式入口为 [styles/index.mq.md](styles/index.mq.md),旁边的字面表保留旧页面全部 59 条声明,并给出 View 包装层的几何适配。
|
||||
|
||||
```bash
|
||||
cargo build -p marqdo --release
|
||||
./target/release/marqdo wasm build -o examples/browser-app
|
||||
cd examples/browser-app && python3 -m http.server 8766
|
||||
| 能力 | 实际行为与边界 |
|
||||
|---|---|
|
||||
| 列表 | 原生记录保留独立 ID;重复内容可单独删除,特殊字符使用 text,删除按钮使用 children |
|
||||
| 草稿 | localStorage 保存输入框文本;完成回调确认保存,缺失值与空草稿分别处理;条目不跨刷新保存 |
|
||||
| 历史 | 三个面板使用真实 pathname;popstate 只反映现有位置,不重复 push;直接打开 /about 或 /net 返回首页 |
|
||||
| 计时 | 同名计时器替换,停止保留已累计次数 |
|
||||
| 批量请求 | 两个公开 UUID 请求可能失败;输出每项真实状态、响应体或错误 |
|
||||
| WebSocket | 本地 /live 原生回声资源;展示实际打开、消息、错误与关闭回调 |
|
||||
| 剪贴板与下载 | 导出当前列表文本;即时提示仅确认已发起,浏览器策略仍可能阻止完成 |
|
||||
|
||||
在仓库根目录构建当前官方运行时,再启动原生服务器。需要已经可用的 Rust/WASM 工具链和本仓库工程、网络插件;缺少 WASM 标准库时先阅读 [工作区工具链手册](../../skills/marqdo-dev/toolchain.mq.md),并将返回的 compiler 传给 build_browser。生成资源与编译样式不作为业务源码提交。
|
||||
|
||||
```sh
|
||||
marqdo call skills/marqdo-dev/index.mq.md build_browser 'out="examples/browser-app/static"' --effects plugin,process.exec,fs.write --fs-root . --require-ok --json
|
||||
marqdo call examples/browser-app/index.mq.md serve --effects plugin,fs.write,network.write --fs-root examples/browser-app --require-ok --json
|
||||
```
|
||||
|
||||
写法:[marqdo-dev](../../.cursor/skills/marqdo-dev/SKILL.md) · 路线图:[browser-wasm-e.md](../../doc/roadmap/browser-wasm-e.md)。
|
||||
打开 http://127.0.0.1:18095。控件等待实际启动成功后启用;缺失资源返回明确失败,不能把加载说明当作已运行。服务只监听本机,示例不引入数据库、认证或持久条目存储。
|
||||
|
||||
开发验证同样通过可执行手册完成。下列浏览器任务原生复制当前运行时,并运行真实页面交互;它覆盖重复项、字面文本、草稿、历史、计时、导出内容、受控批量请求失败与本地 WebSocket 收发。Node/Playwright 是自动化测试的外联边界,文件读写与任务编排仍由 Marqdo 执行。
|
||||
|
||||
```sh
|
||||
marqdo call skills/marqdo-dev/index.mq.md check 'path="examples/browser-app/index.mq.md"' --effects plugin --require-ok --json
|
||||
marqdo call skills/marqdo-dev/index.mq.md test_browser --effects plugin,process.exec,fs.write --fs-root . --require-ok --json
|
||||
```
|
||||
|
||||
后续修改先阅读 [编程规范](../../doc/library-development.mq.md),再修改一个职责的组件或回调。需要新的浏览器宿主能力时扩充正式 bridge 与标准库契约,保留真实浏览器验收;不在父组件中重新拼接 HTML 或业务 JavaScript。
|
||||
@@ -1,285 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: browser-app (route E+)
|
||||
description: list CRUD, storage, navigate, interval, fetch_all, ws — GFM + lib/browser
|
||||
import:
|
||||
browser: lib/browser.mq.md
|
||||
table: lib/table.mq.md
|
||||
text: lib/text.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
**`ticks` = 0**
|
||||
**`bag` = ""**
|
||||
**`path` = "/"**
|
||||
**`ws_id` = "echo"**
|
||||
|
||||
`wire` =
|
||||
|
||||
| @ | 选择器 | 事件 | 调用 | 委托 | 值选择器 |
|
||||
|---|--------|------|------|------|----------|
|
||||
| 1 | "#add" | click | add | | "#draft" |
|
||||
| 2 | "#save" | click | save_draft | | "#draft" |
|
||||
| 3 | "#load" | click | load_draft | | |
|
||||
| 4 | "#start-tick" | click | start_tick | | |
|
||||
| 5 | "#stop-tick" | click | stop_tick | | |
|
||||
| 6 | "#nav-home" | click | go_home | | |
|
||||
| 7 | "#nav-about" | click | go_about | | |
|
||||
| 8 | "#nav-net" | click | go_net | | |
|
||||
| 9 | "window" | popstate | on_pop | | |
|
||||
| 10 | "#items" | click | on_item | "button[data-id]" | |
|
||||
| 11 | "#fetch-all" | click | do_fetch_all | | |
|
||||
| 12 | "#ws-open" | click | ws_open | | |
|
||||
| 13 | "#ws-send" | click | ws_send | | "#ws-msg" |
|
||||
| 14 | "#ws-close" | click | ws_close | | |
|
||||
| 15 | "#copy-log" | click | copy_log | | |
|
||||
| 16 | "#dl-list" | click | dl_list | | |
|
||||
|
||||
`nav` =
|
||||
|
||||
| url | replace |
|
||||
|-----|---------|
|
||||
| / | False |
|
||||
|
||||
`st` =
|
||||
|
||||
| op | key | then |
|
||||
|----|-----|------|
|
||||
| get | mq-draft | on_draft |
|
||||
|
||||
`boot` =
|
||||
|
||||
| wire | navigate | storage |
|
||||
|------|----------|---------|
|
||||
| `wire` | `nav` | `st` |
|
||||
|
||||
*boot*
|
||||
|
||||
## add
|
||||
+ `value`=""
|
||||
|
||||
1. `value` != ""
|
||||
1. `bag` == ""
|
||||
**`bag` = value**
|
||||
2. *
|
||||
**`bag` = bag + "\n" + value**
|
||||
**`parts` = > text.str_split s=bag sep="\n"**
|
||||
**`html` = ""**
|
||||
- [item](遍历 parts 为 item)
|
||||
1. `item` != ""
|
||||
**`html` = html + "<li><span>" + item + "</span> <button type=\"button\" data-id=\"" + item + "\">删</button></li>"**
|
||||
**`ret` = > browser.set_html sel="#items" html=html**
|
||||
**`clr` = > browser.set_value sel="#draft" value=""**
|
||||
**`ret` = > browser.merge a=ret b=clr**
|
||||
**`f` = > browser.focus sel="#draft"**
|
||||
*> browser.merge a=ret b=f*
|
||||
2. *
|
||||
****
|
||||
|
||||
## on_item
|
||||
+ `data_id`=""
|
||||
|
||||
1. `data_id` != ""
|
||||
**`parts` = > text.str_split s=bag sep="\n"**
|
||||
**`next` = ""**
|
||||
- [item](遍历 parts 为 item)
|
||||
1. `item` != ""
|
||||
1. `item` != `data_id`
|
||||
1. `next` == ""
|
||||
**`next` = item**
|
||||
2. *
|
||||
**`next` = next + "\n" + item**
|
||||
**`bag` = next**
|
||||
**`parts2` = > text.str_split s=bag sep="\n"**
|
||||
**`html` = ""**
|
||||
- [item](遍历 parts2 为 item)
|
||||
1. `item` != ""
|
||||
**`html` = html + "<li><span>" + item + "</span> <button type=\"button\" data-id=\"" + item + "\">删</button></li>"**
|
||||
**`ret` = > browser.set_html sel="#items" html=html**
|
||||
**`msg` = "removed " + data_id**
|
||||
**`t` = > browser.set_text sel="#log" text=msg**
|
||||
*> browser.merge a=ret b=t*
|
||||
2. *
|
||||
****
|
||||
|
||||
## save_draft
|
||||
+ `value`=""
|
||||
|
||||
`st` =
|
||||
|
||||
| op | key | value |
|
||||
|----|-----|-------|
|
||||
| set | mq-draft | `value` |
|
||||
|
||||
**`msg` = > browser.set_text sel="#log" text="draft saved"**
|
||||
**`s` = > browser.storage spec=st**
|
||||
*> browser.merge a=msg b=s*
|
||||
|
||||
## load_draft
|
||||
|
||||
`st` =
|
||||
|
||||
| op | key | then |
|
||||
|----|-----|------|
|
||||
| get | mq-draft | on_draft |
|
||||
|
||||
*> browser.storage spec=st*
|
||||
|
||||
## on_draft
|
||||
+ `ok`=True
|
||||
+ `value`=""
|
||||
+ `found`=False
|
||||
|
||||
1. `found`
|
||||
**`ret` = > browser.set_value sel="#draft" value=value**
|
||||
**`msg` = > browser.set_text sel="#log" text="draft loaded"**
|
||||
*> browser.merge a=ret b=msg*
|
||||
2. *
|
||||
*> browser.set_text sel="#log" text="no draft"*
|
||||
|
||||
## start_tick
|
||||
*> browser.interval ms=1000 then="on_tick" id="tick"*
|
||||
|
||||
## stop_tick
|
||||
*> browser.clear_interval id="tick"*
|
||||
|
||||
## on_tick
|
||||
+ `ok`=True
|
||||
+ `id`=""
|
||||
|
||||
**`ticks` = ticks + 1**
|
||||
**`label` = > str ticks**
|
||||
*> browser.set_text sel="#tick" text=label*
|
||||
|
||||
## go_home
|
||||
**`path` = "/"**
|
||||
*> show_path*
|
||||
|
||||
## go_about
|
||||
**`path` = "/about"**
|
||||
*> show_path*
|
||||
|
||||
## go_net
|
||||
**`path` = "/net"**
|
||||
*> show_path*
|
||||
|
||||
## on_pop
|
||||
+ `path`=""
|
||||
|
||||
**`path` = path**
|
||||
*> show_path*
|
||||
|
||||
## show_path
|
||||
**`hide` = > table.put in=None at="hidden" value=""**
|
||||
**`show` = > table.put in=None at="hidden" value=False**
|
||||
1. `path` == "/about"
|
||||
`attrs` =
|
||||
|
||||
| #panel-about | #panel-home | #panel-net |
|
||||
|--------------|-------------|------------|
|
||||
| `show` | `hide` | `hide` |
|
||||
2. *
|
||||
1. `path` == "/net"
|
||||
`attrs` =
|
||||
|
||||
| #panel-net | #panel-home | #panel-about |
|
||||
|------------|-------------|--------------|
|
||||
| `show` | `hide` | `hide` |
|
||||
2. *
|
||||
`attrs` =
|
||||
|
||||
| #panel-home | #panel-about | #panel-net |
|
||||
|-------------|--------------|------------|
|
||||
| `show` | `hide` | `hide` |
|
||||
**`label` = "path: " + path**
|
||||
**`ret` = > browser.set_text sel="#path" text=label**
|
||||
**`a` = > browser.wrap key="set_attr" value=attrs**
|
||||
**`ret` = > browser.merge a=ret b=a**
|
||||
**`nav` = > browser.navigate url=path**
|
||||
*> browser.merge a=ret b=nav*
|
||||
|
||||
## do_fetch_all
|
||||
|
||||
`reqs` =
|
||||
|
||||
| @ | url |
|
||||
|---|-----|
|
||||
| 1 | "https://httpbin.org/uuid" |
|
||||
| 2 | "https://httpbin.org/uuid" |
|
||||
|
||||
**`msg` = > browser.set_text sel="#net-out" text="fetch_all…"**
|
||||
**`fa` = > browser.fetch_all requests=reqs then="on_fetch_all"**
|
||||
*> browser.merge a=msg b=fa*
|
||||
|
||||
## on_fetch_all
|
||||
+ `ok`=True
|
||||
+ `results`=None
|
||||
|
||||
*> browser.set_text sel="#net-out" text="fetch_all done (see console / results in session)"*
|
||||
|
||||
## ws_open
|
||||
|
||||
`w` =
|
||||
|
||||
| op | id | url | then_open | then_message | then_error | then_close |
|
||||
|----|----|-----|-----------|--------------|------------|------------|
|
||||
| open | `ws_id` | "wss://echo.websocket.events" | on_ws_open | on_ws_msg | on_ws_err | on_ws_close |
|
||||
|
||||
*> browser.ws spec=w*
|
||||
|
||||
## on_ws_open
|
||||
+ `ok`=True
|
||||
+ `id`=""
|
||||
|
||||
*> browser.set_text sel="#net-out" text="ws open"*
|
||||
|
||||
## on_ws_msg
|
||||
+ `ok`=True
|
||||
+ `data`=""
|
||||
|
||||
**`msg` = "ws ← " + data**
|
||||
*> browser.set_text sel="#net-out" text=msg*
|
||||
|
||||
## on_ws_err
|
||||
+ `ok`=False
|
||||
+ `error`=""
|
||||
|
||||
**`msg` = "ws error: " + error**
|
||||
*> browser.set_text sel="#net-out" text=msg*
|
||||
|
||||
## on_ws_close
|
||||
+ `ok`=True
|
||||
|
||||
*> browser.set_text sel="#net-out" text="ws closed"*
|
||||
|
||||
## ws_send
|
||||
+ `value`=""
|
||||
|
||||
`w` =
|
||||
|
||||
| op | id | data |
|
||||
|----|----|------|
|
||||
| send | `ws_id` | `value` |
|
||||
|
||||
*> browser.ws spec=w*
|
||||
|
||||
## ws_close
|
||||
|
||||
`w` =
|
||||
|
||||
| op | id |
|
||||
|----|----|
|
||||
| close | `ws_id` |
|
||||
|
||||
*> browser.ws spec=w*
|
||||
|
||||
## copy_log
|
||||
**`msg` = > browser.set_text sel="#log" text="copied bag to clipboard"**
|
||||
**`c` = > browser.clipboard text=bag**
|
||||
*> browser.merge a=msg b=c*
|
||||
|
||||
## dl_list
|
||||
**`msg` = > browser.set_text sel="#log" text="download started"**
|
||||
**`d` = > browser.download body=bag filename="items.txt"**
|
||||
*> browser.merge a=msg b=d*
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: About panel Markdown leaf
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
fs: lib/fs.mq.md
|
||||
---
|
||||
|
||||
## nodes
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Structured View rows for this component |
|
||||
|
||||
About is a terminal Markdown leaf, so further layout splitting would add no useful responsibility. Read its content through the native filesystem under the granted site root. The wrapper supplies only its client visibility id and initial hidden state. The page describes official host capabilities without embedding implementation JavaScript or an HTML shell.
|
||||
|
||||
We **source = [Read the literal About content](fs.read_text(path="content/about.md"))** and **children = [Keep it as ordinary Markdown](component.markdown(text=`source`, slot="about-content"))**.
|
||||
|
||||
`attrs` =
|
||||
|
||||
| id | hidden |
|
||||
|---|---|
|
||||
| panel-about | True |
|
||||
|
||||
Return *[Describe the initially hidden About panel](component.wrap(children=`children`, kind="section", attrs=`attrs`, slot="about"))*.
|
||||
@@ -0,0 +1,70 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Native browser control leaves
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
## button
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| id | text | required | Event target shared with the client wire table |
|
||||
| label | text | required | Literal visible action |
|
||||
| secondary | bool | False | Use the retained secondary palette |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | One disabled native button awaiting successful runtime boot |
|
||||
|
||||
Use `id`, `label` and `secondary`=False for one leaf. The button starts disabled, carries type button and is enabled only after the official runtime boots successfully. Its label remains plain text. The caller chooses placement; this helper neither binds a click handler nor hides a sibling layout. Keep its id aligned with static/app.mq.md.
|
||||
|
||||
`attrs` =
|
||||
|
||||
| id | type | disabled |
|
||||
|---|---|---|
|
||||
| `id` | button | True |
|
||||
|
||||
We **style = ""**.
|
||||
1. `secondary`
|
||||
We **style = "secondary"**.
|
||||
Return *[Describe one literal native action](component.element(kind="button", value=`label`, attrs=`attrs`, style=`style`, slot=`id`))*.
|
||||
|
||||
## input
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| id | text | required | Client value target |
|
||||
| hint | text | required | Plain placeholder text |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | One disabled text input |
|
||||
|
||||
Use `id` and `hint` for the draft or socket message. A native text input preserves its ordinary editing semantics and starts disabled until WASM is ready. The hint is placeholder text rather than a markup template. The component owns one control; the client selects its value through the wire table when the adjacent action is clicked.
|
||||
|
||||
`attrs` =
|
||||
|
||||
| id | type | placeholder | disabled |
|
||||
|---|---|---|---|
|
||||
| `id` | text | `hint` | True |
|
||||
|
||||
Return *[Describe this native value input](component.element(kind="input", attrs=`attrs`, slot=`id`))*.
|
||||
|
||||
## text
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| id | text | required | Stable output target |
|
||||
| value | text | required | Literal initial text |
|
||||
| kind | text | "text" | Native text or pre output |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | One escaped text leaf |
|
||||
|
||||
Use `id`, `value` and `kind`="text" for an output target. Select pre for the runtime log and ordinary text for the path, tick count or network outcome. Initial and later content stays literal: the renderer escapes this value and callbacks use set_text. This leaf declares no timer or network operation; those belong to the browser program.
|
||||
|
||||
We **attrs = [Retain the exact output target](table.put(in=None, at="id", value=`id`))**.
|
||||
Return *[Describe the literal output leaf](component.element(kind=`kind`, value=`value`, attrs=`attrs`, slot=`id`))*.
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Draft and list editor
|
||||
import:
|
||||
controls: ../controls.mq.md
|
||||
component: ext/web/component/index.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
## nodes
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Structured View rows for this component |
|
||||
|
||||
The editor contains one draft input, three draft actions, the export actions and an initially empty native list. The client owns records, stable identities and delegated deletion; no authored list HTML is stored here. Save persists only the draft under this origin. Copy and Download export current item text while list state remains in browser session memory.
|
||||
|
||||
We **heading = [Read the plain editor heading](component.markdown(text="## 待办"))** and **input = [Describe the exact draft target](controls.input(id="draft", hint="新项…"))** and **children = [Place input after its heading](table.concat(a=`heading`, b=`input`))**.
|
||||
|
||||
`actions` =
|
||||
|
||||
| @ | id | label | secondary |
|
||||
|---|---|---|---|
|
||||
| 1 | add | 添加 | False |
|
||||
| 2 | save | 存草稿 | True |
|
||||
| 3 | load | 读草稿 | True |
|
||||
| 4 | copy-log | 复制列表 | True |
|
||||
| 5 | dl-list | 下载列表 | True |
|
||||
|
||||
- [Describe each native action leaf](for actions as action)
|
||||
We **button = [Keep this action separate from state](controls.button(id=access(action, "id"), label=access(action, "label"), secondary=access(action, "secondary")))** and **children = [Preserve the authored action order](table.concat(a=`children`, b=`button`))**.
|
||||
We **empty = [Start the empty native list](table.empty_list())** and **attrs = [Retain the delegated list target](table.put(in=None, at="id", value="items"))** and **list = [Describe the list container](component.wrap(children=`empty`, kind="list", attrs=`attrs`, slot="items"))**.
|
||||
Return *[Keep the list after its editing controls](table.concat(a=`children`, b=`list`))*.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Home panel assembly
|
||||
import:
|
||||
editor: editor.mq.md
|
||||
timer: timer.mq.md
|
||||
component: ext/web/component/index.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
## nodes
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Structured View rows for this component |
|
||||
|
||||
Home has two independent children: the list editor and the named timer. This parent expresses only that ordering and the panel identity used by the client. Start with Home visible; About and Network are hidden in their own definitions. State and transport do not belong in layout tables, and changing one child does not require copying the entire page.
|
||||
|
||||
We **list = [Assemble the editor responsibility](editor.nodes())** and **clock = [Assemble the timer responsibility](timer.nodes())** and **children = [Keep the two home regions ordered](table.concat(a=`list`, b=`clock`))** and **attrs = [Name the client visibility target](table.put(in=None, at="id", value="panel-home"))**.
|
||||
Return *[Describe the initially visible Home panel](component.wrap(children=`children`, kind="section", attrs=`attrs`, slot="home"))*.
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Named timer controls
|
||||
import:
|
||||
controls: ../controls.mq.md
|
||||
component: ext/web/component/index.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
## nodes
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Structured View rows for this component |
|
||||
|
||||
This region describes the tick output and its two actions. The client increments retained state only when the named timer actually calls back. Start replaces a timer with the same id; Stop preserves the count. This layout performs no sleeping or counting on the server, and its native text output can be tested independently of timer scheduling.
|
||||
|
||||
We **label = [Describe the timer label](component.markdown(text="计时(秒):"))** and **counter = [Describe the initial count](controls.text(id="tick", value="0"))** and **start = [Describe the explicit start action](controls.button(id="start-tick", label="开始"))** and **stop = [Describe the explicit stop action](controls.button(id="stop-tick", label="停止", secondary=True))** and **content = [Keep label before count](table.concat(a=`label`, b=`counter`))** and **actions = [Keep the two actions together](table.concat(a=`start`, b=`stop`))** and **children = [Place actions beside their output](table.concat(a=`content`, b=`actions`))**.
|
||||
Return *[Wrap this one timer responsibility](component.wrap(children=`children`, kind="row", slot="timer"))*.
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Browser example recursive page assembly
|
||||
import:
|
||||
navigation: navigation.mq.md
|
||||
home: home/index.mq.md
|
||||
about: about.mq.md
|
||||
network: network/index.mq.md
|
||||
controls: controls.mq.md
|
||||
component: ext/web/component/index.mq.md
|
||||
fs: lib/fs.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
## nodes
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Structured View rows for this component |
|
||||
|
||||
Read this root to see the whole page: introduction, path, navigation, three panels, feedback and runtime. Follow one import at a time until a child is a plain Markdown leaf or native control. Business values never become a page HTML string. The official runtime starts only after the server has staged the current built assets and the actual client source. Controls stay disabled until boot succeeds; missing resources therefore remain visible as a loading failure. The readiness target and enable selectors are typed resource metadata, not executable snippets. Styles reference the generated stylesheet produced by serve. Server discovery reads the terminal content leaves under the granted root; the browser receives the same ordered region tree.
|
||||
|
||||
We **source = [Read the plain introduction](fs.read_text(path="content/intro.md"))** and **intro = [Retain its Markdown](component.markdown(text=`source`, slot="intro"))** and **path = [Describe the initial pathname](controls.text(id="path", value="path: /"))** and **nav = [Assemble the authored destinations](navigation.nodes())** and **home = [Assemble list and timer](home.nodes())** and **about = [Read the About leaf](about.nodes())** and **network = [Assemble independent network controls](network.nodes())** and **log = [Describe literal runtime feedback](controls.text(id="log", value="loading…", kind="pre"))** and **style = [Reference the compiled declarative theme](component.asset(url="/static/theme.css", kind="stylesheet"))**.
|
||||
|
||||
`runtime_attrs` =
|
||||
|
||||
| type | data-mq-wasm | data-mq-source-url | data-mq-ready | data-mq-enable |
|
||||
|---|---|---|---|---|
|
||||
| module | "/static/marqdo_wasm.wasm" | "/static/app.mq.md" | "#log" | "#draft,#add,#save,#load,#start-tick,#stop-tick,#fetch-all,#ws-open,#ws-msg,#ws-send,#ws-close,#copy-log,#dl-list" |
|
||||
|
||||
We **runtime = [Declare the official module and readiness targets](component.asset(url="/static/marqdo-bridge.js", attrs=`runtime_attrs`, slot="runtime"))**.
|
||||
|
||||
`groups` =
|
||||
|
||||
| rows |
|
||||
|---|
|
||||
| `intro` |
|
||||
| `path` |
|
||||
| `nav` |
|
||||
| `home` |
|
||||
| `about` |
|
||||
| `network` |
|
||||
| `log` |
|
||||
| `style` |
|
||||
| `runtime` |
|
||||
|
||||
We **children = [Start the complete ordered page](table.empty_list())**.
|
||||
- [Retain each independently inspectable region](for groups as group)
|
||||
We **children = [Keep typed children in reading order](table.concat(a=`children`, b=`group`))**.
|
||||
Return *[Wrap the recursive page once](component.wrap(children=`children`, slot="browser-app", style="browser-app"))*.
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Three browser panel destinations
|
||||
import:
|
||||
component: ext/web/component/index.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
## nodes
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Structured View rows for this component |
|
||||
|
||||
Navigation contains three ordinary links with stable ids. Their fragment destinations leave a readable fallback without issuing a server page request. The official wire table intercepts each click and requests one deliberate history entry. Back and Forward only repaint the already selected panel. This component does not own client state or generate navigation JavaScript.
|
||||
|
||||
`destinations` =
|
||||
|
||||
| @ | id | href | label |
|
||||
|---|---|---|---|
|
||||
| 1 | nav-home | "#/" | 首页 |
|
||||
| 2 | nav-about | "#/about" | 关于 |
|
||||
| 3 | nav-net | "#/net" | 网络 |
|
||||
|
||||
We **links = [Start the ordered native navigation](table.empty_list())**.
|
||||
- [Declare each independently named destination](for destinations as destination)
|
||||
We **label = [Read its literal label](access(destination, "label"))** and **id = [Read its stable event target](access(destination, "id"))** and **href = [Read its fallback destination](access(destination, "href"))**.
|
||||
|
||||
`attrs` =
|
||||
|
||||
| id | href |
|
||||
|---|---|
|
||||
| `id` | `href` |
|
||||
|
||||
We **link = [Describe this native destination](component.element(kind="link", value=`label`, attrs=`attrs`))** and **links = [Preserve navigation order](table.concat(a=`links`, b=`link`))**.
|
||||
Return *[Place those links in a navigation region](component.wrap(children=`links`, kind="nav", slot="navigation"))*.
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Network panel assembly
|
||||
import:
|
||||
socket: socket.mq.md
|
||||
controls: ../controls.mq.md
|
||||
component: ext/web/component/index.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
## nodes
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Structured View rows for this component |
|
||||
|
||||
Network places plain explanatory content, the actual response output, a batch-fetch action and a local echo group. Batch requests retain the original public demonstration endpoint and may fail; ordered callback records show each status and body. Socket transport is local and independent. The panel starts hidden and the browser client alone selects it.
|
||||
|
||||
We **heading = [Describe the network responsibility](component.markdown(text="## 网络\n\n批量请求显示每项的实际状态;WebSocket 使用本机 /live 回声服务。"))** and **output = [Describe literal transport feedback](controls.text(id="net-out", value="idle"))** and **fetch = [Describe the batch request action](controls.button(id="fetch-all", label="fetch_all ×2 uuid"))** and **echo = [Assemble local socket controls](socket.nodes())** and **first = [Place feedback below its explanation](table.concat(a=`heading`, b=`output`))** and **last = [Keep fetch before socket interaction](table.concat(a=`fetch`, b=`echo`))** and **children = [Preserve the two network responsibilities](table.concat(a=`first`, b=`last`))**.
|
||||
|
||||
`attrs` =
|
||||
|
||||
| id | hidden |
|
||||
|---|---|
|
||||
| panel-net | True |
|
||||
|
||||
Return *[Describe the initially hidden Network panel](component.wrap(children=`children`, kind="section", attrs=`attrs`, slot="network"))*.
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Local echo socket controls
|
||||
import:
|
||||
controls: ../controls.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
## nodes
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Structured View rows for this component |
|
||||
|
||||
The echo group contains Open, the message input, Send and Close as separate native leaves. The server binds /live, and the official bridge sends the browser program’s transport instructions. Actual lifecycle callbacks update the network output. This component performs no handshake itself and does not rely on availability of a public echo service.
|
||||
|
||||
We **open = [Describe the connection action](controls.button(id="ws-open", label="WS 打开"))** and **message = [Describe exact message input](controls.input(id="ws-msg", hint="ws 消息"))** and **send = [Describe the explicit send action](controls.button(id="ws-send", label="WS 发送"))** and **close = [Describe the explicit close action](controls.button(id="ws-close", label="WS 关闭", secondary=True))** and **first = [Keep open before message entry](table.concat(a=`open`, b=`message`))** and **last = [Keep send before close](table.concat(a=`send`, b=`close`))**.
|
||||
Return *[Keep the local echo interaction ordered](table.concat(a=`first`, b=`last`))*.
|
||||
@@ -0,0 +1,5 @@
|
||||
## 关于
|
||||
|
||||
从 `index.mq.md` 阅读工程入口,沿 `components/index.mq.md` 逐层查看布局,再阅读 `static/app.mq.md` 的事件与回调。
|
||||
|
||||
普通内容使用 Markdown,控件使用原生节点,列表保留带独立 ID 的记录。浏览器执行官方 bridge 提供的 DOM、历史、存储与网络能力,无需作者撰写业务 JavaScript。
|
||||
@@ -0,0 +1,3 @@
|
||||
# Marqdo browser-app
|
||||
|
||||
列表、草稿存储、历史导航、计时、批量请求、WebSocket、剪贴板和下载。页面和业务流程均由 Marqdo 源码表达,浏览器宿主能力由官方 bridge 提供。
|
||||
@@ -1,96 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hans">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Marqdo · browser-app (route E)</title>
|
||||
<style>
|
||||
:root { --ink: #1a1f1c; --paper: #e8efe6; --accent: #2f6f4e; --muted: #5a6b60; }
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0; min-height: 100vh; font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
|
||||
color: var(--ink);
|
||||
background: linear-gradient(165deg, #f3f7f2, var(--paper));
|
||||
padding: 2rem clamp(1rem, 4vw, 3rem);
|
||||
}
|
||||
h1 { font-family: "IBM Plex Serif", "Noto Serif SC", serif; margin: 0 0 0.35rem; }
|
||||
.lead { color: var(--muted); max-width: 42rem; }
|
||||
nav a { margin-right: 0.75rem; color: var(--accent); }
|
||||
section { margin: 1.5rem 0; padding: 1rem 0; border-top: 1px solid #c5d4c9; }
|
||||
#path { font-family: ui-monospace, monospace; color: var(--muted); }
|
||||
#items { list-style: none; padding: 0; margin: 0.75rem 0; }
|
||||
#items li {
|
||||
display: flex; align-items: center; gap: 0.5rem;
|
||||
padding: 0.4rem 0.6rem; margin-bottom: 0.35rem;
|
||||
background: rgba(255,255,255,0.65); border: 1px solid #b7c7bb;
|
||||
}
|
||||
#items button { margin-left: auto; }
|
||||
input[type="text"] { padding: 0.45rem 0.65rem; border: 1px solid #b7c7bb; width: min(16rem, 70%); }
|
||||
button {
|
||||
padding: 0.45rem 0.9rem; border: 0; background: var(--accent); color: #f5faf6;
|
||||
font: inherit; cursor: pointer; margin: 0.2rem 0.35rem 0.2rem 0;
|
||||
}
|
||||
button.secondary { background: #3a4740; }
|
||||
#tick, #net-out { font-variant-numeric: tabular-nums; }
|
||||
#net-out {
|
||||
min-height: 2.5rem; padding: 0.6rem 0.75rem; background: rgba(255,255,255,0.55);
|
||||
border: 1px solid #b7c7bb; white-space: pre-wrap; word-break: break-all;
|
||||
}
|
||||
pre {
|
||||
margin-top: 1rem; padding: 0.85rem 1rem; background: #122018; color: #d7eadc;
|
||||
font-size: 0.8rem; overflow: auto; max-width: 42rem;
|
||||
}
|
||||
.err { color: #ffb4a8; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Marqdo browser-app</h1>
|
||||
<p class="lead">路线 E:列表 CRUD / storage / navigate / interval / fetch_all / ws / clipboard / download — <strong>无作者业务 JS</strong>。</p>
|
||||
<p id="path">path: /</p>
|
||||
<nav>
|
||||
<a href="#/" id="nav-home">首页</a>
|
||||
<a href="#/about" id="nav-about">关于</a>
|
||||
<a href="#/net" id="nav-net">网络</a>
|
||||
</nav>
|
||||
|
||||
<section id="panel-home">
|
||||
<h2>待办</h2>
|
||||
<input id="draft" type="text" placeholder="新项…" disabled />
|
||||
<button id="add" type="button" disabled>添加</button>
|
||||
<button id="save" class="secondary" type="button" disabled>存草稿</button>
|
||||
<button id="load" class="secondary" type="button" disabled>读草稿</button>
|
||||
<button id="copy-log" class="secondary" type="button" disabled>复制列表</button>
|
||||
<button id="dl-list" class="secondary" type="button" disabled>下载列表</button>
|
||||
<ul id="items"></ul>
|
||||
<p>计时:<span id="tick">0</span>s
|
||||
<button id="start-tick" type="button" disabled>开始</button>
|
||||
<button id="stop-tick" class="secondary" type="button" disabled>停止</button>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section id="panel-about" hidden>
|
||||
<h2>关于</h2>
|
||||
<p>作者只写 <code>app.mq.md</code>。官方 bridge 提供 DOM / 路由 / storage / ws / fetch_all 等宿主能力。</p>
|
||||
</section>
|
||||
|
||||
<section id="panel-net" hidden>
|
||||
<h2>网络</h2>
|
||||
<p id="net-out">idle</p>
|
||||
<button id="fetch-all" type="button" disabled>fetch_all ×2 uuid</button>
|
||||
<button id="ws-open" type="button" disabled>WS 打开</button>
|
||||
<input id="ws-msg" type="text" placeholder="ws 消息" disabled />
|
||||
<button id="ws-send" type="button" disabled>WS 发送</button>
|
||||
<button id="ws-close" class="secondary" type="button" disabled>WS 关闭</button>
|
||||
</section>
|
||||
|
||||
<pre id="log">loading…</pre>
|
||||
<script
|
||||
type="module"
|
||||
src="./marqdo-bridge.js"
|
||||
data-mq-wasm="./marqdo_wasm.wasm"
|
||||
data-mq-source-url="./app.mq.md"
|
||||
data-mq-ready="#log"
|
||||
data-mq-enable="#draft,#add,#save,#load,#start-tick,#stop-tick,#fetch-all,#ws-open,#ws-msg,#ws-send,#ws-close,#copy-log,#dl-list"
|
||||
></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
markup: occlusion
|
||||
type: web
|
||||
view: main
|
||||
route: /
|
||||
title: Marqdo browser-app
|
||||
import:
|
||||
page: components/index.mq.md
|
||||
styles: styles/index.mq.md
|
||||
web: ext/web/web.mq.md
|
||||
http: ext/net/http.mq.md
|
||||
socket: ext/net/websocket.mq.md
|
||||
fs: lib/fs.mq.md
|
||||
result: lib/result.mq.md
|
||||
---
|
||||
|
||||
This is the callable engineering entry. Follow components/index.mq.md for recursive layout, static/app.mq.md for browser state and effects, and styles/index.mq.md for the retained theme. Plain content is Markdown; controls and resources remain native structured values. There is no authored HTML host or business JavaScript. Serve runs from the checkout root with --fs-root examples/browser-app.
|
||||
|
||||
## main
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | list | Inspectable native page rows |
|
||||
|
||||
The Document delegates page assembly to its component root. Home, About and Network are client panels within this one page, with their own independently readable components. The client controls visibility and history while ordinary content remains Markdown. This function does not start a server, fetch public endpoints or open a socket. Read the returned tree as layout data, and call serve for a real running application.
|
||||
|
||||
Return *[Assemble the recursive browser demonstration](page.nodes())*.
|
||||
|
||||
## serve
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| root | text | "examples/browser-app" | Explicit site directory relative to the checkout |
|
||||
| port | number | 18095 | Loopback listen port |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Blocking listener or missing-asset failure |
|
||||
|
||||
Use `root`="examples/browser-app" and `port`=18095 with plugin,fs.write,network.write and the site filesystem root. Build current browser assets through the development handbook first. Both generated assets must exist before theme compilation or listening; missing files produce an actionable Result. The native filesystem writes only the explicit compiled stylesheet. No Python static server or generated shell workflow is needed.
|
||||
|
||||
Discovery prepares the Document and the static mount. Direct /about and /net visits redirect to the entry page, matching the transient panel-state model; Back and Forward inside a live page retain their actual history positions. A separate local network resource binds /live for anonymous demonstration echo. This loopback example does not authenticate or persist item records. Keep every returned app value and listen only after binding all resources.
|
||||
|
||||
`assets` =
|
||||
|
||||
| file |
|
||||
|---|
|
||||
| static/marqdo_wasm.wasm |
|
||||
| static/marqdo-bridge.js |
|
||||
|
||||
- [Require current official browser resources](for assets as file)
|
||||
1. not [The required runtime asset exists](fs.exists(path=`file`))
|
||||
Return *[Expose the actual build prerequisite](result.error(code="browser_app.assets", message="call build_browser and stage its assets in examples/browser-app/static before serve", operation="serve"))*.
|
||||
We **css = [Compile the retained declarative theme](styles.css())** and **[Write only the generated stylesheet](fs.atomic_write(path="static/theme.css", text=`css`))** and **app = [Discover the native Document and static assets](web.prepare(root=`root`, host="127.0.0.1", port=`port`, static_dir="static"))** and **app = [Retain a direct About entry](http.redirect(app=`app`, from="/about", to="/", permanent=False))** and **app = [Retain a direct Network entry](http.redirect(app=`app`, from="/net", to="/", permanent=False))** and **app = [Bind the actual local echo resource](socket.route(app=`app`, path="/live", mode="echo", require_auth=False))**.
|
||||
Return *[Listen after the real resources are ready](web.listen(app=`app`))*.
|
||||
@@ -0,0 +1,568 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Browser effects — native records and explicit completion
|
||||
description: list CRUD, storage, navigate, interval, fetch_all, ws — GFM + lib/browser
|
||||
import:
|
||||
browser: lib/browser.mq.md
|
||||
table: lib/table.mq.md
|
||||
text: lib/text.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Initial browser view/state record |
|
||||
|
||||
This entry prepares browser instructions; it does not itself fetch a URL or manipulate a server filesystem. The host page must supply the selectors listed below. List state uses native records with stable ids, keeping duplicate text and literal newlines independent. The wire table maps each UI event to one actual callback, including delegated item buttons, history navigation, timer controls, parallel fetches and a named WebSocket connection.
|
||||
|
||||
Event declarations contain no user values interpolated into code. Input values flow through callback parameters while the server page remains a separate document.
|
||||
|
||||
The returned boot record combines event registration and a storage lookup, without pushing an initial history entry. The browser bridge applies those instructions and dispatches later events into the callbacks. Draft text, tick count, route and socket identifier belong to that browser instance. Storage callbacks complete asynchronously; the initial return is not proof that a saved draft was found.
|
||||
|
||||
We **ticks = 0** as the retained count before the first real timer event.
|
||||
We **items = [Start native list state](table.empty_list())** and **next_id = 1** for independent record identities.
|
||||
We **route_path = "/"** as this browser instance’s panel state.
|
||||
We **ws_id = "echo"** as the one named local connection.
|
||||
|
||||
`wire` =
|
||||
|
||||
| @ | 选择器 | 事件 | 调用 | 委托 | 值选择器 |
|
||||
|---|--------|------|------|------|----------|
|
||||
| 1 | "#add" | click | add | | "#draft" |
|
||||
| 2 | "#save" | click | save_draft | | "#draft" |
|
||||
| 3 | "#load" | click | load_draft | | |
|
||||
| 4 | "#start-tick" | click | start_tick | | |
|
||||
| 5 | "#stop-tick" | click | stop_tick | | |
|
||||
| 6 | "#nav-home" | click | go_home | | |
|
||||
| 7 | "#nav-about" | click | go_about | | |
|
||||
| 8 | "#nav-net" | click | go_net | | |
|
||||
| 9 | "window" | popstate | on_pop | | |
|
||||
| 10 | "#items" | click | on_item | "button[data-id]" | |
|
||||
| 11 | "#fetch-all" | click | do_fetch_all | | |
|
||||
| 12 | "#ws-open" | click | ws_open | | |
|
||||
| 13 | "#ws-send" | click | ws_send | | "#ws-msg" |
|
||||
| 14 | "#ws-close" | click | ws_close | | |
|
||||
| 15 | "#copy-log" | click | copy_log | | |
|
||||
| 16 | "#dl-list" | click | dl_list | | |
|
||||
|
||||
`st` =
|
||||
|
||||
| op | key | then |
|
||||
|----|-----|------|
|
||||
| get | mq-draft | on_draft |
|
||||
|
||||
`boot` =
|
||||
|
||||
| wire | storage |
|
||||
|---|---|
|
||||
| `wire` | `st` |
|
||||
|
||||
After these steps, return *boot*.
|
||||
|
||||
## add
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| value | text | "" | Exact draft text supplied by the add control |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Native list refresh, input clear and focus; None for empty text |
|
||||
|
||||
Use `value`="" from the input. Retain each nonempty value exactly as one record, including quotes, angle brackets or a literal newline. A monotonically assigned id separates duplicate titles; deleting one must not erase its siblings. This direct callback updates entry state, then passes those records explicitly to the pure renderer. No business value is interpolated into HTML.
|
||||
|
||||
The input clears and regains focus after a real local addition. An empty string returns None without changing records or consuming an id. This list is session memory; only the separately saved draft uses browser storage.
|
||||
|
||||
1. `value` == ""
|
||||
Return *None* because there is no new item.
|
||||
We **id = [Assign an independent stable identity](str(next_id))** and **next_id = next_id + 1**.
|
||||
|
||||
`record` =
|
||||
|
||||
| id | text |
|
||||
|---|---|
|
||||
| `id` | `value` |
|
||||
|
||||
We **items = [Retain the actual text record](table.append(list=`items`, item=`record`))** and **view = [Render typed labels and delete controls](_list(records=`items`))** and **clear = [Clear the completed input](browser.set_value(sel="#draft", value=""))** and **focus = [Return to the draft control](browser.focus(sel="#draft"))**.
|
||||
We **view = [Keep the independent list and value effects](browser.merge(a=`view`, b=`clear`))**.
|
||||
Return *[Keep focus with the completed list update](browser.merge(a=`view`, b=`focus`))*.
|
||||
|
||||
## on_item
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| data_id | text | "" | Stable id supplied by the delegated delete button |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Remaining native records and removal feedback, or None for an unknown id |
|
||||
|
||||
Use `data_id`="" from button[data-id]. Compare identities rather than text, so duplicate values and values containing newlines stay independent. Preserve remaining order and do nothing for an empty or unknown id. The renderer receives retained records explicitly; it does not infer client state inside a normal helper call.
|
||||
|
||||
A deletion rebuilds the same list through typed controls and reports the removed id as text. It neither modifies a saved draft nor changes timer, transport or route state. Ids are not recycled after deletion, avoiding a stale event selecting a different later item.
|
||||
|
||||
1. `data_id` == ""
|
||||
Return *None* for an absent selection.
|
||||
We **remaining = [Start the retained row order](table.empty_list())**.
|
||||
- [Keep every record except the selected identity](for items as item)
|
||||
1. access(`item`, "id") != `data_id`
|
||||
We **remaining = [Keep this independent record](table.append(list=`remaining`, item=`item`))**.
|
||||
1. len(`remaining`) == len(`items`)
|
||||
Return *None* because no selected identity exists.
|
||||
We **items = remaining** and **view = [Render the actual retained rows](_list(records=`items`))** and **message = "removed " + data_id** and **status = [Describe the observed local removal](browser.set_text(sel="#log", text=`message`))**.
|
||||
Return *[Keep list and feedback together](browser.merge(a=`view`, b=`status`))*.
|
||||
|
||||
## save_draft
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| value | text | "" | Exact text selected from the draft input |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Storage write request; completion arrives at on_saved |
|
||||
|
||||
Use `value`="" from the draft control. The storage record names the local key and its completion callback. Return the request immediately; only on_saved can announce a successful write. An intentionally empty draft is valid and differs from an absent key. Storage belongs to this browser origin, while list records stay in session memory. Returning this record does not write server files or grant process access.
|
||||
|
||||
`request` =
|
||||
|
||||
| op | key | value | then |
|
||||
|---|---|---|---|
|
||||
| set | mq-draft | `value` | on_saved |
|
||||
|
||||
Return *[Ask the browser to persist the exact draft](browser.storage(spec=`request`))*.
|
||||
|
||||
## load_draft
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Storage read request with an explicit completion callback |
|
||||
|
||||
Request mq-draft from this browser origin. The callback distinguishes a missing key, an empty saved value and a failed read. No input is cleared while the read is pending, and this operation never replaces the native item list. The same read runs at boot, so a reload restores the saved draft without claiming to persist list records.
|
||||
|
||||
`request` =
|
||||
|
||||
| op | key | then |
|
||||
|---|---|---|
|
||||
| get | mq-draft | on_draft |
|
||||
|
||||
Return *[Request the stored draft and its actual outcome](browser.storage(spec=`request`))*.
|
||||
|
||||
## on_draft
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| ok | bool | True | Actual storage-read completion |
|
||||
| value | text | "" | Stored draft text, including an intentionally empty value |
|
||||
| found | bool | False | Whether the key actually existed |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Restored value and feedback, or actual missing/failure feedback |
|
||||
|
||||
Use `ok`=True, `value`="" and `found`=False from storage. A missing key differs from a stored empty draft, and an unsuccessful read must not be described as absence. Restore the exact value only after a successful read with found=True. This changes the draft input, not the native item list, and never interprets the stored text as code.
|
||||
|
||||
1. not `ok`
|
||||
Return *[Keep a failed read visible](browser.set_text(sel="#log", text="draft read failed"))*.
|
||||
1. not `found`
|
||||
Return *[Keep an absent draft visible](browser.set_text(sel="#log", text="no draft"))*.
|
||||
We **value_effect = [Restore exact stored draft text](browser.set_value(sel="#draft", value=`value`))** and **status = [Confirm the observed read](browser.set_text(sel="#log", text="draft loaded"))**.
|
||||
Return *[Keep the actual value and feedback](browser.merge(a=`value_effect`, b=`status`))*.
|
||||
|
||||
## start_tick
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | One named repeating timer instruction |
|
||||
|
||||
Start tick at one-second intervals. The bridge replaces a timer with the same id, so repeated Start clicks do not accumulate independent clocks. Each callback increments the session counter once. This returns an instruction; it is neither a blocking sleep nor proof that one second has passed. Stop cancels future callbacks and preserves the accumulated display.
|
||||
|
||||
Return *[Start or replace the one named timer](browser.interval(ms=1000, then="on_tick", id="tick"))*.
|
||||
|
||||
## stop_tick
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Cancellation of the named timer |
|
||||
|
||||
Cancel tick through its explicit id. Calling Stop before Start is harmless, and stopping does not reset the visible count or alter other timers. A later Start resumes counting from retained state. The browser owns the timer handle; authors do not keep a JavaScript handle or generate a client program to clear it.
|
||||
|
||||
Return *[Cancel future callbacks for this timer](browser.clear_interval(id="tick"))*.
|
||||
|
||||
## on_tick
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| ok | bool | True | Whether this timer callback is valid |
|
||||
| id | text | "" | Actual named timer id |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Updated count, or None for a failed/unrelated callback |
|
||||
|
||||
Use `ok`=True and `id`="" from the timer. Count only successful events belonging to tick; unrelated callbacks must not change this counter. Retained ticks belongs to the direct browser callback, rather than being supplied by the event. A manual call to this function constructs the same text effect but does not prove that a real timer fired.
|
||||
|
||||
1. not `ok` or `id` != "tick"
|
||||
Return *None* for an unrelated timer outcome.
|
||||
We **ticks = ticks + 1** and **label = [Format the actual accumulated count](str(ticks))**.
|
||||
Return *[Display that observed timer count](browser.set_text(sel="#tick", text=`label`))*.
|
||||
|
||||
## go_home
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Selected panel effects and one actual navigation request |
|
||||
|
||||
Select / from its authored navigation control. This direct callback updates the retained panel state and requests exactly one history entry. The helper receives the path explicitly rather than assuming an ordinary call captures entry bindings. Back/Forward uses on_pop, which renders without navigation. No server request or page HTML is constructed here.
|
||||
|
||||
We **route_path = "/"**.
|
||||
Return *[Render and request this one deliberate navigation](_view(route=`route_path`, push=True))*.
|
||||
|
||||
## go_about
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Selected panel effects and one actual navigation request |
|
||||
|
||||
Select /about from its authored navigation control. This direct callback updates the retained panel state and requests exactly one history entry. The helper receives the path explicitly rather than assuming an ordinary call captures entry bindings. Back/Forward uses on_pop, which renders without navigation. No server request or page HTML is constructed here.
|
||||
|
||||
We **route_path = "/about"**.
|
||||
Return *[Render and request this one deliberate navigation](_view(route=`route_path`, push=True))*.
|
||||
|
||||
## go_net
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Selected panel effects and one actual navigation request |
|
||||
|
||||
Select /net from its authored navigation control. This direct callback updates the retained panel state and requests exactly one history entry. The helper receives the path explicitly rather than assuming an ordinary call captures entry bindings. Back/Forward uses on_pop, which renders without navigation. No server request or page HTML is constructed here.
|
||||
|
||||
We **route_path = "/net"**.
|
||||
Return *[Render and request this one deliberate navigation](_view(route=`route_path`, push=True))*.
|
||||
|
||||
## on_pop
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| path | text | "" | Actual browser pathname, including optional query string |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | History-selected panel effects without pushing history again |
|
||||
|
||||
Use `path`="" from the real popstate callback. Keep its normalized panel route in the differently named entry state, avoiding accidental shadowing of a callback parameter. The browser has already selected this history entry, so returning navigate would add an incorrect new entry. Query text does not choose a different panel; only the known pathname is used.
|
||||
|
||||
We **parts = [Separate the pathname from query text](text.str_split(s=`path`, sep="?"))** and **route_path = [Keep the actual panel path](table.first(list=`parts`))**.
|
||||
Return *[Reflect the actual history position](_view(route=`route_path`))*.
|
||||
|
||||
## show_path
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Current panel visibility and label without history mutation |
|
||||
|
||||
This direct browser callback reads retained route_path and delegates pure rendering with explicit input. It never pushes another history entry, so a repaint cannot trap Back/Forward. Call the navigation callbacks to request a new route. Server routing and page structure remain separate responsibilities; unknown browser paths select the home panel.
|
||||
|
||||
Return *[Refresh the retained panel without navigating](_view(route=`route_path`))*.
|
||||
|
||||
## do_fetch_all
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | The value explicitly returned below; conditional returns follow the selected branch |
|
||||
|
||||
Queue two independent browser fetches and return an immediate loading message together with the request instruction. Results arrive through on_fetch_all; this initial return does not contain either HTTP response. The request table keeps both URLs visible and avoids generating JavaScript to construct the batch.
|
||||
|
||||
The example endpoint is external and may fail or be unavailable. Consumers must inspect the actual callback records rather than count request declarations as successful responses. Browser network policy still applies; no backend file or shell operation is authorized by this instruction.
|
||||
|
||||
`reqs` =
|
||||
|
||||
| @ | url |
|
||||
|---|-----|
|
||||
| 1 | "https://httpbin.org/uuid" |
|
||||
| 2 | "https://httpbin.org/uuid" |
|
||||
|
||||
We **msg = [Describe the pending batch](browser.set_text(sel="#net-out", text="fetch_all…"))** and **requests = [Request both actual HTTP outcomes](browser.fetch_all(requests=`reqs`, then="on_fetch_all"))**.
|
||||
Return *[Keep pending feedback with its asynchronous requests](browser.merge(a=`msg`, b=`requests`))*.
|
||||
|
||||
## on_fetch_all
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| ok | bool | True | Whether the batch callback itself completed |
|
||||
| results | any | None | Ordered per-request ok/status/body/error records |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Actual per-request outcomes shown as plain text |
|
||||
|
||||
Use `ok`=True and `results`=None from the bridge. A completed batch can still contain failed HTTP or network operations; the outer callback flag does not make each record successful. Show the real ordered records, including status, body and errors, rather than a fixed completion message. Text output cannot become HTML or a browser command.
|
||||
|
||||
A missing result list stays visibly unavailable. Public endpoints remain demonstration dependencies; local tests supply controlled responses and a failure. This callback does not retry a request or replace its body with a predetermined answer.
|
||||
|
||||
1. not `ok`
|
||||
Return *[Keep batch failure visible](browser.set_text(sel="#net-out", text="fetch_all failed"))*.
|
||||
1. `results` == None
|
||||
Return *[Keep absent results distinct](browser.set_text(sel="#net-out", text="fetch_all returned no results"))*.
|
||||
We **message = [Retain actual request outcomes](str(results))**.
|
||||
Return *[Display observed successes and failures literally](browser.set_text(sel="#net-out", text=`message`))*.
|
||||
|
||||
## ws_open
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Named local WebSocket request and lifecycle callbacks |
|
||||
|
||||
Open the site’s /live echo resource under the explicit echo id. A relative URL uses the current origin and its transport security, allowing the example to run without a public echo provider. The server separately binds this native network resource. Returning the record only requests a connection; open, message, error and close callbacks describe actual transport outcomes. Subsequent send and close instructions reuse the same id.
|
||||
|
||||
`request` =
|
||||
|
||||
| op | id | url | then_open | then_message | then_error | then_close |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| open | `ws_id` | "/live" | on_ws_open | on_ws_msg | on_ws_err | on_ws_close |
|
||||
|
||||
Return *[Request the local echo connection](browser.ws(spec=`request`))*.
|
||||
|
||||
## on_ws_open
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| ok | bool | True | Actual connection completion |
|
||||
| id | text | "" | Connected socket id |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Confirmed connection text, or None for a failed/unrelated callback |
|
||||
|
||||
Use `ok`=True and `id`="" from the real transport. Accept only the named echo socket; a different resource cannot announce this widget ready. This callback confirms the handshake, while sending still requires a separate user action. It neither invents a received message nor marks a requested connection successful before the bridge reports it.
|
||||
|
||||
1. not `ok` or `id` != `ws_id`
|
||||
Return *None* for an unrelated connection.
|
||||
Return *[Confirm the observed handshake](browser.set_text(sel="#net-out", text="ws open"))*.
|
||||
|
||||
## on_ws_msg
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| ok | bool | True | Actual message completion |
|
||||
| data | text | "" | Exact received text |
|
||||
| id | text | "" | Receiving socket id |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Literal received message, or None for a failed/unrelated callback |
|
||||
|
||||
Use `ok`=True, `data`="" and `id`="" from the echo connection. Preserve the complete received text, including quotes and angle brackets. Display it through set_text so a message is data rather than page markup. Receipt is independent of the send click: the remote resource may respond later or close without replying.
|
||||
|
||||
1. not `ok` or `id` != `ws_id`
|
||||
Return *None* for an unrelated message.
|
||||
We **message = "ws ← " + data**.
|
||||
Return *[Display the actual echo as plain text](browser.set_text(sel="#net-out", text=`message`))*.
|
||||
|
||||
## on_ws_err
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| ok | bool | False | Failure flag supplied by the bridge |
|
||||
| error | text | "" | Actual transport failure text |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Visible transport failure |
|
||||
|
||||
Use `ok`=False and `error`="" from the transport callback. Keep the actual error text in the output rather than substituting a success message. The callback performs no automatic reconnect and sends no pending message. Reopening is an explicit user operation; failures remain inspectable while the rest of the page can continue operating.
|
||||
|
||||
We **message = "ws error: " + error**.
|
||||
Return *[Expose the actual connection failure](browser.set_text(sel="#net-out", text=`message`))*.
|
||||
|
||||
## on_ws_close
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| ok | bool | True | Actual close callback flag |
|
||||
| id | text | "" | Closed socket id |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Observed close text, or None for an unrelated socket |
|
||||
|
||||
Use `ok`=True and `id`="" after the bridge observes closure. The named socket may close because of the user’s request or the server. This is a lifecycle observation and does not itself initiate another close or reopen. Leave list state, draft and timer untouched so transport changes remain independent of local page work.
|
||||
|
||||
1. `id` != `ws_id`
|
||||
Return *None* for an unrelated socket.
|
||||
Return *[Report the observed connection closure](browser.set_text(sel="#net-out", text="ws closed"))*.
|
||||
|
||||
## ws_send
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| value | text | "" | Exact text selected from the message input |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Send request for the existing named socket |
|
||||
|
||||
Use `value`="" as the message payload. Sending preserves literal text and addresses the existing echo socket; it does not create a second hidden connection. Open first and wait for the real connection callback. The request is not an echo result: only on_ws_msg displays a received response, and transport failures remain visible through the bridge.
|
||||
|
||||
`request` =
|
||||
|
||||
| op | id | data |
|
||||
|---|---|---|
|
||||
| send | `ws_id` | `value` |
|
||||
|
||||
Return *[Send exact text through the named connection](browser.ws(spec=`request`))*.
|
||||
|
||||
## ws_close
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Close request for the named socket |
|
||||
|
||||
Ask the bridge to close echo, reusing the same identity as open and send. The close callback supplies the observed lifecycle result. Returning this instruction does not delete page records or cancel the independent timer. Closing an absent connection is harmless; opening a later connection remains an explicit user action.
|
||||
|
||||
`request` =
|
||||
|
||||
| op | id |
|
||||
|---|---|
|
||||
| close | `ws_id` |
|
||||
|
||||
Return *[Request closure of this connection](browser.ws(spec=`request`))*.
|
||||
|
||||
## copy_log
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Clipboard request and truthful queued feedback |
|
||||
|
||||
Export the retained item texts in their current order, including duplicate values and literal newlines. The native records remain unchanged. This browser capability is a request: policy, user activation or the destination environment may prevent completion. The bridge exposes errors, and the immediate feedback says queued because no completion callback confirms a final clipboard write or saved file.
|
||||
|
||||
We **plain = [Read the current literal list export](_plain(records=`items`))** and **request = [Request clipboard delivery](browser.clipboard(text=`plain`))** and **status = [Describe only the requested operation](browser.set_text(sel="#log", text="clipboard request queued"))**.
|
||||
Return *[Keep the request and its truthful feedback](browser.merge(a=`request`, b=`status`))*.
|
||||
|
||||
## dl_list
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Download request and truthful queued feedback |
|
||||
|
||||
Export the retained item texts in their current order, including duplicate values and literal newlines. The native records remain unchanged. This browser capability is a request: policy, user activation or the destination environment may prevent completion. The bridge exposes errors, and the immediate feedback says queued because no completion callback confirms a final clipboard write or saved file.
|
||||
|
||||
We **plain = [Read the current literal list export](_plain(records=`items`))** and **request = [Request the plain-text download](browser.download(body=`plain`, filename="items.txt"))** and **status = [Describe only the requested operation](browser.set_text(sel="#log", text="download request queued"))**.
|
||||
Return *[Keep the request and its truthful feedback](browser.merge(a=`request`, b=`status`))*.
|
||||
|
||||
## _list
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| records | list | required | Native id/text records in visible order |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Structured list effect with literal labels and native delete buttons |
|
||||
|
||||
Use `records` from the direct callback's retained state. Each row contains a span label and button as typed children. The button's data-id carries the independent record identity; visible business text stays in text, never html. The official bridge escapes it and preserves delegation without rebuilding the parent page.
|
||||
|
||||
This helper is pure and receives records explicitly. It does not read hidden entry state, delete anything or assume that a returned effect has already reached the DOM. The existing host list and event wiring own those later steps.
|
||||
|
||||
We **rows = [Start the native visible row records](table.empty_list())**.
|
||||
- [Describe one label and native delete action](for records as record)
|
||||
We **id = [Retain the exact row identity](access(record, "id"))** and **value = [Retain literal business text](access(record, "text"))**.
|
||||
|
||||
`label` =
|
||||
|
||||
| tag | text |
|
||||
|---|---|
|
||||
| span | `value` |
|
||||
|
||||
`attributes` =
|
||||
|
||||
| type | data-id |
|
||||
|---|---|
|
||||
| button | `id` |
|
||||
|
||||
`button` =
|
||||
|
||||
| tag | text | attrs |
|
||||
|---|---|---|
|
||||
| button | 删 | `attributes` |
|
||||
|
||||
`children` =
|
||||
|
||||
| node |
|
||||
|---|
|
||||
| `label` |
|
||||
| `button` |
|
||||
|
||||
`row` =
|
||||
|
||||
| tag | children |
|
||||
|---|---|
|
||||
| li | `children` |
|
||||
|
||||
We **rows = [Retain this typed row](table.append(list=`rows`, item=`row`))**.
|
||||
Return *[Update only the existing list](browser.render_list(sel="#items", items=`rows`))*.
|
||||
|
||||
|
||||
## _view
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| route | text | required | Selected panel pathname |
|
||||
| push | bool | False | Explicit navigation callback requests one history entry |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Actual boolean panel visibility, path label and optional deliberate navigation |
|
||||
|
||||
Use `route` and `push`=False. Only /about and /net select secondary panels; other paths render Home. Hidden attributes are actual booleans, while False removes the attribute. The pure helper receives its path explicitly and does not pretend to capture the browser entry state.
|
||||
|
||||
History observations use the default without navigation; authored link callbacks opt in once. Keep all three targets inside a single set_attr record because effect merging is shallow and otherwise one target map could overwrite another. This function performs no fetch, storage write or socket operation.
|
||||
|
||||
We **selected = "/"**.
|
||||
1. `route` == "/about" or `route` == "/net"
|
||||
We **selected = route**.
|
||||
We **home = [Describe Home visibility](table.put(in=None, at="hidden", value=(`selected` != "/")))** and **about = [Describe About visibility](table.put(in=None, at="hidden", value=(`selected` != "/about")))** and **network = [Describe Network visibility](table.put(in=None, at="hidden", value=(`selected` != "/net")))**.
|
||||
|
||||
`targets` =
|
||||
|
||||
| #panel-home | #panel-about | #panel-net |
|
||||
|---|---|---|
|
||||
| `home` | `about` | `network` |
|
||||
|
||||
We **visibility = [Keep every panel target together](browser.wrap(key="set_attr", value=`targets`))** and **message = "path: " + selected** and **label = [Display the selected path](browser.set_text(sel="#path", text=`message`))** and **effects = [Keep independent visibility and text effects](browser.merge(a=`visibility`, b=`label`))**.
|
||||
1. `push`
|
||||
We **navigation = [Request one intentional history entry](browser.navigate(url=`selected`))** and **effects = [Keep navigation with its actual panel effects](browser.merge(a=`effects`, b=`navigation`))**.
|
||||
Return *effects* after describing the real selected panel.
|
||||
|
||||
|
||||
## _plain
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| records | list | required | Native text records in retained order |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | text | Literal newline-joined values for copy or download |
|
||||
|
||||
Use `records` to retain the original plain-text export purpose without turning the client state into a newline-encoded database. Each item's text remains a single native value; newlines are introduced only in this human-readable export. This pure transformation neither writes the clipboard nor starts a download, and it does not encode HTML.
|
||||
|
||||
We **values = [Select actual text fields in order](table.pluck(list=`records`, key="text"))**.
|
||||
Return *[Form the intended text export](text.str_join(xs=`values`, sep="\n"))*.
|
||||
|
||||
## on_saved
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| ok | bool | True | Actual storage-write completion |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Feedback for the completed write |
|
||||
|
||||
Use `ok`=True from the storage callback. Confirm saving after the browser reports completion, rather than when the user merely clicks Save. A failed callback remains a failure message. Host storage exceptions also appear through the official bridge error channel; this function cannot turn an unavailable storage service into a successful write.
|
||||
|
||||
1. not `ok`
|
||||
Return *[Expose the failed write](browser.set_text(sel="#log", text="draft save failed"))*.
|
||||
Return *[Confirm the completed write](browser.set_text(sel="#log", text="draft saved"))*.
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Retained browser theme compilation
|
||||
import:
|
||||
document: lib/document.mq.md
|
||||
web: ext/web/web.mq.md
|
||||
text: lib/text.mq.md
|
||||
---
|
||||
|
||||
## css
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | text | Original theme declarations followed by bounded View geometry |
|
||||
|
||||
Call with fs.read and plugin under the site root. The original table retains every declaration from the former host page, including fonts, green palette, panel spacing and feedback surfaces. The geometry table only adapts native View wrappers and long text for a narrow viewport. Compilation returns CSS through the existing native style capability; it neither writes a file nor starts a server. Serve owns the explicit generated output. Review the data leaf when adjusting appearance and verify actual computed styles in the browser.
|
||||
|
||||
We **original = [Read all retained declarations](document.read_table(path="styles/theme.tables.md", title="original"))** and **geometry = [Read explicit native wrapper rules](document.read_table(path="styles/theme.tables.md", title="geometry"))** and **base = [Compile the retained theme](web.make_style(name="original", table=`original`))** and **wrappers = [Compile bounded View adaptation](web.make_style(name="geometry", table=`geometry`))**.
|
||||
Return *[Keep original cascade before native adaptation](`base` + "\n" + `wrappers`)*.
|
||||
@@ -0,0 +1,88 @@
|
||||
# Browser example theme
|
||||
|
||||
This literal data preserves the original browser-app palette, typefaces, spacing, backgrounds and controls. Region selectors are scoped to the native View frame. Callable compilation is documented in index.mq.md beside this data.
|
||||
|
||||
## original
|
||||
|
||||
Every original declaration appears in its original order. Only selectors gain the known frame address, keeping basic preview defaults from overriding the authored theme.
|
||||
|
||||
| selector | property | value |
|
||||
|---|---|---|
|
||||
| ":root" | "--ink" | "#1a1f1c" |
|
||||
| ":root" | "--paper" | "#e8efe6" |
|
||||
| ":root" | "--accent" | "#2f6f4e" |
|
||||
| ":root" | "--muted" | "#5a6b60" |
|
||||
| "*" | "box-sizing" | "border-box" |
|
||||
| "body" | "margin" | "0" |
|
||||
| "body" | "min-height" | "100vh" |
|
||||
| "body" | "font-family" | "\"IBM Plex Sans\", \"Noto Sans SC\", sans-serif" |
|
||||
| "body" | "color" | "var(--ink)" |
|
||||
| "body" | "background" | "linear-gradient(165deg, #f3f7f2, var(--paper))" |
|
||||
| "body" | "padding" | "2rem clamp(1rem, 4vw, 3rem)" |
|
||||
| ".mq-document .browser-app h1" | "font-family" | "\"IBM Plex Serif\", \"Noto Serif SC\", serif" |
|
||||
| ".mq-document .browser-app h1" | "margin" | "0 0 0.35rem" |
|
||||
| ".mq-document .browser-app .lead" | "color" | "var(--muted)" |
|
||||
| ".mq-document .browser-app .lead" | "max-width" | "42rem" |
|
||||
| ".mq-document .browser-app nav a" | "margin-right" | "0.75rem" |
|
||||
| ".mq-document .browser-app nav a" | "color" | "var(--accent)" |
|
||||
| ".mq-document .browser-app section" | "margin" | "1.5rem 0" |
|
||||
| ".mq-document .browser-app section" | "padding" | "1rem 0" |
|
||||
| ".mq-document .browser-app section" | "border-top" | "1px solid #c5d4c9" |
|
||||
| ".mq-document .browser-app #path" | "font-family" | "ui-monospace, monospace" |
|
||||
| ".mq-document .browser-app #path" | "color" | "var(--muted)" |
|
||||
| ".mq-document .browser-app #items" | "list-style" | "none" |
|
||||
| ".mq-document .browser-app #items" | "padding" | "0" |
|
||||
| ".mq-document .browser-app #items" | "margin" | "0.75rem 0" |
|
||||
| ".mq-document .browser-app #items li" | "display" | "flex" |
|
||||
| ".mq-document .browser-app #items li" | "align-items" | "center" |
|
||||
| ".mq-document .browser-app #items li" | "gap" | "0.5rem" |
|
||||
| ".mq-document .browser-app #items li" | "padding" | "0.4rem 0.6rem" |
|
||||
| ".mq-document .browser-app #items li" | "margin-bottom" | "0.35rem" |
|
||||
| ".mq-document .browser-app #items li" | "background" | "rgba(255,255,255,0.65)" |
|
||||
| ".mq-document .browser-app #items li" | "border" | "1px solid #b7c7bb" |
|
||||
| ".mq-document .browser-app #items button" | "margin-left" | "auto" |
|
||||
| ".mq-document .browser-app input[type=\"text\"]" | "padding" | "0.45rem 0.65rem" |
|
||||
| ".mq-document .browser-app input[type=\"text\"]" | "border" | "1px solid #b7c7bb" |
|
||||
| ".mq-document .browser-app input[type=\"text\"]" | "width" | "min(16rem, 70%)" |
|
||||
| ".mq-document .browser-app button" | "padding" | "0.45rem 0.9rem" |
|
||||
| ".mq-document .browser-app button" | "border" | "0" |
|
||||
| ".mq-document .browser-app button" | "background" | "var(--accent)" |
|
||||
| ".mq-document .browser-app button" | "color" | "#f5faf6" |
|
||||
| ".mq-document .browser-app button" | "font" | "inherit" |
|
||||
| ".mq-document .browser-app button" | "cursor" | "pointer" |
|
||||
| ".mq-document .browser-app button" | "margin" | "0.2rem 0.35rem 0.2rem 0" |
|
||||
| ".mq-document .browser-app button.secondary" | "background" | "#3a4740" |
|
||||
| ".mq-document .browser-app #tick, #net-out" | "font-variant-numeric" | "tabular-nums" |
|
||||
| ".mq-document .browser-app #net-out" | "min-height" | "2.5rem" |
|
||||
| ".mq-document .browser-app #net-out" | "padding" | "0.6rem 0.75rem" |
|
||||
| ".mq-document .browser-app #net-out" | "background" | "rgba(255,255,255,0.55)" |
|
||||
| ".mq-document .browser-app #net-out" | "border" | "1px solid #b7c7bb" |
|
||||
| ".mq-document .browser-app #net-out" | "white-space" | "pre-wrap" |
|
||||
| ".mq-document .browser-app #net-out" | "word-break" | "break-all" |
|
||||
| ".mq-document .browser-app pre" | "margin-top" | "1rem" |
|
||||
| ".mq-document .browser-app pre" | "padding" | "0.85rem 1rem" |
|
||||
| ".mq-document .browser-app pre" | "background" | "#122018" |
|
||||
| ".mq-document .browser-app pre" | "color" | "#d7eadc" |
|
||||
| ".mq-document .browser-app pre" | "font-size" | "0.8rem" |
|
||||
| ".mq-document .browser-app pre" | "overflow" | "auto" |
|
||||
| ".mq-document .browser-app pre" | "max-width" | "42rem" |
|
||||
| ".mq-document .browser-app .err" | "color" | "#ffb4a8" |
|
||||
|
||||
## geometry
|
||||
|
||||
These additions adapt the preview wrappers and keep native controls and literal long text within a narrow viewport. They do not replace the retained palette or typography.
|
||||
|
||||
| selector | property | value |
|
||||
|---|---|---|
|
||||
| ".mq-document .mq-view" | "max-width" | "none" |
|
||||
| ".mq-document .mq-view" | "margin" | "0" |
|
||||
| ".mq-document .mq-view" | "padding" | "0" |
|
||||
| ".mq-document .mq-view" | "font-family" | "inherit" |
|
||||
| ".mq-document .mq-view" | "line-height" | "inherit" |
|
||||
| ".mq-document .browser-app" | "display" | "block" |
|
||||
| ".mq-document .browser-app .mq-column" | "display" | "block" |
|
||||
| ".mq-document .browser-app .mq-row" | "flex-wrap" | "wrap" |
|
||||
| ".mq-document .browser-app #items span" | "overflow-wrap" | "anywhere" |
|
||||
| ".mq-document .browser-app button" | "max-width" | "100%" |
|
||||
| ".mq-document .browser-app pre" | "white-space" | "pre-wrap" |
|
||||
| ".mq-document .browser-app pre" | "overflow-wrap" | "anywhere" |
|
||||
@@ -1,21 +0,0 @@
|
||||
# browser-hello(WASM C1–C4 / 路线 D)
|
||||
|
||||
浏览器内跑 Marqdo。**无作者业务 JS**——只保留官方 `marqdo-bridge.js`(`marqdo wasm build` 拷贝)。客户端 `.mq.md` 用 **GFM 表格 + `lib/browser`**。
|
||||
|
||||
```bash
|
||||
# 仓库根目录
|
||||
cargo build -p marqdo --release
|
||||
./target/release/marqdo wasm build -o examples/browser-hello
|
||||
|
||||
cd examples/browser-hello
|
||||
python3 -m http.server 8765
|
||||
```
|
||||
|
||||
| 页 | 说明 |
|
||||
|----|------|
|
||||
| [/](http://127.0.0.1:8765/) | playground:`data-mq-playground` + textarea → `mq_run` |
|
||||
| [/interact.html](http://127.0.0.1:8765/interact.html) | `counter.mq.md` wire → 点击改 DOM |
|
||||
| [/fetch.html](http://127.0.0.1:8765/fetch.html) | `fetch` / `after` 效应 |
|
||||
| [/form.html](http://127.0.0.1:8765/form.html) | `input` + `value` / `set_class`(D3) |
|
||||
|
||||
自启方式:脚本上的 `data-mq-source-url` / `data-mq-playground`,或 `#marqdo-boot` JSON。详见 [browser-wasm-d.md](../../doc/roadmap/browser-wasm-d.md)。
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: browser counter (C3)
|
||||
description: wire table + browser.set_text — no json glue
|
||||
import:
|
||||
browser: lib/browser.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
**`count` = 0**
|
||||
|
||||
`wire` =
|
||||
|
||||
| @ | 选择器 | 事件 | 调用 |
|
||||
|---|--------|------|------|
|
||||
| 1 | "#bump" | click | bump |
|
||||
| 2 | "#reset" | click | reset |
|
||||
|
||||
*`wire`*
|
||||
|
||||
## bump
|
||||
**`count` = count + 1**
|
||||
**`label` = > str count**
|
||||
*> browser.set_text sel="#count" text=label*
|
||||
|
||||
## reset
|
||||
**`count` = 0**
|
||||
*> browser.set_text sel="#count" text="0"*
|
||||
@@ -1,86 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hans">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Marqdo · fetch / after (C4)</title>
|
||||
<style>
|
||||
:root {
|
||||
--ink: #1a1f1c;
|
||||
--paper: #e8efe6;
|
||||
--accent: #2f6f4e;
|
||||
--muted: #5a6b60;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
|
||||
color: var(--ink);
|
||||
background:
|
||||
radial-gradient(800px 420px at 0% 100%, #d5e4d8 0%, transparent 55%),
|
||||
linear-gradient(165deg, #f3f7f2, var(--paper));
|
||||
padding: 2rem clamp(1rem, 4vw, 3rem);
|
||||
}
|
||||
h1 {
|
||||
font-family: "IBM Plex Serif", "Noto Serif SC", serif;
|
||||
font-weight: 600;
|
||||
font-size: clamp(1.6rem, 3vw, 2.2rem);
|
||||
margin: 0 0 0.35rem;
|
||||
}
|
||||
.lead { color: var(--muted); margin: 0 0 1.25rem; max-width: 38rem; }
|
||||
#status {
|
||||
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.45;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
min-height: 4rem;
|
||||
margin: 1rem 0 1.25rem;
|
||||
padding: 0.85rem 1rem;
|
||||
background: rgba(255,255,255,0.55);
|
||||
border: 1px solid #b7c7bb;
|
||||
}
|
||||
button {
|
||||
margin-right: 0.5rem;
|
||||
margin-bottom: 0.4rem;
|
||||
padding: 0.55rem 1.1rem;
|
||||
border: 0;
|
||||
background: var(--accent);
|
||||
color: #f5faf6;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
button.secondary { background: #3a4740; }
|
||||
button:disabled { opacity: 0.5; cursor: wait; }
|
||||
pre {
|
||||
margin-top: 1.5rem;
|
||||
width: min(42rem, 100%);
|
||||
padding: 0.9rem 1rem;
|
||||
background: #122018;
|
||||
color: #d7eadc;
|
||||
overflow: auto;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.err { color: #ffb4a8; }
|
||||
a { color: var(--accent); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Marqdo</h1>
|
||||
<p class="lead">C4/D:返回 <code>fetch</code> / <code>after</code> 效应;bridge 自启(ADR 0003)。业务只在 <code>fetch.mq.md</code>。<a href="./interact.html">计数器</a> · <a href="./form.html">表单</a> · <a href="./">打印</a></p>
|
||||
<div id="status">idle</div>
|
||||
<button id="load" type="button" disabled>请求 UUID</button>
|
||||
<button id="ping" class="secondary" type="button" disabled>延迟 pong</button>
|
||||
<pre id="log">loading…</pre>
|
||||
<script
|
||||
type="module"
|
||||
src="./marqdo-bridge.js"
|
||||
data-mq-wasm="./marqdo_wasm.wasm"
|
||||
data-mq-source-url="./fetch.mq.md"
|
||||
data-mq-ready="#log"
|
||||
data-mq-enable="#load,#ping"
|
||||
></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,44 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: browser fetch (C4)
|
||||
description: fetch/after effects via lib/browser — no json glue
|
||||
import:
|
||||
browser: lib/browser.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
`wire` =
|
||||
|
||||
| @ | 选择器 | 事件 | 调用 |
|
||||
|---|--------|------|------|
|
||||
| 1 | "#load" | click | load |
|
||||
| 2 | "#ping" | click | ping |
|
||||
|
||||
*`wire`*
|
||||
|
||||
## load
|
||||
**`msg` = > browser.set_text sel="#status" text="loading…"**
|
||||
**`req` = > browser.fetch url="https://httpbin.org/uuid" then="on_uuid"**
|
||||
*> browser.merge a=msg b=req*
|
||||
|
||||
## on_uuid
|
||||
+ `ok`
|
||||
+ `status`
|
||||
+ `body`=""
|
||||
+ `error`=""
|
||||
|
||||
1. ok
|
||||
*> browser.set_text sel="#status" text=body*
|
||||
2. *
|
||||
*> browser.set_text sel="#status" text="fetch failed"*
|
||||
|
||||
## ping
|
||||
**`msg` = > browser.set_text sel="#status" text="wait 600ms…"**
|
||||
**`t` = > browser.after ms=600 then="on_ping"**
|
||||
*> browser.merge a=msg b=t*
|
||||
|
||||
## on_ping
|
||||
+ `ok`=True
|
||||
|
||||
*> browser.set_text sel="#status" text="pong"*
|
||||
@@ -1,76 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hans">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Marqdo · 表单 (D3)</title>
|
||||
<style>
|
||||
:root {
|
||||
--ink: #1a1f1c;
|
||||
--paper: #e8efe6;
|
||||
--accent: #2f6f4e;
|
||||
--muted: #5a6b60;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
|
||||
color: var(--ink);
|
||||
background:
|
||||
radial-gradient(700px 400px at 100% 20%, #d0e0d4 0%, transparent 50%),
|
||||
linear-gradient(165deg, #f3f7f2, var(--paper));
|
||||
padding: 2rem clamp(1rem, 4vw, 3rem);
|
||||
}
|
||||
h1 {
|
||||
font-family: "IBM Plex Serif", "Noto Serif SC", serif;
|
||||
font-weight: 600;
|
||||
font-size: clamp(1.6rem, 3vw, 2.2rem);
|
||||
margin: 0 0 0.35rem;
|
||||
}
|
||||
.lead { color: var(--muted); margin: 0 0 1.25rem; max-width: 38rem; }
|
||||
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 0.75rem 0 0.35rem; }
|
||||
input[type="text"] {
|
||||
width: min(24rem, 100%);
|
||||
padding: 0.5rem 0.75rem;
|
||||
border: 1px solid #b7c7bb;
|
||||
background: rgba(255,255,255,0.75);
|
||||
font: inherit;
|
||||
}
|
||||
#echo {
|
||||
margin-top: 1rem;
|
||||
font-size: 1.25rem;
|
||||
min-height: 1.5em;
|
||||
}
|
||||
#echo.hi { color: var(--accent); font-weight: 600; }
|
||||
pre {
|
||||
margin-top: 1.5rem;
|
||||
width: min(42rem, 100%);
|
||||
padding: 0.9rem 1rem;
|
||||
background: #122018;
|
||||
color: #d7eadc;
|
||||
overflow: auto;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.err { color: #ffb4a8; }
|
||||
a { color: var(--accent); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Marqdo</h1>
|
||||
<p class="lead">D3:<code>input</code> 事件把 <code>value</code> 传入 Marqdo;<code>set_value</code> / <code>set_class</code> / <code>set_attr</code> 回写 DOM。业务只在 <code>form.mq.md</code>。<a href="./interact.html">计数器</a> · <a href="./">打印</a></p>
|
||||
<label for="name">名字</label>
|
||||
<input id="name" type="text" placeholder="输入…" disabled />
|
||||
<div id="echo">(等待输入)</div>
|
||||
<pre id="log">loading…</pre>
|
||||
<script
|
||||
type="module"
|
||||
src="./marqdo-bridge.js"
|
||||
data-mq-wasm="./marqdo_wasm.wasm"
|
||||
data-mq-source-url="./form.mq.md"
|
||||
data-mq-ready="#log"
|
||||
data-mq-enable="#name"
|
||||
></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,35 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: browser form (D3)
|
||||
description: input wire passes value; effects via lib/browser
|
||||
import:
|
||||
browser: lib/browser.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
`wire` =
|
||||
|
||||
| @ | 选择器 | 事件 | 调用 |
|
||||
|---|--------|------|------|
|
||||
| 1 | "#name" | input | on_input |
|
||||
|
||||
*`wire`*
|
||||
|
||||
## on_input
|
||||
+ `value`=""
|
||||
+ `event`=""
|
||||
|
||||
1. `value` != ""
|
||||
**`label` = "你好," + value**
|
||||
**`ret` = > browser.set_text sel="#echo" text=label**
|
||||
**`cls` = > browser.set_class sel="#echo" class="hi"**
|
||||
**`ret` = > browser.merge a=ret b=cls**
|
||||
**`attrs` = > table.put in=None at="data-name" value=value**
|
||||
**`attr` = > browser.set_attr sel="#echo" attrs=attrs**
|
||||
*> browser.merge a=ret b=attr*
|
||||
2. *
|
||||
**`ret` = > browser.set_text sel="#echo" text="(等待输入)"**
|
||||
**`cls` = > browser.set_class sel="#echo" class=""**
|
||||
*> browser.merge a=ret b=cls*
|
||||
@@ -1,88 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hans">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Marqdo browser hello (WASM C1)</title>
|
||||
<style>
|
||||
:root {
|
||||
--ink: #1a1f1c;
|
||||
--paper: #e8efe6;
|
||||
--accent: #2f6f4e;
|
||||
--muted: #5a6b60;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
|
||||
color: var(--ink);
|
||||
background:
|
||||
radial-gradient(1200px 600px at 10% -10%, #c5dcc8 0%, transparent 55%),
|
||||
linear-gradient(165deg, #f3f7f2, var(--paper));
|
||||
padding: 2rem clamp(1rem, 4vw, 3rem);
|
||||
}
|
||||
h1 {
|
||||
font-family: "IBM Plex Serif", "Noto Serif SC", serif;
|
||||
font-weight: 600;
|
||||
font-size: clamp(1.6rem, 3vw, 2.2rem);
|
||||
margin: 0 0 0.35rem;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
.lead { color: var(--muted); margin: 0 0 1.5rem; max-width: 36rem; }
|
||||
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
|
||||
textarea {
|
||||
width: min(40rem, 100%);
|
||||
min-height: 10rem;
|
||||
padding: 0.75rem 0.9rem;
|
||||
border: 1px solid #b7c7bb;
|
||||
border-radius: 2px;
|
||||
background: rgba(255,255,255,0.7);
|
||||
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.45;
|
||||
}
|
||||
button {
|
||||
margin-top: 0.85rem;
|
||||
padding: 0.55rem 1.1rem;
|
||||
border: 0;
|
||||
background: var(--accent);
|
||||
color: #f5faf6;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
button:disabled { opacity: 0.5; cursor: wait; }
|
||||
pre {
|
||||
margin-top: 1.25rem;
|
||||
width: min(40rem, 100%);
|
||||
padding: 0.9rem 1rem;
|
||||
background: #122018;
|
||||
color: #d7eadc;
|
||||
overflow: auto;
|
||||
font-size: 0.85rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.err { color: #ffb4a8; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Marqdo</h1>
|
||||
<p class="lead">浏览器内 WASM(路线 C/D):源码是 <code>.mq.md</code>,官方 bridge 自启 playground,无作者业务 JS。<a href="./interact.html">交互</a> · <a href="./fetch.html">fetch</a> · <a href="./form.html">表单</a></p>
|
||||
<label for="src">程序</label>
|
||||
<textarea id="src"># main
|
||||
|
||||
> print text=Hello from browser WASM!
|
||||
</textarea>
|
||||
<div>
|
||||
<button id="run" disabled>运行</button>
|
||||
</div>
|
||||
<pre id="out">loading wasm…</pre>
|
||||
<script
|
||||
type="module"
|
||||
src="./marqdo-bridge.js"
|
||||
data-mq-wasm="./marqdo_wasm.wasm"
|
||||
data-mq-playground="#src,#run,#out"
|
||||
data-mq-ready="#out"
|
||||
></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,79 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hans">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Marqdo · 交互装配 (C3)</title>
|
||||
<style>
|
||||
:root {
|
||||
--ink: #1a1f1c;
|
||||
--paper: #e8efe6;
|
||||
--accent: #2f6f4e;
|
||||
--muted: #5a6b60;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
|
||||
color: var(--ink);
|
||||
background:
|
||||
radial-gradient(900px 500px at 90% 0%, #cfe0d2 0%, transparent 50%),
|
||||
linear-gradient(165deg, #f3f7f2, var(--paper));
|
||||
padding: 2rem clamp(1rem, 4vw, 3rem);
|
||||
}
|
||||
h1 {
|
||||
font-family: "IBM Plex Serif", "Noto Serif SC", serif;
|
||||
font-weight: 600;
|
||||
font-size: clamp(1.6rem, 3vw, 2.2rem);
|
||||
margin: 0 0 0.35rem;
|
||||
}
|
||||
.lead { color: var(--muted); margin: 0 0 1.5rem; max-width: 36rem; }
|
||||
#count {
|
||||
font-family: "IBM Plex Serif", serif;
|
||||
font-size: 4rem;
|
||||
line-height: 1;
|
||||
margin: 1rem 0 1.25rem;
|
||||
letter-spacing: -0.04em;
|
||||
}
|
||||
button {
|
||||
margin-right: 0.5rem;
|
||||
padding: 0.55rem 1.1rem;
|
||||
border: 0;
|
||||
background: var(--accent);
|
||||
color: #f5faf6;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
button.secondary { background: #3a4740; }
|
||||
pre {
|
||||
margin-top: 1.5rem;
|
||||
width: min(40rem, 100%);
|
||||
padding: 0.9rem 1rem;
|
||||
background: #122018;
|
||||
color: #d7eadc;
|
||||
overflow: auto;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.err { color: #ffb4a8; }
|
||||
a { color: var(--accent); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Marqdo</h1>
|
||||
<p class="lead">C3/D:GFM 交互表装配事件;官方 <code>mount</code> 自启,业务只在 <code>counter.mq.md</code>。<a href="./fetch.html">fetch</a> · <a href="./form.html">表单</a> · <a href="./">打印</a></p>
|
||||
<div id="count">0</div>
|
||||
<button id="bump" type="button" disabled>加一</button>
|
||||
<button id="reset" class="secondary" type="button" disabled>清零</button>
|
||||
<pre id="log">loading…</pre>
|
||||
<script
|
||||
type="module"
|
||||
src="./marqdo-bridge.js"
|
||||
data-mq-wasm="./marqdo_wasm.wasm"
|
||||
data-mq-source-url="./counter.mq.md"
|
||||
data-mq-ready="#log"
|
||||
data-mq-enable="#bump,#reset"
|
||||
></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +0,0 @@
|
||||
# browser-media(路线 F)
|
||||
|
||||
作者**零业务 JS**;`.mq.md` 用 **GFM 表格 + `lib/browser`**(禁止 `json.set` 链)。
|
||||
|
||||
| 能力 | 演示 |
|
||||
|------|------|
|
||||
| read_file | 文本 / DataURL |
|
||||
| canvas | `@` 指令表 |
|
||||
| audio | beep(Web Audio) |
|
||||
| observe | Intersection + Resize |
|
||||
| drag/drop | `data-drag` → `drop_text` |
|
||||
|
||||
```bash
|
||||
cargo build -p marqdo --release
|
||||
./target/release/marqdo wasm build -o examples/browser-media
|
||||
cd examples/browser-media && python3 -m http.server 8767
|
||||
```
|
||||
|
||||
写法约定见 [.cursor/skills/marqdo-dev/SKILL.md](../../.cursor/skills/marqdo-dev/SKILL.md)。
|
||||
路线图:[browser-wasm-f.md](../../doc/roadmap/browser-wasm-f.md)。
|
||||
@@ -1,98 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hans">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Marqdo · browser-media (route F)</title>
|
||||
<style>
|
||||
:root { --ink: #1a1f1c; --paper: #e8efe6; --accent: #2f6f4e; --muted: #5a6b60; }
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0; min-height: 100vh; font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
|
||||
color: var(--ink);
|
||||
background: linear-gradient(165deg, #f3f7f2, var(--paper));
|
||||
padding: 2rem clamp(1rem, 4vw, 3rem);
|
||||
}
|
||||
h1 { font-family: "IBM Plex Serif", "Noto Serif SC", serif; margin: 0 0 0.35rem; }
|
||||
.lead { color: var(--muted); max-width: 42rem; }
|
||||
section { margin: 1.5rem 0; padding: 1rem 0; border-top: 1px solid #c5d4c9; }
|
||||
button {
|
||||
padding: 0.45rem 0.9rem; border: 0; background: var(--accent); color: #f5faf6;
|
||||
font: inherit; cursor: pointer; margin: 0.2rem 0.35rem 0.2rem 0;
|
||||
}
|
||||
button.secondary { background: #3a4740; }
|
||||
#pad {
|
||||
display: block; background: #fff; border: 1px solid #b7c7bb;
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
#chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.75rem 0; }
|
||||
#chips span {
|
||||
padding: 0.45rem 0.75rem; background: rgba(255,255,255,0.75);
|
||||
border: 1px dashed #2f6f4e; cursor: grab; user-select: none;
|
||||
}
|
||||
#dropzone {
|
||||
min-height: 3.5rem; padding: 0.85rem; border: 2px dashed #7a9584;
|
||||
background: rgba(255,255,255,0.45); color: var(--muted);
|
||||
}
|
||||
#beacon {
|
||||
margin-top: 8rem; padding: 2rem; background: #2f6f4e; color: #f5faf6;
|
||||
text-align: center;
|
||||
}
|
||||
#preview { margin-top: 0.5rem; min-height: 1rem; }
|
||||
pre {
|
||||
margin-top: 1rem; padding: 0.85rem 1rem; background: #122018; color: #d7eadc;
|
||||
font-size: 0.8rem; overflow: auto; max-width: 42rem;
|
||||
}
|
||||
.err { color: #ffb4a8; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Marqdo browser-media</h1>
|
||||
<p class="lead">路线 F:文件 / Canvas / Audio / Observer / 拖放 — <strong>无作者业务 JS</strong>。</p>
|
||||
|
||||
<section>
|
||||
<h2>F1 文件</h2>
|
||||
<input id="file" type="file" accept="image/*,text/*,.txt,.md" disabled />
|
||||
<button id="read-text" type="button" disabled>读文本</button>
|
||||
<button id="read-dataurl" type="button" disabled>读 DataURL</button>
|
||||
<div id="preview"></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>F2 Canvas · F3 Audio</h2>
|
||||
<button id="draw" type="button" disabled>绘制</button>
|
||||
<button id="play" type="button" disabled>蜂鸣</button>
|
||||
<canvas id="pad" width="280" height="120"></canvas>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>F4 Observer</h2>
|
||||
<button id="watch" type="button" disabled>开始观察</button>
|
||||
<button id="unwatch" class="secondary" type="button" disabled>停止</button>
|
||||
<p id="obs">idle</p>
|
||||
<p>向下滚动可触发 Intersection;改窗口大小触发 Resize。</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>F5 拖放</h2>
|
||||
<div id="chips">
|
||||
<span draggable="true" data-drag="alpha">alpha</span>
|
||||
<span draggable="true" data-drag="beta">beta</span>
|
||||
<span draggable="true" data-drag="gamma">gamma</span>
|
||||
</div>
|
||||
<div id="dropzone">拖到这里</div>
|
||||
</section>
|
||||
|
||||
<div id="beacon">beacon(滚到可见)</div>
|
||||
|
||||
<pre id="log">loading…</pre>
|
||||
<script
|
||||
type="module"
|
||||
src="./marqdo-bridge.js"
|
||||
data-mq-wasm="./marqdo_wasm.wasm"
|
||||
data-mq-source-url="./media.mq.md"
|
||||
data-mq-ready="#log"
|
||||
data-mq-enable="#file,#read-text,#read-dataurl,#draw,#play,#watch,#unwatch"
|
||||
></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,164 +0,0 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: browser-media (route F)
|
||||
description: file / canvas / audio / observers / drag — GFM tables + lib/browser
|
||||
import:
|
||||
browser: lib/browser.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
Route F demo: author data stays in tables; effects via `browser.*`.
|
||||
|
||||
**`obs_on` = False**
|
||||
|
||||
`wire` =
|
||||
|
||||
| @ | 选择器 | 事件 | 调用 | 委托 |
|
||||
|---|--------|------|------|------|
|
||||
| 1 | "#read-text" | click | read_text | |
|
||||
| 2 | "#read-dataurl" | click | read_dataurl | |
|
||||
| 3 | "#draw" | click | draw_box | |
|
||||
| 4 | "#play" | click | play_tone | |
|
||||
| 5 | "#watch" | click | start_watch | |
|
||||
| 6 | "#unwatch" | click | stop_watch | |
|
||||
| 7 | "#chips" | dragstart | on_drag | "[data-drag]" |
|
||||
| 8 | "#dropzone" | dragover | on_dragover | |
|
||||
| 9 | "#dropzone" | drop | on_drop | |
|
||||
|
||||
**`ready` = > browser.set_text sel="#log" text="ready (route F)"**
|
||||
**`boot` = > table.put in=None at="wire" value=wire**
|
||||
*> browser.merge a=boot b=ready*
|
||||
|
||||
## read_text
|
||||
*> browser.read_file sel="#file" then="on_file" as="text"*
|
||||
|
||||
## read_dataurl
|
||||
*> browser.read_file sel="#file" then="on_file" as="data_url"*
|
||||
|
||||
## on_file
|
||||
+ `ok`=False
|
||||
+ `name`=""
|
||||
+ `size`=0
|
||||
+ `body`=""
|
||||
+ `data_url`=""
|
||||
+ `as`=""
|
||||
+ `error`=""
|
||||
|
||||
1. `ok`
|
||||
1. `as` == "data_url"
|
||||
**`n` = > len value=data_url**
|
||||
**`ns` = > str `n`**
|
||||
**`preview` = name + " data_url chars=" + ns**
|
||||
**`ret` = > browser.set_text sel="#log" text=preview**
|
||||
1. `data_url` != ""
|
||||
**`h` = "<img alt=\"preview\" src=\"" + data_url + "\" style=\"max-width:12rem;max-height:8rem\" />"**
|
||||
**`img` = > browser.set_html sel="#preview" html=h**
|
||||
*> browser.merge a=ret b=img*
|
||||
2. *
|
||||
*ret*
|
||||
2. *
|
||||
**`n` = > len value=body**
|
||||
**`ns` = > str `n`**
|
||||
**`ss` = > str `size`**
|
||||
**`preview` = name + " (" + ss + " B, chars=" + ns + ") ok"**
|
||||
*> browser.set_text sel="#log" text=preview*
|
||||
2. *
|
||||
**`preview` = "file error: " + error**
|
||||
*> browser.set_text sel="#log" text=preview*
|
||||
|
||||
## draw_box
|
||||
|
||||
Canvas commands as a readable `@` table:
|
||||
|
||||
`commands` =
|
||||
|
||||
| @ | op | x | y | w | h | fill | stroke | text |
|
||||
|---|----|---|---|---|---|------|--------|------|
|
||||
| 1 | fillrect | 10 | 10 | 120 | 80 | "#2f6f4e" | | |
|
||||
| 2 | strokerect | 20 | 20 | 100 | 60 | | "#122018" | |
|
||||
| 3 | filltext | 40 | 55 | | | "#f5faf6" | | Marqdo |
|
||||
|
||||
**`cv` = > browser.canvas sel="#pad" commands=commands clear=True**
|
||||
**`msg` = > browser.set_text sel="#log" text="canvas drawn"**
|
||||
*> browser.merge a=cv b=msg*
|
||||
|
||||
## play_tone
|
||||
**`tone` = > browser.audio op="play" id="demo" src="beep" freq=523 ms=220**
|
||||
**`msg` = > browser.set_text sel="#log" text="audio beep"**
|
||||
*> browser.merge a=tone b=msg*
|
||||
|
||||
## start_watch
|
||||
**`obs_on` = True**
|
||||
|
||||
`obs` =
|
||||
|
||||
| @ | kind | sel | id | then | threshold |
|
||||
|---|------|-----|----|------|-----------|
|
||||
| 1 | intersect | "#beacon" | beacon | on_intersect | 0.25 |
|
||||
| 2 | resize | "#pad" | pad | on_resize | |
|
||||
|
||||
**`o` = > browser.observe specs=obs**
|
||||
**`msg` = > browser.set_text sel="#log" text="observers on"**
|
||||
*> browser.merge a=o b=msg*
|
||||
|
||||
## stop_watch
|
||||
**`obs_on` = False**
|
||||
|
||||
`ids` =
|
||||
|
||||
| @ | id |
|
||||
|---|----|
|
||||
| 1 | beacon |
|
||||
| 2 | pad |
|
||||
|
||||
**`u` = > browser.unobserve specs=ids**
|
||||
**`msg` = > browser.set_text sel="#log" text="observers off"**
|
||||
*> browser.merge a=u b=msg*
|
||||
|
||||
## on_intersect
|
||||
+ `intersecting`=False
|
||||
+ `ratio`=0
|
||||
|
||||
1. `obs_on`
|
||||
**`state` = "hidden"**
|
||||
1. `intersecting`
|
||||
**`state` = "visible"**
|
||||
2. *
|
||||
---
|
||||
**`r` = > str `ratio`**
|
||||
**`msg` = "beacon " + state + " ratio=" + r**
|
||||
*> browser.set_text sel="#obs" text=msg*
|
||||
2. *
|
||||
****
|
||||
|
||||
## on_resize
|
||||
+ `width`=0
|
||||
+ `height`=0
|
||||
|
||||
1. `obs_on`
|
||||
**`w` = > str `width`**
|
||||
**`h` = > str `height`**
|
||||
**`msg` = "pad size " + w + "×" + h**
|
||||
*> browser.set_text sel="#obs" text=msg*
|
||||
2. *
|
||||
****
|
||||
|
||||
## on_drag
|
||||
+ `drag`=""
|
||||
|
||||
**`msg` = "dragging: " + drag**
|
||||
*> browser.set_text sel="#log" text=msg*
|
||||
|
||||
## on_dragover
|
||||
****
|
||||
|
||||
## on_drop
|
||||
+ `drop_text`=""
|
||||
|
||||
**`msg` = "dropped: " + drop_text**
|
||||
**`h` = "<strong>" + drop_text + "</strong>"**
|
||||
**`t` = > browser.set_text sel="#log" text=msg**
|
||||
**`box` = > browser.set_html sel="#dropzone" html=h**
|
||||
*> browser.merge a=t b=box*
|
||||
@@ -1,17 +1,39 @@
|
||||
# 计算器
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 供下述方法复用的对象或类型命名空间;直接调用所需的子函数。 |
|
||||
|
||||
这是一个普通的 Marqdo 文档。
|
||||
|
||||
其中包含一些可以复用的数学计算知识。
|
||||
|
||||
## 加法
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| a | any | 必填 | Left operand supplied to this calculation |
|
||||
| b | any | 必填 | Right operand supplied to this calculation |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 下文显式返回的计算值或结构化结果;分支存在时遵循实际命中的分支。 |
|
||||
|
||||
计算两个数字`a`和`b`的和。
|
||||
|
||||
*[计算结果](a + b)*
|
||||
完成上述步骤后,返回*[计算结果]((`a` + `b`))*。
|
||||
|
||||
## 乘法
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| a | any | 必填 | Left operand supplied to this calculation |
|
||||
| b | any | 必填 | Right operand supplied to this calculation |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 下文显式返回的计算值或结构化结果;分支存在时遵循实际命中的分支。 |
|
||||
|
||||
计算两个数字`a`和`b`的积。
|
||||
|
||||
*[计算结果](a * b)*
|
||||
完成上述步骤后,返回*[计算结果]((`a` * `b`))*。
|
||||
@@ -12,37 +12,84 @@ description: >-
|
||||
|
||||
## 单价
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| 价 | any | 必填 | 同一币种下单件商品的标价 |
|
||||
| 杯数 | any | 1 | 参与本次计价的杯数,未提供时使用正文默认值 |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 逐行累加得到的订单总额 |
|
||||
|
||||
一杯标价为`价`的饮品,默认`杯数`=1。先把**总额 = 价 * 杯数**算清,再返回*总额*。
|
||||
|
||||
## 会员折
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| 原价 | any | 必填 | 应用折扣之前的原始金额 |
|
||||
| 折扣 | any | 0.85 | 价格乘数;0.85 表示支付原价的百分之八十五 |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 下文显式返回的计算值或结构化结果;分支存在时遵循实际命中的分支。 |
|
||||
|
||||
会员单要原价`原价`;店里默认八五折,记作`折扣`=0.85。
|
||||
先算**应付 = 原价 * 折扣**,再返回*应付*。
|
||||
|
||||
## 结账摘要
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| 品名 | any | 必填 | 收据或摘要中显示的商品名称 |
|
||||
| 价 | any | 必填 | 同一币种下单件商品的标价 |
|
||||
| 杯数 | any | 1 | 参与本次计价的杯数,未提供时使用正文默认值 |
|
||||
| 会员 | any | False | 是否采用本示例的会员折扣分支 |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 包含商品、数量和实付金额的显示文案 |
|
||||
|
||||
客人点了`品名`,单价`价`,杯数`杯数`=1;是否`会员`=False。
|
||||
|
||||
按杯数问单价:**小计 = 单价 价=`价` 杯数=`杯数`**。
|
||||
|
||||
1. `会员`
|
||||
**实付 = 会员折 原价=`小计`**
|
||||
**标签 = "会员价"**
|
||||
我们先**实付 = [计算并保存 实付](会员折(原价=`小计`))**,供下一步使用。
|
||||
我们先**标签 = "会员价"**,供下一步使用。
|
||||
2. *
|
||||
**实付 = 小计**
|
||||
**标签 = "原价"**
|
||||
我们先**实付 = `小计`**,供下一步使用。
|
||||
我们先**标签 = "原价"**,供下一步使用。
|
||||
|
||||
对账时拼成一句人话:
|
||||
|
||||
**文案 = 品名 + " ×" + 杯数 + " → " + 标签 + " " + 实付**
|
||||
*文案*
|
||||
我们先**文案 = ((((((`品名` + " ×") + `杯数`) + " → ") + `标签`) + " ") + `实付`)**,供下一步使用。
|
||||
完成上述步骤后,返回*文案*。
|
||||
|
||||
## 印章加一
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| 印 | any | 必填 | 积分卡当前已有的印章数量 |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 下文显式返回的计算值或结构化结果;分支存在时遵循实际命中的分支。 |
|
||||
|
||||
积分卡上的`印`,每喝一杯就**印 = 印 + 1**,接着返回*印*。
|
||||
|
||||
# main
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 空值;按顺序执行本页的演示步骤,观察输出或已说明的副作用。 |
|
||||
|
||||
这份手账把定价规则放在真正的结账函数里,入口只组织今天的几笔订单。菜单横表是品名到单价的记录,外卖行表则是多条带有数量和会员标记的订单;两者的数据形态不同,因此先按名称取价,再逐行传给同一个摘要函数。
|
||||
|
||||
会员示例与原价对照使用同一套参数和默认值,避免正文与实现各维护一份优惠规则。金额在本例中使用普通运行时数值,会员折扣可能产生小数;这里没有宣称采用专门的货币舍入模型。需要真实计费精度时应另行规定最小单位与舍入步骤,不能把展示摘要的文本当成准确记账凭证。
|
||||
|
||||
打印的是已经计算出的摘要,后续业务若要复用它应直接传递该值,而不是解析输出文字。最后给积分卡加一只改变演示中的印章值,不写入用户文件,也不代表某个真实账户已经更新。
|
||||
|
||||
今日黑板价目——表格给人扫一眼,程序当字典用:
|
||||
|
||||
`菜单` =
|
||||
@@ -55,14 +102,14 @@ description: >-
|
||||
|
||||
上午来了位会员,点两杯拿铁。品名写进`名`,价钱从菜单里取:
|
||||
|
||||
**名 = "拿铁"**
|
||||
**价 = [名](access(菜单, `名`))**
|
||||
**摘要 = [结账摘要] 品名=`名` 价=`价` 杯数=2 会员=True**
|
||||
我们先**名 = "拿铁"**,供下一步使用。
|
||||
我们先**价 = [名](access(`菜单`, `名`))**,供下一步使用。
|
||||
我们先**摘要 = [计算并保存 摘要](结账摘要(品名=`名`, 价=`价`, 杯数=2, 会员=True))**,供下一步使用。
|
||||
**打印 内容=`摘要`**
|
||||
|
||||
旁桌只要一杯普通美式,对照一下原价:
|
||||
|
||||
**对照 = [结账摘要] 品名="美式" 价=[美式](access(菜单, "美式"))**
|
||||
我们先**对照 = [计算并保存 对照](结账摘要(品名="美式", 价=[美式](access(`菜单`, "美式"))))**,供下一步使用。
|
||||
**打印 内容=`对照`**
|
||||
|
||||
---
|
||||
@@ -77,11 +124,11 @@ description: >-
|
||||
| 2 | 美式 | 18 | 2 | False |
|
||||
|
||||
- [行](遍历 今日订单 为 行)
|
||||
**一行 = 结账摘要 品名=[品名](access(行, "品名")) 价=[单价](access(行, "单价")) 杯数=[杯数](access(行, "杯数")) 会员=[会员](access(行, "会员"))**
|
||||
我们先**一行 = [计算并保存 一行](结账摘要(品名=[品名](access(`行`, "品名")), 价=[单价](access(`行`, "单价")), 杯数=[杯数](access(`行`, "杯数")), 会员=[会员](access(`行`, "会员"))))**,供下一步使用。
|
||||
**打印 内容=`一行`**
|
||||
|
||||
打烊前给积分卡盖一个章:
|
||||
|
||||
**印 = 41**
|
||||
**印 = 印章加一 印=`印`**
|
||||
我们先**印 = 41**,供下一步使用。
|
||||
我们先**印 = [计算并保存 印](印章加一(印=`印`))**,供下一步使用。
|
||||
**打印 内容=`印`**
|
||||
@@ -9,8 +9,22 @@ Use when: final normalized configuration is required.
|
||||
|
||||
# config
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Object/type namespace for the child functions below; call the intended child directly |
|
||||
|
||||
## resolve_config
|
||||
+ `path`
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| path | any | required | Filesystem path under the granted root; this callback's prose identifies URL paths separately |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | None; this unit completes the operations described below without a data return |
|
||||
The shared input protocol also accepts `path`. We **[Accept this documented input without changing the result](`path`)**.
|
||||
|
||||
Input `path`, used by the steps below.
|
||||
|
||||
`defaults` =
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ description: Tiny project demonstrating Capability Catalog + reuse + decisions.
|
||||
|
||||
# Engineering Knowledge demo
|
||||
|
||||
|
||||
This folder is a miniature “large engineering” slice: config resolution already exists.
|
||||
Before generating a new loader, run:
|
||||
|
||||
@@ -19,4 +20,8 @@ Expected: **REUSE config.resolve**, not a new `load_configuration`.
|
||||
|
||||
# main
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
|
||||
|
||||
* "see README via catalog/reuse CLI"
|
||||
@@ -8,25 +8,45 @@ import:
|
||||
|
||||
# 订单定价
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 供下述方法复用的对象或类型命名空间;直接调用所需的子函数。 |
|
||||
|
||||
按订单行取未税金额与品类,套用税率后汇总含税总额。
|
||||
|
||||
## 含税价
|
||||
|
||||
`行`
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| 行 | any | 必填 | 订单行记录;按相邻数据表提供金额、品类等字段 |
|
||||
|
||||
**金额 = [订单行金额](access(行, "金额"))**
|
||||
**品类 = [订单行品类](access(行, "品类"))**
|
||||
**税率 = > tax.标准税率.查询 品类=`品类`**
|
||||
**结果 = [本行含税价](金额 * (1 + 税率))**
|
||||
*结果*
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 本次计算得到的结果 |
|
||||
|
||||
输入`行`,按下方步骤使用这个值。
|
||||
|
||||
我们先**金额 = [订单行金额](access(`行`, "金额"))**,供下一步使用。
|
||||
我们先**品类 = [订单行品类](access(`行`, "品类"))**,供下一步使用。
|
||||
我们先**税率 = [计算并保存 税率](tax.标准税率.查询(品类=`品类`))**,供下一步使用。
|
||||
我们先**结果 = [本行含税价]((`金额` * (1 + `税率`)))**,供下一步使用。
|
||||
完成上述步骤后,返回*结果*。
|
||||
|
||||
## 含税总额
|
||||
|
||||
`订单`
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| 订单 | any | 必填 | 包含行记录集合的订单数据;税率与金额字段由本示例约定 |
|
||||
|
||||
**行列表 = [订单行列表](access(订单, "行"))**
|
||||
`总额` = 0
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 逐行累加得到的订单总额 |
|
||||
|
||||
输入`订单`,按下方步骤使用这个值。
|
||||
|
||||
我们先**行列表 = [订单行列表](access(`订单`, "行"))**,供下一步使用。
|
||||
我们先**总额 = 0**,供下一步使用。
|
||||
- [逐个订单行](遍历 行列表 为 行)
|
||||
**行含税价 = > 订单定价.含税价 行=`行`**
|
||||
**总额 = [累加](总额 + 行含税价)**
|
||||
*总额*
|
||||
我们先**行含税价 = [计算并保存 行含税价](订单定价.含税价(行=`行`))**,供下一步使用。
|
||||
我们先**总额 = [累加]((`总额` + `行含税价`))**,供下一步使用。
|
||||
完成上述步骤后,返回*总额*。
|
||||
@@ -9,11 +9,15 @@ import:
|
||||
|
||||
# main
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
|
||||
|
||||
发票回答:演示订单一行图书,未税金额 100。
|
||||
|
||||
`订单` = > json.parse text={"行":[{"金额":100,"品类":"书"}]}
|
||||
**总额 = > pricing.订单定价.含税总额 订单=`订单`**
|
||||
We first **订单 = [Compute 订单](json.parse(text="{\"行\":[{\"金额\":100,\"品类\":\"书\"}]}"))** for the next step.
|
||||
We first **总额 = [Compute 总额](pricing.订单定价.含税总额(订单=`订单`))** for the next step.
|
||||
|
||||
这张订单的含税总额是[含税总价](总额)。
|
||||
|
||||
> print text=`总额`
|
||||
We now **[Display this step's result](> print text=`总额`)**.
|
||||
@@ -7,8 +7,16 @@ title: 折扣不适用于退款
|
||||
|
||||
# 折扣不适用于退款
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Object/type namespace for the child functions below; call the intended child directly |
|
||||
|
||||
负知识:退款结算不得套用会员折扣。Agent 复用折扣能力时应拒绝该适用面。
|
||||
|
||||
## 说明
|
||||
|
||||
*[不适用](false)*
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | The value explicitly returned below; conditional returns follow the selected branch |
|
||||
|
||||
After these steps, return *[不适用](`false`)*.
|
||||