-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
125 lines (116 loc) · 1.88 KB
/
main.js
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
define`
<page-header>
<style>
header {
display: grid;
grid-template-columns: auto;
grid-template-rows: auto;
grid-template-areas:
"title graphic"
"description graphic"
"resource graphic";
width: 85%;
margin: auto;
margin-bottom: 1em;
margin-top: 1em;
}
#graphic {
grid-area: graphic;
padding-left: 2em;
}
#title {
grid-area: title;
font-size: 3em;
margin-top: 0;
margin-bottom: 0;
}
#description {
grid-area: description;
}
#resource {
grid-area: resource;
}
@media (max-width: 750px) {
header {
text-align: center;
grid-template-areas:
"graphic"
"title"
"description"
"resource";
}
#graphic {
padding-left: 0;
}
#title {
font-size: 2.5em;
margin-top: 0.5em;
}
}
</style>
<header>
<a id="graphic" href=${'href'} target="_blank">
<img src=${'graphic'} width="258" />
</a>
<h1 id="title">${'page-title'}</h1>
<p id="description">${'description'}</p>
<section id="resource">
<slot>
</section
</header>
</page-header>
`;
define`
<app-grid>
<style>
section {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr;
}
@media (max-width: 750px) {
section {
grid-template-columns: 1fr;
}
}
</style>
<section>
<slot>
</section>
</app-grid>
`;
define`
<app-block>
<style>
:host {
border-radius: 2em;
margin: 1em;
padding: 1em;
box-shadow:
0 0 0 4px #CCC,
0 0 0 8px #888;
}
h2 {
margin: 0;
}
</style>
<section>
<h2>${'app-title'}</h2>
<p>${'description'}</p>
<slot>
</section>
</app-block>
`;
define`
<app-link>
<style>
a {
display: block;
}
a:hover {
background: aliceblue;
}
</style>
<a href=${'href'} target="_blank"><slot></a>
</app-link>
`;