-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
607 lines (575 loc) · 23.4 KB
/
Copy pathindex.html
File metadata and controls
607 lines (575 loc) · 23.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>Vix Lang</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="description" content="一门静态类型、编译型语言。使用 LLVM 后端,支持泛型、ADT、模式匹配、指针运算。">
<style>
:root {
--bg: #353b45;
--bg-alt: #3e4652;
--text-main: #f5f5f5;
--text-muted: #cccccc;
--border: #5c6678;
--orange: #e67e22;
--orange-hover: #d35400;
--orange-light: #ffd6c2;
--gray-dark: #282c33;
--link: #e67e22;
}
* { box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
margin: 0;
padding: 0;
color: var(--text-main);
background: var(--bg);
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
/* Nav */
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 0;
min-height: 70px;
}
.brand {
display: flex;
align-items: center;
gap: 12px;
font-weight: bold;
font-size: 1.6rem;
color: var(--text-main);
text-decoration: none;
margin-left: -16px;
}
.brand img { height: 64px; }
.nav-right {
display: flex;
align-items: center;
gap: 28px;
}
.nav-links {
display: flex;
gap: 24px;
list-style: none;
margin: 0;
padding: 0;
}
.nav-links a {
color: var(--text-main);
font-weight: 500;
font-size: 0.95rem;
}
.nav-links a:hover { color: var(--orange); text-decoration: none; }
.lang-switch {
display: flex;
gap: 10px;
background: var(--gray-dark);
padding: 6px 12px;
border-radius: 4px;
font-size: 0.85em;
font-weight: bold;
}
.lang-switch a { cursor: pointer; color: var(--text-muted); }
.lang-switch a:hover, .lang-switch a.active { color: var(--orange); text-decoration: none; }
/* Hero */
.hero {
padding: 50px 0 80px;
}
.hero-inner {
display: flex;
align-items: center;
justify-content: space-between;
gap: 50px;
}
.hero-main { flex: 1.2; padding-left: 60px; }
.hero-code { flex: 1; min-width: 0; margin-left: -20px; }
.hero h1 {
font-size: 7rem;
margin: 0 0 16px 0;
letter-spacing: -0.05em;
font-weight: 900;
color: var(--orange);
}
.hero h2 {
font-size: 1.6rem;
font-weight: 400;
color: var(--text-muted);
margin: 0;
line-height: 1.4;
}
.hero-actions {
display: flex;
gap: 16px;
margin-top: 32px;
flex-wrap: wrap;
}
.btn {
display: inline-block;
padding: 14px 28px;
font-size: 1.05rem;
font-weight: bold;
border-radius: 6px;
text-decoration: none !important;
transition: all 0.2s;
text-align: center;
}
.btn-primary {
background: var(--orange);
color: #fff;
border: 2px solid var(--orange);
}
.btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn-secondary {
background: transparent;
color: var(--text-main);
border: 2px solid var(--border);
}
.btn-secondary:hover { border-color: var(--orange); color: var(--orange); }
.code-sample {
background: var(--gray-dark);
border: 1px solid var(--border);
border-radius: 8px;
padding: 20px;
overflow-x: auto;
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
font-size: 0.9rem;
line-height: 1.55;
text-align: left;
}
.code-sample pre { margin: 0; color: #e6edf3; }
.code-keyword { color: #ff7b72; }
.code-title { color: #d2a8ff; }
.code-string { color: #a5d6ff; }
.code-comment { color: #8b949e; }
/* Sections */
.section { padding: 70px 0; }
.section-green { background: #2d3a2d; }
.section-purple { background: #3a2d3a; }
.section-orange-bg { background: var(--orange); color: #fff; }
.section-orange-bg h2,
.section-orange-bg h3 { color: #fff; }
.section-orange-bg p { color: var(--orange-light); }
.section-orange-bg a { color: #fff; text-decoration: underline; }
.section h2 {
font-size: 2.2rem;
margin-top: 0;
margin-bottom: 12px;
letter-spacing: -0.02em;
color: var(--text-main);
}
.highlight-bar {
width: 60px;
height: 4px;
background: var(--orange);
margin-bottom: 40px;
}
.section-orange-bg .highlight-bar { background: #fff; }
/* Why */
.why-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 32px;
}
.why-card h3 {
font-size: 1.4rem;
margin: 0 0 12px 0;
color: var(--orange);
}
.why-card p {
margin: 0;
color: var(--text-muted);
font-size: 1.05rem;
line-height: 1.6;
}
/* Build */
.build-intro {
font-size: 1.1rem;
color: var(--text-muted);
max-width: 800px;
margin-bottom: 30px;
}
.build-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 24px;
}
.build-card {
display: flex;
flex-direction: column;
gap: 12px;
}
.build-card h3 {
font-size: 1.2rem;
margin: 0;
color: var(--orange);
}
.build-card p {
flex-grow: 1;
margin: 0;
color: var(--text-muted);
font-size: 0.95rem;
line-height: 1.6;
}
.build-card .btn-secondary {
margin-top: auto;
align-self: flex-start;
font-size: 0.95rem;
padding: 10px 20px;
}
/* Production */
.production { background: var(--bg-alt); }
.production p {
font-size: 1.2rem;
color: var(--text-muted);
line-height: 1.7;
max-width: 900px;
}
/* Community */
.community-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 32px;
margin-bottom: 40px;
}
.community-card {
display: flex;
flex-direction: column;
gap: 12px;
}
.community-card h3 {
font-size: 1.4rem;
margin: 0;
color: #fff;
}
.community-card p {
flex-grow: 1;
margin: 0;
color: var(--orange-light);
font-size: 1rem;
line-height: 1.6;
}
.community-card .btn-secondary {
margin-top: auto;
align-self: flex-start;
border-color: rgba(255,255,255,0.4);
color: #fff;
font-size: 0.95rem;
padding: 10px 20px;
}
.community-card .btn-secondary:hover {
background: #fff;
color: var(--orange);
border-color: #fff;
}
.community-full {
margin-top: 20px;
}
.community-full h3 {
font-size: 1.4rem;
margin: 0 0 12px 0;
color: #fff;
}
.community-full p {
color: var(--orange-light);
font-size: 1rem;
line-height: 1.6;
margin: 0 0 20px 0;
}
/* Thanks */
.thanks { background: var(--bg-alt); }
.thanks-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 32px;
margin-top: 40px;
}
.thanks-card {
display: flex;
flex-direction: column;
gap: 12px;
}
.thanks-card h3 {
font-size: 1.3rem;
margin: 0;
color: var(--orange);
}
.thanks-card p {
flex-grow: 1;
margin: 0;
color: var(--text-muted);
font-size: 0.95rem;
line-height: 1.6;
}
.thanks-card .btn-secondary {
margin-top: auto;
align-self: flex-start;
font-size: 0.95rem;
padding: 10px 20px;
}
/* Footer */
footer {
background: var(--gray-dark);
padding: 60px 0 30px;
}
.footer-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 40px;
margin-bottom: 40px;
}
.footer-col h4 {
font-size: 1.1rem;
margin: 0 0 16px 0;
color: var(--text-main);
}
.footer-col ul {
list-style: none;
margin: 0;
padding: 0;
}
.footer-col li { margin-bottom: 10px; }
.footer-col a {
color: var(--text-muted);
font-size: 0.95rem;
}
.footer-col a:hover { color: var(--orange); text-decoration: none; }
.social-row {
display: flex;
gap: 16px;
flex-wrap: wrap;
align-items: center;
}
.social-row a {
color: var(--text-muted);
font-size: 0.95rem;
}
.social-row a:hover { color: var(--orange); }
.attribution {
text-align: center;
color: var(--text-muted);
font-size: 0.9rem;
padding-top: 30px;
border-top: 1px solid var(--border);
}
.attribution p { margin: 6px 0; }
.attribution a { color: var(--text-muted); }
@media (max-width: 768px) {
.hero-inner { flex-direction: column; text-align: center; }
.hero-main { padding-left: 0; }
.hero h1 { font-size: 5rem; }
.hero h2 { font-size: 1.3rem; }
.hero-actions { justify-content: center; }
.hero-code { width: 100%; text-align: left; margin-left: 0; }
.nav-right { flex-direction: column; gap: 10px; align-items: flex-end; }
.nav-links { gap: 12px; font-size: 0.85rem; }
.why-grid, .build-grid, .community-grid, .thanks-grid, .footer-grid { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<div class="container">
<nav>
<a href="#" class="brand">
<img src="logo.png" alt="Vix Lang Logo">
<span>Vix</span>
</a>
<div class="nav-right">
<ul class="nav-links">
<li><a href="/VixDocs/" data-i18n="nav_doc">文档</a></li>
<li><a href="https://github.com/vixlang/VixDocs" data-i18n="nav_learn">LearnVix</a></li>
<li><a href="https://github.com/vixlang/Very">Very</a></li>
<li><a href="https://github.com/vixlang/Vix-lang">GitHub</a></li>
</ul>
<div class="lang-switch">
<a id="btn-zh" onclick="setLang('zh')" class="active">中文</a>
<a id="btn-en" onclick="setLang('en')">EN</a>
</div>
</div>
</nav>
</div>
<div class="container">
<header class="hero">
<div class="hero-inner">
<div class="hero-main">
<h1 data-i18n="title">Vix</h1>
<h2 data-i18n="desc">赋予每个人构建简洁、<br class="dn db-ns">可靠且高效系统软件的能力。</h2>
<div class="hero-actions">
<a href="https://github.com/vixlang/Vix-lang/releases/tag/v0.3.3" class="btn btn-primary" data-i18n="start">马上开始</a>
<a href="https://github.com/vixlang/Vix-lang" class="btn btn-secondary" data-i18n="src">查看源码</a>
</div>
</div>
<div class="hero-code">
<div class="code-sample">
<pre><code><span class="code-keyword">fn</span> <span class="code-title">find</span>(arr: [i32], target: i32): ?i32 {
<span class="code-keyword">for</span> (i <span class="code-keyword">in</span> 0 .. arr.length) {
<span class="code-keyword">if</span> (arr[i] == target) {
<span class="code-keyword">return</span> <span class="code-title">Some</span>(i)
}
}
<span class="code-keyword">return</span> <span class="code-title">None</span>
}
<span class="code-keyword">fn</span> <span class="code-title">main</span>(): i32 {
<span class="code-keyword">let</span> arr = [10, 20, 30, 40, 50]
<span class="code-keyword">match</span> find(arr, 30) {
<span class="code-title">Some</span>(idx) -> print(<span class="code-string">"Found at index: "</span>, idx)
<span class="code-title">None</span> -> print(<span class="code-string">"Not found"</span>)
}
<span class="code-keyword">match</span> find(arr, 99) {
<span class="code-title">Some</span>(idx) -> print(<span class="code-string">"Found at index: "</span>, idx)
<span class="code-title">None</span> -> print(<span class="code-string">"Not found"</span>)
}
<span class="code-keyword">return</span> 0
}</code></pre>
</div>
</div>
</div>
</header>
</div>
<section class="section section-green">
<div class="container">
<h2 data-i18n="why_title">为什么选择 Vix?</h2>
<div class="highlight-bar"></div>
<div class="why-grid">
<div class="why-card">
<h3 data-i18n="f1_t">编译即优化</h3>
<p data-i18n="f1_d">基于 LLVM 后端,Vix 在编译期完成大量优化。没有沉重的运行时负担,生成的二进制文件精简高效,启动速度毫秒级。</p>
</div>
<div class="why-card">
<h3 data-i18n="f2_t">模式匹配与 ADT</h3>
<p data-i18n="f2_d">原生支持代数数据类型和强大的 match 表达式,让状态处理变得直观且穷尽。编译器会提醒你漏掉的每一种情况,而不是在运行时崩溃。</p>
</div>
<div class="why-card">
<h3 data-i18n="f3_t">可控的底层能力</h3>
<p data-i18n="f3_d">需要操作原始内存?Vix 提供指针运算和手动内存管理的能力。不需要时,现代化的语法和类型系统帮你远离段错误。</p>
</div>
</div>
</div>
</section>
<section class="section section-purple">
<div class="container">
<h2 data-i18n="build_title">用 Vix 构建应用</h2>
<div class="highlight-bar"></div>
<p class="build-intro" data-i18n="build_desc">
Vix 目前处于积极开发阶段(v0.3.3),核心语法和类型系统已经可用。以下是一些你可以尝试的方向,更多示例请参考官方仓库。
</p>
<div class="build-grid">
<div class="build-card">
<h3>算法与数据结构</h3>
<p>用 Vix 的经典语法实现链表、树和排序算法,感受模式匹配带来的清晰逻辑表达。</p>
<a href="https://github.com/vixlang/Vix-lang/tree/stage0/examples" class="btn btn-secondary">浏览示例</a>
</div>
<div class="build-card">
<h3>系统工具</h3>
<p>编写文件处理器、文本分析器或小型 CLI 工具。Vix 的编译速度和高性能运行时让工具开发事半功倍。</p>
<a href="https://github.com/vixlang/Vix-lang/tree/stage0/examples" class="btn btn-secondary">浏览示例</a>
</div>
<div class="build-card">
<h3>探索语言特性</h3>
<p>从泛型到指针运算,从结构体到可选类型。示例代码覆盖了 Vix 当前支持的核心特性。</p>
<a href="https://github.com/vixlang/Vix-lang/tree/stage0/examples" class="btn btn-secondary">浏览示例</a>
</div>
</div>
</div>
</section>
<!-- 橙色加灰色组合背景区块 -->
<section class="section section-orange">
<div class="container" style="text-align: center;">
<h2 data-i18n="eco_title">加入生态系统</h2>
<p style="font-size: 1.1rem; max-width: 600px; margin: 0 auto 30px;" data-i18n="eco_desc">
依靠 Very 包管理器,项目的依赖解决、编译与分发变得异常简单。我们欢迎您对生态和编译器的贡献。
</p>
<div class="hero-actions" style="justify-content: center;">
<a href="https://github.com/vixlang/Very" class="btn btn-secondary" data-i18n="eco_xpm">了解 XPM 包管理器</a>
<a href="/VixDocs/" class="btn btn-secondary" data-i18n="eco_doc">阅读文档</a>
</div>
</div>
</section>
<footer>
<div class="container">
<div class="footer-grid">
<div class="footer-col">
<h4>获得帮助</h4>
<ul>
<li><a href="/VixDocs/">文档</a></li>
<li><a href="https://github.com/vixlang/Vix-docs">贡献者文档</a></li>
<li><a href="#">在用户论坛提问</a></li>
</ul>
</div>
<div class="footer-col">
<h4>条款与政策</h4>
<ul>
<li><a href="#">行为准则</a></li>
<li><a href="https://github.com/vixlang/Vix-lang/blob/stage0/LICENSE">许可证</a></li>
<li><a href="#">安全问题公示</a></li>
</ul>
</div>
<div class="footer-col">
<h4>社交</h4>
<div class="social-row">
<a href="https://github.com/vixlang" target="_blank">GitHub</a>
<a href="mailto:popolk1871@outlook.com">Contact Us</a>
</div>
<p style="margin-top: 12px; color: var(--text-muted); font-size: 0.9rem;">QQ 群: 130577506</p>
</div>
</div>
<div class="attribution">
<p>由 Vix Lang 贡献者维护 | MIT 协议</p>
<p>发现了错别字?<a href="https://github.com/vixlang/vixlang.github.io/issues">在这里提交修复!</a></p>
</div>
</div>
</footer>
<script>
const translations = {
zh: {
nav_doc: "文档", nav_learn: "LearnVix",
title: "Vix",
desc: "赋予每个人构建简洁、可靠且高效系统软件的能力。",
start: "马上开始", src: "查看源码",
why_title: "为什么选择 VIx?",
f1_t: "高性能", f1_d: "由于基于 LLVM 后端,Vix 速度惊人且内存利用率极高。它可以胜任对性能要求极高的服务,甚至可以直接在嵌入式设备上运行。",
f2_t: "现代类型系统", f2_d: "丰富的类型系统支持泛型与代数数据类型(ADT)。内置现代语言级别的 match 模式匹配体系以及结构体等,使得代码极具表现力。",
f3_t: "底层控制力", f3_d: "无缝支持指针运算和原生内存操作。使用 & 取地址,@ 解引用,在提供高级语法抽象的同时,毫不妥协对硬件的绝对掌控。",
build_title: "用 VIx 构建应用", build_desc: "VIx 目前正在快速发展中,语法简洁、一致。",
code_comment: "// [在此处插入实际的 Vix 代码示例]",
eco_title: "加入生态系统", eco_desc: "依靠 XPM 包管理器,项目的依赖解决、编译与分发变得异常简单。我们欢迎您对生态和编译器的贡献。",
eco_xpm: "了解 XPM 包管理器", eco_doc: "阅读文档",
footer_txt: "由 VIx Lang 贡献者维护 | MIT 协议"
},
en: {
nav_doc: "Docs", nav_learn: "LearnVix",
title: "Vix",
desc: "A language empowering everyone to build simple, reliable, and efficient systems software.",
start: "Get Started", src: "View Source",
why_title: "Why VIx?",
f1_t: "High Performance", f1_d: "Based on the LLVM backend, Vix is blazingly fast and highly memory-efficient. It handles performance-critical services and runs directly on embedded devices.",
f2_t: "Modern Type System", f2_d: "Rich type system supporting generics and ADTs. Built-in modern pattern matching and structs make code highly expressive.",
f3_t: "Low-level Control", f3_d: "Seamless support for pointer arithmetic and raw memory manipulation. High-level abstractions without compromising hardware control.",
build_title: "Build with VIx", build_desc: "VIx is evolving rapidly with clean and consistent syntax.",
code_comment: "// [Insert your VIx code example here]",
eco_title: "Join the Ecosystem", eco_desc: "With the XPM package manager, dependency resolution, compilation, and distribution become incredibly simple.",
eco_xpm: "Discover XPM", eco_doc: "Read the Docs",
footer_txt: "Maintained by VIx Lang Contributors | MIT License"
}
};
function setLang(lang) {
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.getAttribute('data-i18n');
if (translations[lang] && translations[lang][key]) {
el.innerText = translations[lang][key];
}
});
document.getElementById('btn-zh').className = lang === 'zh' ? 'active' : '';
document.getElementById('btn-en').className = lang === 'en' ? 'active' : '';
document.documentElement.lang = lang === 'zh' ? 'zh-CN' : 'en';
}
</script>
</body>
</html>