aotds-docks/src/lib/components/Output/Json.svelte

34 lines
653 B
Svelte
Raw Normal View History

2020-07-30 00:29:21 +00:00
<aside transition:fade>
2020-07-28 22:00:39 +00:00
<pre><code>{json}</code></pre>
</aside>
<script>
export let ship = {};
let json;
2022-03-01 17:42:33 +00:00
$: json = JSON.stringify(ship, null, 2);
2020-07-28 22:00:39 +00:00
2022-03-01 17:42:33 +00:00
import { fly, fade } from "svelte/transition";
import { createEventDispatcher } from "svelte";
2020-07-28 22:00:39 +00:00
2022-03-01 17:42:33 +00:00
const dispatch = createEventDispatcher();
const close = () => dispatch("close");
2020-07-28 22:00:39 +00:00
</script>
<style>
pre {
font-family: monospace;
font-size: var(--font-scale-9);
overflow: scroll;
height: 90%;
}
div {
2022-03-01 17:42:33 +00:00
text-align: right;
2020-07-28 22:00:39 +00:00
}
aside {
padding: 1em;
border: 3px solid var(--indigo-dye);
border-radius: 1em;
font-size: var(--font-scale-11);
}
</style>