Refactoring: remove import flow, fix various issues, get PDF-export working (but not quite)

This commit is contained in:
Pieter Vander Vennet 2023-05-05 02:03:41 +02:00
parent 2149fc1a1d
commit f7eaec2243
36 changed files with 739 additions and 3930 deletions

520
index.css
View file

@ -12,486 +12,484 @@
@tailwind utilities;
@layer utilities {
.z-above-map {
z-index: 10000;
}
.z-above-map {
z-index: 10000;
}
.z-above-controls {
z-index: 10001;
}
.z-above-controls {
z-index: 10001;
}
.w-160 {
width: 40rem;
}
.w-160 {
width: 40rem;
}
.bg-subtle {
background-color: var(--subtle-detail-color);
color: var(--subtle-detail-color-contrast);
}
.bg-subtle {
background-color: var(--subtle-detail-color);
color: var(--subtle-detail-color-contrast);
}
.bg-unsubtle {
background-color: var(--unsubtle-detail-color);
color: var(--unsubtle-detail-color-contrast);
}
.bg-unsubtle {
background-color: var(--unsubtle-detail-color);
color: var(--unsubtle-detail-color-contrast);
}
.bg-catch {
background-color: var(--catch-detail-color);
color: var(--catch-detail-color-contrast);
}
.bg-catch {
background-color: var(--catch-detail-color);
color: var(--catch-detail-color-contrast);
}
.rounded-left-full {
border-bottom-left-radius: 999rem;
border-top-left-radius: 999rem;
}
.rounded-left-full {
border-bottom-left-radius: 999rem;
border-top-left-radius: 999rem;
}
.rounded-right-full {
border-bottom-right-radius: 999rem;
border-top-right-radius: 999rem;
}
.rounded-right-full {
border-bottom-right-radius: 999rem;
border-top-right-radius: 999rem;
}
}
:root {
/* The main colour scheme of mapcomplete is configured here.
* For a custom styling, set 'customCss' in your layoutConfig and overwrite some of these.
*/
/* The main colour scheme of mapcomplete is configured here.
* For a custom styling, set 'customCss' in your layoutConfig and overwrite some of these.
*/
/* Main color of the application: the background and text colours */
--background-color: white;
/* Main text colour. Also styles some elements, such as the 'close popup'-button or 'back-arrow' (in mobile) */
--foreground-color: black;
/* Main color of the application: the background and text colours */
--background-color: white;
/* Main text colour. Also styles some elements, such as the 'close popup'-button or 'back-arrow' (in mobile) */
--foreground-color: black;
/* A colour to indicate an error or warning */
--alert-color: #fee4d1;
/* A colour to indicate an error or warning */
--alert-color: #fee4d1;
/**
* Base colour of interactive elements, mainly the 'subtle button'
*
*/
--subtle-detail-color: #dbeafe;
--subtle-detail-color-contrast: black;
--subtle-detail-color-light-contrast: lightgrey;
/**
* Base colour of interactive elements, mainly the 'subtle button'
*
*/
--subtle-detail-color: #dbeafe;
--subtle-detail-color-contrast: black;
--subtle-detail-color-light-contrast: lightgrey;
/**
* A stronger variant of the 'subtle-detail-colour'
* Used as subtle button hover
*/
--unsubtle-detail-color: #bfdbfe;
--unsubtle-detail-color-contrast: black;
/**
* A stronger variant of the 'subtle-detail-colour'
* Used as subtle button hover
*/
--unsubtle-detail-color: #bfdbfe;
--unsubtle-detail-color-contrast: black;
--catch-detail-color: #3a3aeb;
--catch-detail-color-contrast: white;
--catch-detail-color: #3a3aeb;
--catch-detail-color-contrast: white;
--non-active-tab-svg: var(--foreground-color);
--shadow-color: #00000066;
--non-active-tab-svg: var(--foreground-color);
--shadow-color: #00000066;
--return-to-the-map-height: 2em;
--image-carousel-height: 350px;
--image-carousel-height: 350px;
/* Technical variable to make some dynamic behaviour possible; set by javascript. */
--variable-title-height: 0px;
/* Technical variable to make some dynamic behaviour possible; set by javascript. */
--variable-title-height: 0px;
}
html,
body {
height: 100%;
min-height: 100vh;
min-height: -webkit-fill-available;
margin: 0;
padding: 0;
background-color: var(--background-color);
color: var(--foreground-color);
font-family: "Helvetica Neue", Arial, sans-serif;
height: 100%;
min-height: 100vh;
min-height: -webkit-fill-available;
margin: 0;
padding: 0;
background-color: var(--background-color);
color: var(--foreground-color);
font-family: "Helvetica Neue", Arial, sans-serif;
}
svg,
img {
box-sizing: content-box;
width: 100%;
height: 100%;
box-sizing: content-box;
width: 100%;
height: 100%;
}
.no-images img {
/* Used solely in 'imageAttribution' */
display: none;
/* Used solely in 'imageAttribution' */
display: none;
}
.text-white a {
/* Used solely in 'imageAttribution' */
color: var(--background-color);
/* Used solely in 'imageAttribution' */
color: var(--background-color);
}
.weblate-link {
/* Weblate-links are the little translation icon next to translatable sentences. Due to their special nature, they are exempt from some rules */
/* Weblate-links are the little translation icon next to translatable sentences. Due to their special nature, they are exempt from some rules */
}
a {
color: var(--foreground-color);
color: var(--foreground-color);
}
.btn {
line-height: 1.25rem;
--tw-text-opacity: 1;
color: var(--catch-detail-color-contrast);
--tw-bg-opacity: 1;
background-color: var(--catch-detail-color);
display: inline-flex;
border-radius: 1.5rem;
padding-top: 0.75rem;
padding-bottom: 0.75rem;
padding-left: 1.25rem;
padding-right: 1.25rem;
font-size: large;
font-weight: bold;
transition: 100ms;
/*-- invisible border: rendered on hover*/
border: 3px solid var(--unsubtle-detail-color);
line-height: 1.25rem;
--tw-text-opacity: 1;
color: var(--catch-detail-color-contrast);
--tw-bg-opacity: 1;
background-color: var(--catch-detail-color);
display: inline-flex;
border-radius: 1.5rem;
padding-top: 0.75rem;
padding-bottom: 0.75rem;
padding-left: 1.25rem;
padding-right: 1.25rem;
font-size: large;
font-weight: bold;
transition: 100ms;
/*-- invisible border: rendered on hover*/
border: 3px solid var(--unsubtle-detail-color);
}
.btn:hover {
border: 3px solid var(--catch-detail-color);
border: 3px solid var(--catch-detail-color);
}
.btn-secondary {
background-color: var(--catch-detail-color);
filter: saturate(0.5);
background-color: var(--catch-detail-color);
filter: saturate(0.5);
}
.btn-secondary:hover {
background-color: var(--catch-detail-color);
filter: unset;
background-color: var(--catch-detail-color);
filter: unset;
}
.btn-disabled {
filter: saturate(0.3);
cursor: default;
filter: saturate(0.3);
cursor: default;
}
.btn-disabled:hover {
border: 3px solid var(--unsubtle-detail-color);
border: 3px solid var(--unsubtle-detail-color);
}
/* slider */
input[type="range"].vertical {
writing-mode: bt-lr; /* IE */
-webkit-appearance: slider-vertical; /* Chromium */
cursor: pointer;
writing-mode: bt-lr; /* IE */
-webkit-appearance: slider-vertical; /* Chromium */
cursor: pointer;
}
@-moz-document url-prefix() {
input[type="range"].elevator::-moz-range-thumb {
background-color: #00000000 !important;
background-image: url("/assets/svg/elevator_wheelchair.svg");
width: 150px !important;
height: 30px !important;
border: 2px;
border-style: solid;
background-size: contain;
background-position: center center;
background-repeat: no-repeat;
cursor: pointer;
border-image: linear-gradient(to right, black 50%, transparent 50%) 100% 1;
padding-bottom: 5px;
}
input[type="range"].elevator::-moz-range-thumb {
background-color: #00000000 !important;
background-image: url("/assets/svg/elevator_wheelchair.svg");
width: 150px !important;
height: 30px !important;
border: 2px;
border-style: solid;
background-size: contain;
background-position: center center;
background-repeat: no-repeat;
cursor: pointer;
border-image: linear-gradient(to right, black 50%, transparent 50%) 100% 1;
padding-bottom: 5px;
}
}
.rounded-left-full {
border-bottom-left-radius: 999rem;
border-top-left-radius: 999rem;
border-bottom-left-radius: 999rem;
border-top-left-radius: 999rem;
}
.rounded-right-full {
border-bottom-right-radius: 999rem;
border-top-right-radius: 999rem;
border-bottom-right-radius: 999rem;
border-top-right-radius: 999rem;
}
.link-underline a {
text-decoration: underline 1px var(--foreground-color);
text-decoration: underline 1px var(--foreground-color);
}
a.link-underline {
text-decoration: underline 1px var(--foreground-color);
text-decoration: underline 1px var(--foreground-color);
}
.link-no-underline a {
text-decoration: none;
text-decoration: none;
}
li {
margin-left: 0.5em;
padding-left: 0.2em;
margin-top: 0.1em;
margin-left: 0.5em;
padding-left: 0.2em;
margin-top: 0.1em;
}
h2 {
font-size: large;
margin-top: 0.5em;
margin-bottom: 0.3em;
font-weight: bold;
font-size: large;
margin-top: 0.5em;
margin-bottom: 0.3em;
font-weight: bold;
}
h3 {
font-size: larger;
margin-top: 0.6em;
margin-bottom: 0;
font-weight: bold;
font-size: larger;
margin-top: 0.6em;
margin-bottom: 0;
font-weight: bold;
}
h3 {
font-size: larger;
margin-top: 0.6em;
margin-bottom: 0;
font-weight: bolder;
font-size: larger;
margin-top: 0.6em;
margin-bottom: 0;
font-weight: bolder;
}
p {
padding-top: 0.1em;
padding-top: 0.1em;
}
li::marker {
content: "•";
content: "•";
}
.subtle-background {
background: var(--subtle-detail-color);
color: var(--subtle-detail-color-contrast);
background: var(--subtle-detail-color);
color: var(--subtle-detail-color-contrast);
}
.normal-background {
background: var(--background-color);
color: var(--foreground-color);
background: var(--background-color);
color: var(--foreground-color);
}
.subtle-lighter {
color: var(--subtle-detail-color-light-contrast);
color: var(--subtle-detail-color-light-contrast);
}
.border-attention-catch {
border: 5px solid var(--catch-detail-color);
border: 5px solid var(--catch-detail-color);
}
.border-attention {
border-color: var(--catch-detail-color);
border-color: var(--catch-detail-color);
}
.direction-svg svg path {
fill: var(--catch-detail-color) !important;
fill: var(--catch-detail-color) !important;
}
.block-ruby {
display: block ruby;
display: block ruby;
}
.disable-links a {
pointer-events: none;
text-decoration: none !important;
color: var(--subtle-detail-color-contrast) !important;
pointer-events: none;
text-decoration: none !important;
color: var(--subtle-detail-color-contrast) !important;
}
.enable-links a {
pointer-events: unset;
text-decoration: underline !important;
color: unset !important;
pointer-events: unset;
text-decoration: underline !important;
color: unset !important;
}
.disable-links a.must-link,
.disable-links .must-link a {
/* Hide links if they are disabled */
display: none;
/* Hide links if they are disabled */
display: none;
}
.selected svg:not(.noselect *) path.selectable {
stroke: white !important;
stroke-width: 20px !important;
overflow: visible !important;
-webkit-animation: glowing-drop-shadow 1s ease-in-out infinite alternate;
-moz-animation: glowing-drop-shadow 1s ease-in-out infinite alternate;
animation: glowing-drop-shadow 1s ease-in-out infinite alternate;
stroke: white !important;
stroke-width: 20px !important;
overflow: visible !important;
-webkit-animation: glowing-drop-shadow 1s ease-in-out infinite alternate;
-moz-animation: glowing-drop-shadow 1s ease-in-out infinite alternate;
animation: glowing-drop-shadow 1s ease-in-out infinite alternate;
}
.selected svg {
overflow: visible !important;
overflow: visible !important;
}
@-webkit-keyframes glowing-drop-shadow {
from {
filter: drop-shadow(5px 5px 60px rgb(128 128 128 / 0.6));
}
to {
filter: drop-shadow(5px 5px 80px rgb(0.5 0.5 0.5 / 0.8));
}
from {
filter: drop-shadow(5px 5px 60px rgb(128 128 128 / 0.6));
}
to {
filter: drop-shadow(5px 5px 80px rgb(0.5 0.5 0.5 / 0.8));
}
}
/**************** GENERIC ****************/
.alert {
background-color: var(--alert-color);
color: var(--foreground-color);
font-weight: bold;
border-radius: 1em;
margin: 0.25em;
text-align: center;
padding: 0.15em 0.3em;
background-color: var(--alert-color);
color: var(--foreground-color);
font-weight: bold;
border-radius: 1em;
margin: 0.25em;
text-align: center;
padding: 0.15em 0.3em;
}
.invalid {
box-shadow: 0 0 10px #ff5353;
height: min-content;
box-shadow: 0 0 10px #ff5353;
height: min-content;
}
.shadow {
box-shadow: 0 0 10px var(--shadow-color);
box-shadow: 0 0 10px var(--shadow-color);
}
.title-font span {
font-size: xx-large !important;
font-weight: bold;
font-size: xx-large !important;
font-weight: bold;
}
.soft {
background-color: var(--subtle-detail-color);
color: var(--subtle-detail-color-contrast);
font-weight: bold;
border-radius: 1em;
margin: 0.25em;
text-align: center;
padding: 0.15em 0.3em;
background-color: var(--subtle-detail-color);
color: var(--subtle-detail-color-contrast);
font-weight: bold;
border-radius: 1em;
margin: 0.25em;
text-align: center;
padding: 0.15em 0.3em;
}
.subtle {
color: #999;
color: #999;
}
.link-underline .subtle a {
text-decoration: underline 1px #7193bb88;
color: #7193bb;
text-decoration: underline 1px #7193bb88;
color: #7193bb;
}
.thanks {
background-color: #43d904;
font-weight: bold;
border-radius: 1em;
margin: 0.25em;
text-align: center;
padding: 0.15em 0.3em;
background-color: #43d904;
font-weight: bold;
border-radius: 1em;
margin: 0.25em;
text-align: center;
padding: 0.15em 0.3em;
}
@keyframes slide {
/* This is the animation on the marker to add a new point - it slides through all the possible presets */
from {
transform: translateX(0%);
}
/* This is the animation on the marker to add a new point - it slides through all the possible presets */
from {
transform: translateX(0%);
}
to {
transform: translateX(calc(-100% + 42px));
}
to {
transform: translateX(calc(-100% + 42px));
}
}
/***************** Info box (box containing features and questions ******************/
input {
color: var(--foreground-color);
color: var(--foreground-color);
}
.literal-code {
display: inline-block;
background-color: lightgray;
padding: 0.5em;
word-break: break-word;
color: black;
box-sizing: border-box;
display: inline-block;
background-color: lightgray;
padding: 0.5em;
word-break: break-word;
color: black;
box-sizing: border-box;
}
/** Switch layout **/
.small-image img {
height: 1em;
max-width: 1em;
height: 1em;
max-width: 1em;
}
.small-image {
height: 1em;
max-width: 1em;
height: 1em;
max-width: 1em;
}
.slideshow-item img {
height: var(--image-carousel-height);
width: unset;
height: var(--image-carousel-height);
width: unset;
}
.animate-height {
transition: max-height 0.5s ease-in-out;
overflow-y: hidden;
transition: max-height 0.5s ease-in-out;
overflow-y: hidden;
}
.zebra-table tr:nth-child(even) {
background-color: #f2f2f2;
background-color: #f2f2f2;
}
.glowing-shadow {
-webkit-animation: glowing 1s ease-in-out infinite alternate;
-moz-animation: glowing 1s ease-in-out infinite alternate;
animation: glowing 1s ease-in-out infinite alternate;
-webkit-animation: glowing 1s ease-in-out infinite alternate;
-moz-animation: glowing 1s ease-in-out infinite alternate;
animation: glowing 1s ease-in-out infinite alternate;
}
@-webkit-keyframes glowing {
from {
box-shadow: 0 0 20px 10px #eaaf2588, inset 0 0 0px 1px #eaaf25;
}
to {
box-shadow: 0 0 20px 20px #eaaf2588, inset 0 0 5px 1px #eaaf25;
}
from {
box-shadow: 0 0 20px 10px #eaaf2588, inset 0 0 0px 1px #eaaf25;
}
to {
box-shadow: 0 0 20px 20px #eaaf2588, inset 0 0 5px 1px #eaaf25;
}
}
.mapping-icon-small-height {
/* A mapping icon type */
height: 1.5rem;
margin-right: 0.5rem;
width: unset;
/* A mapping icon type */
height: 1.5rem;
margin-right: 0.5rem;
width: unset;
}
.mapping-icon-medium-height {
/* A mapping icon type */
height: 3rem;
margin-right: 0.5rem;
width: unset;
/* A mapping icon type */
height: 3rem;
margin-right: 0.5rem;
width: unset;
}
.mapping-icon-large-height {
/* A mapping icon type */
height: 5rem;
margin-right: 0.5rem;
width: unset;
/* A mapping icon type */
height: 5rem;
margin-right: 0.5rem;
width: unset;
}
.mapping-icon-small {
/* A mapping icon type */
width: 1.5rem;
max-height: 1.5rem;
margin-right: 0.5rem;
/* A mapping icon type */
width: 1.5rem;
max-height: 1.5rem;
margin-right: 0.5rem;
}
.mapping-icon-medium {
/* A mapping icon type */
width: 3rem;
max-height: 3rem;
margin-right: 1rem;
margin-left: 1rem;
/* A mapping icon type */
width: 3rem;
max-height: 3rem;
margin-right: 1rem;
margin-left: 1rem;
}
.mapping-icon-large {
/* A mapping icon type */
width: 6rem;
max-height: 5rem;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
margin-right: 1.5rem;
margin-left: 1.5rem;
/* A mapping icon type */
width: 6rem;
max-height: 5rem;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
margin-right: 1.5rem;
margin-left: 1.5rem;
}