Skip to content

Commit

Permalink
unit-conversion/energy: Init with watt-hour
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Jul 12, 2024
1 parent 9f03151 commit ed13a3c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Sd from "svelte-material-icons/Sd.svelte";
import Weight from "svelte-material-icons/Weight.svelte";
import Hexadecimal from "svelte-material-icons/Hexadecimal.svelte";
import CubeOutline from "svelte-material-icons/CubeOutline.svelte";
import LightningBolt from "svelte-material-icons/LightningBolt.svelte";

export default {
"Plain text": [
Expand Down Expand Up @@ -104,6 +105,11 @@ export default {
path: "/unit-conversion/volume",
title: "Volume",
icon: CubeOutline
},
{
path: "/unit-conversion/energy",
title: "Energy",
icon: LightningBolt
}
],

Expand Down
16 changes: 16 additions & 0 deletions src/routes/unit-conversion/energy/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script>
import OneColumnView from "$lib/components/one-column-view.svelte";
import Tool from "$lib/components/tool.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>
</Tool>

0 comments on commit ed13a3c

Please sign in to comment.