diff --git a/app/contexts/settings.py b/app/contexts/settings.py index fa756167..4026af0d 100644 --- a/app/contexts/settings.py +++ b/app/contexts/settings.py @@ -31,36 +31,53 @@ def complementary(hexcolor): def scaleby(hexcolor, scalefactor): - """ - Scales a hex string by ``scalefactor``. Returns scaled hex string. + def calculate(hexcolor, scalefactor): + """ + Scales a hex string by ``scalefactor``. Returns scaled hex string. - To darken the color, use a float value between 0 and 1. - To brighten the color, use a float value greater than 1. + To darken the color, use a float value between 0 and 1. + To brighten the color, use a float value greater than 1. + + >>> colorscale("#DF3C3C", .5) + #6F1E1E + >>> colorscale("#52D24F", 1.6) + #83FF7E + >>> colorscale("#4F75D2", 1) + #4F75D2 + """ + + def clamp(val, minimum=0, maximum=255): + if val < minimum: + return minimum + if val > maximum: + return maximum + return int(val) + + hexcolor = hexcolor.strip('#') + + if scalefactor < 0 or len(hexcolor) != 6: + return hexcolor + + r, g, b = int(hexcolor[:2], 16), int(hexcolor[2:4], 16), int(hexcolor[4:], 16) + + r = clamp(r * scalefactor) + g = clamp(g * scalefactor) + b = clamp(b * scalefactor) + + return "#%02x%02x%02x" % (r, g, b) - >>> colorscale("#DF3C3C", .5) - #6F1E1E - >>> colorscale("#52D24F", 1.6) - #83FF7E - >>> colorscale("#4F75D2", 1) - #4F75D2 """ - def clamp(val, minimum=0, maximum=255): - if val < minimum: - return minimum - if val > maximum: - return maximum - return int(val) + Same as scaleby, but is color dependent. + scalefactor is now always between 0 and 1. A value of 0.8 + will cause bright colors to become darker and + dark colors to become brigther by 20% + """ hexcolor = hexcolor.strip('#') - scalefactor = float(scalefactor.value) - - if scalefactor < 0 or len(hexcolor) != 6: - return hexcolor + scalefactor = abs(float(scalefactor.value)) + scalefactor = min(1.0, max(0, scalefactor)) r, g, b = int(hexcolor[:2], 16), int(hexcolor[2:4], 16), int(hexcolor[4:], 16) + value = max(r, g, b) - r = clamp(r * scalefactor) - g = clamp(g * scalefactor) - b = clamp(b * scalefactor) - - return "#%02x%02x%02x" % (r, g, b) \ No newline at end of file + return calculate(hexcolor, scalefactor if value >= 127 else 2 - scalefactor) diff --git a/app/static/app/css/main.scss b/app/static/app/css/main.scss index 7eac760c..d315e1d1 100644 --- a/app/static/app/css/main.scss +++ b/app/static/app/css/main.scss @@ -59,7 +59,7 @@ html, body, section.main, .content, #wrapper, #page-wrapper{ .email{ font-size: 90%; - color: gray; + opacity: 0.9; } } } @@ -167,15 +167,6 @@ button i.glyphicon{ background-color: #dddddd; } -.btn.btn-white{ - background-color: #fff; - color: #111; - - &:hover{ - background-color: #f4f4f4; - } -} - .dropdown-menu>li>a{ padding-left: 10px; color: #222; diff --git a/app/static/app/css/theme.scss b/app/static/app/css/theme.scss index a8c45ca5..a1b396b5 100644 --- a/app/static/app/css/theme.scss +++ b/app/static/app/css/theme.scss @@ -4,10 +4,20 @@ ul#side-menu.nav a, .console, .alert, .dropdown-menu > li > a, -.form-control +.form-control, +.theme-color-primary, { color: theme("primary"); } +.tooltip{ + .tooltip-inner{ + background-color: theme("primary"); + } + &.left .tooltip-arrow{ border-left-color: theme("primary"); } + &.top .tooltip-arrow{ border-top-color: theme("primary"); } + &.bottom .tooltip-arrow{ border-bottom-color: theme("primary"); } + &.right .tooltip-arrow{ border-right-color: theme("primary"); } +} /* Secondary */ body, @@ -15,17 +25,39 @@ body, .console, .alert, .modal-content, -.form-control +.form-control, +.dropdown-menu, +.theme-secondary { background-color: theme("secondary"); } +.tooltip > .tooltip-inner{ + color: theme("secondary"); +} + .alert{ .close:hover, .close:focus{ color: complementary(theme("secondary")); } } +.pagination li > a, +.pagination .disabled > a, +.pagination .disabled > a:hover, .pagination .disabled > a:focus{ + color: scaleby(theme("primary"), 0.7); + background-color: theme("secondary"); + border-color: scaleby(theme("secondary"), 0.7); +} +.pagination li > a{ + color: theme("primary"); +} + +/* Tertiary */ +a, a:hover, a:focus{ + color: theme("tertiary"); +} + /* Button primary */ #navbar-top .navbar-top-links,{ a:hover,a:focus,.open > a{ @@ -64,6 +96,26 @@ body, } } +.pagination>.active>a, .pagination>.active>span, .pagination>.active>a:hover, .pagination>.active>span:hover, .pagination>.active>a:focus, .pagination>.active>span:focus, +.pagination .active > a:hover, .pagination .active > a:focus, +.pagination li > a:hover, .pagination li > a:focus{ + background-color: theme("button_default"); + color: theme("secondary"); +} + +/* Button danger */ +.btn-danger, .btn-danger:active, .btn-danger.active, .open>.dropdown-toggle.btn-danger{ + background-color: theme("button_danger"); + border-color: theme("button_danger"); + color: theme("secondary"); + + &:hover, &:active, &:focus{ + background-color: scaleby(theme("button_danger"), 0.90); + border-color: scaleby(theme("button_danger"), 0.90); + color: theme("secondary"); + } +} + /* Header background */ #navbar-top{ background-color: theme("header_background"); @@ -87,21 +139,58 @@ table-bordered>thead>tr>th, .table-bordered>thead>tr>th, table-bordered>tbody>tr footer, .modal-content, .modal-header, -.modal-footer{ +.modal-footer, +.dropdown-menu +{ border-color: theme("border"); } +.dropdown-menu .divider{ + background-color: theme("border"); +} /* Highlight */ .task-list-item:nth-child(odd), -.table-striped>tbody>tr:nth-of-type(odd){ +.table-striped>tbody>tr:nth-of-type(odd), +.theme-background-highlight{ background-color: theme("highlight"); } pre.prettyprint, .form-control{ border-color: theme('highlight'); + &:focus{ + border-color: scaleby(theme('highlight'), 0.7); + } } /* Dialog warning */ .alert-warning{ border-color: theme("dialog_warning"); } + +/* Success */ +.task-list-item .status-label.done{ + background-color: theme("success"); +} + +/* Failed */ +.task-list-item .status-label.error{ + background-color: theme("failed"); +} + + +/* ModelView.jsx specific */ +.model-view #potree_sidebar_container .dropdown-menu a{ + color: theme("primary"); +} + +/* MapView.jsx specific */ +.leaflet-bar a, .leaflet-control > a{ + background-color: theme("button_primary") !important; + border-color: theme("button_primary") !important; + color: theme("secondary") !important; + + &:hover{ + background-color: scaleby(theme("button_primary"), 0.90) !important; + border-color: scaleby(theme("button_primary"), 0.90) !important; + } +} \ No newline at end of file diff --git a/app/static/app/js/MapView.jsx b/app/static/app/js/MapView.jsx index 51d6dbab..c08f0405 100644 --- a/app/static/app/js/MapView.jsx +++ b/app/static/app/js/MapView.jsx @@ -102,7 +102,7 @@ class MapView extends React.Component { showBackground={true} opacity={opacity} mapType={this.state.selectedMapType} /> -
{this.props.uploading ? "Your images are being uploaded. In the meanwhile, check these additional options:" diff --git a/app/static/app/js/components/ProcessingNodeOption.jsx b/app/static/app/js/components/ProcessingNodeOption.jsx index 4fd2cc2e..1c6d7027 100644 --- a/app/static/app/js/components/ProcessingNodeOption.jsx +++ b/app/static/app/js/components/ProcessingNodeOption.jsx @@ -112,7 +112,7 @@ class ProcessingNodeOption extends React.Component {