-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
234 lines (224 loc) · 8.52 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<title>🤘 metalshop</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Oxanium&display=swap"/>
<link rel="stylesheet" href="./style.css"/>
<!-- autostart metalshop demo -->
<script type="importmap-shim" src="./dist/importmap.json"></script>
<script type="importmap-shim">{"imports": {"metalshop/": "./"}}</script>
<script async defer type="module-shim">
import {parseQuery} from "./dist/metalfront/toolbox/parse-query.js"
const {mock, env} = parseQuery()
const configElement = document.querySelector("metal-config")
function config(key, value) {
configElement.setAttribute(key, value)
}
// node microservice context
if (/^https?:\/\/metalnode\.chasemoskal\.com:8\d{3}$/i.test(location.origin)) {
config("auth-server", "http://metalnode.chasemoskal.com:8000")
config("liveshow-server", "http://metalnode.chasemoskal.com:8001")
config("paywall-server", "http://metalnode.chasemoskal.com:8002")
config("questions-server", "http://metalnode.chasemoskal.com:8003")
config("schedule-server", "http://metalnode.chasemoskal.com:8004")
config("settings-server", "http://metalnode.chasemoskal.com:8005")
}
// minikube dev context
else if (/^https?:\/\/metalshop\.chasemoskal\.com$/i.test(location.origin)) {
config("auth-server", "http://auth.metalshop.chasemoskal.com")
config("liveshow-server", "http://liveshow.metalshop.chasemoskal.com")
config("paywall-server", "http://paywall.metalshop.chasemoskal.com")
config("questions-server", "http://questions.metalshop.chasemoskal.com")
config("schedule-server", "http://schedule.metalshop.chasemoskal.com")
config("settings-server", "http://settings.metalshop.chasemoskal.com")
}
// deployed to stage context
else if (/^https?:\/\/stage\.metalshop\.dev$/i.test(location.origin)) {
config("auth-server", "https://auth.stage.metalshop.dev")
config("liveshow-server", "https://liveshow.stage.metalshop.dev")
config("paywall-server", "https://paywall.stage.metalshop.dev")
config("questions-server", "https://questions.stage.metalshop.dev")
config("schedule-server", "https://schedule.stage.metalshop.dev")
config("settings-server", "https://settings.stage.metalshop.dev")
}
const entry = mock === undefined ? "autostart.js" : "demo-autostart.js"
importShim(`./dist/metalfront/${entry}`)
</script>
<script async defer src="https://unpkg.com/es-module-shims@0.6.0/dist/es-module-shims.js"></script>
<metal-config
auth-server="https://auth.metalshop.dev"
liveshow-server="https://liveshow.metalshop.dev"
paywall-server="https://paywall.metalshop.dev"
questions-server="https://questions.metalshop.dev"
schedule-server="https://schedule.metalshop.dev"
settings-server="https://settings.metalshop.dev"
></metal-config>
</head>
<body>
<header>
<h1>🤘 metalshop</h1>
<!-- menu system comes from the "menutown" library -->
<menu-system sticky initially-hidden>
<menu-display data-label="account">
<!-- metalshop ui components -->
<metal-my-avatar slot="button" title="Your Account"></metal-my-avatar>
<metal-account initially-hidden>
<h2 slot="top">Your account</h2>
<metal-personal></metal-personal>
<metal-paywall></metal-paywall>
</metal-account>
</menu-display>
</menu-system>
</header>
<main class="content">
<section class="twoside">
<section>
<h2>welcome to the proving grounds</h2>
<p>see the <strong><a href="https://github.com/chase-moskal/metalshop#readme">metalshop readme</a></strong> on github</p>
<p>this is a testing playground used during development</p>
<p>some of the component tests below will give you an idea of metalshop's capabilities</p>
<p>this page operates in a local testing mock mode. this demo is operating without connecting to any microservices. instead, all of the system's business logic is running locally in your browser, using mocked database connections</p>
<p>the database state is persisted in localstorage. you can clear it with the reset button below</p>
</section>
<section>
<h2>select backend environment</h2>
<ul>
<li><a href="/">/</a> ← production kubernetes cluster</li>
<li><a href="/?env=dev">/?env=dev</a> ← local minikube cluster</li>
<li><a href="/?env=node">/?env=node</a> ← local node microservices</li>
<li><a href="/?env=stage">/?env=stage</a> ← staging kubernetes cluster</li>
</ul>
<h3>or mix-and-match mock mode</h3>
<ul>
<li><a href="/?mock">/?mock</a> ← mock mode</li>
<li><a href="/?mock=loggedin">/?mock=loggedin</a> ← start logged in</li>
<li><a href="/?mock=loggedin+open">/?mock=loggedin+open</a> ← with menu open</li>
<li><a href="/?mock=loggedin+banned">/?mock=loggedin+banned</a> ← be banned</li>
<li><a href="/?mock=loggedin+staff">/?mock=loggedin+staff</a> ← be staff member</li>
<li><a href="/?mock=loggedin+admin">/?mock=loggedin+admin</a> ← be an administrator</li>
<li><a href="/?mock=loggedin+premium">/?mock=loggedin+premium</a> ← be a premium user</li>
<li><a href="/?mock=loggedin+premium+admin">/?mock=loggedin+premium+admin</a> ← god mode</li>
</ul>
</section>
</section>
<iron-reset></iron-reset>
<section class="component-demos">
<h2>
component demos
<!-- <small>
<metal-admin-mode initially-hidden>Admin mode</metal-admin-mode>
</small> -->
</h2>
<details open>
<summary><metal-app-list></summary>
<div>
<metal-app-list></metal-app-list>
</div>
</details>
<details>
<summary><metal-questions></summary>
<div>
<metal-questions board="qa1" initially-hidden>
<h2 slot="post">Post your question!</h2>
<h2 slot="rate">Rate other submitted questions</h2>
</metal-questions>
</div>
</details>
<details>
<summary><metal-is-*> components</summary>
<div>
<p><strong><metal-is-loggedin></strong></p>
<metal-is-loggedin initially-hidden>
<p>you are logged in</p>
<p slot="not">you are logged out</p>
</metal-is-loggedin>
<br/>
<p><strong><metal-is-premium></strong></p>
<metal-is-premium initially-hidden>
<p>you are premium</p>
<p slot="not">you are NOT premium</p>
</metal-is-premium>
<br/>
<p><strong><metal-is-staff></strong></p>
<metal-is-staff fancy initially-hidden>
<p>you are staff</p>
<p slot="not">you are NOT staff</p>
</metal-is-staff>
</div>
</details>
<details>
<summary><demo-cobalt></summary>
<div>
<demo-cobalt></demo-cobalt>
</div>
</details>
<details>
<summary><iron-text-input></summary>
<div>
<iron-text-input value="Che">
Nickname
</iron-text-input>
<br/>
<br/>
<iron-text-input readonly value="Che">
Nickname
</iron-text-input>
</div>
</details>
<details>
<summary><metal-button-*></summary>
<div>
<metal-button-auth></metal-button-auth>
<br/>
<metal-button-premium></metal-button-premium>
</div>
</details>
<details>
<summary><iron-loading></summary>
<div>
<demo-iron-loading></demo-iron-loading>
</div>
</details>
<details>
<summary><metal-countdown></summary>
<div>
<metal-countdown event-label="countdown1" initially-hidden>
<h2>Countdown to next stream</h2>
</metal-countdown>
</div>
</details>
<details>
<summary><metal-liveshow></summary>
<div>
<metal-liveshow video-label="livestream" initially-hidden>
<h2>Welcome to the private livestream!</h2>
<p>You are logged in as a premium supporter</p>
</metal-liveshow>
</div>
</details>
<details>
<summary><metal-account></summary>
<div>
<metal-account initially-hidden>
<h2 slot="top">Your account</h2>
<metal-profile></metal-profile>
<metal-settings></metal-settings>
<metal-paywall></metal-paywall>
</metal-account>
</div>
</details>
<details>
<summary><metal-account> disassembled</summary>
<div>
<br/><h3>personal:</h3>
<metal-personal></metal-personal>
<br/><h3>paywall:</h3>
<metal-paywall></metal-paywall>
</div>
</details>
</section>
</main>
</body>
</html>