Skip to content

Instantly share code, notes, and snippets.

@davidtaylorhq
Created April 7, 2021 16:24
Show Gist options
  • Save davidtaylorhq/3f47fe7d0a68a65c0b53ec3f04b3ad5a to your computer and use it in GitHub Desktop.
Save davidtaylorhq/3f47fe7d0a68a65c0b53ec3f04b3ad5a to your computer and use it in GitHub Desktop.
Slidein
import Component from '@ember/component';
export default Component.extend({
actions: {
toggle(){
this.set("shouldShow", !this.shouldShow);
}
}
})
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.update-banner {
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
background-color: yellow;
overflow: none;
animation: slidein 1s linear;
animation-fill-mode: forwards;
}
@keyframes slidein {
from {
height: 0px;
}
to {
height: 50px;
}
}
<br>
<br>
{{outlet}}
<br>
<br>
{{my-component}}
{{#if shouldShow}}
<div class="update-banner"></div>
{{/if}}
<button {{action "toggle"}}>Click me</button>
{
"version": "0.17.1",
"EmberENV": {
"FEATURES": {},
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": false,
"_APPLICATION_TEMPLATE_WRAPPER": true,
"_JQUERY_INTEGRATION": true
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.js",
"ember": "3.18.1",
"ember-template-compiler": "3.18.1",
"ember-testing": "3.18.1"
},
"addons": {
"@glimmer/component": "1.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment