Skip to content

Commit

Permalink
Added sidebar logic to toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
nwittwer committed Jan 6, 2019
1 parent 952747d commit 9ca5921
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions src/components/Toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,24 @@
>
<div id="toolbar__recentURLs"></div>
</div>
<div
@click="toggleSidebar()"
v-if="artboards.length"
v-bind:class="{'button--is-active': sidebar}"
class="button"
>Sizes</div>
</div>
</template>

<script>
export default {
name: "Toolbar",
computed: {
// Bind to our Vuex Store's URL value
sidebar() {
return this.$store.state.gui.sidebar;
},
url: {
// Bind to our Vuex Store's URL value
get() {
return this.$store.state.url;
},
Expand All @@ -33,6 +42,12 @@ export default {
artboards: function() {
return this.$store.state.artboards;
}
},
methods: {
toggleSidebar() {
const newState = !this.sidebar;
this.$store.commit("toggleSidebar", newState);
}
}
};
</script>
Expand All @@ -57,27 +72,27 @@ export default {
}
& > *:nth-child(1) {
flex: 1 0 auto;
}
flex: 1 0 auto;
}
input[type="text"] {
border: none;
box-sizing: border-box;
padding: 0.5rem;
background: #ffffff;
input[type="text"] {
border: none;
box-sizing: border-box;
padding: 0.5rem;
background: #ffffff;
border: 1px solid #979797;
border-radius: 4px;
border-radius: 4px;
transition: all 0.125s ease-in-out;
width: 200px;
&:hover {
background: lighten($body-bg, 5%);
}
&:hover {
background: lighten($body-bg, 5%);
}
&:focus {
outline: none;
background: lighten($body-bg, 3%);
border: 1px solid rgba($accent-color, 1);
&:focus {
outline: none;
background: lighten($body-bg, 3%);
border: 1px solid rgba($accent-color, 1);
width: 400px;
}
}
Expand Down Expand Up @@ -105,11 +120,11 @@ export default {
#canvas-controls__fit-to-screen {
margin-top: 0.25rem;
}
}
}
a {
text-decoration: none;
}
}
#toolbar__url-container {
position: relative;
Expand Down

0 comments on commit 9ca5921

Please sign in to comment.