|
6 | 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
7 | 7 | <title>Document</title> |
8 | 8 | <style> |
| 9 | + * { |
| 10 | + margin: 0; |
| 11 | + padding: 0; |
| 12 | + box-sizing: border-box; |
| 13 | + } |
| 14 | + |
| 15 | + html, |
| 16 | + body { |
| 17 | + width: 100%; |
| 18 | + height: 100%; |
| 19 | + overflow-y: auto; |
| 20 | + overflow-x: hidden; |
| 21 | + } |
| 22 | + |
9 | 23 | body { |
10 | 24 | color: #bfb; |
11 | 25 | text-shadow: 0 0 2px #fff, 0 0 6px #fff, 0 0 15px #00a67c; |
12 | 26 | filter: drop-shadow(0 0 2px #00a67c); |
| 27 | + padding: 15px 20px; |
| 28 | + font-size: 16px; |
| 29 | + line-height: 1.6; |
13 | 30 | } |
14 | | - |
| 31 | + |
| 32 | + #text { |
| 33 | + width: 100%; |
| 34 | + height: 100%; |
| 35 | + } |
| 36 | + |
| 37 | + #text li { |
| 38 | + list-style: none; |
| 39 | + margin-bottom: 15px; |
| 40 | + line-height: 1.7; |
| 41 | + font-size: 16px; |
| 42 | + } |
| 43 | + |
| 44 | + #text li span:first-child { |
| 45 | + display: inline-block; |
| 46 | + min-width: 70px; |
| 47 | + margin-right: 12px; |
| 48 | + font-size: 17px; |
| 49 | + font-weight: bold; |
| 50 | + color: #0f7; |
| 51 | + } |
| 52 | + |
| 53 | + #text li span:last-child { |
| 54 | + font-size: 15px; |
| 55 | + } |
| 56 | + |
| 57 | + #text div { |
| 58 | + margin-bottom: 15px; |
| 59 | + line-height: 1.7; |
| 60 | + font-size: 16px; |
| 61 | + } |
| 62 | + |
| 63 | + #text h1 { |
| 64 | + margin: 25px 0 20px 0; |
| 65 | + font-size: 28px; |
| 66 | + } |
| 67 | + |
15 | 68 | button { |
16 | 69 | background-color: #00a67c; |
17 | 70 | color: #bfb; |
18 | 71 | text-shadow: 0 0 2px #fff, 0 0 6px #fff, 0 0 15px #00a67c; |
19 | 72 | outline: none; |
20 | 73 | border: none; |
21 | 74 | border-radius: 4px; |
| 75 | + padding: 10px 18px; |
| 76 | + font-size: 15px; |
| 77 | + } |
| 78 | + |
| 79 | + /* 隐藏滚动条 */ |
| 80 | + body::-webkit-scrollbar { |
| 81 | + display: none; |
| 82 | + } |
| 83 | + |
| 84 | + body { |
| 85 | + -ms-overflow-style: none; /* IE and Edge */ |
| 86 | + scrollbar-width: none; /* Firefox */ |
22 | 87 | } |
23 | 88 | </style> |
24 | 89 | </head> |
|
28 | 93 | <script src="https://unpkg.com/typeit@8.6.0/dist/index.umd.js"></script> |
29 | 94 | <script> |
30 | 95 | let hash = window.parent?.location?.hash?.split("#")?.[1]; |
31 | | - // let hash = location?.hash?.split("#")?.[1]; |
32 | | - // 基本加密方式 |
33 | | - // const encode = (name) => { |
34 | | - // hash = [...encodeURI(name)].map((c) => c.charCodeAt(0) ^ "lec").join("&"); |
35 | | - // return hash; |
36 | | - // }; |
37 | | - let time |
38 | | - const handleClick = () => { |
39 | | - alert(1); |
40 | | - }; |
41 | | - |
| 96 | + console.log(hash) |
| 97 | + let time; |
| 98 | + |
42 | 99 | const decode = () => { |
43 | | - const hashList = hash?.split('/') |
44 | | - time = hashList[1] |
45 | | - hash = hashList[2] |
| 100 | + const hashList = hash?.split("/"); |
| 101 | + console.log(hashList) |
| 102 | + time = hashList[1]; |
| 103 | + hash = hashList[2]; |
| 104 | + console.log(hash) |
46 | 105 | const arr = hash?.split("&")?.map((c) => +c ^ "lec"); |
47 | 106 | const text = String.fromCharCode(...arr); |
48 | | - hash = decodeURI(text); |
| 107 | + hash = text |
49 | 108 | return hash; |
50 | 109 | }; |
| 110 | + |
51 | 111 | const res = decode(); |
52 | 112 |
|
| 113 | + console.log('year:') |
| 114 | + console.log('name:',res) |
| 115 | + |
| 116 | + // 改进的自动滚动函数 |
| 117 | + const scrollToBottom = () => { |
| 118 | + requestAnimationFrame(() => { |
| 119 | + const body = document.body; |
| 120 | + const html = document.documentElement; |
| 121 | + |
| 122 | + // 尝试所有可能的滚动方式 |
| 123 | + body.scrollTop = body.scrollHeight; |
| 124 | + html.scrollTop = html.scrollHeight; |
| 125 | + window.scrollTo(0, document.body.scrollHeight); |
| 126 | + |
| 127 | + // 使用 scrollIntoView |
| 128 | + const textElement = document.getElementById('text'); |
| 129 | + if (textElement && textElement.lastElementChild) { |
| 130 | + textElement.lastElementChild.scrollIntoView({ |
| 131 | + behavior: 'smooth', |
| 132 | + block: 'nearest' |
| 133 | + }); |
| 134 | + } |
| 135 | + }); |
| 136 | + }; |
| 137 | + |
53 | 138 | if (hash) { |
54 | | - console.log(1); |
55 | 139 | new TypeIt("#text", { |
56 | 140 | speed: 50, |
57 | 141 | startDelay: 900, |
| 142 | + afterStep: scrollToBottom, // 每步后滚动 |
58 | 143 | }) |
59 | 144 | .type( |
60 | 145 | `<li> |
|
129 | 214 | <span>OpenAI 发布 GPT-2,大模型时代的前夜到来</span> |
130 | 215 | </li> |
131 | 216 |
|
| 217 | + <li><span>2024</span><span>开源大模型爆发式增长,Llama 3、Qwen 等系列模型推动 AI 技术普惠化</span></li> |
| 218 | +
|
132 | 219 | `, |
133 | 220 | { delay: 100 } |
134 | 221 | ) |
|
170 | 257 | { delay: 800 } |
171 | 258 | ) |
172 | 259 | .go(); |
173 | | - } else { |
174 | | - new TypeIt("#text", { |
175 | | - speed: 50, |
176 | | - startDelay: 900, |
177 | | - }) |
178 | | - .type(`ERROR: INVADED BY SOMEONE UNKNOWN!`, { delay: 100 }) |
179 | | - .go(); |
180 | | - } |
181 | | - </script> |
| 260 | + } else { |
| 261 | + new TypeIt("#text", { |
| 262 | + speed: 50, |
| 263 | + startDelay: 900, |
| 264 | + }) |
| 265 | + .type(`ERROR: INVADED BY SOMEONE UNKNOWN!`, { delay: 100 }) |
| 266 | + .go(); |
| 267 | + } |
| 268 | +</script> |
182 | 269 | </html> |
0 commit comments