Skip to content

Instantly share code, notes, and snippets.

@k-fish
Last active September 16, 2019 13:42
Show Gist options
  • Save k-fish/1ae4900c9fa6d2f57b4d4df1f6c36fb6 to your computer and use it in GitHub Desktop.
Save k-fish/1ae4900c9fa6d2f57b4d4df1f6c36fb6 to your computer and use it in GitHub Desktop.
Flex Tiles
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.flexParent {
position: relative;
}
.overlay {
position: absolute;
top: 0;
height: 100%;
width: 100%;
z-index: 2;
background-color: rgba(0,0,0,0.1);
}
<h1>Flex</h1>
<br>
<br>
<div class="flexParent">
<div style="display: flex; padding: 10px; background-color: red;">
<div style="flex: 1; background-color: blue;">
{{my-component}}
</div>
<div style=" width: 2px; background-color: black; display: flex;">
<div style="height: 5px; position:absolute; top: 0; margin-top: 52px; width: calc(30% - 60px); margin-left: calc(-15% + 30px); z-index: 2; background-color: gray; border-radius: 2px;"></div>
</div>
<div style="flex: 1; background-color: green;">
{{my-component long=true}}
</div>
<div style=" width: 2px; background-color: black;">
<div style="height: 5px; position:absolute; top: 0; margin-top: 52px; width: calc(30% - 60px); margin-left: calc(-15% + 30px); z-index: 2; background-color: gray; border-radius: 2px;"></div>
</div>
<div style="flex: 1; background-color: yellow;">
{{my-component}}
</div>
</div>
</div>
<br>
<br>
<div style="display: flex; flex-direction: column; height: 100%;">
<div style="display: flex; align-items: center; justify-content: center; padding: 20px;">
<div style="border-radius: 50%; width: 50px; height: 50px; background-color: white">
</div>
</div>
<div style="text-align: center; padding: 10px; flex: 1;">
{{#if long}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut feugiat ex vitae nulla placerat accumsan. Vivamus vel aliquam lectus, id posuere dolor
{{/if}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut feugiat ex vitae nulla placerat accumsan. Vivamus vel aliquam lectus, id posuere dolor
</div>
<div style="text-align: center; padding: 10px; margin-bottom: 10px;">
<button> Click me</button>
</div>
</div>
{
"version": "0.15.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.2.2",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2"
},
"addons": {
"ember-data": "3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment