-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
76 lines (75 loc) · 1.61 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
<html>
<head>
<style>
body {
font-family: sans-serif;
font-size: 14px;
margin: 0;
}
form {
max-width: 800px;
margin: 50px auto;
}
.item {
width: 100%;
padding: 10px;
box-sizing: border-box;
}
.item label {
display: block;
padding: 5px 0;
font-weight: bold;
color: royalblue;
}
.item input {
width: 100%;
border: 1px solid rgba(0,0,0,0.3);
margin: 5px 0;
padding: 10px;
box-sizing: border-box;
}
form button {
background: rgba(0,0,0,0.9);
color: white;
padding: 5px 10px;
border-radius: 4px;
border: none;
}
</style>
</head>
<body>
<form>
<div class='item'>
<label>Project Name (A folder will be created with the name)</label>
<input type="text" placeholder='Project name' id='name' />
</div>
<div class='item'>
<label>Icon URL (Leave empty to use the default icon)</label>
<input type="text" placeholder='Icon URL' id='icon' />
</div>
<div class='item'>
<label>Git URL (Leave empty to start an empty project)</label>
<input type="text" placeholder='Git URL' id='git' />
</div>
<div class='item'>
<button>Submit</button>
</div>
</form>
<script>
document.querySelector("form").addEventListener("submit", async (e) => {
e.preventDefault()
e.stopPropagation()
let name = document.querySelector("#name").value
if (/\s/.test(name)) {
alert("The name must not contain spaces")
return
}
let params = new URLSearchParams()
params.set("name", document.querySelector("#name").value)
params.set("git", document.querySelector("#git").value)
params.set("icon", document.querySelector("#icon").value)
location.href = "start.js?" + params.toString()
})
</script>
</body>
</html>