-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.html
110 lines (76 loc) · 1.88 KB
/
demo.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
<script type="coffeedom">
# Note: needs to be served by webserver, as most browsers prevent the use of
# history.pushstate when using the file:// protocol
dom.BODY = ->
loc = fetch 'location'
homepage = loc.url == '/' || loc.url == ''
DIV
style:
padding: 50
fontSize: 18
if !homepage
DIV
style:
position: 'absolute'
top: 20
left: 20
cursor: 'pointer'
textDecoration: 'underline'
onClick: ->
Earl.load_page '/',
came_from_skill_section: true
'back home'
if homepage
HOMEPAGE()
else
RESUME()
dom.HOMEPAGE = ->
DIV null,
DIV
style:
fontSize: 50
'Hello, I\'m Earl!'
DIV null,
'Click me to see what I can do'
A
href: '/what_i_do'
EARL_HEADSHOT()
dom.RESUME = ->
links = [
A
href: "/"
target: '_blank'
"I can open internal links in a new tab"
A
href: 'https://invisible.college'
'I let external link open freely'
A
href: 'https://invisible.college'
target: '_blank'
"...including external links that open a new tab"
]
DIV null,
for l in links
DIV
style:
padding: 50
EARL_HEADSHOT
style:
width: 150
display: 'inline-block'
marginRight: 40
l
DIV
onClick: -> location.reload()
SPAN
style:
textDecoration: 'underline'
cursor: 'pointer'
'Reload the page'
' and see that we return right back here'
dom.EARL_HEADSHOT = ->
IMG
src: 'https://f.consider.it/earl.jpg'
style: @props.style or {}
#</script><script src="https://stateb.us/client5.js"></script>
<script src="https://rawgit.com/invisible-college/Earl/master/earl.js" history_aware_links></script>