Skip to content

Commit 278c618

Browse files
committed
help button for extended login box; 'dark-skin', 'light-skin' auto-assign;
1 parent 610937e commit 278c618

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

www/css/sepiaFW-style.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,11 @@ body {
481481
text-align: center;
482482
z-index: 10;
483483
}
484+
@media (max-height: 530px) {
485+
#sepiaFW-login-box {
486+
top: 4%;
487+
}
488+
}
484489
#sepiaFW-login-box h2 {
485490
font-weight: normal;
486491
}
@@ -539,6 +544,28 @@ body {
539544
color: inherit !important;
540545
margin: 4px 0 0 0 !important;
541546
}
547+
#sepiaFW-login-help-btn {
548+
position: absolute;
549+
bottom: -50px;
550+
right: calc(50% - 24px);
551+
height: auto;
552+
width: auto !important;
553+
background: transparent !important;
554+
display: none;
555+
}
556+
html.light-skin #sepiaFW-login-help-btn {
557+
color: #111 !important;
558+
}
559+
html.dark-skin #sepiaFW-login-help-btn {
560+
color: #eee !important;
561+
}
562+
/*@media (max-height: 480px) {
563+
#sepiaFW-login-help-btn {
564+
position: fixed;
565+
bottom: 0;
566+
right: 0;
567+
}
568+
}*/
542569

543570
#sepiaFW-main-window input, #sepiaFW-main-window button, #sepiaFW-main-window article {
544571
border-radius: 3px;

www/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ <h2><!--Welcome--><script>SepiaFW.local.w('welcome')</script></h2>
103103
</div>
104104
<!-- extend button -->
105105
<div id="sepiaFW-login-extend-box"><button id="sepiaFW-login-extend-btn"><i class="material-icons md-btn2">arrow_drop_down</i></button></div>
106+
<!-- help button -->
107+
<button id="sepiaFW-login-help-btn" onclick="SepiaFW.ui.actions.openUrlAutoTarget('https://github.com/SEPIA-Framework/sepia-docs#welcome-to-the-documentation-page-for-sepia');"><i class="material-icons md-mnu">help</i></button></div>
106108
</div>
107109
<!-- Main -->
108110
<div id="sepiaFW-main-window" class="sepiaFW-translucent-10 sepiaFW-skin-mod">

www/scripts/sepiaFW.account.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,10 @@ function sepiaFW_build_account(){
603603
$('#sepiaFW-login-box').find('.extended-controls').each(function(){
604604
if (isVisible){
605605
$(this).fadeOut(150);
606+
$('#sepiaFW-login-help-btn').fadeOut(150);
606607
}else{
607608
$(this).fadeIn(300);
609+
$('#sepiaFW-login-help-btn').fadeIn(300);
608610
}
609611
});
610612
if (isVisible){

www/scripts/sepiaFW.ui.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ function sepiaFW_build_ui(){
124124
UI.loadingColor = '#b4b4b4';
125125
UI.assistantColor = '';
126126
UI.micBackgroundColor = '#fff'; //reassigned during UI setup
127+
UI.htmlBackgroundColor = window.getComputedStyle(document.documentElement).getPropertyValue("background-color") || "#fff";
127128

128129
UI.isMenuOpen = false;
129130
UI.lastInput = "";
@@ -144,9 +145,21 @@ function sepiaFW_build_ui(){
144145
UI.awaitDialogColor = adC? window.getComputedStyle(adC, null).getPropertyValue("background-color"): 'gold';
145146
UI.assistantColor = asC? window.getComputedStyle(asC, null).getPropertyValue("background-color"): UI.primaryColor;
146147
UI.loadingColor = lC? window.getComputedStyle(lC, null).getPropertyValue("background-color"): 'rgba(180, 180, 180, 1.0)';
148+
UI.htmlBackgroundColor = window.getComputedStyle(document.documentElement).getPropertyValue("background-color") || "#fff";
147149
//UI.assistantColor = $('#sepiaFW-chat-output').find('article.chatAssistant').first().css("background-color");
148150
//refresh theme-color
149151
$('meta[name="theme-color"]').replaceWith('<meta name="theme-color" content="' + UI.primaryColor + '">');
152+
//set general skin style
153+
var backColor = UI.htmlBackgroundColor;
154+
if ((backColor + '').indexOf('rgb') === 0){
155+
var rgbBack = SepiaFW.tools.convertRgbColorStringToRgbArray(backColor);
156+
backColor = SepiaFW.tools.rgbToHex(rgbBack[0], rgbBack[1], rgbBack[2]);
157+
}
158+
if (SepiaFW.tools.getBestContrast(backColor) === 'white'){
159+
$(document.documentElement).removeClass('light-skin').addClass("dark-skin");
160+
}else{
161+
$(document.documentElement).removeClass('dark-skin').addClass("light-skin");
162+
}
150163
//update statusbar
151164
if ('StatusBar' in window){
152165
var colorString = UI.primaryColor;

0 commit comments

Comments
 (0)