Open
feat: 霓虹主题变种 #2
feat: 霓虹主题变种 #2
Open
gcw_hrun4t3TAdd on Oct 18
Total: 1 files changed+304-0
Aindex.html+304-0
@@ -0,0 +1,304 @@
1+<!DOCTYPE html>
2+<html lang="zh-CN">
3+<head>
4+<meta charset="UTF-8">
5+<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+<title>码道小助手</title>
7+<style>
8+ * { margin: 0; padding: 0; box-sizing: border-box; }
9+ 
10+ html, body {
11+ height: 100%;
12+ background: #1f1f1f;
13+ font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
14+ display: flex;
15+ align-items: center;
16+ justify-content: center;
17+ }
18+ 
19+ .phone {
20+ width: 375px;
21+ height: 720px;
22+ background: #ededed;
23+ position: relative;
24+ overflow: hidden;
25+ border-radius: 18px;
26+ border: 1px solid rgba(0, 240, 255, 0.45);
27+ box-shadow: 0 0 22px rgba(255, 0, 230, 0.35), 0 0 46px rgba(0, 240, 255, 0.2), 0 14px 44px rgba(0, 0, 0, 0.6);
28+ display: flex;
29+ flex-direction: column;
30+ }
31+ 
32+ .header {
33+ height: 48px;
34+ background: linear-gradient(90deg, #1a0b2e, #0d0221 50%, #1a0b2e);
35+ color: #00f0ff;
36+ display: flex;
37+ align-items: center;
38+ justify-content: center;
39+ position: relative;
40+ flex-shrink: 0;
41+ border-bottom: 1px solid rgba(0, 240, 255, 0.35);
42+ border-radius: 0 0 14px 14px;
43+ box-shadow: 0 2px 14px rgba(255, 0, 230, 0.28);
44+ }
45+ 
46+ .header .back {
47+ position: absolute;
48+ left: 14px;
49+ font-size: 22px;
50+ color: #ff00e6;
51+ line-height: 1;
52+ font-weight: 300;
53+ text-shadow: 0 0 8px rgba(255, 0, 230, 0.7);
54+ }
55+ 
56+ .header .title {
57+ font-size: 17px;
58+ font-weight: 500;
59+ letter-spacing: 1px;
60+ text-shadow: 0 0 8px rgba(0, 240, 255, 0.85), 0 0 16px rgba(0, 240, 255, 0.45);
61+ }
62+ 
63+ .chat {
64+ flex: 1;
65+ overflow-y: auto;
66+ padding: 12px 10px;
67+ background: #ededed;
68+ }
69+ 
70+ .row {
71+ display: flex;
72+ margin-bottom: 16px;
73+ align-items: flex-start;
74+ }
75+ 
76+ .row.other { justify-content: flex-start; }
77+ .row.me { justify-content: flex-end; }
78+ 
79+ .avatar {
80+ width: 38px;
81+ height: 38px;
82+ border-radius: 4px;
83+ flex-shrink: 0;
84+ background-size: cover;
85+ background-position: center;
86+ }
87+ 
88+ .row.other .avatar {
89+ background: #ffffff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='38' height='38'><rect width='38' height='38' fill='%23ffffff'/><text x='50%25' y='55%25' font-size='20' text-anchor='middle' dominant-baseline='middle'>🤖</text></svg>") no-repeat center;
90+ }
91+ 
92+ .row.me .avatar {
93+ background: #7a00ff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='38' height='38'><rect width='38' height='38' fill='%237a00ff'/><text x='50%25' y='55%25' font-size='20' text-anchor='middle' dominant-baseline='middle'>🙂</text></svg>") no-repeat center;
94+ box-shadow: 0 0 8px rgba(122, 0, 255, 0.6);
95+ }
96+ 
97+ .bubble {
98+ max-width: 220px;
99+ padding: 9px 12px;
100+ font-size: 15px;
101+ line-height: 1.45;
102+ border-radius: 8px;
103+ position: relative;
104+ word-break: break-word;
105+ }
106+ 
107+ .row.other .bubble {
108+ background: #ffffff;
109+ color: #333333;
110+ margin-left: 10px;
111+ }
112+ 
113+ .row.other .bubble::before {
114+ content: "";
115+ position: absolute;
116+ left: -6px;
117+ top: 12px;
118+ width: 0;
119+ height: 0;
120+ border-top: 6px solid transparent;
121+ border-bottom: 6px solid transparent;
122+ border-right: 6px solid #ffffff;
123+ }
124+ 
125+ .row.me .bubble {
126+ background: linear-gradient(135deg, #00f0ff 0%, #ff00e6 50%, #7a00ff 100%);
127+ color: #ffffff;
128+ margin-right: 10px;
129+ box-shadow: 0 0 10px rgba(255, 0, 230, 0.45);
130+ }
131+ 
132+ .row.me .bubble::before {
133+ content: "";
134+ position: absolute;
135+ right: -6px;
136+ top: 12px;
137+ width: 0;
138+ height: 0;
139+ border-top: 6px solid transparent;
140+ border-bottom: 6px solid transparent;
141+ border-left: 6px solid #ff00e6;
142+ }
143+ 
144+ .input-bar {
145+ height: 50px;
146+ background: #f7f7f7;
147+ border-top: 1px solid #dcdcdc;
148+ display: flex;
149+ align-items: center;
150+ padding: 0 10px;
151+ flex-shrink: 0;
152+ }
153+ 
154+ .input-bar .icon {
155+ font-size: 22px;
156+ color: #666666;
157+ margin: 0 8px;
158+ }
159+ 
160+ .input-bar input {
161+ flex: 1;
162+ height: 34px;
163+ border: 1px solid #dcdcdc;
164+ border-radius: 4px;
165+ padding: 0 8px;
166+ font-size: 15px;
167+ background: #ffffff;
168+ outline: none;
169+ }
170+ 
171+ .input-bar .send {
172+ margin-left: 8px;
173+ background: linear-gradient(135deg, #00f0ff, #ff00e6);
174+ color: #ffffff;
175+ border: none;
176+ border-radius: 4px;
177+ padding: 7px 12px;
178+ font-size: 14px;
179+ cursor: pointer;
180+ box-shadow: 0 0 8px rgba(255, 0, 230, 0.4);
181+ }
182+ 
183+ .row.compact { margin-top: -10px; }
184+ 
185+ .bubble { animation: pop 0.32s cubic-bezier(0.22, 0.9, 0.3, 1); }
186+ @keyframes pop {
187+ from { opacity: 0; transform: translateY(10px); }
188+ to { opacity: 1; transform: translateY(0); }
189+ }
190+ 
191+ .typing {
192+ display: flex;
193+ gap: 5px;
194+ align-items: center;
195+ padding: 11px 14px;
196+ }
197+ .typing span {
198+ width: 6px;
199+ height: 6px;
200+ border-radius: 50%;
201+ background: #b3b3b3;
202+ animation: blink 1.3s infinite ease-in-out;
203+ }
204+ .typing span:nth-child(2) { animation-delay: 0.18s; }
205+ .typing span:nth-child(3) { animation-delay: 0.36s; }
206+ @keyframes blink {
207+ 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
208+ 30% { opacity: 1; transform: translateY(-4px); }
209+ }
210+ 
211+ .chat { transition: opacity 0.5s ease; }
212+</style>
213+</head>
214+<body>
215+ <div class="phone">
216+ <div class="header">
217+ <span class="back">‹</span>
218+ <span class="title">码道小助手</span>
219+ </div>
220+ 
221+ <div class="chat" id="chat"></div>
222+ 
223+ <div class="input-bar">
224+ <span class="icon">🎤</span>
225+ <input type="text" placeholder="说点什么..." />
226+ <span class="icon">😊</span>
227+ <button class="send">发送</button>
228+ </div>
229+ </div>
230+ 
231+ <script>
232+ const script = [
233+ { who: 'other', text: '在吗?' },
234+ { who: 'me', text: '在的,怎么啦?' },
235+ { who: 'other', text: '我想用 AI 做一个无限动画,听说可以用 git 边做边回退?' },
236+ { who: 'me', text: '对,思路很简单' },
237+ { who: 'me', text: '满意就 commit,不满意就 checkout / reset 回退再改' },
238+ { who: 'other', text: '懂了,那我先去试试' },
239+ { who: 'me', text: '👍 有不懂的随时问' }
240+ ];
241+ 
242+ const chat = document.getElementById('chat');
243+ const sleep = ms => new Promise(r => setTimeout(r, ms));
244+ 
245+ function scrollBottom() {
246+ chat.scrollTo({ top: chat.scrollHeight, behavior: 'smooth' });
247+ }
248+ 
249+ function addRow(who, content, compact) {
250+ const row = document.createElement('div');
251+ row.className = 'row ' + who + (compact ? ' compact' : '');
252+ const avatar = document.createElement('div');
253+ avatar.className = 'avatar';
254+ if (who === 'other') { row.appendChild(avatar); row.appendChild(content); }
255+ else { row.appendChild(content); row.appendChild(avatar); }
256+ chat.appendChild(row);
257+ scrollBottom();
258+ return row;
259+ }
260+ 
261+ function makeBubble(text) {
262+ const b = document.createElement('div');
263+ b.className = 'bubble';
264+ b.textContent = text;
265+ return b;
266+ }
267+ 
268+ function makeTyping() {
269+ const b = document.createElement('div');
270+ b.className = 'bubble typing';
271+ b.innerHTML = '<span></span><span></span><span></span>';
272+ return b;
273+ }
274+ 
275+ async function play() {
276+ while (true) {
277+ let lastWho = null;
278+ for (const msg of script) {
279+ const compact = (msg.who === lastWho);
280+ if (msg.who === 'other') {
281+ const typing = addRow('other', makeTyping(), false);
282+ const dur = Math.min(2200, 700 + msg.text.length * 45);
283+ await sleep(dur);
284+ typing.remove();
285+ addRow('other', makeBubble(msg.text), compact);
286+ } else {
287+ await sleep(550);
288+ addRow('me', makeBubble(msg.text), compact);
289+ }
290+ lastWho = msg.who;
291+ await sleep(520);
292+ }
293+ await sleep(2400);
294+ chat.style.opacity = '0';
295+ await sleep(520);
296+ chat.innerHTML = '';
297+ chat.style.opacity = '1';
298+ await sleep(700);
299+ }
300+ }
301+ play();
302+ </script>
303+</body>
304+</html>