btcmortgage/css/main.scss
2023-09-26 04:55:52 +05:30

1136 lines
19 KiB
SCSS

* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Roboto", sans-serif;
}
:root {
font-size: clamp(1rem, 1.2vmax, 1.5rem);
}
html,
body {
height: 100%;
}
body {
--accent-color: #596afb;
--text-color: 30, 30, 30;
--background-color: 248, 248, 248;
--foreground-color: 255, 255, 255;
--danger-color: rgb(255, 75, 75);
--green: #1cad59;
scrollbar-width: thin;
scrollbar-gutter: stable;
color: rgba(var(--text-color), 1);
background-color: rgba(var(--background-color), 1);
transition: background-color 0.3s;
}
body[data-theme="dark"] {
--accent-color: #b1b9ff;
--text-color: 220, 220, 220;
--background-color: 10, 10, 10;
--foreground-color: 24, 24, 24;
--danger-color: rgb(255, 106, 106);
--green: #00e676;
sm-popup::part(popup) {
background-color: rgba(var(--foreground-color), 1);
}
::-webkit-calendar-picker-indicator {
filter: invert(1);
}
}
p,
strong {
font-size: 0.9rem;
max-width: 65ch;
line-height: 1.7;
color: rgba(var(--text-color), 0.9);
}
a {
text-decoration: none;
color: var(--accent-color);
&:focus-visible {
box-shadow: 0 0 0 0.1rem rgba(var(--text-color), 1) inset;
}
}
button,
.button {
user-select: none;
position: relative;
display: inline-flex;
border: none;
background-color: transparent;
overflow: hidden;
color: inherit;
-webkit-tap-highlight-color: transparent;
align-items: center;
font-size: inherit;
font-weight: 500;
white-space: nowrap;
padding: 0.6rem 0.9rem;
border-radius: 0.3rem;
justify-content: center;
&:focus-visible {
outline: var(--accent-color) solid medium;
}
&:not(:disabled) {
cursor: pointer;
}
}
.button {
background-color: rgba(var(--text-color), 0.02);
border: solid thin rgba(var(--text-color), 0.06);
&--primary {
color: rgba(var(--background-color), 1);
background-color: var(--accent-color);
padding: 0.8rem 1rem;
.icon {
fill: rgba(var(--background-color), 1);
}
}
&--colored {
color: var(--accent-color);
.icon {
fill: var(--accent-color);
}
}
&--danger {
background-color: #ff737310;
color: var(--danger-color);
.icon {
fill: var(--danger-color);
}
}
&--small {
padding: 0.4rem 0.6rem;
}
&--outlined {
border: solid rgba(var(--text-color), 0.3) 0.1rem;
background-color: rgba(var(--foreground-color), 1);
}
&--transparent {
background-color: transparent;
}
}
button:disabled {
cursor: not-allowed;
background-color: rgba(var(--text-color), 0.03);
color: rgba(var(--text-color), 0.5);
}
.cta {
text-transform: uppercase;
font-size: 0.9rem;
font-weight: 700;
letter-spacing: 0.05em;
padding: 0.8rem 1rem;
}
.icon {
width: 1.2rem;
height: 1.2rem;
fill: rgba(var(--text-color), 0.8);
flex-shrink: 0;
}
.icon-only {
padding: 0.5rem;
border-radius: 0.3rem;
}
.icon--big {
width: 3rem;
height: 3rem;
}
a:any-link:focus-visible {
outline: rgba(var(--text-color), 1) 0.1rem solid;
}
details summary {
display: flex;
user-select: none;
cursor: pointer;
align-items: center;
gap: 0.5rem;
color: var(--accent-color);
font-weight: 500;
.down-arrow {
fill: var(--accent-color);
}
}
details[open] {
& summary {
margin-bottom: 1rem;
}
& > summary .down-arrow {
transform: rotate(180deg);
}
}
sm-input,
sm-textarea {
font-size: 0.9rem;
--border-radius: 0.5rem;
--background-color: rgba(var(--foreground-color), 1);
button {
.icon {
fill: var(--accent-color);
}
}
}
sm-textarea {
--max-height: auto;
}
sm-spinner {
--size: 1rem;
--stroke-width: 0.1rem;
}
sm-form {
--gap: 1rem;
}
sm-chips {
--gap: 0.3rem;
}
sm-chip {
position: relative;
font-size: 0.9rem;
--border-radius: 0.5rem;
--padding: 0.5rem 0.8rem;
--background: rgba(var(--text-color), 0.06);
user-select: none;
&[selected="true"] {
.badge {
background-color: rgba(var(--foreground-color), 1);
color: var(--accent-color);
}
}
.badge {
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 1.2rem;
border-radius: 2rem;
margin-left: 0.5rem;
font-weight: 700;
aspect-ratio: 1/1;
background-color: var(--accent-color);
color: rgba(var(--background-color), 1);
}
}
sm-select {
&::part(options) {
max-height: 40vh;
}
}
sm-option {
flex-shrink: 0;
&::part(option) {
grid-template-columns: none;
}
}
ul {
list-style: none;
}
fieldset {
display: grid;
gap: 0.5rem;
padding: 1rem;
border-radius: 0.5rem;
border: solid 1px rgba(var(--text-color), 0.3);
legend {
font-size: 0.9rem;
font-weight: 500;
}
}
input[type="radio"] {
height: 1.1em;
width: 1.1em;
margin-right: 0.5rem;
accent-color: var(--accent-color);
}
.overflow-ellipsis {
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.wrap-around {
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
}
.full-bleed {
grid-column: 1/-1;
}
h1,
.h1 {
font-size: 1.8rem;
}
h2,
.h2 {
font-size: 1.5rem;
}
h3,
h3 {
font-size: 1.2rem;
line-height: 1.3;
}
.h4 {
font-size: 0.9rem;
}
.h5 {
font-size: 0.75rem;
}
.uppercase {
text-transform: uppercase;
}
.capitalize {
&::first-letter {
text-transform: uppercase;
}
}
.sticky {
position: sticky;
}
.top-0 {
top: 0;
}
.flex {
display: flex;
}
.flex-1 {
flex: 1;
}
.flex-wrap {
flex-wrap: wrap;
}
.grid {
display: grid;
}
.flow-column {
grid-auto-flow: column;
}
.gap-0-3 {
gap: 0.3rem;
}
.gap-0-5 {
gap: 0.5rem;
}
.gap-1 {
gap: 1rem;
}
.gap-1-5 {
gap: 1.5rem;
}
.gap-2 {
gap: 2rem;
}
.gap-3 {
gap: 3rem;
}
.text-align-right {
text-align: right;
}
.align-start {
align-content: flex-start;
}
.align-center {
align-items: center;
}
.align-end {
align-items: flex-end;
}
.align-content-center {
align-content: center;
}
.text-center {
text-align: center;
}
.justify-start {
justify-content: start;
}
.justify-content-center {
justify-content: center;
}
.justify-items-center {
justify-items: center;
}
.justify-right {
margin-left: auto;
}
.justify-items-center {
justify-items: center;
}
.align-self-center {
align-self: center;
}
.justify-self-center {
justify-self: center;
}
.justify-self-start {
justify-self: start;
}
.justify-self-end {
justify-self: end;
}
.flex-direction-column {
flex-direction: column;
}
.space-between {
justify-content: space-between;
}
.w-100 {
width: 100%;
}
.h-100 {
height: 100%;
}
.margin-left-0-5 {
margin-left: 0.5rem;
}
.margin-left-auto {
margin-left: auto;
}
.margin-right-0-5 {
margin-right: 0.5rem;
}
.margin-right-auto {
margin-right: auto;
}
.ripple {
height: 8rem;
width: 8rem;
position: absolute;
border-radius: 50%;
transform: scale(0);
background: radial-gradient(
circle,
rgba(var(--text-color), 0.3) 0%,
rgba(0, 0, 0, 0) 50%
);
pointer-events: none;
}
.button--primary,
.button--danger {
.ripple {
background: radial-gradient(
circle,
rgba(var(--background-color), 0.3) 0%,
rgba(0, 0, 0, 0) 50%
);
}
}
.interact:not([disabled="true"]) {
position: relative;
overflow: hidden;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
.empty-state {
display: grid;
width: 100%;
padding: 1.5rem 0;
}
.observe-empty-state:empty {
display: none !important;
}
.observe-empty-state:not(:empty) + .empty-state {
display: none;
}
.bullet-point {
display: flex;
align-items: center;
justify-content: center;
margin: 0 0.8ch;
&::after {
content: "";
height: 0.4ch;
width: 0.4ch;
border-radius: 0.5em;
background-color: var(--accent-color);
}
}
.multi-state-button {
display: grid;
text-align: center;
align-items: center;
justify-items: center;
& > * {
grid-area: 1/1/2/2;
}
button {
z-index: 1;
width: 100%;
}
}
.password-field {
label {
display: flex;
justify-content: center;
input:checked ~ .visible {
display: none;
}
input:not(:checked) ~ .invisible {
display: none;
}
}
}
.tooltip {
position: relative;
cursor: pointer;
isolation: isolate;
&:hover {
z-index: 10;
.tooltip__content {
opacity: 1;
pointer-events: auto;
}
}
&__content {
pointer-events: none;
position: absolute;
opacity: 0;
top: 100%;
justify-self: center;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
background-color: rgba(var(--text-color), 0.8);
color: rgba(var(--background-color), 1);
font-size: 0.8rem;
transition: opacity 0.2s;
z-index: 10;
backdrop-filter: blur(0.5rem);
}
}
#confirmation_popup,
#prompt_popup {
flex-direction: column;
h4 {
margin-bottom: 0.5rem;
}
.flex {
margin-top: 1rem;
}
}
.popup__header {
position: relative;
display: grid;
gap: 0.5rem;
width: 100%;
padding: 0 1.5rem 0 0.5rem;
align-items: center;
grid-template-columns: auto 1fr;
& > * {
grid-row: 1;
}
h3,
h4 {
grid-column: 1/-1;
justify-self: center;
align-self: center;
}
&__close {
grid-column: 1;
}
}
#app_body {
display: block;
height: 100%;
width: 100%;
}
#main_header {
grid-area: header;
background-color: rgba(var(--foreground-color), 1);
view-transition-name: header;
}
#sub_page_container {
grid-area: main;
padding: max(1rem, 1.5vw);
}
#loading {
position: fixed;
display: grid;
top: 0;
left: 0;
bottom: 0;
right: 0;
place-content: center;
justify-items: center;
background: rgba(var(--foreground-color), 1);
z-index: 10;
h4 {
margin-top: 1.5rem;
font-weight: 500;
}
sm-spinner {
--size: 1.5rem;
}
}
#sign_in,
#sign_up {
display: grid;
width: 100%;
height: 100%;
justify-items: center;
align-content: center;
padding: 1.5rem;
section {
width: min(26rem, 100%);
}
}
#sign_in {
section {
background-color: rgba(var(--foreground-color), 1);
border-radius: 1rem;
padding: max(1rem, 2vw);
box-shadow: 0 0.5rem 1rem rgba(var(--text-color), 0.1);
}
}
#generated_keys_wrapper {
padding: 1rem;
background-color: rgba(var(--foreground-color), 1);
border-radius: 0.5rem;
}
#generated_keys_warning {
border: solid thin rgba(var(--text-color), 0.3);
background-color: rgba(var(--text-color), 0.03);
padding: 1rem;
border-radius: 0.5rem;
.icon {
height: 3rem;
width: 3rem;
padding: 0.8rem;
overflow: visible;
background-color: #ffc107;
border-radius: 3rem;
fill: rgba(0, 0, 0, 0.8);
}
}
#landing {
}
.landing__section {
display: flex;
background-color: rgba(var(--foreground-color), 1);
min-height: 80vh;
> * {
flex: 1 1 50%;
padding: max(1rem, 1.5vw);
}
&__image-wrapper {
display: flex;
justify-content: center;
align-items: center;
img {
width: 100%;
max-width: 24rem;
max-height: 80vh;
}
}
&__info-wrapper {
display: flex;
flex-direction: column;
gap: 1rem;
margin: auto;
padding: max(1rem, 5vw);
justify-content: center;
}
&:nth-of-type(1) {
.landing__section__image-wrapper {
background-color: #eaf7f9;
}
}
&:not(:first-of-type) {
min-height: 100dvh;
}
&:nth-of-type(2) {
.section__sub-header {
color: var(--accent-color);
}
ol {
margin-top: 1rem;
padding-left: 1rem;
li {
&:not(:last-of-type) {
margin-bottom: 2.5rem;
}
&::marker {
color: var(--accent-color);
font-weight: 700;
}
h4 {
margin-bottom: 0.5rem;
}
}
}
.landing__section__image-wrapper {
background-color: #ffe4ba;
}
}
}
#hero_section {
height: calc(100vh - 4.1rem);
.flex {
margin-top: 1rem;
}
}
#main_header {
display: flex;
gap: 1rem;
padding: 1rem max(1rem, 1.5vw);
width: 100%;
align-items: center;
}
.app-brand {
display: flex;
gap: 0.3rem;
align-items: center;
.icon {
height: 1.7rem;
width: 1.7rem;
}
}
.app-name {
&__company {
font-size: 0.8rem;
font-weight: 500;
color: rgba(var(--text-color), 0.8);
}
}
#user_popup_button {
background-color: rgba(var(--text-color), 0.06);
border-radius: 2rem;
font-size: 0.9rem;
text-overflow: ellipsis;
overflow: hidden;
}
.card {
padding: 1.5rem;
border-radius: 0.5rem;
box-shadow: 0 0 0 1px rgba(var(--text-color), 0.1);
background-color: rgba(var(--foreground-color), 1);
transition: box-shadow 0.2s, background-color 0.2s;
}
#main_page {
display: grid;
min-width: 0;
width: min(72rem, 100%);
margin: auto;
grid-template-columns: minmax(0, 1fr);
align-items: flex-start;
}
#balance_list {
display: flex;
justify-items: flex-start;
gap: 0.5rem;
}
.balance-card {
display: flex;
flex-direction: column;
gap: 0.5rem;
width: 100%;
padding: 0.7rem;
border-radius: 0.5rem;
background-color: rgba(var(--foreground-color), 1);
& > span:last-of-type {
font-weight: 500;
font-size: 1rem;
}
}
#apply_loan {
width: min(64rem, 100%);
margin: auto;
}
#policy_list {
display: grid;
width: 100%;
gap: 0.5rem;
grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}
.policy {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
padding: 1rem;
border-radius: 0.5rem;
background-color: rgba(var(--foreground-color), 1);
box-shadow: 0 0 0 1px rgba(var(--text-color), 0.1);
flex: 1 1 12rem;
& > div {
h5 {
font-weight: 400;
color: rgba(var(--text-color), 0.8);
}
b {
font-size: 1.1rem;
font-weight: 500;
}
}
button {
grid-column: 1/-1;
margin-left: auto;
}
}
#request_loan_form {
label {
display: flex;
align-items: center;
gap: 0.5rem;
input {
height: 1.2em;
width: 1.2em;
}
}
}
.loan {
display: grid;
gap: 1.5rem;
background-color: rgba(var(--foreground-color), 1);
padding: max(1rem, 1.5vw);
border-radius: 0.5rem;
.status {
display: flex;
align-items: center;
gap: 0.5rem;
font-weight: 500;
font-size: 0.9rem;
box-shadow: 0 0.3rem 0.5rem rgba(0, 0, 0, 0.1);
padding: 0.8rem;
border-radius: 0.5rem;
margin-right: auto;
border: solid thin rgba(var(--text-color), 0.2);
.icon {
fill: var(--accent-color);
}
}
}
.loan-process {
display: grid;
gap: 1rem;
background-color: rgba(var(--foreground-color), 1);
padding: max(1rem, 1.5vw);
border-radius: 0.5rem;
--progress-line-thickness: 0.15rem;
&__type {
position: relative;
padding-bottom: 0.5rem;
color: rgba(var(--text-color), 0.8);
margin-right: auto;
&::before {
content: "";
position: absolute;
height: 0.2rem;
width: 40%;
left: 0;
bottom: 0;
transform: translateY(-50%);
border-radius: 0 0.5rem 0.5rem 0;
background-color: var(--accent-color);
}
}
ul {
display: grid;
li {
display: grid;
gap: 1rem;
grid-template-columns: auto 1fr;
&:not(:last-of-type) {
.details {
padding-bottom: 2rem;
}
}
}
}
.progress {
display: grid;
justify-content: center;
justify-items: center;
isolation: isolate;
& > * {
grid-area: 1/1/2/2;
}
}
li.done {
.circle {
border-width: 0.3rem;
border-color: var(--green);
}
.line {
background-color: var(--green);
}
}
.circle {
margin-top: 0.2rem;
width: 0.8rem;
height: 0.8rem;
border-radius: 50%;
background-color: rgba(var(--foreground-color), 1);
z-index: 1;
border: solid var(--progress-line-thickness) rgba(var(--text-color), 0.5);
}
.line {
margin-top: 0.2rem;
width: var(--progress-line-thickness);
height: 100%;
background-color: rgba(var(--text-color), 0.5);
}
.details {
display: grid;
gap: 0.3rem;
button {
margin-top: 0.5rem;
}
}
time {
font-size: 0.9rem;
color: rgba(var(--text-color), 0.8);
}
}
#collateral_requests_list {
display: grid;
gap: 1rem;
grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
}
.collateral-request {
display: flex;
gap: 1.5rem;
flex-direction: column;
background-color: rgba(var(--foreground-color), 1);
padding: 1rem;
b {
color: rgba(var(--text-color), 0.9);
}
}
#loan_requests_list {
display: grid;
gap: 1rem;
align-items: flex-start;
grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
}
.loan-request {
display: flex;
flex-direction: column;
justify-items: flex-start;
gap: 1rem;
background-color: rgba(var(--foreground-color), 1);
padding: 1rem;
border-radius: 0.5rem;
b {
font-weight: 500;
color: rgba(var(--text-color), 0.9);
}
.button {
margin-top: auto;
}
}
#create_policy_form {
padding: 1rem;
width: min(24rem, 100%);
border-radius: 0.5rem;
background-color: rgba(var(--foreground-color), 1);
sm-select {
height: 3.2rem;
flex: 1;
}
}
.banker-request {
padding: max(1rem, 1.5vw);
border-radius: 0.5rem;
}
@media screen and (max-width: 40rem) {
theme-toggle {
order: 2;
}
.landing__section {
flex-direction: column;
&__image-wrapper {
order: 1;
img {
max-height: 50vh;
}
}
&__info-wrapper {
order: 2;
}
}
#user_popup_button {
flex: 1;
order: 1;
}
#balance_list {
overflow-x: auto;
margin: 0 -1rem;
padding: 0 1rem;
padding-bottom: 1.5rem;
margin-bottom: -1.5rem;
scrollbar-width: 0;
&::-webkit-scrollbar {
display: none;
}
}
.balance-card {
flex: 1 1 12rem;
min-width: 42vw;
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
.button {
border: none;
background-color: transparent;
padding: 0.2rem 0;
}
}
.hide-on-small {
display: none !important;
}
}
@media screen and (min-width: 40rem) {
h1 {
font-size: 4vw;
}
sm-popup {
--width: 24rem;
}
.popup__header {
padding: 1.5rem 1.5rem 0 0.75rem;
}
.landing__section {
&:nth-of-type(2n) {
flex-direction: row-reverse;
}
}
#balance_list {
flex-wrap: wrap;
}
#request_loan_popup {
--width: 32rem;
}
}
@media screen and (min-width: 46rem) {
#main_page {
grid-template-columns: 18rem 1fr;
& > :first-child {
position: sticky;
top: 1rem;
overflow-y: auto;
}
}
}
@media (any-hover: hover) {
::-webkit-scrollbar {
width: 0.5rem;
height: 0.5rem;
}
::-webkit-scrollbar-thumb {
background: rgba(var(--text-color), 0.3);
border-radius: 1rem;
&:hover {
background: rgba(var(--text-color), 0.5);
}
}
.interact:not([disabled]) {
transition: background-color 0.3s;
&:hover {
background-color: rgba(var(--text-color), 0.06);
}
}
.button:not([disabled]) {
transition: background-color 0.3s, filter 0.3s;
&:hover {
filter: contrast(2);
}
}
}
@supports (overflow: overlay) {
body {
overflow: overlay;
}
}
.hidden {
display: none !important;
}
::view-transition-old(root) {
animation: slide-up-out 0.3s both;
}
::view-transition-new(root) {
animation: slide-up-in-place 0.3s both;
}
@keyframes slide-up-in-place {
from {
opacity: 0;
transform: translateY(1rem);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slide-up-out {
from {
opacity: 1;
transform: translateY(0);
}
to {
opacity: 0;
transform: translateY(-1rem);
}
}
@media (prefers-reduced-motion) {
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
animation: none !important;
}
}