2023-01-10 16:28:27 +00:00
|
|
|
<script>
|
2023-01-15 11:09:27 +00:00
|
|
|
import CodeViewer from './codeviewer.svelte';
|
|
|
|
|
2023-01-10 16:28:27 +00:00
|
|
|
export let code = '';
|
2023-01-15 11:09:27 +00:00
|
|
|
|
|
|
|
let modalCode = '';
|
2023-01-10 16:28:27 +00:00
|
|
|
</script>
|
|
|
|
|
2023-01-15 11:09:27 +00:00
|
|
|
<div class="examplecode" on:pointerdown={() => modalCode = code}>
|
2023-01-10 16:28:27 +00:00
|
|
|
<strong>CLI command</strong>
|
|
|
|
<code>{code}</code>
|
|
|
|
</div>
|
|
|
|
|
2023-01-15 11:09:27 +00:00
|
|
|
<CodeViewer bind:code={modalCode} language="js" />
|
|
|
|
|
2023-01-10 16:28:27 +00:00
|
|
|
<style>
|
|
|
|
.examplecode {
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
border-radius: 10px;
|
|
|
|
padding: 0.5rem;
|
|
|
|
opacity: 0.6;
|
|
|
|
}
|
|
|
|
|
|
|
|
strong {
|
|
|
|
display: inline-block;
|
|
|
|
margin-right: 1rem;
|
|
|
|
font-weight: 700;
|
|
|
|
}
|
|
|
|
|
|
|
|
code {
|
|
|
|
user-select: all;
|
|
|
|
}
|
|
|
|
</style>
|