Skip to content

Commit 29a2524

Browse files
Fix referral invite mobile layout
1 parent 8b69eae commit 29a2524

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

docs/referral/referral.css

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,33 @@ html[lang="en"] .language-toggle [data-lang="en"] {
234234

235235
.invite-code {
236236
margin: 26px auto 18px;
237+
width: 100%;
238+
max-width: 100%;
237239
color: var(--ink);
238240
font-family: var(--mono);
239-
font-size: clamp(50px, 15vw, 84px);
241+
font-size: clamp(46px, 13vw, 84px);
240242
font-weight: 520;
241-
letter-spacing: 0.22em;
243+
letter-spacing: 0.18em;
242244
line-height: 1;
243245
text-align: center;
244-
text-indent: 0.22em;
246+
text-indent: 0.18em;
245247
white-space: nowrap;
248+
overflow: hidden;
246249
transform: translateZ(0);
247250
}
248251

252+
.invite-code.compact {
253+
font-size: clamp(38px, 10.6vw, 64px);
254+
letter-spacing: 0.12em;
255+
text-indent: 0.12em;
256+
}
257+
258+
.invite-code.ultra-compact {
259+
font-size: clamp(32px, 8.8vw, 52px);
260+
letter-spacing: 0.08em;
261+
text-indent: 0.08em;
262+
}
263+
249264
.invite-code span {
250265
display: inline-block;
251266
animation: codeEnter 760ms var(--ease) both;
@@ -661,7 +676,8 @@ html[lang="en"] .language-toggle [data-lang="en"] {
661676
.invite-code {
662677
margin-left: 0;
663678
text-align: left;
664-
text-indent: 0.22em;
679+
text-indent: 0.18em;
680+
overflow: visible;
665681
}
666682

667683
.actions {

docs/referral/referral.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const copy = {
3333
valid: [
3434
["首次使用的新用户", "老用户、重复设备和自邀不会计入"],
3535
["绑定邀请码", "被邀请人只能绑定一次邀请码"],
36-
["完成核心行为", "运行 Python、创建项目或使用 AI 功能"],
36+
["完成核心行为", "运行 Python 或使用 AI 功能"],
3737
["次日仍打开 App", "完成留存验证后才计入有效邀请"],
3838
],
3939
other: [
@@ -73,7 +73,7 @@ const copy = {
7373
valid: [
7474
["A first-time new user", "Existing users, duplicate devices, and self-invites are excluded"],
7575
["Invite code is bound", "Each invited user can bind only one code"],
76-
["Core action completed", "Run Python, create a project, or use AI"],
76+
["Core action completed", "Run Python or use AI"],
7777
["Returns the next day", "Retention must be verified before it becomes valid"],
7878
],
7979
other: [
@@ -199,6 +199,9 @@ function renderInviteCode(code) {
199199
const target = document.querySelector("[data-invite-code]");
200200
if (!target) return;
201201
target.dataset.inviteCode = code;
202+
target.dataset.length = String(code.length);
203+
target.classList.toggle("compact", code.length >= 7);
204+
target.classList.toggle("ultra-compact", code.length >= 10);
202205
target.innerHTML = code.split("").map((char, index) => `<span style="--i:${index}">${char}</span>`).join("");
203206
}
204207

0 commit comments

Comments
 (0)