-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
60 lines (58 loc) · 2.23 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
<!doctype html>
<meta charset=utf-8>
<style>
body{text-align:center;font-family:calibri;background:#beb;font-size:12px;}
table{width:900px;table-layout:fixed;border-collapse:collapse;margin:auto; background:#fff;}
th{background:#dfd;font-size:20px;}
div{margin:10px;border:1px solid;text-align:left;padding:10px;cursor:pointer;background:#fff;}
td{vertical-align:top;background:#efe;}
h3{font-size:16px;margin:0;}
p{margin:0;}
img{width:250px;margin:10px 0 0;}
pre{width:230px;background:#def;margin:10px 0 0;padding:10px;}
button{width:270px;margin:10px 0 0;}
</style>
<h1>Codegolf JS news</h1>
<table border>
<tr>
<th>Projects
<th>Challenges
<th>Tips & Tricks
<tr>
<td id=projects_td>
<td id=challenges_td>
<td id=tips_td>
</table>
<script src=projects.js></script>
<script src=challenges.js></script>
<script src=tips.js></script>
<script>
html = "<button onclick=window.location='https://github.com/codegolf/codegolf.github.io/edit/master/projects.js'>Add a project</button>";
for(i in projects){
html += "<div onclick=window.location='" + projects[i].url + "'>";
html += "<h3>" + projects[i].name + "</h3>";
html += "<i>" + projects[i].author + " - " + projects[i].date + " - " + projects[i].size + "</i>";
html += "<p>" + projects[i].description + "</p>";
html += "<img src=" + projects[i].screenshot + ">";
html += "</div>";
}
projects_td.innerHTML=html;
html = "<button onclick=window.location='https://github.com/codegolf/codegolf.github.io/edit/master/challenges.js'>Add a challenge</button>";
for(i in challenges){
html += "<div onclick=window.location='" + challenges[i].url + "'>";
html += "<h3>" + challenges[i].name + "</h3>";
html += "<i>" + challenges[i].author + " - " + challenges[i].date + "</i>";
html += "<p>" + challenges[i].description + "</p>";
html += "</div>";
}
challenges_td.innerHTML=html;
html = "<button onclick=window.location='https://github.com/codegolf/codegolf.github.io/edit/master/tips.js'>Add a tip</button>";
for(i in tips){
html += "<div>";
html += "<p><b>" + tips[i].description + "</b></p>";
html += "<i>" + tips[i].author + " - " + tips[i].date + "</i>";
html += "<pre>" + tips[i].source + "</pre>";
html += "</div>";
}
tips_td.innerHTML=html;
</script>