Font size setting

This commit is contained in:
Romein van Buren 2022-07-18 11:40:44 +02:00
parent d87b2edf66
commit cf4165ec96
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
6 changed files with 50 additions and 47 deletions

View File

@ -111,10 +111,13 @@
<div <div
class="center theme-{$settings.theme}" class="center theme-{$settings.theme}"
style="--cols: {$settings.cols || 4}; --rows: {$settings.rows || 3};" style="
--cols: {$settings.cols || 4};
--rows: {$settings.rows || 3};
font-size: {$settings.fontSize}rem;
"
> >
<div class="ratio"> <div class="ratio">
<div class="content">
<div class="tiles"> <div class="tiles">
{#each tiles as tile (tile.id)} {#each tiles as tile (tile.id)}
<div <div
@ -140,7 +143,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<style> <style>
.center { .center {
@ -154,24 +156,14 @@
} }
.ratio { .ratio {
height: 56.25vw; height: calc(56.25vw - 2rem);
left: 50%; left: 50%;
max-height: 100vh; max-height: calc(100vh - 2rem);
max-width: 177.77778vh; max-width: calc(177.77778vh - 2rem);
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translate(-50%,-50%); transform: translate(-50%,-50%);
width: 100vw; width: calc(100vw - 2rem);
margin: 1rem 0;
display: flex;
justify-content: center;
}
.content {
display: grid;
grid-template-rows: 1fr 40px;
gap: 0.5rem;
width: calc(100% - 2rem);
} }
.tiles { .tiles {
@ -179,7 +171,9 @@
grid-template-columns: repeat(var(--cols), 1fr); grid-template-columns: repeat(var(--cols), 1fr);
grid-template-rows: repeat(var(--rows), 1fr); grid-template-rows: repeat(var(--rows), 1fr);
gap: 1rem; gap: 1rem;
justify-items: stretch; align-items: stretch;
justify-content: stretch;
height: calc(100% - 50px);
} }
.tiles > * { .tiles > * {
@ -194,13 +188,15 @@
.footer { .footer {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: 50px;
font-size: 1.2em;
} }
.pagination em { .pagination em {
display: inline-block; display: inline-block;
margin-left: 0.5rem; margin-left: 0.5rem;
height: 5px; height: 10px;
width: 5px; width: 10px;
border-radius: 5px; border-radius: 5px;
background-color: #fff; background-color: #fff;
opacity: 0.4; opacity: 0.4;

View File

@ -7,6 +7,7 @@ function createSettingsStore() {
theme: 'dark', theme: 'dark',
cols: 4, cols: 4,
rows: 3, rows: 3,
fontSize: 1,
}; };
const s = writable(defaults); const s = writable(defaults);

View File

@ -50,6 +50,7 @@
max-width: 500px; max-width: 500px;
z-index: 11; z-index: 11;
color: var(--body-fg); color: var(--body-fg);
font-size: 1.1rem;
} }
.header { .header {

View File

@ -44,12 +44,17 @@
<label> <label>
Columns Columns
<input type="number" bind:value={$settings.cols} width="10"> <input type="number" bind:value={$settings.cols} width="10" />
</label> </label>
<label> <label>
Rows Rows
<input type="number" bind:value={$settings.rows} width="10"> <input type="number" bind:value={$settings.rows} width="10" />
</label>
<label>
Font size (REMs)
<input type="number" bind:value={$settings.fontSize} width="10" step="0.1" />
</label> </label>
</Modal> </Modal>

View File

@ -18,7 +18,7 @@
<style> <style>
.value { .value {
font-size: 3vw; font-size: 3em;
font-weight: 600; font-weight: 600;
margin-top: auto; margin-top: auto;
} }

View File

@ -89,12 +89,12 @@
.desc .title { .desc .title {
font-weight: 300; font-weight: 300;
font-size: 1.7vw; font-size: 1.3em;
} }
.desc .subtitle { .desc .subtitle {
font-weight: 300; font-weight: 300;
font-size: 1.5vw; font-size: 1.1em;
opacity: 0.7; opacity: 0.7;
} }
@ -106,7 +106,7 @@
.bottom .time { .bottom .time {
margin: auto 0 0 auto; margin: auto 0 0 auto;
opacity: 0.6; opacity: 0.6;
font-size: 1.3vw; font-size: 1em;
text-align: right; text-align: right;
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;