CSS tweaks & modal escape

This commit is contained in:
Romein van Buren 2023-02-23 10:29:45 +01:00
parent bd9444f30f
commit 9c8b939fc0
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
3 changed files with 10 additions and 14 deletions

View File

@ -3,8 +3,8 @@ html, body {
--body-fg: #fff;
--tile-bg: #181818;
--grey: grey;
--red: red;
--green: green;
--red: #f00;
--green: #1d641d;
--dark: #0a0a0a;
--radius: 10px;
--cols: 4;
@ -17,10 +17,11 @@ html, body {
}
.theme-light {
--body-bg: #fff;
--body-bg: #d6d6d6;
--body-fg: #000;
--tile-bg: #dedede;
--dark: #c2c2c2;
--green: #377137;
}
.mb {

View File

@ -4,24 +4,21 @@
export let title = '';
export let open = false;
function close() {
open = false;
}
function keyup(event) {
function keydown(event) {
if (event.key === 'Escape') {
close();
event.preventDefault();
open = false;
}
}
</script>
<svelte:window on:keyup={keyup} />
<svelte:window on:keydown={keydown} />
<div class="modal-bg theme-{$settings.theme}" class:open>
<div class="modal">
<div class="header">
<div class="title">{title}</div>
<button class="close" on:click={close}>&times;</button>
<button class="close" on:click={() => open = false}>&times;</button>
</div>
<div class="body">
@ -38,7 +35,6 @@
right: 0;
bottom: 0;
padding-top: 3rem;
background-color: rgba(0, 0, 0, 0.4);
align-items: center;
justify-content: center;
display: none;

View File

@ -7,11 +7,10 @@
export let value;
export let date;
export let since;
export let weight = 600;
</script>
<Tile {title} {subtitle} {color} {date} {since}>
<div class="value {color}" style:font-weight={weight}>
<div class="value {color}">
{value}
</div>
</Tile>