enigmatic 0.9.14 → 0.9.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +15 -0
- package/elements/alert-box/alert-box.js +19 -0
- package/elements/alert-box/index.html +6 -0
- package/elements/block-maker/block-maker.js +15 -0
- package/elements/block-maker/index.html +7 -0
- package/elements/chart-progress-bar/chart-progress-bar.js +9 -0
- package/elements/chart-progress-bar/index.html +5 -0
- package/elements/chart-radial-progress/chart-radial-progress.css +39 -0
- package/elements/chart-radial-progress/chart-radial-progress.js +13 -0
- package/elements/chart-radial-progress/index.html +13 -0
- package/elements/chart-statistic/chart-statistic.js +34 -0
- package/elements/chart-statistic/index.html +13 -0
- package/elements/data-grid/data-grid.js +39 -0
- package/elements/data-grid/index.html +13 -0
- package/elements/data-source/data-source.js +36 -0
- package/elements/data-source/index.html +10 -0
- package/elements/data-stream/data-stream.js +28 -0
- package/elements/data-stream/index.html +7 -0
- package/elements/font-awesome/font-awesome.js +11 -0
- package/elements/font-awesome/index.html +7 -0
- package/elements/for-list/for-list.js +25 -0
- package/elements/for-list/index.html +11 -0
- package/elements/hello-world/hello-world.js +16 -0
- package/elements/hello-world/index.html +3 -0
- package/elements/index.mjs +20 -0
- package/elements/map-embed/index.html +4 -0
- package/elements/map-embed/map-embed.js +9 -0
- package/elements/monaco-editor/index.html +11 -0
- package/elements/monaco-editor/monaco-editor.mjs +33 -0
- package/elements/online-indicator/index.html +15 -0
- package/elements/online-indicator/online-indicator.js +20 -0
- package/elements/side-menu/index.html +10 -0
- package/elements/side-menu/side-menu.js +16 -0
- package/elements/tailwind-css/index.html +11 -0
- package/elements/tailwind-css/tailwind-css.js +11 -0
- package/elements/test-runner/test-runner.js +59 -0
- package/elements/time-ago/index.html +11 -0
- package/elements/time-ago/time-ago.js +22 -0
- package/elements/toggle-switch/index.html +8 -0
- package/elements/toggle-switch/toggle-switch.js +86 -0
- package/elements/view-panel/index.html +18 -0
- package/elements/view-panel/view-panel.js +22 -0
- package/elements/you-tube/index.html +7 -0
- package/elements/you-tube/you-tube.js +9 -0
- package/{index.css → enigmatic.css} +97 -165
- package/{index.js → enigmatic.js} +4 -6
- package/package.json +3 -3
- package/readme.md +99 -0
- package/test.html +176 -0
- package/sw-nouse.js +0 -22
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
class TestRunner extends EnigmaticElement {
|
|
2
|
+
|
|
3
|
+
tests = {}
|
|
4
|
+
|
|
5
|
+
connectedCallback() {
|
|
6
|
+
window.testrunner = this
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
createTests(tests) {
|
|
10
|
+
this.tests = tests
|
|
11
|
+
this.innerHTML = `
|
|
12
|
+
<div style="display:grid; grid-template: 4fr 1fr / 4fr 1fr">
|
|
13
|
+
<e-e id='trdisplay'></e-e>
|
|
14
|
+
<div></div>
|
|
15
|
+
<div>
|
|
16
|
+
<span id='trstatus'>${this.count()} tests loaded</span>
|
|
17
|
+
<button style='margin-top: 5px; float: right' onclick='testrunner.run()'>Run</button>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
count() {
|
|
24
|
+
return Object.keys(this.tests).length
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async run() {
|
|
28
|
+
console.clear()
|
|
29
|
+
let pass = true, ret = [], time = +new Date(), func
|
|
30
|
+
for (const test in this.tests) {
|
|
31
|
+
let success, message
|
|
32
|
+
$('#trstatus').innerHTML = `<i>${test}</i>`
|
|
33
|
+
try {
|
|
34
|
+
func = this.tests[test]
|
|
35
|
+
const isAsyncTest = (func.constructor.name === 'AsyncFunction')
|
|
36
|
+
success = isAsyncTest ? await func() : func()
|
|
37
|
+
} catch (e) {
|
|
38
|
+
success = false
|
|
39
|
+
message = e
|
|
40
|
+
console.error(e)
|
|
41
|
+
}
|
|
42
|
+
if (!success) {
|
|
43
|
+
this.innerHTML = `Failed on test: ${test} ${message}`
|
|
44
|
+
pass = false
|
|
45
|
+
}
|
|
46
|
+
ret = [...ret, { test, func, success }]
|
|
47
|
+
}
|
|
48
|
+
const status = $('#trstatus'), count = this.count()
|
|
49
|
+
status.innerHTML = `${pass ? '<green>Passed</green>' : '<red>Failed</red>'}`
|
|
50
|
+
status.innerHTML += ` ${count} tests in ${+new Date() - time}ms`
|
|
51
|
+
console[!!console.table ? 'table' : 'log'](ret)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
set(s) {
|
|
55
|
+
$('#trstatus').innerHTML = s
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
customElements.define('test-runner', TestRunner)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
class TimeAgo extends EnigmaticElement {
|
|
3
|
+
set(v) {
|
|
4
|
+
const d = new Date(v)
|
|
5
|
+
const now = new Date()
|
|
6
|
+
const diff = (now - d) / 1000
|
|
7
|
+
const day_diff = Math.floor(diff / 86400)
|
|
8
|
+
this.textContent =
|
|
9
|
+
diff < 60 && 'just now' ||
|
|
10
|
+
diff < 120 && '1 minute ago' ||
|
|
11
|
+
diff < 3600 && Math.floor( diff / 60 ) + ' minutes ago' ||
|
|
12
|
+
diff < 7200 && '1 hour ago' ||
|
|
13
|
+
diff < 86400 && Math.floor( diff / 3600 ) + ' hours ago' ||
|
|
14
|
+
day_diff == 1 && 'Yesterday' ||
|
|
15
|
+
day_diff < 7 && day_diff + ' days ago' ||
|
|
16
|
+
day_diff < 31 && Math.ceil( day_diff / 7 ) + ' weeks ago' ||
|
|
17
|
+
day_diff < 365 && Math.ceil(day_diff / 30) + ' months ago' ||
|
|
18
|
+
Math.ceil(day_diff / 365) + ' years ago'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
customElements.define('time-ago', TimeAgo)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script src='https://unpkg.com/enigmatic'></script>
|
|
2
|
+
<script src='toggle-switch.js'></script>
|
|
3
|
+
|
|
4
|
+
<toggle-switch id='ts'></toggle-switch>
|
|
5
|
+
<button onclick='ts.toggle()'>Toggle</button>
|
|
6
|
+
<button onclick='ts.toggle(true)'>On</button>
|
|
7
|
+
<button onclick='ts.toggle(false)'>Off</button>
|
|
8
|
+
<button onclick='ts.set("")'>Set</button>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
|
|
2
|
+
class ToggleSwitch extends EnigmaticElement {
|
|
3
|
+
|
|
4
|
+
async connectedCallback() {
|
|
5
|
+
this.innerHTML = `
|
|
6
|
+
<style>
|
|
7
|
+
.switch {
|
|
8
|
+
position: relative;
|
|
9
|
+
display: inline-block;
|
|
10
|
+
width: 60px;
|
|
11
|
+
height: 34px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.switch input {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
width: 0;
|
|
17
|
+
height: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.slider {
|
|
21
|
+
position: absolute;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
top: 0;
|
|
24
|
+
left: 0;
|
|
25
|
+
right: 0;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
background-color: #ccc;
|
|
28
|
+
-webkit-transition: .4s;
|
|
29
|
+
transition: .4s;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.slider:before {
|
|
33
|
+
position: absolute;
|
|
34
|
+
content: "";
|
|
35
|
+
height: 26px;
|
|
36
|
+
width: 26px;
|
|
37
|
+
left: 4px;
|
|
38
|
+
bottom: 4px;
|
|
39
|
+
background-color: white;
|
|
40
|
+
-webkit-transition: .4s;
|
|
41
|
+
transition: .4s;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
input:checked + .slider {
|
|
45
|
+
background-color: #2196F3;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
input:focus + .slider {
|
|
49
|
+
box-shadow: 0 0 1px #2196F3;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
input:checked + .slider:before {
|
|
53
|
+
-webkit-transform: translateX(26px);
|
|
54
|
+
-ms-transform: translateX(26px);
|
|
55
|
+
transform: translateX(26px);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Rounded sliders */
|
|
59
|
+
.slider.round {
|
|
60
|
+
border-radius: 34px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.slider.round:before {
|
|
64
|
+
border-radius: 50%;
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
67
|
+
|
|
68
|
+
<label class="switch">
|
|
69
|
+
<input type="checkbox" checked>
|
|
70
|
+
<span class="slider round"></span>
|
|
71
|
+
</label>
|
|
72
|
+
`
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
toggle(onoff) {
|
|
76
|
+
if (onoff !== undefined)
|
|
77
|
+
return this.querySelector('input').checked = onoff
|
|
78
|
+
this.querySelector('input').checked = !this.querySelector('input').checked;
|
|
79
|
+
}
|
|
80
|
+
set(v) {
|
|
81
|
+
const tf = !!v
|
|
82
|
+
this.querySelector('input').checked = tf
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
customElements.define('toggle-switch', ToggleSwitch)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script src='//unpkg.com/enigmatic'></script>
|
|
2
|
+
<script src='view-panel.js'></script>
|
|
3
|
+
<link rel='stylesheet' href='//unpkg.com/enigmatic/index.css'>
|
|
4
|
+
|
|
5
|
+
<body>
|
|
6
|
+
<view-panel id='mypanel' agent='chromex'>
|
|
7
|
+
Hidden, not a valid agent
|
|
8
|
+
</view-panel>
|
|
9
|
+
|
|
10
|
+
<view-panel id='mypanel2'>
|
|
11
|
+
<div>One</div>
|
|
12
|
+
<div id='two'>Two</div>
|
|
13
|
+
<div>Three</div>
|
|
14
|
+
</view-panel>
|
|
15
|
+
<button onclick='mypanel2.hide()'>Hide</button>
|
|
16
|
+
<button onclick='mypanel2.show()'>Show</button>
|
|
17
|
+
<button onclick='mypanel2.showOnly("#two")'>Show only Two</button>
|
|
18
|
+
</body>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
class ViewPanel extends EnigmaticElement {
|
|
2
|
+
constructor() {
|
|
3
|
+
super()
|
|
4
|
+
}
|
|
5
|
+
connectedCallback() {
|
|
6
|
+
const browser = navigator.userAgent.toLowerCase()
|
|
7
|
+
const agent = this.attributes['agent']?.value
|
|
8
|
+
if (agent && !browser.match(agent))
|
|
9
|
+
this.remove()
|
|
10
|
+
}
|
|
11
|
+
showOnly(qs) {
|
|
12
|
+
for (const child of this.children) {
|
|
13
|
+
if (child instanceof EnigmaticElement) {
|
|
14
|
+
child[child.matches(qs) ? 'show' : 'hide']()
|
|
15
|
+
} else {
|
|
16
|
+
child.classList.add(child.matches(qs) ? 'show' : 'hide')
|
|
17
|
+
child.classList.remove(child.matches(qs) ? 'hide' : 'show')
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
customElements.define('view-panel', ViewPanel)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
class YouTube extends EnigmaticElement {
|
|
2
|
+
connectedCallback() {
|
|
3
|
+
this.uid = this.getAttribute('uid') || 'Fku7hi5kI-c'
|
|
4
|
+
this.innerHTML = `<iframe width="560" height="315" src="https://www.youtube.com/embed/${this.uid}"
|
|
5
|
+
title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write;
|
|
6
|
+
encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
customElements.define('you-tube', YouTube)
|
|
@@ -1,26 +1,40 @@
|
|
|
1
|
+
/* layout */
|
|
2
|
+
|
|
1
3
|
body {
|
|
4
|
+
display: grid;
|
|
2
5
|
font-family: Roboto, Helvetica, sans-serif;
|
|
3
6
|
margin: 0;
|
|
7
|
+
grid-template-columns: var(--cols, 1fr 4fr 1fr);
|
|
8
|
+
grid-template-rows: var(--rows, 1fr 9fr 1fr);
|
|
9
|
+
height: 100vh;
|
|
4
10
|
}
|
|
5
11
|
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
grid-template-columns: var(--cols);
|
|
9
|
-
grid-template-rows: var(--rows);
|
|
12
|
+
.span {
|
|
13
|
+
grid-column: span var(--span, 3);
|
|
10
14
|
}
|
|
11
15
|
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
height: 100vh;
|
|
16
|
+
.span-rows {
|
|
17
|
+
grid-row: span var(--span-rows, 3);
|
|
15
18
|
}
|
|
16
19
|
|
|
17
|
-
.
|
|
18
|
-
|
|
19
|
-
grid-template-rows: 1fr 7fr 1fr;
|
|
20
|
+
.flex {
|
|
21
|
+
display: flex;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
/** positioning **/
|
|
25
|
+
|
|
26
|
+
.center {
|
|
27
|
+
position: fixed;
|
|
28
|
+
top: 50%;
|
|
29
|
+
left: 50%;
|
|
30
|
+
margin-top: -50px;
|
|
31
|
+
margin-left: -100px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.center-h {
|
|
35
|
+
position: fixed;
|
|
36
|
+
left: 50%;
|
|
37
|
+
margin-left: -100px;
|
|
24
38
|
}
|
|
25
39
|
|
|
26
40
|
.right {
|
|
@@ -31,11 +45,29 @@ body {
|
|
|
31
45
|
float: left;
|
|
32
46
|
}
|
|
33
47
|
|
|
34
|
-
.
|
|
35
|
-
|
|
36
|
-
|
|
48
|
+
.fixed {
|
|
49
|
+
position: fixed;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.top {
|
|
53
|
+
top: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.bottom {
|
|
57
|
+
bottom: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.fill {
|
|
61
|
+
height: 100vh;
|
|
62
|
+
width: 100wh;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.roboto {
|
|
66
|
+
font-family: 'Roboto', sans-serif;
|
|
37
67
|
}
|
|
38
68
|
|
|
69
|
+
/** font **/
|
|
70
|
+
|
|
39
71
|
@font-face {
|
|
40
72
|
font-family: 'Roboto';
|
|
41
73
|
font-style: normal;
|
|
@@ -43,6 +75,8 @@ body {
|
|
|
43
75
|
src: local('Roboto Regular'), local('Roboto-Regular'), url(//themes.googleusercontent.com/static/fonts/roboto/v10/2UX7WLTfW3W8TclTUvlFyQ.woff) format('woff');
|
|
44
76
|
}
|
|
45
77
|
|
|
78
|
+
/** elements **/
|
|
79
|
+
|
|
46
80
|
.hide {
|
|
47
81
|
opacity: 0;
|
|
48
82
|
transition: opacity .25s linear;
|
|
@@ -53,10 +87,6 @@ body {
|
|
|
53
87
|
transition: opacity .25s linear;
|
|
54
88
|
}
|
|
55
89
|
|
|
56
|
-
.fixed {
|
|
57
|
-
position: fixed;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
90
|
.slide-in {
|
|
61
91
|
animation: slide-in 0.1s forwards;
|
|
62
92
|
-webkit-animation: slide-in 0.1s forwards;
|
|
@@ -100,23 +130,6 @@ body {
|
|
|
100
130
|
}
|
|
101
131
|
|
|
102
132
|
|
|
103
|
-
.top {
|
|
104
|
-
top: 0;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.bottom {
|
|
108
|
-
bottom: 0;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.fill {
|
|
112
|
-
height: 100vh;
|
|
113
|
-
width: 100wh;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.roboto {
|
|
117
|
-
font-family: 'Roboto', sans-serif;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
133
|
a {
|
|
121
134
|
text-decoration: none;
|
|
122
135
|
}
|
|
@@ -129,20 +142,12 @@ a {
|
|
|
129
142
|
cursor: default;
|
|
130
143
|
}
|
|
131
144
|
|
|
132
|
-
.bg-
|
|
133
|
-
background-color: #001f3f
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.bg-blue {
|
|
145
|
+
.bg-blue, .hover\:bg-blue:hover {
|
|
137
146
|
background-color: #0074d9
|
|
138
147
|
}
|
|
139
148
|
|
|
140
|
-
.bg-aqua {
|
|
141
|
-
background-color: #7fdbff
|
|
142
|
-
}
|
|
143
|
-
|
|
144
149
|
.bg-green {
|
|
145
|
-
background-color: #
|
|
150
|
+
background-color: #1a8d1e;
|
|
146
151
|
}
|
|
147
152
|
|
|
148
153
|
.bg-yellow {
|
|
@@ -169,20 +174,12 @@ a {
|
|
|
169
174
|
background-color: #111
|
|
170
175
|
}
|
|
171
176
|
|
|
172
|
-
.bg-ltgray {
|
|
173
|
-
background-color: #f7f4f4
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.navy {
|
|
177
|
-
color: #001f3f
|
|
178
|
-
}
|
|
179
|
-
|
|
180
177
|
.blue {
|
|
181
178
|
color: #0074d9
|
|
182
179
|
}
|
|
183
180
|
|
|
184
181
|
.green {
|
|
185
|
-
color: #
|
|
182
|
+
color: #1a8d1e;
|
|
186
183
|
}
|
|
187
184
|
|
|
188
185
|
.yellow {
|
|
@@ -197,22 +194,10 @@ a {
|
|
|
197
194
|
color: #ff4136
|
|
198
195
|
}
|
|
199
196
|
|
|
200
|
-
.purple {
|
|
201
|
-
color: #b10dc9
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.maroon {
|
|
205
|
-
color: #85144b
|
|
206
|
-
}
|
|
207
|
-
|
|
208
197
|
.white {
|
|
209
198
|
color: #fff;
|
|
210
199
|
}
|
|
211
200
|
|
|
212
|
-
.silver {
|
|
213
|
-
color: #ddd
|
|
214
|
-
}
|
|
215
|
-
|
|
216
201
|
.gray {
|
|
217
202
|
color: #aaa
|
|
218
203
|
}
|
|
@@ -221,93 +206,16 @@ a {
|
|
|
221
206
|
color: #111
|
|
222
207
|
}
|
|
223
208
|
|
|
224
|
-
.ltgray {
|
|
225
|
-
color: #fcfcfc
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.modal {
|
|
229
|
-
position: fixed;
|
|
230
|
-
top: 0;
|
|
231
|
-
left: 0;
|
|
232
|
-
width: 100%;
|
|
233
|
-
height: 100%;
|
|
234
|
-
background: #fcfcfc;
|
|
235
|
-
opacity: 0.8;
|
|
236
|
-
filter: alpha(opacity=80);
|
|
237
|
-
z-index: 1000;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
209
|
.margins {
|
|
241
|
-
margin: 15px
|
|
210
|
+
margin: var(--margins, 15px)
|
|
242
211
|
}
|
|
243
212
|
|
|
244
213
|
.padding {
|
|
245
|
-
padding: 15px
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
img {
|
|
249
|
-
max-width: 100%;
|
|
250
|
-
height: auto
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.ten {
|
|
254
|
-
font-size: 10px;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.twelve {
|
|
258
|
-
font-size: 12px;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.thirteen {
|
|
262
|
-
font-size: 13px;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.fourteen {
|
|
266
|
-
font-size: 14px;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.fifteen {
|
|
270
|
-
font-size: 15px;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.twenty {
|
|
274
|
-
font-size: 20px;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.thirty {
|
|
278
|
-
font-size: 30px;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.forty {
|
|
282
|
-
font-size: 40px;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.fifty {
|
|
286
|
-
font-size: 50px;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.sixty {
|
|
290
|
-
font-size: 60px;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.seventy {
|
|
294
|
-
font-size: 70px;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.eighty {
|
|
298
|
-
font-size: 80px;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.ninety {
|
|
302
|
-
font-size: 90px;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.hundred {
|
|
306
|
-
font-size: 100px;
|
|
214
|
+
padding: var(--padding, 15px)
|
|
307
215
|
}
|
|
308
216
|
|
|
309
|
-
.
|
|
310
|
-
|
|
217
|
+
.rem {
|
|
218
|
+
font-size: var(--rem, 2rem);
|
|
311
219
|
}
|
|
312
220
|
|
|
313
221
|
.faded {
|
|
@@ -336,16 +244,6 @@ img {
|
|
|
336
244
|
opacity: 1
|
|
337
245
|
}
|
|
338
246
|
|
|
339
|
-
.full-page {
|
|
340
|
-
min-height: 100%;
|
|
341
|
-
min-width: 1024px;
|
|
342
|
-
width: 100%;
|
|
343
|
-
height: auto;
|
|
344
|
-
position: fixed;
|
|
345
|
-
top: 0;
|
|
346
|
-
left: 0;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
247
|
.rounded {
|
|
350
248
|
-moz-border-radius: 10px;
|
|
351
249
|
-webkit-border-radius: 10px;
|
|
@@ -353,6 +251,34 @@ img {
|
|
|
353
251
|
-khtml-border-radius: 10px;
|
|
354
252
|
}
|
|
355
253
|
|
|
254
|
+
.round {
|
|
255
|
+
vertical-align: middle;
|
|
256
|
+
width: 50px;
|
|
257
|
+
height: 50px;
|
|
258
|
+
border-radius: 50%;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** html elements **/
|
|
262
|
+
|
|
263
|
+
button {
|
|
264
|
+
border-radius: 0.5rem;
|
|
265
|
+
background-color: #787978;
|
|
266
|
+
/* Green */
|
|
267
|
+
border: none;
|
|
268
|
+
color: white;
|
|
269
|
+
padding: 15px 32px;
|
|
270
|
+
text-align: center;
|
|
271
|
+
text-decoration: none;
|
|
272
|
+
display: inline-block;
|
|
273
|
+
opacity: .85;
|
|
274
|
+
transition: opacity .25s ease-in-out;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
button:hover {
|
|
278
|
+
opacity: 1;
|
|
279
|
+
transition: opacity .25s ease-in-out;
|
|
280
|
+
}
|
|
281
|
+
|
|
356
282
|
ul {
|
|
357
283
|
list-style-type: none;
|
|
358
284
|
border: 20px;
|
|
@@ -371,13 +297,19 @@ li:hover {
|
|
|
371
297
|
cursor: pointer;
|
|
372
298
|
}
|
|
373
299
|
|
|
374
|
-
|
|
375
|
-
|
|
300
|
+
/** Opacity **/
|
|
301
|
+
.opacity-100 {
|
|
302
|
+
opacity: 1;
|
|
376
303
|
}
|
|
377
304
|
|
|
378
|
-
.
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
305
|
+
.opacity-25 {
|
|
306
|
+
opacity: .25;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.opacity-50 {
|
|
310
|
+
opacity: .5;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.opacity-75 {
|
|
314
|
+
opacity: .75;
|
|
383
315
|
}
|
|
@@ -5,6 +5,8 @@ window.body = document.body
|
|
|
5
5
|
|
|
6
6
|
window.loadJS = src => {
|
|
7
7
|
return new Promise((r, j) => {
|
|
8
|
+
if ($(`script[src="${src}"]`))
|
|
9
|
+
return r(true)
|
|
8
10
|
const s = document.createElement('script')
|
|
9
11
|
s.src = src
|
|
10
12
|
s.addEventListener('load', r)
|
|
@@ -31,12 +33,7 @@ class Data {
|
|
|
31
33
|
for(const k of e.getAttribute('data').split('.')) {
|
|
32
34
|
v = v[k]
|
|
33
35
|
}
|
|
34
|
-
|
|
35
|
-
e.set(v)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
for (const e of $$(`[data=ALL]`)) {
|
|
39
|
-
e.set(this._)
|
|
36
|
+
e.set ? e.set(v) : e.textContent = v
|
|
40
37
|
}
|
|
41
38
|
const ret = {}
|
|
42
39
|
ret[name] = value
|
|
@@ -119,6 +116,7 @@ window.addEventListener('DOMContentLoaded', (event) => {
|
|
|
119
116
|
body.appendChild(child)
|
|
120
117
|
return child
|
|
121
118
|
}
|
|
119
|
+
if(main) main(document)
|
|
122
120
|
if(window.main) window.main(document)
|
|
123
121
|
})
|
|
124
122
|
|
package/package.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"name": "enigmatic",
|
|
3
3
|
"description": "Simple web controls",
|
|
4
4
|
"url": "http://github.com/digplan/enigmatic",
|
|
5
|
-
"author": "
|
|
6
|
-
"main": "
|
|
5
|
+
"author": "",
|
|
6
|
+
"main": "enigmatic.js",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git://github.com/digplan/enigmatic.git"
|
|
10
10
|
},
|
|
11
|
-
"version": "0.9.
|
|
11
|
+
"version": "0.9.15"
|
|
12
12
|
}
|