-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.html
81 lines (76 loc) · 1.84 KB
/
404.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
<html>
<head>
<title>Nuo-Router</title>
<script src="https://npmcdn.com/ejs/ejs.min.js"></script>
<style>
body{
padding: 50px;
text-align: center;
font-family: consolas;
background-color: #f0f0f2;
margin: 0;
padding: 0;
}
a{
margin-left: 15px;
}
/* ul {
list-style-type: none;
} */
a:focus {
background-color: yellow;
}
div {
width: 600px;
margin: 5em auto;
padding: 2em;
background-color: #fdfdff;
border-radius: 0.5em;
box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
@media (max-width: 700px) {
div {
margin: 0 auto;
width: auto;
}
}
</style>
</head>
<body>
<span id="root" >Hello world</span>
<br><br>
<a href="javascript:nuo.to('./html')">html</a>
<a href="javascript:nuo.to('./fetch')">.html</a>
<a href="javascript:nuo.to('./ejs')">.ejs</a>
<a href="javascript:err()"> 404</a>
<br><br>
<h2> nuo-router : front-end routing 404.html</h2>
<script src="./src/nuo-router.js"></script>
<script src="./src/router.js"></script>
<script>
function uniqueModulus(mod) {
let aiueo = "aiueo";
let bcdfg = "bcdfghjklmnpqrstvwxy";
let res = "";
if (mod % 2 != 0) {
res = aiueo[Math.floor(Math.random() * aiueo.length)];
} else {
res = bcdfg[Math.floor(Math.random() * bcdfg.length)];
}
return res;
}
var getRandomName = (t, e) => {
for (var r = "", n = t, o = 0; o < e; o++) {
r += uniqueModulus(o);
}
return r;
};
function err(){
let colors = ['blue','red','green','orange','purple']
let color = colors[Math.floor(Math.random() * 5)]
let randomName = getRandomName('',5)
nuo.to('./'+randomName, {color})
}
</script>
</body>
</html>