-
Notifications
You must be signed in to change notification settings - Fork 0
/
quote.jsx
57 lines (51 loc) · 1.23 KB
/
quote.jsx
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
import {css} from "uebersicht";
// styles
const quote = css({
fontSize: "24px",
});
const author = css({
fontSize: "18px",
fontStyle: "italic",
});
export const className = {
position: "fixed",
top: "auto",
bottom: "20%",
left: "20%",
right: "auto",
width: "60%",
textAlign: "center",
lineHeight: 1.5,
fontFamily: "YuKyokasyo, Helvetica Neue",
fontWeight: "medium",
fontSmoothing: "antialiased",
color: "#ffffff",
textShadow: "2px 2px 2px rgba(64, 64, 64, 0.8)",
};
// refresh frequency
export const refreshFrequency = 86400000; // 1 day
// command
// invoked every `refreshFrequency` milliseconds.
// the return value is passed to the `updateState` function.
export const command = "curl -s https://zenquotes.io/api/today";
// initialState
// SKIP
// updateState
// SKIP
// render
export const render = ({output}) => {
if (typeof output === "undefined") {
return (<div></div>);
}
var quotes = JSON.parse(output || "null");
if (quotes == null) {
return (<div></div>);
}
return (
<div>
<span className={quote}>"{quotes[0].q}"</span>
<br/>
<span className={author}>{quotes[0].a}</span>
</div>
);
};