Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanqui committed Nov 27, 2024
1 parent d01287f commit 55e7210
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 26 deletions.
12 changes: 10 additions & 2 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ code {
padding: 3px;
}

button, input {
button {
background: transparent;
border: none;
padding: 0;
margin: 0;
font-family: 'Barlow', sans-serif;
}

button:not(.link), input {
border: 2px solid var(--color-primary);
background: transparent;
padding: 8px 16px;
Expand All @@ -75,7 +83,7 @@ button, input {
cursor: pointer;
}

button.active, input.active {
button:not(.link).active, input.active {
background: var(--color-primary);
color: white;
}
Expand Down
4 changes: 0 additions & 4 deletions src/lib/AssetBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
margin-left: 16px;
flex-shrink: 0;
}
.asset-photo a {
display: block;
}
.asset-img {
margin-left: 32px;
Expand Down
1 change: 0 additions & 1 deletion src/lib/BlogBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
</script>

<div class="blog-box">
<!-- TODO this should probably be h3 -->
<h3>
<a href="{href}">
{title}
Expand Down
8 changes: 6 additions & 2 deletions src/lib/BurgerButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@
}
</style>

<button class:open onclick={() => open = !open}
style="transition: color {duration}s ease-in-out; color: {open ? 'var(--color-bg)' : 'var(--color-primary)'};">
<button
class:open
onclick={() => open = !open}
aria-label="{open ? 'close' : 'open'} menu"
style="transition: color {duration}s ease-in-out; color: {open ? 'var(--color-bg)' : 'var(--color-primary)'};"
>
<svg width=32 height=32>
<line id="top" x1=0 y1=9 x2=32 y2=9 style="transition: transform {duration}s ease-in-out, opacity {duration}s ease-in-out;"/>
<line id="mid" x1=0 y1=18.5 x2=32 y2=18.5 style="transition: transform {duration}s ease-in-out, opacity {duration}s ease-in-out;"/>
Expand Down
23 changes: 16 additions & 7 deletions src/lib/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
{#each menuItems as menuItem}
<li>
<a href="{menuItem.url}" onclick={() => burgerMenuOpen=false}>
<Loc cs="{menuItem.cs}" en="{menuItem.en}" />
<Loc cs={menuItem.cs} en={menuItem.en} />
</a>
</li>
{/each}
Expand All @@ -73,21 +73,24 @@
<!-- XXX this is a temporary hack -->
{#if menuItem.submenu}
<li>
<a
<button
class="link"
style="cursor: pointer;"
onclick={() => currentExpandedMenu = currentExpandedMenu?.url == menuItem.url ? null : menuItem}
onkeyup={() => currentExpandedMenu = currentExpandedMenu?.url == menuItem.url ? null : menuItem}
tabindex="0"
>
<Loc
cs="{menuItem.cs} &nbsp;{currentExpandedMenu == menuItem ? '' : ''}"
en="{menuItem.en} &nbsp;{currentExpandedMenu == menuItem ? '' : ''}"
/>
</a>
</button>
{#if currentExpandedMenu}
<ul class="dropdown" transition:slide>
{#each menuItem.submenu as subMenuItem}
<li>
<a href="{subMenuItem.url}" onclick={resetExpandedMenu}>
<Loc cs="{subMenuItem.cs}" en="{subMenuItem.en}" />
<Loc cs={subMenuItem.cs} en={subMenuItem.en} />
</a>
</li>
{/each}
Expand All @@ -97,7 +100,7 @@
{:else}
<li>
<a href="{menuItem.url}" onclick={resetExpandedMenu}>
<Loc cs="{menuItem.cs}" en="{menuItem.en}" />
<Loc cs={menuItem.cs} en={menuItem.en} />
</a>
</li>
{/if}
Expand Down Expand Up @@ -168,15 +171,21 @@
border-left: none;
}
a {
a, button {
color: inherit;
text-transform: uppercase;
text-decoration: none;
white-space: nowrap;
user-select: none;
border: none;
font-size: inherit;
padding: 0;
margin: 0;
font-weight: normal;
font-family: 'Barlow', sans-serif;
}
a:hover {
a:hover, button:hover {
text-decoration: underline;
}
Expand Down
5 changes: 3 additions & 2 deletions src/lib/InterviewAudio.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
<script lang="ts">
import IntersectionObserver from "svelte-intersection-observer";
import AudioPlayer from './AudioPlayer.svelte';
import type { InterviewData } from "$src/types";
interface Props {
data: InterviewData;
}
let { data }: Props = $props();
let element: HTMLElement = $state();
let intersecting: boolean = $state();
let element: HTMLElement | undefined = $state();
let intersecting: boolean | undefined = $state();
let threshold: number = 1;
</script>

Expand Down
14 changes: 8 additions & 6 deletions src/lib/LanguageSwitcher.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import { lang } from '../stores.js';
import { page } from '$app/stores';
let langValue: "en" | "cs" = $state();
let langValue: "en" | "cs" = $state("cs");
lang.subscribe(value => {
langValue = value;
langValue = value as "en" | "cs";
})
function setLangEn() {
Expand All @@ -20,9 +20,9 @@
<!-- Currently only the homepage is localized -->
{#if $page.url.pathname == '/'}
{#if langValue == 'cs'}
<a onclick={setLangEn} onkeyup={setLangEn}>switch to english</a>
<button class="link" onclick={setLangEn} onkeyup={setLangEn}>switch to english</button>
{:else}
<a onclick={setLangCs} onkeyup={setLangCs}>přepnout do češtiny</a>
<button class="link" onclick={setLangCs} onkeyup={setLangCs}>přepnout do češtiny</button>
{/if}
{/if}
</div>
Expand All @@ -31,15 +31,17 @@
div {
margin-bottom: -12px;
}
a {
button {
user-select: none;
color: inherit;
text-transform: uppercase;
text-decoration: none;
white-space: nowrap;
cursor: pointer;
font-size: 90%;
}
a:hover {
button:hover {
text-decoration: underline;
}
</style>
4 changes: 2 additions & 2 deletions src/lib/Loc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
let { cs, en }: Props = $props();
let langValue: "en" | "cs" = $state();
let langValue: "en" | "cs" = $state("cs");
lang.subscribe(value => {
langValue = value;
langValue = value as "en" | "cs";
})
</script>

Expand Down

0 comments on commit 55e7210

Please sign in to comment.