LiveAtlas/src/scss/style.scss

379 lines
6.3 KiB
SCSS
Raw Normal View History

2020-12-16 16:54:41 +00:00
/*!
* 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 "mixins";
2020-12-01 23:20:38 +00:00
@import "placeholders";
2021-05-25 13:21:37 +00:00
@import "notifications";
2020-12-01 23:20:38 +00:00
@import "leaflet/controls";
@import "leaflet/popups";
2020-12-15 01:51:19 +00:00
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
2020-12-01 23:20:38 +00:00
@font-face {
font-family: 'Raleway';
font-style: normal;
font-weight: 400;
2020-12-12 19:07:00 +00:00
font-display: swap;
2020-12-01 23:20:38 +00:00
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;
}
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;
}
2021-01-24 22:35:59 +00:00
a {
2021-05-15 22:24:29 +00:00
color: var(--text-base);
2021-01-24 22:35:59 +00:00
}
2020-12-01 23:20:38 +00:00
button {
@extend %button;
}
2021-01-07 22:40:05 +00:00
input {
appearance: none;
2021-05-15 22:24:29 +00:00
background-color: var(--background-light);
2021-01-07 22:40:05 +00:00
box-shadow: none;
2021-05-15 22:24:29 +00:00
color: var(--text-base);
2021-01-07 22:40:05 +00:00
font-size: 1.6rem;
padding: 1rem;
2021-05-15 22:24:29 +00:00
border: 0.2rem solid var(--border-color);
2021-01-07 22:40:05 +00:00
border-radius: 0;
@include focus {
2021-05-15 22:24:29 +00:00
color: var(--text-emphasis);
outline-color: var(--text-emphasis);
2021-01-07 22:40:05 +00:00
}
&[disabled] {
2021-05-15 22:24:29 +00:00
background-color: var(--background-disabled);
border-color: var(--border-color);
2021-01-07 22:40:05 +00:00
cursor: not-allowed;
}
}
.focus-mover {
clip: rect(1px, 1px, 1px, 1px);
position: absolute;
height: 1px;
width: 1px;
@include focus {
outline: none;
border: none;
}
}
2020-12-15 22:14:04 +00:00
.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 {
2021-05-15 22:24:29 +00:00
color: var(--text-base);
2020-12-15 22:14:04 +00:00
}
& + svg {
opacity: 1;
}
}
}
svg {
opacity: 0;
transition: opacity 0.2s ease-in;
z-index: 1;
}
span {
2021-05-15 22:24:29 +00:00
color: var(--text-subtle);
2020-12-15 22:14:04 +00:00
padding-left: 3rem;
}
}
2021-05-24 15:42:32 +00:00
.menu {
list-style: none;
margin: 0;
padding: 0;
font-size: 1.6rem;
ul {
list-style: none;
margin: 0;
padding: 0;
}
> li {
display: flex;
padding: 0.8rem 0.8rem 0.7rem;
position: relative;
2021-05-24 16:34:03 +00:00
border-bottom: 0.1rem solid transparent;
2021-05-24 15:42:32 +00:00
> button {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
2021-05-24 15:42:32 +00:00
margin: -0.8rem -0.8rem -0.7rem;
padding: 0.8rem 0.8rem 0.7rem;
text-align: left;
flex-grow: 1;
min-height: 3.2rem;
border-radius: 0.5rem;
2021-05-24 15:42:32 +00:00
}
}
}
2021-05-18 14:45:27 +00:00
#app .map .tile img, img {
2020-12-01 23:20:38 +00:00
image-rendering: pixelated;
}
.clock {
2020-12-12 19:09:38 +00:00
@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;
2020-12-12 19:09:38 +00:00
.clock__time {
2020-12-12 19:09:38 +00:00
text-align: center;
font-size: 2rem;
line-height: 2rem;
margin-top: auto;
2021-05-15 22:24:29 +00:00
background-color: var(--background-base);
z-index: 1;
padding: 0.1rem 0.1rem 0;
border-radius: 0.3rem;
2020-12-12 19:09:38 +00:00
&.night {
2021-05-15 22:24:29 +00:00
color: var(--text-night);
2020-12-12 19:09:38 +00:00
}
2020-12-01 23:20:38 +00:00
2020-12-12 19:09:38 +00:00
&.day {
2021-05-15 22:24:29 +00:00
color: var(--text-day);
2020-12-12 19:09:38 +00:00
}
2020-12-01 23:20:38 +00:00
2020-12-12 19:09:38 +00:00
&.night, &.day {
transition: color 8s 8s linear;
}
}
.clock__sun,
.clock__moon {
2020-12-12 19:09:38 +00:00
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
svg {
width: 15rem;
height: 12rem;
2020-12-12 19:09:38 +00:00
}
}
&.clock--digital {
justify-content: center;
height: 5rem;
width: auto;
2020-12-01 23:20:38 +00:00
.clock__sun,
.clock__moon {
display: none;
2020-12-12 19:09:38 +00:00
}
2020-12-01 23:20:38 +00:00
.clock__time {
margin: 0;
font-size: 3rem;
2020-12-12 19:09:38 +00:00
}
}
2020-12-20 14:45:04 +00:00
@media (max-width: 480px), (max-height: 480px) {
2020-12-20 14:45:04 +00:00
transform: scale(calc((1/6)*5));
transform-origin: top center
}
2020-12-01 23:20:38 +00:00
}
/*******************
* 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,
2021-01-24 22:14:39 +00:00
.player__health-bar,
.player__armor-bar {
height: 7px;
}
.player__health {
2021-01-24 22:14:39 +00:00
background: url(../assets/images/heart_depleted.png) repeat-x left center;
}
2021-01-24 22:14:39 +00:00
.player__health-bar {
background: url(../assets/images/heart.png) repeat-x left center;
}
.player__armor {
2021-01-24 22:14:39 +00:00
background: url(../assets/images/armor_depleted.png) repeat-x left center;
}
2021-01-24 22:14:39 +00:00
.player__armor-bar {
background: url(../assets/images/armor.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;
2021-05-15 22:24:29 +00:00
color: var(--text-base);
background: var(--background-dark);
padding: 0.2rem;
display: none;
max-width: 25vw;
text-overflow: ellipsis;
overflow: hidden;
2020-12-18 23:01:32 +00:00
@at-root .leaflet-pane--show-labels .marker__label {
display: block;
}
}
&:hover {
z-index: 1000;
}
@include focus {
z-index: 1000;
.marker__label {
display: block;
outline: auto;
}
}
&:hover .marker__label {
display: block;
}
@at-root {
.no-animations .marker.marker--player {
transition: none;
}
}
@media print {
display: none !important;
}
2020-12-01 23:20:38 +00:00
}
2020-12-15 22:12:57 +00:00
.leaflet-container {
font-family: inherit;
font-size: 1.5rem;
font-weight: inherit;
line-height: 1;
2021-05-24 16:34:03 +00:00
/* Workaround for focus outlines until https://github.com/Leaflet/Leaflet/pull/7259 gets released */
@include focus {
2021-05-24 16:34:03 +00:00
outline: -webkit-focus-ring-color auto thin !important;
outline: revert !important;
}
2020-12-15 22:12:57 +00:00
}
.leaflet-players-pane {
z-index: 600;
}
@media print {
@page {
size: 297mm 210mm;
}
}