Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save craigtommola/349bc65b62c116111327287614606b17 to your computer and use it in GitHub Desktop.
Save craigtommola/349bc65b62c116111327287614606b17 to your computer and use it in GitHub Desktop.
Flexbox Grid with Responsive and Grow Effect
<div class="container">
<div class="grid-row">
<div class="grid-item">
<a class="wrapping-link" href="https://thecodeteam.com/projects/rex-ray/"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top rex-ray">
<span class="centered project-image-bg rex-ray-image"></span>
</div>
</div>
</div>
</div>
<div class="grid-item">
<a class="wrapping-link" href="https://www.dell.com/learn/us/en/555/campaigns/xps-linux-laptop_us" target="_blank"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top sputnik">
<span class="centered project-image-bg sputnik-image"></span>
</div>
</div>
</div>
</div>
<div class="grid-item">
<a class="wrapping-link" href="https://www.edgexfoundry.org/" target="_blank"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top edgex">
<span class="centered project-image-bg edgex-image"></span>
</div>
</div>
</div>
</div>
<div class="grid-item">
<a class="wrapping-link" href="https://www.openswitch.net/" target="_blank"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top openswitch">
<span class="centered project-image-bg openswitch-image"></span>
</div>
</div>
</div>
</div>
<div class="grid-item">
<a class="wrapping-link" href="https://github.com/kubernetes/kubernetes/tree/master/examples/volumes/scaleio" target="_blank"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top scaleio">
<span class="centered project-image-bg scaleio-image"></span>
</div>
</div>
</div>
</div>
<div class="grid-item">
<a class="wrapping-link" href="https://thecodeteam.com/projects/container-storage-interface/"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top csi">
<span class="centered project-image-bg csi-image"></span>
</div>
</div>
</div>
</div>
<div class="grid-item">
<a class="wrapping-link" href="https://thecodeteam.com/projects/kubernetes/"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top kubernetes">
<span class="centered project-image-bg kubernetes-image"></span>
</div>
</div>
</div>
</div>
<div class="grid-item">
<a class="wrapping-link" href="https://grpc.io/" target="_blank"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top grpc">
<span class="centered project-image-bg grpc-image"></span>
</div>
</div>
</div>
</div>
<div class="grid-item">
<a class="wrapping-link" href="https://thecodeteam.com/projects/envoy/"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top envoy">
<span class="centered project-image-bg envoy-image"></span>
</div>
</div>
</div>
</div>
<div class="grid-item">
<a class="wrapping-link" href="https://thecodeteam.com/projects/istio/"></a>
<div class="grid-item-wrapper">
<div class="grid-item-container">
<div class="grid-image-top istio">
<span class="centered project-image-bg istio-image"></span>
</div>
</div>
</div>
</div>
</div>
</div>
@import url("https://fonts.googleapis.com/css?family=Roboto:400,700");
body {
color: #000;
font-family: "Roboto", sans-serif;
font-size: 18px;
font-weight: 400;
line-height: 1.6;
}
.container {
max-width: 1335px;
margin: 0 auto;
}
.grid-row {
display: flex;
flex-flow: row wrap;
justify-content: flex-start;
}
.grid-item {
height: 250px;
flex-basis: 20%;
-ms-flex: auto;
width: 250px;
position: relative;
padding: 10px;
box-sizing: border-box;
}
.grid-row a {
text-decoration: none;
}
.wrapping-link {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 2;
color: currentColor;
}
.grid-item-wrapper {
-webkit-box-sizing: initial;
-moz-box-sizing: initial;
box-sizing: initial;
background: #aaa;
margin: 0;
height: 100%;
width: 100%;
overflow: hidden;
-webkit-transition: padding 0.15s cubic-bezier(0.4,0,0.2,1), margin 0.15s cubic-bezier(0.4,0,0.2,1), box-shadow 0.15s cubic-bezier(0.4,0,0.2,1);
transition: padding 0.15s cubic-bezier(0.4,0,0.2,1), margin 0.15s cubic-bezier(0.4,0,0.2,1), box-shadow 0.15s cubic-bezier(0.4,0,0.2,1);
position: relative;
}
.grid-item-container {
height: 100%;
width: 100%;
position: relative;
}
.grid-image-top {
height: 45%;
width: 120%;
background-size: cover;
position: relative;
background-position: 50% 50%;
left: -10.5%;
top: -4.5%;
display: none;
}
.grid-image-top .centered {
text-align: center;
transform: translate(-50%, -50%);
background-size: contain;
background-repeat: no-repeat;
position: absolute;
top: 54.5%;
left: 50%;
width: 60%;
height: 60%;
background-position: center;
}
.rex-ray-image {
background-image: url(https://thecodeteam.com/wp-content/uploads/2017/08/Rex-Ray-icon-209x300.png);
}
.sputnik-image {
background-image: url(https://thecodeteam.com/wp-content/uploads/2017/08/sputnik-1-300x257.png);
}
.edgex-image {
background-image: url(https://thecodeteam.com/wp-content/uploads/2017/08/edge-x-300x287.png);
}
.openswitch-image {
background-image: url(https://thecodeteam.com/wp-content/uploads/2017/08/open-switch-300x207.png);
}
.scaleio-image {
background-image: url(https://thecodeteam.com/wp-content/uploads/2017/08/K8s_ScaleIO_Color-white-thumb-221x300.png);
}
.csi-image {
background-image: url(https://thecodeteam.com/wp-content/uploads/2017/08/csi-1-300x99.png);
}
.kubernetes-image {
background-image: url(https://thecodeteam.com/wp-content/uploads/2017/08/kubernetes-300x293.png);
}
.grpc-image {
background-image: url(https://thecodeteam.com/wp-content/uploads/2017/08/grpc-300x105.png);
}
.envoy-image {
background-image: url(https://thecodeteam.com/wp-content/uploads/2017/08/envoy_logo-5028052-300x91.png);
}
.istio-image {
background-image: url(https://thecodeteam.com/wp-content/uploads/2017/08/istio-203x300.png);
}
.grid-item-content {
padding: 0 20px 20px 20px;
}
.item-title {
font-size: 24px;
line-height: 26px;
font-weight: 700;
margin-bottom: 18px;
display: block;
}
.item-category {
text-transform: uppercase;
display: block;
margin-bottom: 20px;
font-size: 14px;
}
.item-excerpt {
margin-bottom: 20px;
display: block;
font-size: 14px;
}
.more-info {
position: absolute;
bottom: 0;
margin-bottom: 25px;
padding-left: 0;
transition-duration: .5s;
font-size: 12px;
display: flex;
}
.more-info i {
padding-left: 5px;
transition-duration: .5s;
}
.grid-item:hover .more-info i {
padding-left: 20px;
transition-duration: .5s;
}
.more-info i::before {
font-size: 16px;
}
.grid-item:hover .grid-item-wrapper {
padding: 2% 2%;
margin: -2% -2%;
}
@media(max-width: 1333px) {
.grid-item {
flex-basis: 33.33%;
}
}
@media(max-width: 1073px) {
.grid-item {
flex-basis: 33.33%;
}
}
@media(max-width: 815px) {
.grid-item {
flex-basis: 50%;
}
}
@media(max-width: 620px) {
.col {
clear: both;
float: none;
margin-left: auto;
margin-right: auto;
width: auto !important;
}
}
@media(max-width: 555px) {
.grid-item {
flex-basis: 100%;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment