Skip to content

Commit

Permalink
add visibility toggle to main page
Browse files Browse the repository at this point in the history
  • Loading branch information
cdriesler committed Jan 20, 2020
1 parent 21961ab commit 990b2aa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Major+Mono+Display&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Nova+Mono&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<title>glasshopper</title>
</head>
<body>
Expand Down
41 changes: 29 additions & 12 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,25 @@
>
sandbox
</router-link>
<router-link
<!-- <router-link
to="/g"
class="tab"
>
glossary
</router-link>
<router-link
to="/t"
class="tab"
>
tutorials
</router-link>
</router-link> -->
</div>
<div class="toggles">
<div class="toggle" />
<div class="toggle" />
<div class="toggle" />
<div class="toggle" @pointerdown="toggleGraphVisibility">
<i class="material-icons"> {{ visibilityIcon }}</i>
</div>
</div>
</nav>
<footer>
<div class="footer__title">
glasshopper.io
</div>
<div class="footer__version">
0.4.0
0.4.1
</div>
</footer>
</div>
Expand All @@ -53,6 +47,16 @@ export default Vue.extend({
GraphEditor,
GraphScene
},
methods: {
toggleGraphVisibility(): void {
this.$store.dispatch('toggleFocus');
}
},
computed: {
visibilityIcon(): string {
return this.$store.state.focus === 'graph' ? 'visibility' : 'visibility_off'
}
}
})
</script>

Expand Down Expand Up @@ -144,6 +148,19 @@ nav {
box-sizing: border-box;
border: 0.7mm solid black;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.toggle:hover {
cursor: pointer;
}
.toggle > * {
font-size: 18px;
}
.tabs {
Expand Down

0 comments on commit 990b2aa

Please sign in to comment.