Skip to content

Commit df3c80f

Browse files
committed
Couple of Fixes
1 parent 3019bca commit df3c80f

File tree

3 files changed

+69
-11
lines changed

3 files changed

+69
-11
lines changed

example/status.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import "dart:html";
2+
import "dart:convert";
3+
4+
main() async {
5+
await sync();
6+
}
7+
8+
sync() async {
9+
{
10+
var request = await HttpRequest.request("https://status.github.com/api/status.json", requestHeaders: {
11+
"Origin": window.location.origin
12+
});
13+
14+
15+
16+
var text = request.responseText;
17+
var json = JSON.decode(text);
18+
19+
querySelector("#status")
20+
..appendText(json["status"])
21+
..classes.add("status-${json["status"]}");
22+
}
23+
24+
}

example/status.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<title>GitHub Status</title>
6+
7+
8+
<link rel="stylesheet/less" type="text/css" href="styles/main.less" />
9+
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/1.7.4/less.min.js"></script>
10+
</head>
11+
12+
<body>
13+
14+
<div id="status-container" class="center">
15+
<h1 id="status"></h1>
16+
</div>
17+
18+
<script type="application/dart" src="status.dart"></script>
19+
<script src="packages/browser/dart.js"></script>
20+
</body>
21+
22+
</html>

example/styles/main.less

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
.box {
5252
background: linear-gradient(180deg, rgb(229, 229, 229) 20%, rgb(209, 209, 209) 80%);
53-
box-shadow: 0px 2px 5px 0px rgba(50, 50, 50, 0.85);
53+
box-shadow: 0 2px 5px 0 rgba(50, 50, 50, 0.85);
5454
border-radius: 5px;
5555
word-wrap: break-word;
5656
margin: 5px;
@@ -84,9 +84,9 @@
8484
.center {
8585
display: block;
8686
text-align: center;
87-
margin-top:0px;
88-
margin-bottom:0px;
89-
padding:0px;
87+
margin-top: 0;
88+
margin-bottom: 0;
89+
padding: 0;
9090
}
9191

9292
.left {
@@ -127,7 +127,7 @@
127127
margin-left: 5px;
128128
width: 256px;
129129
}
130-
130+
131131
.emoji {
132132
margin-top: 5px;
133133
}
@@ -143,7 +143,7 @@
143143
border-radius: 3px;
144144
border: 1px solid @color;
145145
color: @color;
146-
font-family:"Helvetica Neue", Helvetica, sans-serif;
146+
font-family: "Helvetica Neue", Helvetica, sans-serif;
147147
-webkit-touch-callout: none;
148148
-webkit-user-select: none;
149149
-khtml-user-select: none;
@@ -188,11 +188,11 @@
188188
background: #fff none;
189189
border: 1px solid #ccc;
190190
border-radius: 4px;
191-
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
192-
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
193-
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
194-
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
195-
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
191+
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
192+
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
193+
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
194+
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
195+
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
196196
}
197197

198198
pre {
@@ -208,3 +208,15 @@ pre {
208208
border: 1px solid #cccccc;
209209
border-radius: 4px;
210210
}
211+
212+
.status-minor {
213+
color: yellow;
214+
}
215+
216+
.status-good {
217+
color: green;
218+
}
219+
220+
.status-major {
221+
color: red;
222+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy