Skip to content

Commit

Permalink
add console component, terminal icon
Browse files Browse the repository at this point in the history
  • Loading branch information
SriNandan33 committed Jun 6, 2020
1 parent bb15425 commit b7e3940
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 3 deletions.
7 changes: 7 additions & 0 deletions public/images/code.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions src/components/Console.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<div class="console">
<div class="console__header"></div>
</div>
</template>

<script>
export default {}
</script>

<style lang="scss" scoped>
.console {
height: 100%;
width: 100%;
overflow-y: auto;
border-top: 2px solid #1f364d;
.console__header {
height: 35px;
background-color: black;
}
}
</style>
23 changes: 22 additions & 1 deletion src/components/Toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
@input="changeLanguage"
></multiselect>
</div>
<div class="column">
<div class="column actions">
<div class="terminal-icon" @click="$emit('toggle-console')">
<img src="/images/code.svg" height="50px" width="50px" alt="console" />
</div>
<button class="button btn-secondary" disabled>Run</button>
<button class="button btn-secondary" @click="save">Save</button>
</div>
</div>
Expand Down Expand Up @@ -96,4 +100,21 @@ export default {
.languages >>> .multiselect__option {
text-transform: capitalize;
}
.actions {
display: flex;
justify-content: space-around;
}
.actions .terminal-icon {
border: 2px solid #1f364d;
width: 40px;
height: 40px;
padding: 10px;
border-radius: 5px;
cursor: pointer;
margin-left: 5px;
}
.actions button {
margin-left: 5px;
}
</style>
18 changes: 16 additions & 2 deletions src/views/Room.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
:options="cmOptions"
@input="onCmCodeChange"
/>
<Console v-if="showConsole" />
<Toolbar
:language="room.language"
:name="room.name"
@change-language="changeLanguage"
@edit-name="updateName"
@save="updateRoom"
@toggle-console="toggleConsole"
/>
</div>
<div class="column is-half drawing-board">
Expand All @@ -26,6 +28,7 @@
</template>

<script>
import Console from '../components/Console'
import Toolbar from '../components/Toolbar'
import DrawingBoard from '../components/DrawingBoard'
import { codemirror } from 'vue-codemirror'
Expand All @@ -42,6 +45,7 @@ import 'codemirror/theme/monokai.css'
export default {
components: {
codemirror,
Console,
Toolbar,
DrawingBoard
},
Expand All @@ -67,7 +71,8 @@ export default {
languageModes: {
python: 'x-python',
javascript: 'javascript'
}
},
showConsole: false
}
},
computed: {
Expand Down Expand Up @@ -98,6 +103,9 @@ export default {
},
updateName(name) {
this.room.name = name
},
toggleConsole() {
this.showConsole = !this.showConsole
}
}
}
Expand All @@ -118,8 +126,14 @@ export default {
border: 3px solid #1f364d;
background: #001528;
}
.dashboard .columns .code-editor {
height: calc(100vh - 50px);
display: flex;
flex-direction: column;
justify-content: stretch;
}
.vue-codemirror {
height: 80vh;
height: 100%;
border-radius: 4px;
}
.vue-codemirror >>> .CodeMirror {
Expand Down

0 comments on commit b7e3940

Please sign in to comment.