Skip to content

Commit cf47ea7

Browse files
Refine referral activity site
1 parent 29a2524 commit cf47ea7

3 files changed

Lines changed: 28 additions & 9 deletions

File tree

docs/activity/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<h1 class="activity-title reveal" id="activity-title" data-t="ruleTitle">邀请活动规则</h1>
4242
<section class="activity-block" aria-labelledby="reward-title">
4343
<h2 class="section-title" id="reward-title" data-t="rewardTitle">奖励档位</h2>
44-
<div class="surface reward-list" data-array="rewards"></div>
44+
<div class="rule-list" data-array="rewards"></div>
4545
</section>
4646
<p class="note reveal" data-t="note">奖励达到后请按 App 内邀请明细与后台记录联系兑换。为防止刷量,截图不能作为有效邀请依据。</p>
4747
</section>
@@ -54,7 +54,7 @@ <h2 class="section-title" id="valid-title" data-t="validTitle">什么是有效
5454

5555
<section class="activity-block" aria-labelledby="other-title">
5656
<h2 class="section-title" id="other-title" data-t="otherTitle">其他活动</h2>
57-
<div class="surface other-list" data-array="other"></div>
57+
<div class="rule-list" data-array="other"></div>
5858
</section>
5959
</section>
6060
</div>

docs/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@
245245
color: var(--ink);
246246
}
247247

248+
.pill-btn.ghost {
249+
background: rgba(255, 255, 255, 0.14);
250+
color: var(--white);
251+
border: 1px solid rgba(255, 255, 255, 0.28);
252+
}
253+
248254
.pill-btn.warm {
249255
background: var(--warm);
250256
color: var(--orange);
@@ -705,6 +711,7 @@ <h1 id="hero-title" data-i18n="heroTitle">在 iPhone 上写 Python</h1>
705711
<span data-i18n="downloadCta">下载</span>
706712
</a>
707713
<a class="pill-btn light" href="docs/" data-i18n="docsCta">阅读文档</a>
714+
<a class="pill-btn ghost" href="activity/" data-i18n="referralCta">邀请活动</a>
708715
</div>
709716
</div>
710717

@@ -810,6 +817,7 @@ <h2 id="hero-card-title" data-i18n="cardTitle">开始使用</h2>
810817
subtitle: "在 iPhone 和 iPad 上编写 Python,构建 AppUI、小组件、Agent 工作流与 iOS 原生能力。",
811818
downloadCta: "下载",
812819
docsCta: "阅读文档",
820+
referralCta: "邀请活动",
813821
cardTitle: "开始使用",
814822
cardAgentLabel: "安装 Agent Skills",
815823
agentSkillCopied: "已复制",
@@ -847,6 +855,7 @@ <h2 id="hero-card-title" data-i18n="cardTitle">开始使用</h2>
847855
subtitle: "Build AppUI, widgets, Agent workflows, and native iOS capabilities on iPhone and iPad.",
848856
downloadCta: "Download",
849857
docsCta: "Read the Docs",
858+
referralCta: "Referral Program",
850859
cardTitle: "Get Started",
851860
cardAgentLabel: "Install Agent Skills",
852861
agentSkillCopied: "Copied",

docs/referral/referral.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ const iconPaths = {
8888
link: "M10 13a5 5 0 0 0 7.07 0l2-2a5 5 0 0 0-7.07-7.07l-1.2 1.2M14 11a5 5 0 0 0-7.07 0l-2 2A5 5 0 0 0 12 20.07l1.2-1.2",
8989
spark: "M12 2v5M12 17v5M4.22 4.22l3.54 3.54M16.24 16.24l3.54 3.54M2 12h5M17 12h5M4.22 19.78l3.54-3.54M16.24 7.76l3.54-3.54",
9090
clock: "M12 8v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z",
91+
gift: "M20 12v8a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-8M2 8h20v4H2V8ZM12 8v13M12 8H8.5A2.5 2.5 0 1 1 11 5.5L12 8Zm0 0h3.5A2.5 2.5 0 1 0 13 5.5L12 8Z",
92+
percent: "M19 5 5 19M7.5 8.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM16.5 19.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",
93+
crown: "M3 8l4.5 4L12 5l4.5 7L21 8l-2 11H5L3 8Z",
94+
pen: "M17 3l4 4L8 20H4v-4L17 3Z",
95+
community: "M16 20a4 4 0 0 0-8 0M12 13a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 20a3.5 3.5 0 0 0-5.4-2.95M17 11a3 3 0 1 0 0-6M2 20a3.5 3.5 0 0 1 5.4-2.95M7 11a3 3 0 1 1 0-6",
9196
};
9297

9398
function routePath() {
@@ -145,10 +150,14 @@ function renderArray(node, t) {
145150
const key = node.dataset.array;
146151
const rows = t[key] || [];
147152
if (key === "rewards") {
148-
node.innerHTML = rows.map(([left, right]) => `
149-
<div class="reward-row reveal motion-surface">
150-
<strong>${left}</strong>
151-
<em>${right}</em>
153+
const icons = ["gift", "percent", "crown"];
154+
node.innerHTML = rows.map(([requirement, reward], index) => `
155+
<div class="rule-row reveal">
156+
<div class="rule-icon" aria-hidden="true">${svgIcon(icons[index] || "gift")}</div>
157+
<div>
158+
<strong>${reward}</strong>
159+
<span>${requirement}</span>
160+
</div>
152161
</div>
153162
`).join("");
154163
return;
@@ -179,13 +188,14 @@ function renderArray(node, t) {
179188
return;
180189
}
181190
if (key === "other") {
182-
node.innerHTML = rows.map(([title, detail]) => `
183-
<div class="other-row reveal motion-surface">
191+
const icons = ["pen", "community"];
192+
node.innerHTML = rows.map(([title, detail], index) => `
193+
<div class="rule-row reveal">
194+
<div class="rule-icon" aria-hidden="true">${svgIcon(icons[index] || "spark")}</div>
184195
<div>
185196
<strong>${title}</strong>
186197
<span>${detail}</span>
187198
</div>
188-
<em>›</em>
189199
</div>
190200
`).join("");
191201
}

0 commit comments

Comments
 (0)