-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
198 lines (195 loc) · 7.12 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<head>
<title>Project Igneous</title>
<link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Slab|Sulphur+Point&display=swap" rel="stylesheet">
<style>
#header {
position:fixed;
width: 100vw;
min-height: 4.5em;
max-height: 4.5em;
background: rgb(221,85,0);
background: linear-gradient(207deg, rgba(221,85,0,1) 0%, rgba(255,100,38,1) 100%);
text-align: center;
font-size: 175%;
font-family: "Roboto Slab",serif;
color: #fff;
line-height: 0.25;
text-decoration: none;
box-shadow: 0px 10px 18px #111;
position: absolute;
top:0;
}
#header > h2 {
font-size: 75%;
}
body {
margin: 0;
background: #222;
overflow-x:hidden;
}
#container {
color: #fff;
max-width: 100vw;
width: 1000px;
min-height:10vh;
margin-left:auto;
margin-right:auto;
margin-top: 10em;
}
.card {
min-width:300px;
max-width:300px;
background: #eee;
border-radius: 3px;
color: #111;
margin: 15px;
display:inline-block;
transition: 0.25s transform, 0.25s box-shadow;
-webkit-box-shadow: 0px 0px 12px -5px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 12px -5px rgba(0,0,0,0.75);
box-shadow: 0px 0px 12px -5px rgba(0,0,0,0.75);
}
.card:hover {
cursor:pointer;
transform: scale(1.05);
-webkit-box-shadow: 0px 0px 15px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 15px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 15px 0px rgba(0,0,0,0.75);
}
.cardImg {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
width:300px;
height:150px;
background-image: url("./img/placeholder.png");
}
.cardContent {
padding: 8px;
}
.cardHeader {
margin-top: 3px;
margin-bottom:0px;
font-size: 150%;
font-family:"Sulphur Point",sans-serif;
font-weight: bolder;
}
.cardDescription {
margin-top: 3px;
margin-bottom:5px;
font-family:"Lato",sans-serif;
}
.cardAttribution {
font-family:"Lato",sans-serif;
}
#gamebox{
position:fixed;
width: 100vw;
height:100vh;
background-color: rgba(0,0,0,0.95);
z-index: 100;
top: 100vh;
transition: 1s all;
}
#game {
position: fixed;
width: 240px;
height: 160px;
left: 50vw;
top: 100vh;
transform: translate(-50%,00%);
transition: 1s all;
z-index: 200;
border:0;
}
</style>
</head>
<body>
<a href="https://github.com/projectigneous" id="header">
<h1>Project Igneous</h1>
<h2>by theLMGN</h2>
</a>
<div id="container">
<div class="card" onclick="location.reload('')">
<img src="img/placeholder.png" class="cardImg"></img>
<div class="cardContent">
<h3 class="cardHeader">Loading content</h3>
<p class="cardDescription">Please wait.</p>
<small class="cardAttribution">if you're stuck here something probably broke</small>
</div>
</div>
</div>
<div id="gamebox"></div>
<iframe id="game" scrolling="no"></iframe>
<script>
function tabopen(url,size) {
if (!size) { return open(url) }
document.querySelector("#game").src = url
document.querySelector("#game").style.top = "50vh"
document.querySelector("#game").style.transform = "translate(-50%,-50%)"
document.querySelector("#gamebox").style.top = "0px"
document.querySelector("#game").style.width = size[0] + "px"
document.querySelector("#game").style.height = size[1] + "px"
history.pushState({
id: url
}, 'Project Igneous', url);
}
function hideGame() {
setTimeout(function(){document.querySelector("#game").src = "about:blank"},1000)
document.querySelector("#game").style.top = "100vh"
document.querySelector("#game").style.transform = "translate(-50%,0%)"
document.querySelector("#gamebox").style.top = "100vh"
history.pushState({
id: 'homepage'
}, 'Project Igneous', '/');
}
document.querySelector("#gamebox").onclick =hideGame
function calculateDate(date) {
var d = new Date(new Date() - new Date(date))
console.log(d)
if (d.getFullYear() > 1970) {
return (d.getFullYear() - 1970) + " year" + d.getFullYear() > 1971 ? "s" : ""
}
if (d.getMonth() > 0) {
return (d.getMonth()) + " month" + (d.getMonth() > 1 ? "s" : "")
}
if (d.getDate() > 1) {
return (d.getDate() - 1) + " day" + (d.getDate() > 2 ? "s" : "")
}
if (d.getHours() > 0) {
return (d.getHours()) + " hour" + (d.getHours() > 1 ? "s" : "")
}
if (d.getMinutes() > 0) {
return (d.getMinutes()) + " minute" + (d.getMinutes() > 1 ? "s" : "")
}
return "a few seconds"
}
function buildCard(name,description,attribution,updated,size) {
return `<div class="card" onclick="tabopen('https://projectigneous.github.io/${name}',${JSON.stringify(size)})">
<img src="img/${name}.png" class="cardImg" onerror="this.src='img/placeholder.png'"></img>
<div class="cardContent">
<h3 class="cardHeader">${name}</h3>
<p class="cardDescription">${description}</p>
<small class="cardAttribution">${attribution} • Updated ${updated} ago</small>
</div>
</div>`
}
async function go() {
var ftch = await fetch("https://api.github.com/orgs/projectigneous/repos")
var j = await ftch.json()
console.log(j)
var h = ``
for (var repo of j) {
try {
var ftch = await fetch("https://projectigneous.github.io/" + repo.name + "/igneous.json")
var j = await ftch.json()
console.log(j)
h += buildCard(repo.name,repo.description,j.developer, calculateDate(repo.pushed_at),j.opensInWindow)
document.querySelector("#container").innerHTML = h
} catch(e) {}
}
document.querySelector("#container").innerHTML = h
}
go()
</script>
<script src="/lol.js"></script>
</body>