wallet-core/packages/anastasis-webui/src/scss/_custom-calendar.scss

264 lines
6.0 KiB
SCSS
Raw Normal View History

2021-10-19 15:56:52 +02:00
/*
This file is part of GNU Taler
(C) 2021 Taler Systems S.A.
GNU Taler is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3, or (at your option) any later version.
GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
:root {
--primary-color: #3298dc;
2021-11-10 14:02:25 +01:00
--primary-text-color-dark: rgba(0, 0, 0, 0.87);
--secondary-text-color-dark: rgba(0, 0, 0, 0.57);
--disabled-text-color-dark: rgba(0, 0, 0, 0.13);
--primary-text-color-light: rgba(255, 255, 255, 0.87);
--secondary-text-color-light: rgba(255, 255, 255, 0.57);
--disabled-text-color-light: rgba(255, 255, 255, 0.13);
--font-stack: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
2021-10-19 15:56:52 +02:00
--primary-card-color: #fff;
--primary-background-color: #f2f2f2;
2021-11-10 14:02:25 +01:00
2021-10-19 15:56:52 +02:00
--box-shadow-lvl-1: 0 1px 3px rgba(0, 0, 0, 0.12),
2021-11-10 14:02:25 +01:00
0 1px 2px rgba(0, 0, 0, 0.24);
2021-10-19 15:56:52 +02:00
--box-shadow-lvl-2: 0 3px 6px rgba(0, 0, 0, 0.16),
2021-11-10 14:02:25 +01:00
0 3px 6px rgba(0, 0, 0, 0.23);
2021-10-19 15:56:52 +02:00
--box-shadow-lvl-3: 0 10px 20px rgba(0, 0, 0, 0.19),
2021-11-10 14:02:25 +01:00
0 6px 6px rgba(0, 0, 0, 0.23);
2021-10-19 15:56:52 +02:00
--box-shadow-lvl-4: 0 14px 28px rgba(0, 0, 0, 0.25),
2021-11-10 14:02:25 +01:00
0 10px 10px rgba(0, 0, 0, 0.22);
2021-10-19 15:56:52 +02:00
}
.home .datePicker div {
margin-top: 0px;
margin-bottom: 0px;
}
2021-10-19 15:56:52 +02:00
.datePicker {
text-align: left;
background: var(--primary-card-color);
border-radius: 3px;
z-index: 200;
position: fixed;
height: auto;
max-height: 90vh;
width: 90vw;
max-width: 448px;
transform-origin: top left;
2021-11-10 14:02:25 +01:00
transition: transform 0.22s ease-in-out, opacity 0.22s ease-in-out;
2021-10-19 15:56:52 +02:00
top: 50%;
left: 50%;
opacity: 0;
transform: scale(0) translate(-50%, -50%);
user-select: none;
&.datePicker--opened {
opacity: 1;
transform: scale(1) translate(-50%, -50%);
}
2021-11-10 14:02:25 +01:00
2021-10-19 15:56:52 +02:00
.datePicker--titles {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
padding: 24px;
height: 100px;
background: var(--primary-color);
2021-11-10 14:02:25 +01:00
h2,
h3 {
2021-10-19 15:56:52 +02:00
cursor: pointer;
color: #fff;
line-height: 1;
padding: 0;
margin: 0;
font-size: 32px;
}
h3 {
2021-11-10 14:02:25 +01:00
color: rgba(255, 255, 255, 0.57);
2021-10-19 15:56:52 +02:00
font-size: 18px;
padding-bottom: 2px;
}
}
nav {
padding: 20px;
height: 56px;
h4 {
width: calc(100% - 60px);
text-align: center;
display: inline-block;
padding: 0;
font-size: 14px;
line-height: 24px;
margin: 0;
position: relative;
top: -9px;
color: var(--primary-text-color);
}
i {
cursor: pointer;
color: var(--secondary-text-color);
font-size: 26px;
user-select: none;
border-radius: 50%;
2021-11-10 14:02:25 +01:00
2021-10-19 15:56:52 +02:00
&:hover {
background: var(--disabled-text-color-dark);
}
}
}
2021-11-10 14:02:25 +01:00
2021-10-19 15:56:52 +02:00
.datePicker--scroll {
overflow-y: auto;
max-height: calc(90vh - 56px - 100px);
}
.datePicker--calendar {
padding: 0 20px;
.datePicker--dayNames {
width: 100%;
display: grid;
text-align: center;
2021-11-10 14:02:25 +01:00
2021-10-19 15:56:52 +02:00
// there's probably a better way to do this, but wanted to try out CSS grid
2022-06-06 05:10:38 +02:00
grid-template-columns:
calc(100% / 7) calc(100% / 7) calc(100% / 7) calc(100% / 7)
calc(100% / 7) calc(100% / 7) calc(100% / 7);
2021-10-19 15:56:52 +02:00
span {
color: var(--secondary-text-color-dark);
font-size: 14px;
line-height: 42px;
display: inline-grid;
}
}
.datePicker--days {
width: 100%;
display: grid;
text-align: center;
2022-06-06 05:10:38 +02:00
grid-template-columns:
calc(100% / 7) calc(100% / 7) calc(100% / 7) calc(100% / 7)
calc(100% / 7) calc(100% / 7) calc(100% / 7);
2021-10-19 15:56:52 +02:00
span {
color: var(--primary-text-color-dark);
line-height: 42px;
font-size: 14px;
display: inline-grid;
2021-11-10 14:02:25 +01:00
transition: color 0.22s;
2021-10-19 15:56:52 +02:00
height: 42px;
position: relative;
cursor: pointer;
user-select: none;
border-radius: 50%;
&::before {
2021-11-10 14:02:25 +01:00
content: "";
2021-10-19 15:56:52 +02:00
position: absolute;
z-index: -1;
height: 42px;
width: 42px;
left: calc(50% - 21px);
background: var(--primary-color);
border-radius: 50%;
2021-11-10 14:02:25 +01:00
transition: transform 0.22s, opacity 0.22s;
2021-10-19 15:56:52 +02:00
transform: scale(0);
opacity: 0;
}
2021-11-10 14:02:25 +01:00
&[disabled="true"] {
2021-10-19 15:56:52 +02:00
cursor: unset;
}
&.datePicker--today {
font-weight: 700;
}
&.datePicker--selected {
2021-11-10 14:02:25 +01:00
color: rgba(255, 255, 255, 0.87);
2021-10-19 15:56:52 +02:00
&:before {
transform: scale(1);
opacity: 1;
}
}
}
}
}
2021-11-10 14:02:25 +01:00
2021-10-19 15:56:52 +02:00
.datePicker--selectYear {
padding: 0 20px;
display: block;
width: 100%;
text-align: center;
max-height: 362px;
2021-11-10 14:02:25 +01:00
2021-10-19 15:56:52 +02:00
span {
display: block;
width: 100%;
font-size: 24px;
margin: 20px auto;
cursor: pointer;
2021-11-10 14:02:25 +01:00
2021-10-19 15:56:52 +02:00
&.selected {
font-size: 42px;
color: var(--primary-color);
}
}
}
div.datePicker--actions {
width: 100%;
padding: 8px;
text-align: right;
button {
margin-bottom: 0;
font-size: 15px;
cursor: pointer;
color: var(--primary-text-color);
border: none;
margin-left: 8px;
min-width: 64px;
line-height: 36px;
background-color: transparent;
appearance: none;
padding: 0 16px;
border-radius: 3px;
2021-11-10 14:02:25 +01:00
transition: background-color 0.13s;
2021-10-19 15:56:52 +02:00
2021-11-10 14:02:25 +01:00
&:hover,
&:focus {
2021-10-19 15:56:52 +02:00
outline: none;
background-color: var(--disabled-text-color-dark);
}
}
}
}
.datePicker--background {
z-index: 199;
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
2021-11-10 14:02:25 +01:00
background: rgba(0, 0, 0, 0.52);
animation: fadeIn 0.22s forwards;
2021-10-19 15:56:52 +02:00
}