Last active
March 14, 2017 09:40
-
-
Save davismj/d8d069d6af9efb366175073093547caa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<nav class="sidebar ${isOpen ? 'open' : 'closed'}"> | |
<button click.delegate="toggle()"> | |
hamburger | |
</button> | |
</nav> | |
<main class="main"></main> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.sidebar { | |
position: absolute; | |
top: 0; | |
left: 0; | |
bottom: 0; | |
transition: width ease-in-out 250ms; | |
& .open { | |
width: 260px; | |
} | |
& .closed { | |
width: 50px; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class AppViewModel { | |
isOpen: boolean; | |
toggle() { | |
this.isOpen = !this.isOpen; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment