-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.html
More file actions
28 lines (28 loc) · 752 Bytes
/
Main.html
File metadata and controls
28 lines (28 loc) · 752 Bytes
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
<h1>Main Page</h1>
<style>
.button {
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.button1 {background-color: #4CAF50;}
</style>
<button onclick="random()" id = "random" class="button button1">
New File
</button>
<script>
function random(){
var key = '';
const allowed ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (let i = 0; i < Math.floor(Math.random() * 10); i++) {
key = key+allowed.charAt(Math.floor(Math.random() * allowed.length));
}
window.location = "/edit/"+key;
}
</script>