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

View File

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

View File

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

View File

@ -44,12 +44,17 @@
<label>
Columns
<input type="number" bind:value={$settings.cols} width="10">
<input type="number" bind:value={$settings.cols} width="10" />
</label>
<label>
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>
</Modal>

View File

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

View File

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