Created
April 4, 2017 06:05
-
-
Save anonymous/a80f1713a1b2140b3925ac38470c9f26 to your computer and use it in GitHub Desktop.
// source https://jsbin.com/cigurohabe
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
<style id="jsbin-css"> | |
.masonry-layout { | |
column-count: 4; | |
-webkit-column-count: 4; | |
column-gap: 1 ; | |
-webkit-column-gap: 1; | |
} | |
.masonry-layout__panel { | |
break-inside: avoid; | |
-webkit-column-break-inside: avoid; | |
padding: 5px; | |
} | |
.masonry-layout__panel-content { | |
padding: 10px; | |
border-radius: 10px; | |
} | |
.bg--red { | |
background-color: #E74C3C; | |
} | |
.bg--green { | |
background-color: #26A65B; | |
} | |
.bg--purple { | |
background-color: #8E44AD; | |
} | |
.bg--orange { | |
background-color: #F89406; | |
} | |
</style> | |
<html></html> | |
<body> | |
<div class="masonry-layout"> | |
<div class="masonry-layout__panel"> | |
<div class="masonry-layout__panel-content bg--red"> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. </p> | |
</div> | |
</div> | |
<div class="masonry-layout__panel"> | |
<div class="masonry-layout__panel-content bg--orange"> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. </p> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. </p> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. </p> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. </p> | |
</div> | |
</div> | |
<div class="masonry-layout__panel"> | |
<div class="masonry-layout__panel-content bg--green"> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. </p> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. </p> | |
</div> | |
</div> | |
<div class="masonry-layout__panel"> | |
<div class="masonry-layout__panel-content bg--green"> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. </p> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. </p> | |
</div> | |
</div> | |
<div class="masonry-layout__panel"> | |
<div class="masonry-layout__panel-content bg--red"> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. </p> | |
</div> | |
</div> | |
</div> | |
<script id="jsbin-source-html" type="text/html">html | |
body | |
.masonry-layout | |
- var n = 0 | |
- var colors = ["red", "green", "purple", "orange"] | |
while n < 5 | |
- var type = Math.floor(Math.random() * 4 + 1) | |
.masonry-layout__panel | |
.masonry-layout__panel-content(class="bg--#{colors[type - 1]}") | |
- var l = 0 | |
while l < type | |
p. | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus tincidunt mauris non hendrerit. Morbi fringilla vehicula lectus vitae molestie. | |
- l++ | |
- n++</script> | |
<script id="jsbin-source-css" type="text/css">.masonry-layout { | |
column-count: 4; | |
-webkit-column-count: 4; | |
column-gap: 1 ; | |
-webkit-column-gap: 1; | |
} | |
.masonry-layout__panel { | |
break-inside: avoid; | |
-webkit-column-break-inside: avoid; | |
padding: 5px; | |
} | |
.masonry-layout__panel-content { | |
padding: 10px; | |
border-radius: 10px; | |
} | |
.bg--red { | |
background-color: #E74C3C; | |
} | |
.bg--green { | |
background-color: #26A65B; | |
} | |
.bg--purple { | |
background-color: #8E44AD; | |
} | |
.bg--orange { | |
background-color: #F89406; | |
}</script> | |
</body> |
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
.masonry-layout { | |
column-count: 4; | |
-webkit-column-count: 4; | |
column-gap: 1 ; | |
-webkit-column-gap: 1; | |
} | |
.masonry-layout__panel { | |
break-inside: avoid; | |
-webkit-column-break-inside: avoid; | |
padding: 5px; | |
} | |
.masonry-layout__panel-content { | |
padding: 10px; | |
border-radius: 10px; | |
} | |
.bg--red { | |
background-color: #E74C3C; | |
} | |
.bg--green { | |
background-color: #26A65B; | |
} | |
.bg--purple { | |
background-color: #8E44AD; | |
} | |
.bg--orange { | |
background-color: #F89406; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment