-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
308 lines (285 loc) · 11.1 KB
/
index.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Gradia</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/codemirror.min.css"
/>
<link
href="https://fonts.googleapis.com/css2?family=Klee+One&display=swap"
rel="stylesheet"
/>
<style>
/* Custom styling for the site */
.project-card {
box-shadow: 0px 1px 1.5px rgba(0, 0, 0, 0.1);
height: 500px;
margin-bottom: 10px;
}
.card-text {
height: 3lh;
}
.section-title {
border-bottom: 1px solid rgba(0, 139, 139, 0.2);
margin-bottom: 20px;
}
.card-img-top {
height: 300px;
object-fit: cover;
max-height: 300px;
overflow: hidden;
}
h1 {
font-size: 60px;
padding: 0;
margin: 0;
margin-left: 10px;
}
.btn {
opacity: 0.5;
}
#result {
user-select: text;
text-align: left;
overflow: scroll;
height: 1%;
max-height: 1%;
cursor: text;
margin-bottom: 0;
}
.footer {
background-color: lightblue;
opacity: 0.7;
color: black;
padding: 20px 0;
text-align: center;
}
.title {
font-size: 80px;
display: flex;
}
#icon {
height: 1em;
}
#result {
background-color: #f5f5f5;
padding: 1rem;
overflow-x: auto;
}
footer {
text-align: center;
font-family: "Klee One", cursive;
}
body {
background: linear-gradient(to bottom, white, aliceblue);
font-family: "Klee One", cursive;
font-size: larger;
}
#editor {
text-align: start;
}
</style>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-custom">
<div class="container">
<a class="navbar-brand" href="#">Gradia Project</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">Code</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tools">Tools</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="hero">
<div class="container">
<div class="title">
<img src="icon.png" alt="Icon" id="icon" />
<h1>Gradia</h1>
</div>
<p>
Lisp like programming language that can give type annotation
for gradual typing
</p>
<a
href="https://github.com/gradia-lang/gradia"
class="btn btn-secondary"
><i class="fab fa-github"></i> GitHub</a
>
<span id="update"></span>
</div>
</section>
<!-- About Section -->
<section id="about" class="container my-5">
<h2 class="section-title">About</h2>
<p>
Gradia name's origin is from "Gradual typing". So, Gradia adopts
gradual way as type system. It improves trustability<br />
Implemented by Rust, and it's splited core interpreter logic and
user-interface. So, Gradia is run on browser using WASM too!<br />
Have a happy hacking of fantastic Gradia programming world!
</p>
</section>
<!-- Projects Section -->
<section id="code" class="container my-5">
<h2 class="section-title">Code</h2>
<div style="display: flex; align-items: baseline;">
<span id="run" class="btn btn-primary">Run</span>
<p>  This sample code is to solve FizzBuzz problem in Gradia. Isn't it cool?</p>
</div>
<textarea id="editor">
(define '(fizzbuzz i:number)
'(cond
'((= 0 (% i 15)) "FizzBuzz")
'((= 0 (% i 3)) "Fizz")
'((= 0 (% i 5)) "Buzz")
'(true i)))
(join (map (range 1 101) fizzbuzz) " ")
</textarea>
<pre id="result">  </pre>
</section>
<!-- Projects Section -->
<section id="tools" class="container my-5">
<h2 class="section-title">Tools</h2>
<div class="row">
<div class="col-md-6">
<div class="card project-card">
<img
src="s-block.png"
class="card-img-top"
alt="Project Image"
/>
<div class="card-body">
<h5 class="card-title">S-Block</h5>
<p class="card-text">
Visual environment that expresses program using
colorful block.<br />
The concept is "Even primary students can use".
</p>
<a
href="https://gradia-lang.github.io/s-block"
class="btn btn-outline-primary"
>Access</a
>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card project-card">
<img
src="grab.png"
class="card-img-top"
alt="Project Image"
/>
<div class="card-body">
<h5 class="card-title">Graboratory</h5>
<p class="card-text">
Notebook apps that can run Gradia code
interactive.<br />
And can write markdown text, useful for creating
reports
</p>
<a
href="https://gradia-lang.github.io/grab"
class="btn btn-outline-primary"
>Access</a
>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="footer">
<div class="container">
© 2024 梶塚太智. All rights reserved
</div>
</footer>
<script src="https://gradia-lang.github.io/gradia.js" type="module"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/addon/edit/closebrackets.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/mode/scheme/scheme.js"></script>
<script>
// Function to get the latest commit of a GitHub repository
async function getLatestCommit(token = null) {
const url = `https://api.github.com/repos/gradia-lang/gradia/commits`;
try {
const response = await fetch(url, {});
if (!response.ok) {
throw new Error(
`Error: ${response.status} ${response.statusText}`,
);
}
const commits = await response.json();
if (commits.length === 0) {
console.log("No commits found.");
return null;
}
const latestCommit = commits[0];
console.log("Latest Commit:", latestCommit);
let elm = document.getElementById("update");
elm.innerHTML = ""; // Clear
let link = document.createElement("a");
link.href = latestCommit.html_url;
link.innerText = latestCommit.commit?.message;
elm.appendChild(link);
} catch (error) {
console.error("Failed to fetch commits:", error);
return null;
}
}
getLatestCommit();
</script>
<script>
let editor;
document.addEventListener("DOMContentLoaded", function () {
let area = document.getElementById("editor");
editor = CodeMirror.fromTextArea(area, {
mode: "scheme",
theme: "cobalt",
lineNumbers: true,
indentUnit: 4,
});
let runButton = document.getElementById("run");
runButton.onclick = function() {
let result = document.getElementById("result");
let gradia = new Gradia();
result.textContent = gradia.eval(editor.getValue());
};
});
</script>
</body>
</html>