LiveAtlas/src/scss/style.scss
2021-01-07 22:40:05 +00:00

514 lines
8.2 KiB
SCSS

/*!
* Copyright 2020 James Lyne
*
* Some portions of this file were taken from https://github.com/webbukkit/dynmap.
* These portions are Copyright 2020 Dynmap Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@import "variables";
@import "placeholders";
@import "leaflet/controls";
@import "leaflet/popups";
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@font-face {
font-family: 'Raleway';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Raleway'), local('Raleway-Regular'), url(https://fonts.gstatic.com/s/raleway/v14/1Ptug8zYS_SKggPNyC0ITw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* {
scrollbar-width: thin;
scrollbar-color: $global-text-color transparent;
}
*::-webkit-scrollbar {
width: 1.2rem;
}
*::-webkit-scrollbar-track {
background: transparent;
}
*::-webkit-scrollbar-thumb {
background-color: #333333;
border-radius: 2rem;
transition: background 1s ease-in;
}
*:hover::-webkit-scrollbar-thumb {
background-color: $global-focus-color;
}
*::-webkit-scrollbar-button {
display: none;
}
html {
font-size: 62.5%;
font: -apple-system-body;
}
body {
font-family: Raleway, sans-serif;
color: $global-text-color;
text-shadow: 0.1rem 0.1rem #000000;
letter-spacing: 0.02rem;
}
html, body {
background-color: $global-background;
height: 100%;
overscroll-behavior: none;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
margin-top: 0;
}
h1 {
font-size: 3rem;
}
h2 {
font-size: 2rem;
line-height: 2.4rem;
margin-bottom: 1rem;
}
button {
@extend %button;
}
input {
appearance: none;
background-color: #333333;
box-shadow: none;
color: #cccccc;
font-size: 1.6rem;
padding: 1rem;
border: 0.2rem solid #333333;
border-radius: 0;
&:focus {
color: #eeeeee;
outline-color: #eeeeee;
}
&[disabled] {
background-color: #333333;
border-color: #333333;
cursor: not-allowed;
}
}
.checkbox {
display: flex;
position: relative;
align-items: center;
&:before,
svg,
input[type=checkbox] {
position: absolute;
top: 0;
bottom: 0;
left: 0;
margin: auto 1rem auto 0;
}
&:before {
content: '';
width: 2.2rem;
height: 2.2rem;
border: 0.2rem solid #cccccc;
border-radius: 0.3rem;
background-color: transparent;
box-sizing: border-box;
z-index: 0;
}
input[type=checkbox] {
width: 2.4rem;
height: 2.4rem;
opacity: 0;
z-index: 2;
&:checked {
& ~ span {
color: #cccccc;
}
& + svg {
opacity: 1;
}
}
}
svg {
opacity: 0;
transition: opacity 0.2s ease-in;
z-index: 1;
}
span {
color: #aaaaaa;
padding-left: 3rem;
}
}
.dynmap {
height: 100%;
}
.dynmap .map .tile img, img {
image-rendering: pixelated;
}
.clock {
@extend %panel;
position: relative;
width: 15rem;
height: 6rem;
z-index: 50;
font-family: monospace;
display: flex;
flex-direction: column;
align-items: center;
padding: 0.5rem 2rem;
.clock__time {
text-align: center;
font-size: 2rem;
line-height: 2rem;
margin-top: auto;
background-color: #222;
z-index: 1;
padding: 0.1rem 0.1rem 0;
border-radius: 0.3rem;
&.night {
color: #ddffff;
}
&.day {
color: #ffdd33;
}
&.night, &.day {
transition: color 8s 8s linear;
}
}
.clock__sun,
.clock__moon {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
svg {
width: 15rem;
height: 12rem;
}
}
&.clock--digital {
justify-content: center;
height: 5rem;
width: auto;
.clock__sun,
.clock__moon {
display: none;
}
.clock__time {
margin: 0;
font-size: 3rem;
}
}
@media (max-width: 30rem), (max-height: 30rem) {
transform: scale(calc((1/6)*5));
transform-origin: top center
}
}
/*******************
* players on the map
*/
.marker {
display: flex;
align-items: center;
&.marker--player {
transition: transform 0.3s ease-in 0s;
.marker__label {
display: block;
}
.player__health,
.player__armor {
width: 50px;
}
.player__health,
.player__armor,
.player__health-bg,
.player__armor-bg {
height: 7px;
}
.player__health {
background: url(../assets/images/heart.png) repeat-x left center;
}
.player__health-bg {
background: url(../assets/images/heart_depleted.png) repeat-x left center;
}
.player__armor {
background: url(../assets/images/armor.png) repeat-x left center;
}
.player__armor-bg {
background: url(../assets/images/armor_depleted.png) repeat-x left center;
}
}
.marker__label {
flex: 0 0 auto;
margin-left: 2px;
z-index: 20;
font-size: 1.5rem;
line-height: 1;
white-space: nowrap;
color: $global-text-color;
background: #121212;
padding: 0.2rem;
display: none;
max-width: 25vw;
text-overflow: ellipsis;
overflow: hidden;
@at-root .leaflet-pane--show-labels .marker__label {
display: block;
}
}
&:hover, &:focus {
z-index: 1000;
}
&:hover .marker__label {
display: block;
}
&:focus .marker__label {
display: block;
outline: auto;
}
@at-root {
.no-animations .marker.marker--player {
transition: none;
}
}
@media print {
display: none !important;
}
}
/*******************
* Compass
*/
.compass, .compass_NE, .compass_SE, .compass_NW, .compass_SW {
display: block;
position: absolute;
z-index: 10;
top: 20px;
right: 32px;
height: 84px;
width: 83px;
background-repeat: no-repeat;
}
.compass, .compass_SE {
background-image: url(../assets/images/compass.png);
}
.compass_NE {
background-image: url(../assets/images/compass_NE.png);
}
.compass_NW {
background-image: url(../assets/images/compass_NW.png);
}
.compass_SW {
background-image: url(../assets/images/compass_SW.png);
}
.compass_flat, .compass_N, .compass_E, .compass_W, .compass_S {
top: 10px;
right: 21px;
height: 105px;
width: 105px;
}
.compass_flat, .compass_S {
background-image: url(../assets/images/compass_flat.png);
}
.compass_N {
background-image: url(../assets/images/compass_N.png);
}
.compass_E {
background-image: url(../assets/images/compass_E.png);
}
.compass_W {
background-image: url(../assets/images/compass_W.png);
}
.mobilecompass {
top: 5px;
right: 10px;
height: 42px;
width: 42px;
background-size: cover;
}
/*******************
* Chat
*/
.loginbutton {
color: #000;
font-family: sans-serif;
font-size: 11px;
border: 1px solid rgba(128,128,128,0.6);
background-color: #bbb;
padding: 2px;
border-radius: 5px;
cursor: pointer;
margin: 0;
}
.dynmap .mapMarker .markerName_offline_players {
font-style: italic;
}
/* Login/register panel */
.dynmaplogin {
text-align: center;
width: 100%;
font-weight: bold;
color: #FFFFFF;
background: #000000;
}
table.loginregister {
color: #ffffff;
border: 1px solid rgba(64,64,64,0.6);
background: #bbb;
font-weight: bold;
margin: auto;
}
td.login {
vertical-align: top;
color: #000000;
background-color: #bbb;
border: 1px solid rgba(64,64,64,0.6);
font-weight: bold;
margin: 2em;
width: 40em;
}
td.register {
vertical-align: top;
color: #000000;
background-color: #bbb;
border: 1px solid rgba(64,64,64,0.6);
font-weight: bold;
margin: 2em;
width: 40em;
}
div.statusmessage {
color: #FF0000;
font-weight: bold;
font-size: 24px;
}
.logincontainer {
background-color: rgba(0,0,0,0.0);
}
.pinnedloginbutton {
margin-right: 201px;
}
.leaflet-container {
font-family: inherit;
font-size: 1.5rem;
font-weight: inherit;
line-height: 1;
}
.leaflet-players-pane {
z-index: 600;
}
@media print {
@page {
size: 297mm 210mm;
}
}