refactor: unify recipe routes into [recipeLang] slug with full bilingual support
Consolidate /rezepte and /recipes routes into single [recipeLang] structure to eliminate code duplication. All pages now use conditional API routing and reactive labels based on language parameter. - Merge duplicate route structures into /[recipeLang] with 404 for invalid slugs - Add English API endpoints for search, favorites, tags, and categories - Implement language dropdown in header with localStorage persistence - Convert all pages to use Svelte 5 runes (, , ) - Add German-only redirects (301) for add/edit pages - Make all view pages (list, detail, filters, search, favorites) fully bilingual - Remove floating language switcher in favor of header dropdown
This commit is contained in:
68
src/routes/[recipeLang]/tips-and-tricks/Converter.svelte
Normal file
68
src/routes/[recipeLang]/tips-and-tricks/Converter.svelte
Normal file
@@ -0,0 +1,68 @@
|
||||
<script>
|
||||
class HefeConverter {
|
||||
constructor(trockenhefe = 1) {
|
||||
this._trockenhefe = trockenhefe;
|
||||
this._frischhefe = this._trockenhefe * 3;
|
||||
}
|
||||
|
||||
get trockenhefe() {
|
||||
return Math.round(this._trockenhefe * 100) / 100 + "g";
|
||||
}
|
||||
|
||||
set trockenhefe(value) {
|
||||
this._trockenhefe = value.replace(/\D/g, '');
|
||||
this._frischhefe = this._trockenhefe * 3;
|
||||
}
|
||||
|
||||
get frischhefe() {
|
||||
return this._frischhefe+"g";
|
||||
}
|
||||
|
||||
set frischhefe(value) {
|
||||
this._frischhefe = value.replace(/\D/g, '');
|
||||
this._trockenhefe = this._frischhefe / 3;
|
||||
}
|
||||
}
|
||||
|
||||
const hefeConverter = new HefeConverter();
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.converter_container {
|
||||
width: fit-content;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
gap: 2rem;
|
||||
background-color: var(--blue);
|
||||
padding: 2rem;
|
||||
margin-inline: auto;
|
||||
align-items: center;
|
||||
}
|
||||
input {
|
||||
width: 5rem;
|
||||
height: 2rem;
|
||||
font-size: 1rem;
|
||||
text-align: center;
|
||||
}
|
||||
.flex_column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
label {
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
</style>
|
||||
<div class=converter_container>
|
||||
<div class="flex_column">
|
||||
<label for="trockenhefe">Trockenhefe</label>
|
||||
<input type="text" bind:value={hefeConverter.trockenhefe} min="0" />
|
||||
</div>
|
||||
<div>
|
||||
=
|
||||
</div>
|
||||
<div class="flex_column">
|
||||
<label for="frischhefe">Frischhefe</label>
|
||||
<input type="text" bind:value={hefeConverter.frischhefe} min="0"/>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user