Skip to content

Commit

Permalink
unit-conversion/energy: Add Joules (closes #56)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Jul 12, 2024
1 parent ed13a3c commit 66b5d79
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/routes/unit-conversion/energy/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
<script>
import OneColumnView from "$lib/components/one-column-view.svelte";
import Tool from "$lib/components/tool.svelte";
import TwoColumnView from "$lib/components/two-column-view.svelte";
import SingleUnit from "../single-unit.svelte";
let from = "watt-hour";
let baseValue = 1;
</script>

<Tool>
<OneColumnView title="Energy Conversion">
<SingleUnit bind:baseValue={baseValue} bind:from={from} to="watt-hour" name="Watt-hour" />
<SingleUnit bind:baseValue={baseValue} bind:from={from} to="kilowatt-hour" name="Killowatt-hour" />
<SingleUnit bind:baseValue={baseValue} bind:from={from} to="megawatt-hour" name="Megawatt-hour" />
</OneColumnView>
<TwoColumnView leftTitle="Watt-hours" rightTitle="Joules">
<div slot="left">
<SingleUnit bind:baseValue={baseValue} bind:from={from} to="watt-hour" name="Watt-hour" />
<SingleUnit bind:baseValue={baseValue} bind:from={from} to="kilowatt-hour" name="Killowatt-hour" />
<SingleUnit bind:baseValue={baseValue} bind:from={from} to="megawatt-hour" name="Megawatt-hour" />
</div>

<div slot="right">
<SingleUnit bind:baseValue={baseValue} bind:from={from} to="joules" name="Joules" />
<SingleUnit bind:baseValue={baseValue} bind:from={from} to="kilojoules" name="Kilojoules" />
<SingleUnit bind:baseValue={baseValue} bind:from={from} to="megajoules" name="Megajoules" />
<SingleUnit bind:baseValue={baseValue} bind:from={from} to="gigajoules" name="Gigajoules" />
</div>
</TwoColumnView>
</Tool>

0 comments on commit 66b5d79

Please sign in to comment.