return '<div class="pure-u-1 pure-u-md-1-3"><label for="_ui_element_' + element.id + '">' + encode(element.label) + '</label>'
+ '<input data-ui_class="password" type="password" id="_ui_element_' + element.id + '" value="' + encode(value)
+ '" class="pure-u-1" style="display:inline-block" maxlength="99" oninput="sendUpdate(\'' + element.id + '\')" />'
- + '<div class="hint" onclick="ShowPwd(\'' + element.id + '\')">👁</div></div>'
+ + '<div class="hint" onclick="ShowPwd(\'' + element.id + '\')"></div></div>'
case 'input':
var pattern = ""
if (element.pattern) {
return '<div class="pure-u-1 pure-u-md-1-3"><label for="_ui_element_' + element.id + '">' + encode(element.label) + '</label>'
+ '<input data-ui_class="input" type="text" id="_ui_element_' + element.id + '" value="' + encode(value) +'"'+ pattern
+ ' class="pure-u-1" style="display:inline-block" maxlength="99" oninput="sendUpdate(\'' + element.id + '\')" />'
- + '<div class="hint" onclick="OpenSelect(\'' + element.id+ '\'); getWiFi(\'' + element.id + '\')">📶</div>'
+ + '<div class="hint" onclick="OpenSelect(\'' + element.id+ '\'); getWiFi(\'' + element.id + '\')"></div>'
+ '<div class="modal" id="_ui_elemmodal_' + element.id + '" hidden>'
+ '<div class="modal-content">'
+ '<div id="_ui_elemselect_' + element.id + '"></div>'
for (const page of pages) {
list = list + '<li id="_ui_pglink_' + page.id
+ '" class="pure-menu-item"><a class="pure-menu-link" onclick="DrawPage(\''+ page.id +'\')" href="#' + page.id + '">'
+ + (page.icon?'<span class="icon">'+page.icon+'</span>':'')
+ page.title+'</a></li>'
}
menu.innerHTML = list
function DrawContacts(contacts) {
if (!contacts) return;
var contact_list = '<hr><h4 class="pure-u1">Контакты</h4>'
- for (const contact of contacts) {
+ for (contact of contacts) {
const url = new URL(contact)
var ref
- console.log(url)
switch (url.protocol) {
case 'http':
case 'https:':
- ref = '⌂ '+url.hostname
+ ref = '<span class="icon"></span>'+url.hostname
break
case 'mailto:':
- ref = '✉ '+url.pathname
+ ref = '<span class="icon"></span>'+url.pathname
+ break
+ case 'tg:':
+ ref = '<span class="icon"></span>'+url.pathname
+ contact = 'tg://resolve?domain='+url.pathname
break
default:
- ref = '🖅 '+url.pathname
+ ref = '<span class="icon"></span>'+url.pathname
}
contact_list += '<a href="'+contact+'">'+ref+'</a>'
}
+/* pure-min */
+
.pure-button:focus,
a:active,
a:hover {
.pure-button-selected,
a.pure-button-primary,
a.pure-button-selected {
- background-color:#0078e7;
+ background-color :#0078e7;
color:#fff
}
.pure-button-group .pure-button {
:root {
--slide:250px
}
+
+/* custom styles */
+
body {
color:#aaa;
- background:#292929
+ background:#242424;
}
+
.pure-img-responsive {
max-width:100%;
height:auto
}
+
#layout,
#menu,
.menu-link {
text-align:center
}
.header h1 {
- color:#2497e3;
+ color:dodgerblue;
margin:.4em 0;
- font-size:2em;
- font-weight:300;
- font-family:fantasy
+ font-size:2.4em;
+ font-weight: bold;
+ font-variant-caps: small-caps
}
.header h2 {
font-weight:300;
left:0;
bottom:0;
z-index:1000;
- background:#191818;
+ background:#181818;
overflow-y:auto;
-webkit-overflow-scrolling:touch
}
}
#menu .pure-menu-selected,
#menu .pure-menu-heading {
- background:#1f8dd6
+ background:dodgerblue
}
#menu .pure-menu-selected a {
color:#fff
.menu-link span,
.menu-link span:before,
.menu-link span:after {
- background-color:#2497e3;
+ background-color:dodgerblue;
width:100%;
height:.2em
}
cursor:pointer;
animate:0.2s;
box-shadow:0 0 0px #000000;
- background:#2497E3;
+ background:dodgerblue;
border-radius:3px;
border:0 solid #000000
}
margin-top:-8.5px
}
input[type=range]:focus::-webkit-slider-runnable-track {
- background:#2497E3
+ background:dodgerblue
}
input[type=range]::-moz-range-track {
width:100%;
cursor:pointer;
animate:0.2s;
box-shadow:0 0 0px #000000;
- background:#2497E3;
+ background:dodgerblue;
border-radius:3px;
border:0 solid #000000
}
input[type=range]::-moz-range-thumb {
box-shadow:0 0 0px #000000;
- border:1px solid #2497E3;
+ border:1px solid dodgerblue;
height:20px;
width:20px;
border-radius:30px;
- background:#A1D0FF;
+ background:lightskyblue;
cursor:pointer
}
input[type=range]::-ms-track {
color:transparent
}
input[type=range]::-ms-fill-lower {
- background:#2497E3;
+ background:dodgerblue;
border:0 solid #000000;
border-radius:6px;
box-shadow:0 0 0px #000000
}
input[type=range]::-ms-fill-upper {
- background:#2497E3;
+ background:dodgerblue;
border:0 solid #000000;
border-radius:6px;
box-shadow:0 0 0px #000000
input[type=range]::-ms-thumb {
margin-top:1px;
box-shadow:0 0 0px #000000;
- border:1px solid #2497E3;
+ border:1px solid dodgerblue;
height:20px;
width:20px;
border-radius:40px;
- background:#A1D0FF;
+ background:lightskyblue;
cursor:pointer
}
input[type=range]:focus::-ms-fill-lower {
- background:#2497E3
+ background:dodgerblue
}
input[type=range]:focus::-ms-fill-upper {
- background:#2497E3
+ background:dodgerblue
}
.hide {
display:none
}
+
+/* footer */
+
footer {
text-align:center;
position: absolute;
display: inline-block;
text-decoration: none
}
+
+/* notification button/message */
+
.notification {
float: right;
}
+
+/* modal dialog */
+
.modal {
position: fixed; /* Stay in place */
z-index: 2000; /* Sit on top */
text-transform:uppercase;
color:#aaa;
font-size:90%;
- border:2px solid #2497e3;
+ border:2px solid dodgerblue;
border-radius:6px;
- box-shadow:inset 0 1px 11px 0 #1f8dd6
+ box-shadow:inset 0 1px 11px 0 steelblue
padding: 1rem;
width: max-content;
min-width: 30%;
text-align: center;
border-bottom: lightgray solid 1px;
}
+
+/* overlapping hint button */
+
.hint {
cursor: pointer;
width: 1rem;
border: none;
box-shadow: none;
display: inline-block;
- vertical-align: super;
+ vertical-align: text-bottom;
margin-left: -2rem;
z-index:1;
}
+
+/* checkbox as a switch */
+
input[type=checkbox].switch {
display: none;
}
border-radius: 5em;
position: absolute;
left: 0;
- border:2px solid #2497e3;
- box-shadow:inset 0 1px 11px 0 #1f8dd6
+ border:2px solid dodgerblue;
+ box-shadow:inset 0 1px 11px 0 steelblue
}
label.switch span.switch.slider:after {
content: "";
width: 1.5rem;
height: 1.5rem;
- background: #2497e3;
+ background: dodgerblue;
border-radius: 5.5ex;
position: absolute;
left: 0.4rem;
}
label.switch.socket input[type=checkbox]:checked + span.slider:before {
color: White;
- background: #0a3660;
+ background: darkslategray;
content: "";
background: D;
}
background: white;
left: 2.4em;
}
+
+/* weekdays */
+
.week {
width: 100%;
}
.weekday, .weekday-selected {
- font-size: min(4vw, 1.5rem);
+ font-size: min(4vw, 100%rem);
text-align: center;
margin: 0.5vw;
padding: 0.4em;
border-radius: 5em;
- border:2px solid #2497e3;
- box-shadow:inset 0 1px 11px 0 #1f8dd6;
+ border:2px solid dodgerblue;
+ box-shadow:inset 0 1px 11px 0 steelblue;
color: gray
}
.weekday-selected {
- background: #0a3660;
+ background: darkslategray;
color: white
}
+
+input[type=number] {
+ appearance: textfield;
+}
+
+/* fill all screen */
+
#layout {
min-height: 100vh;
}
+
+/* fonts */
+
+@font-face {
+ font-family: "icons";
+ font-style: normal;
+ font-weight: 400;
+ src: url("/icons.woff2") format("woff2");
+}
+.hint, .icon {
+ font-family: icons;
+}
+.icon {
+ margin-right: 0.5em;
+}