Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
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
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
export let tldrawStars = fetchJSON("https://api.github.com/repos/tldraw/tldraw")
.then(
(resp) =>
`
<style>
@keyframes pulse-animation {
0% {
transform: scale(1) rotate(0deg);
}
20% {
transform: scale(1.1) rotate(10deg);
}
40% {
transform: scale(1) rotate(-10deg);
}
60% {
transform: scale(0.8) rotate(6deg);
}
80% {
transform: scale(1.1) rotate(-5deg);
}
100% {
transform: scale(1.2) rotate(8deg);
}
}
</style>
<div
style="
background: orange;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
font-family: sans-serif;
font-weight: 700;
font-size: 80px;
text-align: center;
line-height: 0.6em;
"
>
<div>
<div style="font-size: 20px;">tldraw/tldraw</div>
<div
style="
animation: pulse-animation 1.2s infinite;
animation-direction: alternate;
"
>${resp.stargazers_count}</div>
<div style="font-size: 20px;">stars</div>
</div>
</div>`
);
October 23, 2023