-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathsetup.sh
executable file
·85 lines (76 loc) · 1.73 KB
/
setup.sh
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
#!/bin/bash
if [ -d "sb-starter" ]; then
echo "Folder sb-starter already exists. Exiting."
exit 1
fi
mkdir sb-starter
cd sb-starter
curl -so sb.min.js https://unpkg.com/[email protected]/dist/sb.min.js
index_html=$(cat <<EOF
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Strawberry App</title>
<script src="sb.min.js"></script>
</head>
<style>
body {
background: hsla(43, 58%, 95%, 1);
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
</style>
<!-- Template Definitions -->
<template name="sb-block">
<div
style="
padding: 1rem;
background-color: hsla(43, 58%, 92%, 1);
border: 2px solid hsla(17, 48%, 16%, 1);
box-shadow: -4px 4px 0px rgba(0, 0, 0, 0.25);
"
>
<slot />
</div>
</template>
<template name="sb-h1">
<h1
style="
margin: 0;
font-family: sans-serif;
font-weight: bold;
width: fit-content;
color: hsla(6, 64%, 59%, 1);
"
>
<slot />
</h1>
</template>
<!-- Initialize Strawberry -->
<script>
const data = sb.init();
</script>
<!-- HTML Body -->
<body>
<!-- Use defined components -->
<sb-block>
<sb-h1 sb-mark="message">Hello, World!</sb-h1>
</sb-block>
<!-- Update Component -->
<script>
data.message = 'Hello, Strawberry! 🍓';
</script>
</body>
</html>
EOF
)
echo "$index_html" > index.html
cd ..
echo "sb-starter setup completed
open sb-starter/index.html and start coding :)"