Skip to content

Commit

Permalink
chore: clean up code
Browse files Browse the repository at this point in the history
increase package version
  • Loading branch information
milafrerichs committed Sep 5, 2019
1 parent 0935b06 commit 0c659b0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "javascript-repl",
"svelte": "src/Repl.svelte",
"module": "index.mjs",
"version": "0.3.0",
"version": "0.4.0",
"description": "",
"main": "index.js",
"author": "Mila Frerichs <[email protected]>",
Expand Down
6 changes: 3 additions & 3 deletions src/Console.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import Result from './Result.svelte';
import { onMount } from 'svelte';
export let output;
import { code } from './stores.js'
let message = '';
$: if(output) {
$: if($code) {
message = `
document.body.innerHTML = '';
var consoleOutput = '';
Expand All @@ -17,7 +17,7 @@
consoleOutput += message + '<br />';
}
};
${output}
${$code}
document.body.innerHTML = '';
document.body.innerHTML = consoleOutput;
`
Expand Down
2 changes: 1 addition & 1 deletion src/ViewerConsole.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<Viewer />
</div>
<div class:hidden="{tab != 'console'}" class="{cssStyles.console}">
<Console output={$code}/>
<Console />
</div>
</div>
</div>
39 changes: 9 additions & 30 deletions src/layouts/Default.svelte
Original file line number Diff line number Diff line change
@@ -1,49 +1,28 @@
<script>
import {
files,
currentFileIndex
currentFileIndex
} from './../stores.js'
export let cssStyles;
//maybe add the file change here
function showFile(fileIndex) {
//currentFile.content = currentContent;
currentFileIndex.set(fileIndex);
}
</script>

<style>
.hidden {
visibility: hidden;
}
.content-container {
transition-property: all;
transition-duration: .5s;
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
}
.hide-content .content-container{
max-width: 0;
overflow-x: hidden;
}
.hide-content .result-container {
width: 95%;
}
</style>

<div class="{cssStyles.container}" >
<div class="result-container {cssStyles.resultContainer}">
<div class="{cssStyles.editor}">
<div class="{cssStyles.editorActions.container}">
{#each $files as { name }, i}
<div class="{cssStyles.editorActions.tabItem}">
<a class:active="{$currentFileIndex == i}" class="{cssStyles.editorActions.link}" on:click="{() => showFile(i)}">{name}</a>
</div>
{/each}
<div class="{cssStyles.editor}">
<div class="{cssStyles.editorActions.container}">
{#each $files as { name }, i}
<div class="{cssStyles.editorActions.tabItem}">
<a class:active="{$currentFileIndex == i}" class="{cssStyles.editorActions.link}" on:click="{() => showFile(i)}">{name}</a>
</div>
<slot name="editor">
</slot>
{/each}
</div>
<slot name="editor"></slot>
</div>
<slot name="viewer-console"></slot>
</div>
</div>
2 changes: 0 additions & 2 deletions src/layouts/MinimalReverse.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<script>
export let cssStyles;
export let showEditor;
export let tab;
</script>

<div class="{cssStyles.container}" >
Expand Down

0 comments on commit 0c659b0

Please sign in to comment.