Skip to content

Instantly share code, notes, and snippets.

@nicksteffens
Created April 12, 2018 21:31
Show Gist options
  • Save nicksteffens/9227d30e754b34889bed40a47be6e8a2 to your computer and use it in GitHub Desktop.
Save nicksteffens/9227d30e754b34889bed40a47be6e8a2 to your computer and use it in GitHub Desktop.
Masonry Attempt via CSS & Sort Order
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
images: [
'https://placem.at/people?w=150&h=150&txt=1',
'https://placem.at/people?w=150&h=250&txt=2',
'https://placem.at/people?w=150&h=100&txt=3',
'https://placem.at/people?w=150&h=110&txt=4',
'https://placem.at/people?w=150&h=180&txt=5',
'https://placem.at/people?w=150&h=150&txt=6',
'https://placem.at/people?w=150&h=120&txt=7',
]
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.image-gallery {
list-style-type: none;
}
.image-gallery.column,
.image-gallery.masonry {
column-count: 3;
column-gap: 5px;
}
.image-gallery.grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-column-gap: 5px;
}
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<h2>Mansonry Via Sort</h2>
{{image-gallery images=images modifier="masonry"}}
<h2>Column-Count layout</h2>
{{image-gallery images=images modifier="column"}}
<h2>Grid Layout</h2>
{{image-gallery images=images modifier="grid"}}
{
"version": "0.13.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment