I am trying to build an imitation of this amazing circular navbar.
Norse has done an amazing job on it
<div class="container-fluid" id="factoid-info-container">
<!-- INFO -->
<div class="row factoid-top factoid-row">
<div class="col-sm-12 factoid-info-center visible-xs" id="center-title-mobile">
<div id="factoid-title-mobile">
<h2>what we do</h2>
</div>
</div>
<div class="col-sm-5">
<div id="factoid-info-7" class="fact text-right">
<h3 class="ft fact-title-7" style="opacity: 0.2;">
47 Countries
</h3>
<p class="factoid-content" id="factoid-content-7" style="display: none;">
Norse Operates In 47 Countries Around The Globe
</p>
</div>
</div>
<div class="col-sm-5 col-sm-offset-2">
<div id="factoid-info-1" class="fact text-left">
<h3 class="ft fact-title-1" style="opacity: 0.2;">
1,500
</h3>
<p class="factoid-content" id="factoid-content-1" style="display: none;">
Norse weighs more than 1,500 actuarial variables in risk score
calculations for every IP address, and resources more than 1M addresses
every day.
</p>
</div>
</div>
</div>
<div class="row factoid-middle factoid-row">
<div class="col-sm-4">
<div id="factoid-info-6" class="fact text-right">
<h3 class="ft fact-title-6" style="opacity: 0.2;">
16,000,000
</h3>
<p class="factoid-content" id="factoid-content-6" style="display: none;">
Norse operates as a tier-1 carrier, controlling more than
16 million ipv4 addresses and operating 6 autonomous systems worldwide
</p>
</div>
</div>
<div class="col-sm-4 col-sm-offset-4">
<div id="factoid-info-2" class="fact text-left">
<h3 class="ft fact-title-2 factoid-color" style="opacity: 1;">
6,000
</h3>
<p class="factoid-content" id="factoid-content-2" style="display: block;">
Norse sensors and honeypots can emulate more than 6,000 commonly-attacked devices and applications.
</p>
</div>
</div>
</div>
<div class="row factoid-bottom factoid-row">
<div class="col-sm-4">
<div id="factoid-info-5" class="fact text-right">
<h3 class="ft fact-title-5" style="opacity: 0.2;">
8,000,000 SENSORS
</h3>
<p class="factoid-content" id="factoid-content-5" style="display: none;">
Norse receives instant attack telemetry from more than 8 million sensors
deployed everywhere in the world.
</p>
</div>
</div>
<div class="col-sm-4">
<div id="factoid-info-4" class="fact text-center">
<h3 class="ft fact-title-4" style="opacity: 0.2;">200,000 TOR NODES</h3>
<p class="factoid-content" id="factoid-content-4" style="display: none;">
Norse Tracks more than 200,000 tor exit nodes: that's
five times more than any other intelligence source
</p>
</div>
</div>
<div class="col-sm-4 col-md-4">
<div id="factoid-info-3" class="fact text-left">
<h3 class="ft fact-title-3" style="opacity: 0.2;">7 PETABYTES</h3>
<p class="factoid-content" id="factoid-content-3" style="display: none;">
Norse’s operates the world’s largest commercial attack intelligence
database, with more than 7 Petabytes of detailed attack histories.
</p>
</div>
</div>
</div>
<div class="hidden-xs" id="center-title">
<div id="factoid-title">
<h2>what we do</h2>
</div>
</div>
<!-- CIRCLE NAV -->
<div class="factoid-nav">
<div id="slider"><div class="jcs-panel noselect" style="border-width: 11px; border-radius: 506px;"><div class="jcs" style="width: 484px; height: 484px; border-radius: 484px;"><span class="jcs-value" style="width: 220px; height: 220px; font-size: 55px; top: 101px; left: 101px;">80</span></div><div class="jcs-indicator" style="width: 55px; height: 55px; top: 200.286px; left: 368.494px; transform: rotate(80deg);"> </div></div></div>
<div id="white-border-slider"></div>
<div id="slider-bg"></div>
</div>
</div>
Has anyone tried to build something like this?
If yes can you give me some direction on how to proceed
Try with this below code it may help you.
$(document).ready(function() {
$(".trigger").click(function() {
$(".menu").toggleClass("active");
});
});
.absolute-center,
.menu,
.menu .btn .fa,
.menu .btn.trigger .line {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translateX(-50%) translateY(-50%);
-ms-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
.menu {
width: 5em;
height: 5em;
}
.menu .btn {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 50%;
background: rgba(255, 015, 255, 0.15);
opacity: 0;
z-index: -10;
cursor: pointer;
-webkit-transition: opacity 1s, z-index 0.3s, -webkit-transform 1s;
transition: opacity 1s, z-index 0.3s, transform 1s;
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
.menu .btn .fa {
font-size: 3em;
-webkit-transition: color 0.3s;
transition: color 0.3s;
}
.menu .btn:hover .fa { color: rgba(255, 255, 255, 0.7); }
.menu .btn.trigger {
opacity: 1;
z-index: 100;
cursor: pointer;
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
}
.menu .btn.trigger:hover {
-webkit-transform: scale(1.2);
-ms-transform: scale(1.2);
transform: scale(1.2);
}
.menu .btn.trigger:hover .line { background-color: rgba(255, 255, 255, 0.7); }
.menu .btn.trigger:hover .line:before,
.menu .btn.trigger:hover .line:after { background-color: rgba(255, f15, 255, 0.7); }
.menu .btn.trigger .line {
width: 60%;
height: 6px;
background: #000;
border-radius: 6px;
-webkit-transition: background-color 0.3s, height 0.3s, top 0.3s;
transition: background-color 0.3s, height 0.3s, top 0.3s;
}
.menu .btn.trigger .line:before,
.menu .btn.trigger .line:after {
content: "";
display: block;
position: absolute;
left: 0;
width: 100%;
height: 6px;
background: #000;
border-radius: 6px;
-webkit-transition: background-color 0.3s, -webkit-transform 0.3s;
transition: background-color 0.3s, transform 0.3s;
}
.menu .btn.trigger .line:before {
top: -12px;
-webkit-transform-origin: 15% 100%;
-ms-transform-origin: 15% 100%;
transform-origin: 15% 100%;
}
.menu .btn.trigger .line:after {
top: 12px;
-webkit-transform-origin: 25% 30%;
-ms-transform-origin: 25% 30%;
transform-origin: 25% 30%;
}
.menu .rotater {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
}
.menu.active .btn-icon {
opacity: 1;
z-index: 50;
}
.menu.active .trigger .line {
height: 0px;
top: 45%;
}
.menu.active .trigger .line:before {
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
width: 110%;
}
.menu.active .trigger .line:after {
-webkit-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
width: 110%;
}
/* horrible things are happening here
for some reason nth-child(1) is always busy and elements starting from 2 */
.rotater:nth-child(1) {
-webkit-transform: rotate(-22.5deg);
-ms-transform: rotate(-22.5deg);
transform: rotate(-22.5deg);
}
.menu.active .rotater:nth-child(1) .btn-icon {
-webkit-transform: translateX(-10em) rotate(22.5deg);
-ms-transform: translateX(-10em) rotate(22.5deg);
transform: translateX(-10em) rotate(22.5deg);
}
.rotater:nth-child(2) {
-webkit-transform: rotate(22.5deg);
-ms-transform: rotate(22.5deg);
transform: rotate(22.5deg);
}
.menu.active .rotater:nth-child(2) .btn-icon {
-webkit-transform: translateX(-10em) rotate(-22.5deg);
-ms-transform: translateX(-10em) rotate(-22.5deg);
transform: translateX(-10em) rotate(-22.5deg);
}
.rotater:nth-child(3) {
-webkit-transform: rotate(67.5deg);
-ms-transform: rotate(67.5deg);
transform: rotate(67.5deg);
}
.menu.active .rotater:nth-child(3) .btn-icon {
-webkit-transform: translateX(-10em) rotate(-67.5deg);
-ms-transform: translateX(-10em) rotate(-67.5deg);
transform: translateX(-10em) rotate(-67.5deg);
}
.rotater:nth-child(4) {
-webkit-transform: rotate(112.5deg);
-ms-transform: rotate(112.5deg);
transform: rotate(112.5deg);
}
.menu.active .rotater:nth-child(4) .btn-icon {
-webkit-transform: translateX(-10em) rotate(-112.5deg);
-ms-transform: translateX(-10em) rotate(-112.5deg);
transform: translateX(-10em) rotate(-112.5deg);
}
.rotater:nth-child(5) {
-webkit-transform: rotate(157.5deg);
-ms-transform: rotate(157.5deg);
transform: rotate(157.5deg);
}
.menu.active .rotater:nth-child(5) .btn-icon {
-webkit-transform: translateX(-10em) rotate(-157.5deg);
-ms-transform: translateX(-10em) rotate(-157.5deg);
transform: translateX(-10em) rotate(-157.5deg);
}
.rotater:nth-child(6) {
-webkit-transform: rotate(202.5deg);
-ms-transform: rotate(202.5deg);
transform: rotate(202.5deg);
}
.menu.active .rotater:nth-child(6) .btn-icon {
-webkit-transform: translateX(-10em) rotate(-202.5deg);
-ms-transform: translateX(-10em) rotate(-202.5deg);
transform: translateX(-10em) rotate(-202.5deg);
}
.rotater:nth-child(7) {
-webkit-transform: rotate(247.5deg);
-ms-transform: rotate(247.5deg);
transform: rotate(247.5deg);
}
.menu.active .rotater:nth-child(7) .btn-icon {
-webkit-transform: translateX(-10em) rotate(-247.5deg);
-ms-transform: translateX(-10em) rotate(-247.5deg);
transform: translateX(-10em) rotate(-247.5deg);
}
.rotater:nth-child(8) {
-webkit-transform: rotate(292.5deg);
-ms-transform: rotate(292.5deg);
transform: rotate(292.5deg);
}
.menu.active .rotater:nth-child(8) .btn-icon {
-webkit-transform: translateX(-10em) rotate(-292.5deg);
-ms-transform: translateX(-10em) rotate(-292.5deg);
transform: translateX(-10em) rotate(-292.5deg);
}
.rotater:nth-child(9) {
-webkit-transform: rotate(337.5deg);
-ms-transform: rotate(337.5deg);
transform: rotate(337.5deg);
}
.menu.active .rotater:nth-child(9) .btn-icon {
-webkit-transform: translateX(-10em) rotate(-337.5deg);
-ms-transform: translateX(-10em) rotate(-337.5deg);
transform: translateX(-10em) rotate(-337.5deg);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<div class="menu">
<div class="btn trigger">
<span class="line"></span>
</div>
<div class="icons">
<div class="rotater">
<div class="btn btn-icon">
<i class="fa fa-codepen"></i>
</div>
</div>
<div class="rotater">
<div class="btn btn-icon">
<i class="fa fa-facebook"></i>
</div>
</div>
<div class="rotater">
<div class="btn btn-icon">
<i class="fa fa-google-plus"></i>
</div>
</div>
<div class="rotater">
<div class="btn btn-icon">
<i class="fa fa-twitter"></i>
</div>
</div>
<div class="rotater">
<div class="btn btn-icon">
<i class="fa fa-dribbble"></i>
</div>
</div>
<div class="rotater">
<div class="btn btn-icon">
<i class="fa fa-linkedin"></i>
</div>
</div>
<div class="rotater">
<div class="btn btn-icon">
<i class="fa fa-github"></i>
</div>
</div>
<div class="rotater">
<div class="btn btn-icon">
<i class="fa fa-behance"></i>
</div>
</div>
</div>
</div>
Related
I have problem with CSS below. In div with class front text is blurred like on this image
I'm using Chrome, but on every browser I see same blurred text. I want keep every div but I'm not sure what makes this text so blurred.
How I can fix it to make it no blure?
JsFiddle
HTML and CSS
.main {
margin: auto;
height: auto;
padding-top: 25px;
}
.panel {
width: 45%;
display: inline-block;
margin: 14px;
}
.est {
box-shadow: 0 0 0 #fff;
background-color: transparent;
}
.flip .back {
-webkit-transform: rotateY(360deg);
-moz-transform: rotateY(360deg);
-ms-transform: rotateY(360deg);
-o-transform: rotateY(360deg);
transform: rotateY(360deg);
}
#card-1,
#card-2,
#card-3,
#card-4,
#card-5 {
height: 300px;
width: 100%;
margin: 0 auto;
z-index: 1;
display: inline-block;
perspective: 700px;
}
h4,
.h4 {
font-size: 20px;
}
body {
font-size: 14px;
font-family: Roboto, sans-serif;
line-height: 1.35;
color: #222;
background: #f4f5f7;
text-rendering: optimizeLegibility;
padding: 0;
left: 0;
right: 0;
transition-duration: 200ms;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.front {
-webkit-transform: rotateY(0);
-moz-transform: rotateY(0);
-ms-transform: rotateY(0);
-o-transform: rotateY(0);
transform: rotateY(0);
z-index: 1;
}
.back,
.front {
border: 1px solid #ddd;
height: 100%;
top: 0;
transform-style: preserve-3d;
backface-visibility: hidden;
}
.back,
.front,
.front .info-box,
.social-bar {
position: absolute;
left: 0;
width: 100%;
}
.ease {
-webkit-transition: all .45s ease-out;
-moz-transition: all .45s ease-out;
-ms-transition: all .45s ease-out;
-o-transition: all .45s ease-out;
transition: all .45s ease-out;
}
.e-i-f-about,
.front,
.p-class-earn,
.strike {
overflow: hidden;
}
.back,
.flip .front {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.back,
.front {
border: 1px solid #ddd;
height: 100%;
top: 0;
transform-style: preserve-3d;
backface-visibility: hidden;
}
.back,
.front,
.front .info-box,
.social-bar {
position: absolute;
left: 0;
width: 100%;
}
.back {
background-color: #fff;
display: table;
z-index: 2;
font-size: 13px;
line-height: 23px;
padding: 10px 20px;
height: 320px;
}
<div class="main pad-2">
<center>
<h4>Not blurred text</h4>
<div class="panel e-b est" style="margin-top:0">
<div class="wrapper">
<div id="card-1">
<div class="front ease">
Click
<div class="info-box">
<div class="info">
<h4>test1 blurred text</h4>
</div>
</div>
</div>
<div class="back ease">
2nd text here
</div>
</div>
</div>
</div>
<div class="panel e-b est" style="margin-top:0">
<div class="wrapper">
<div id="card-2">
<div class="front ease">
Click
<div class="info-box">
<div class="info">
<h4>test2 blurred text</h4>
</div>
</div>
</div>
<div class="back ease">
2nd text here
</div>
</div>
</div>
</div>
</center>
</div>
I am trying to make some hover effects over an image. See a demosite here. I am getting stuck now, because I would like the box there is coming when you hover to be centered on each image, no matter what the image size is.
I have tried to place the hover with padding, but that is not a good solution. Does anybody knows how I can center the gradient overlay on each picture, no matter the size og the picture?
.hovereffect {
width: 100%;
height: 100%;
float: left;
overflow: hidden;
position: relative;
text-align: center;
cursor: default;
}
.hovereffect .overlay {
width: 100%;
height: 100%;
position: absolute;
overflow: hidden;
top: 0;
left: 0;
-webkit-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.hovereffect:hover .overlay {
background-color: rgba(170,170,170,0.4);
}
.hovereffect h2, .hovereffect img {
-webkit-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.hovereffect img {
display: block;
position: relative;
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1);
}
.hovereffect:hover img {
-webkit-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.hovereffect h2 {
text-transform: uppercase;
color: #fff;
text-align: center;
position: relative;
font-size: 17px;
padding: 10px;
background: rgba(0, 0, 0, 0.6);
}
.hovereffect a.info {
display: inline-block;
text-decoration: none;
padding: 7px 14px;
text-transform: uppercase;
color: #fff;
border: 1px solid #fff;
margin: 50px 0 0 0;
background-color: transparent;
opacity: 0;
filter: alpha(opacity=0);
-webkit-transform: scale(1.5);
-ms-transform: scale(1.5);
transform: scale(1.5);
-webkit-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
font-weight: normal;
height: 85%;
width: 85%;
position: absolute;
top: -20%;
left: 8%;
padding: 70px;
}
.hovereffect:hover a.info {
opacity: 1;
filter: alpha(opacity=100);
-webkit-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
background-color: rgba(0,0,0,0.4);
}
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="hovereffect">
<img class="img-responsive" src="https://www.capitalhyundai.ca/wp-content/uploads/sites/385/2017/08/2017-hyundai-elantra-gt-interior-view.jpg" alt="text"></img>
<div class="overlay">
<a class="info" href="#">link here</a>
</div>
</div>
</div>
</div>
<br/><br/>
<div class="row">
<div class="col-sm-5">
<div class="hovereffect">
<img class="img-responsive" src="https://www.carzone.ie/newcar/assets/img/models/kiasportage-abb0540cd673ba0e6dd80d5e1edc9c64.jpg" alt="text"></img>
<div class="overlay">
<a class="info" href="#">link here</a>
</div>
</div>
</div>
</div>
<br/><br/>
<div class="row">
<div class="col-sm-3">
<div class="hovereffect">
<img class="img-responsive" src="http://solcontrolcustomsandtint.com/wp-content/uploads/2014/09/car-audio-system-sound-4.jpg" alt="text"></img>
<div class="overlay">
<a class="info" href="#">link here</a>
</div>
</div>
</div>
</div>
</div>
Firt make the image container inline-block so that its width is defined by its content then you can easily adjust the overlay:
.hovereffect {
display:inline-block;
overflow: hidden;
position: relative;
text-align: center;
cursor: default;
}
.hovereffect .overlay {
width: 100%;
height: 100%;
position: absolute;
overflow: hidden;
top: 0;
left: 0;
transition: all 0.4s ease-in-out;
}
.hovereffect:hover .overlay {
background-color: rgba(170,170,170,0.4);
}
.hovereffect h2, .hovereffect img {
transition: all 0.4s ease-in-out;
}
.hovereffect img {
display: block;
position: relative;
transform: scale(1.1);
}
.hovereffect:hover img {
transform: scale(1);
}
.hovereffect h2 {
text-transform: uppercase;
color: #fff;
text-align: center;
position: relative;
font-size: 17px;
padding: 10px;
background: rgba(0, 0, 0, 0.6);
}
.hovereffect a.info {
text-decoration: none;
text-transform: uppercase;
color: #fff;
border: 1px solid #fff;
background-color: transparent;
opacity: 0;
transform: scale(1.5);
transition: all 0.4s ease-in-out;
font-weight: normal;
height: 85%;
width: 85%;
top:7.5%; /* (100% - 85%)/2 */
left:7.5%;
position: absolute;
}
.hovereffect:hover a.info {
opacity: 1;
transform: scale(1);
background-color: rgba(0,0,0,0.4);
}
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="hovereffect">
<img class="img-responsive" src="https://www.capitalhyundai.ca/wp-content/uploads/sites/385/2017/08/2017-hyundai-elantra-gt-interior-view.jpg" alt="text"></img>
<div class="overlay">
<a class="info" href="#">link here</a>
</div>
</div>
</div>
</div>
<br/><br/>
<div class="row">
<div class="col-sm-5">
<div class="hovereffect">
<img class="img-responsive" src="https://www.carzone.ie/newcar/assets/img/models/kiasportage-abb0540cd673ba0e6dd80d5e1edc9c64.jpg" alt="text"></img>
<div class="overlay">
<a class="info" href="#">link here</a>
</div>
</div>
</div>
</div>
<br/><br/>
<div class="row">
<div class="col-sm-3">
<div class="hovereffect">
<img class="img-responsive" src="http://solcontrolcustomsandtint.com/wp-content/uploads/2014/09/car-audio-system-sound-4.jpg" alt="text"></img>
<div class="overlay">
<a class="info" href="#">link here</a>
</div>
</div>
</div>
</div>
</div>
I have 4 images on my site and display 2 vertically with 2 horizontal images next to these in a grid.
The problem I'm having is that the images line up correctly when the page is desktop size but when it is scaled down to mobile the images will scale differently and look out of alignment
As you can see the vertical images on the left don't scale to fit the container height, is there a way to stretch these images to match the container height?
How can I get the images to stay aligned at all times?
* {
box-sizing: border-box;
}
.home-promo-wrap {
display: flex;
flex-wrap: wrap;
}
.home-promo-cell {
display: flex;
flex: 0 0 50%;
}
.gridA {
display:flex;
flex-wrap: wrap;
flex: 1 1 auto;
}
.gridB {
display:flex;
flex-wrap: wrap;
}
.cell {
display: flex;
flex: 0 0 50%;
padding: 10px;
}
.gridB .cell:nth-child(1) {
flex: 0 0 100%;
}
.gridB .cell:nth-child(2) {
flex: 0 0 100%;
}
.text-vertical {
position: absolute;
top: 0;
left: 0;
right: 0;
color: #000;
z-index: 1;
text-align: center;
background: rgba( 255,255,255,0.6);
padding: 20px;
}
.inner-cell-vertical:hover .text-vertical {
background: rgba(255,255,255,0);
transition: background 0.8s ease;
}
.inner-cell-vertical {
position: relative;
overflow: hidden;
background: #ff00ff;
}
.inner-cell-vertical img {
width: 100%;
height: auto;
display: block;
overflow:hidden;
}
.inner-cell-vertical::after {
content:'\A';
position:absolute;
width:100%; height:100%;
top:0; left:0;
background:rgba(255,255,255,.6);
animation-name: fadeFromtop;
-webkit-animation-name: fadeFromtop;
animation-duration: 300ms;
-webkit-animation-duration: 300ms;
animation-timing-function: ease-out;
-webkit-animation-timing-function: ease-out;
animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
overflow: hidden;
}
.inner-cell-vertical:hover .text {
bottom: 50%;
transform: translateY(50%);
-webkit-transform: translateY(50%);
-moz-transform: translateY(50%);
-o-transform: translateY(50%);
}
.text {
position: absolute;
top:0;
left:0;
padding-left: 35px;
padding-bottom: 17px;
transition: all 0.5s ease;
height: 100%;
}
a {
display: flex;
}
a:hover .inner-cell-vertical:after {
animation-name: fadeFromBottom;
-webkit-animation-name: fadeFromBottom;
animation-duration: 300ms;
-webkit-animation-duration: 300ms;
animation-timing-function: ease-in;
-webkit-animation-timing-function: ease-in;
animation-fill-mode: forwards;
opacity:1;
overflow: hidden;
}
#keyframes fadeFromBottom {
0%{
opacity:0;
-webkit-transform: translateY(100%);
-moz-transform: translateY(100%);
-ms-transform: translateY(100%);
-o-transform: translateY(100%);
transform: translateY(100%);
}
100%{
opacity: 1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
-o-transform: translateY(0px);
transform: translateY(0px);
display: block;
}
}
#keyframes fadeFromtop {
0%{
opacity:1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
-o-transform: translateY(0px);
transform: translateY(0px);
}
100%{
opacity: 0;
-webkit-transform: translateY(100%);
-moz-transform: translateY(100%);
-ms-transform: translateY(400%);
-o-transform: translateY(100%);
transform: translateY(100%);
}
}
<div class="home-promo-wrap">
<div class="home-promo-cell">
<div class="gridA">
<div class="cell">
<a>
<div class="inner-cell-vertical">
<div class="text-vertical">
<h2>
</h2>
<p class="text-desc">
</p>
</div><img class="img-responsive" src="https://plissee-jalousien-rollos.de/media/wysiwyg/categories_1_1.jpg" alt="" /></div>
</a>
</div>
<div class="cell">
<a>
<div class="inner-cell-vertical">
<div class="text-vertical">
<h2>
</h2>
<p class="text-desc">
</p>
</div>
<img class="img-responsive" src="https://plissee-jalousien-rollos.de/media/wysiwyg/categories_1_1.jpg" alt="" />
</div>
</a>
</div>
</div>
</div>
<div class="home-promo-cell">
<div class="gridB">
<div class="cell">
<a>
<div class="inner-cell-vertical">
<div class="text-vertical">
<h2>
</h2>
<p class="text-desc">
</p>
</div>
<img class="img-responsive" src="https://plissee-jalousien-rollos.de/media/wysiwyg/categories_1_3.jpg" alt="" />
</div>
</a>
</div>
<div class="cell">
<a>
<div class="inner-cell-vertical">
<div class="text-vertical">
<h2>
</h2>
<p class="text-desc">
</p>
</div>
<img class="img-responsive" src="https://plissee-jalousien-rollos.de/media/wysiwyg/categories_1_4.jpg" alt="" />
</div>
</a>
</div>
</div>
</div>
</div>
If to keep the img you could use object-fit.
Note, object-fit has limits when it comes to browser support: https://caniuse.com/#feat=object-fit
If you need better browser support, here is a sample using background-image: jsfiddle demo.
The main with this version is to set a height and nested flex containers.
Stack snippet
* {
box-sizing: border-box;
}
.home-promo-wrap {
display: flex;
flex-wrap: wrap;
}
.home-promo-cell {
display: flex;
flex: 0 0 50%;
}
.gridA {
display:flex;
flex-wrap: wrap;
flex: 1 1 auto;
}
.gridB {
display:flex;
flex-wrap: wrap;
}
.cell {
display: flex;
flex: 0 0 50%;
padding: 10px;
}
.gridB .cell:nth-child(1) {
flex: 0 0 100%;
}
.gridB .cell:nth-child(2) {
flex: 0 0 100%;
}
.text-vertical {
position: absolute;
top: 0;
left: 0;
right: 0;
color: #000;
z-index: 1;
text-align: center;
background: rgba( 255,255,255,0.6);
padding: 20px;
}
.inner-cell-vertical:hover .text-vertical {
background: rgba(255,255,255,0);
transition: background 0.8s ease;
}
.inner-cell-vertical {
position: relative;
overflow: hidden;
background: #ff00ff;
}
.inner-cell-vertical img {
width: 100%;
height: 100%; /* changed */
display: block;
overflow:hidden;
object-fit: cover; /* added */
}
.inner-cell-vertical::after {
content:'\A';
position:absolute;
width:100%; height:100%;
top:0; left:0;
background:rgba(255,255,255,.6);
animation-name: fadeFromtop;
-webkit-animation-name: fadeFromtop;
animation-duration: 300ms;
-webkit-animation-duration: 300ms;
animation-timing-function: ease-out;
-webkit-animation-timing-function: ease-out;
animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
overflow: hidden;
}
.inner-cell-vertical:hover .text {
bottom: 50%;
transform: translateY(50%);
-webkit-transform: translateY(50%);
-moz-transform: translateY(50%);
-o-transform: translateY(50%);
}
.text {
position: absolute;
top:0;
left:0;
padding-left: 35px;
padding-bottom: 17px;
transition: all 0.5s ease;
height: 100%;
}
a {
display: flex;
}
a:hover .inner-cell-vertical:after {
animation-name: fadeFromBottom;
-webkit-animation-name: fadeFromBottom;
animation-duration: 300ms;
-webkit-animation-duration: 300ms;
animation-timing-function: ease-in;
-webkit-animation-timing-function: ease-in;
animation-fill-mode: forwards;
opacity:1;
overflow: hidden;
}
#keyframes fadeFromBottom {
0%{
opacity:0;
-webkit-transform: translateY(100%);
-moz-transform: translateY(100%);
-ms-transform: translateY(100%);
-o-transform: translateY(100%);
transform: translateY(100%);
}
100%{
opacity: 1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
-o-transform: translateY(0px);
transform: translateY(0px);
display: block;
}
}
#keyframes fadeFromtop {
0%{
opacity:1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
-o-transform: translateY(0px);
transform: translateY(0px);
}
100%{
opacity: 0;
-webkit-transform: translateY(100%);
-moz-transform: translateY(100%);
-ms-transform: translateY(400%);
-o-transform: translateY(100%);
transform: translateY(100%);
}
}
<div class="home-promo-wrap">
<div class="home-promo-cell">
<div class="gridA">
<div class="cell">
<a>
<div class="inner-cell-vertical">
<div class="text-vertical">
<h2>
</h2>
<p class="text-desc">
</p>
</div><img class="img-responsive" src="https://plissee-jalousien-rollos.de/media/wysiwyg/categories_1_1.jpg" alt="" /></div>
</a>
</div>
<div class="cell">
<a>
<div class="inner-cell-vertical">
<div class="text-vertical">
<h2>
</h2>
<p class="text-desc">
</p>
</div>
<img class="img-responsive" src="https://plissee-jalousien-rollos.de/media/wysiwyg/categories_1_1.jpg" alt="" />
</div>
</a>
</div>
</div>
</div>
<div class="home-promo-cell">
<div class="gridB">
<div class="cell">
<a>
<div class="inner-cell-vertical">
<div class="text-vertical">
<h2>
</h2>
<p class="text-desc">
</p>
</div>
<img class="img-responsive" src="https://plissee-jalousien-rollos.de/media/wysiwyg/categories_1_3.jpg" alt="" />
</div>
</a>
</div>
<div class="cell">
<a>
<div class="inner-cell-vertical">
<div class="text-vertical">
<h2>
</h2>
<p class="text-desc">
</p>
</div>
<img class="img-responsive" src="https://plissee-jalousien-rollos.de/media/wysiwyg/categories_1_4.jpg" alt="" />
</div>
</a>
</div>
</div>
</div>
</div>
I believe its a one line change at line number 64 in the css.
height: auto; to height: 100%;
.inner-cell-vertical img {
width: 100%;
height: 100%;
display: block;
overflow:hidden;
}
Here is the Pen. Please let me know whether this helps.
I have a 3D Tab on my website which I got from codepen (codepen.io/vavik96/pen/QjPVRL).
I increased the width (800px) and height (550px).
No matter how much I tried I couldn't set a right size to it.
It should be screen web page sized to meet my needs.
Somebody help me.
Here my work.
.perspective {
-webkit-perspective: 76em;
perspective: 76em;
-webkit-perspective-origin: 50% 50px;
perspective-origin: 50% 50px;
width: 494px;
margin: 0 auto;
font-family: 'Roboto', sans-serif;
font-weight: 100;
color: #fff;
text-align: center;
}
input { display: none; }
.tab {
position: absolute;
width: 80px;
height: 70px;
background: pink;
right: 0;
line-height: 70px;
font-weight: 300;
}
.tab:nth-child(1) {
top: -80px;
left:84px;
background: #06D6A0;
}
.tab:nth-child(2) {
top: -80px;
left: 174px;
background: #1B9AAA;
}
.tab:nth-child(3) {
top: -80px;
left: 262px;
background: #EF476F;
}
.tab:nth-child(4) {
top: -80px;
left: 352px;
background: red;
}
.cube {
position: relative;
width: 300px;
height: 200px;
-webkit-transform-origin: 0 100px;
-ms-transform-origin: 0 100px;
transform-origin: 100px 100px;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transition: -webkit-transform 0.5s ease-in;
transition: transform 0.5s ease-in;
}
.tab-content {
width: 800px;
height: 550px;
position: absolute;
}
.tab-content h1 {
font-size: 25px;
margin: 75px 0 10px;
font-weight: 300;
}
.tab-content p { font-size: 12px; }
.tab-content:nth-child(1) {
-webkit-transform: translateZ(100px);
transform: translateZ(700px);
background: #06D6A0;
}
.tab-content:nth-child(2) {
-webkit-transform: rotateX(-270deg) translateY(-100px);
transform: rotateY(270deg) translateX(-100px);
-webkit-transform-origin: top left;
-ms-transform-origin: top left;
transform-origin: top left;
background: #EF476F;
}
.tab-content:nth-child(3) {
-webkit-transform: rotateX(90deg) translateY(200px);
transform: rotateY(90deg) translateX(100px);
-webkit-transform-origin: bottom center;
-ms-transform-origin: bottom center;
transform-origin: bottom right;
background: red;
}
.tab-content:nth-child(4) {
-webkit-transform: translateZ(100px);
transform: translateZ(-100px);
background: #1B9AAA;
}
#tab-one:checked ~ .cube {
-webkit-transform: rotateY(90deg);
transform: rotateY(-90deg);
}
#tab-two:checked ~ .cube {
-webkit-transform: rotateX(0deg);
transform: rotateX(0deg);
}
#tab-three:checked ~ .cube {
-webkit-transform: rotateX(-90deg);
transform: rotateY(-180deg);
}
#tab-four:checked ~ .cube {
-webkit-transform: rotateX(90deg);
transform: rotateY(-270deg);
}
<br>
<br>
<br>
<br>
<br>
<div class="perspective">
<label class="tab" for="tab-two">Tab 2</label>
<label class="tab" for="tab-one">Tab 1</label>
<label class="tab" for="tab-three">Tab 3</label>
<label class="tab" for="tab-four">Tab 4</label>
<input type="radio" name="tabs" id="tab-one">
<input type="radio" name="tabs" id="tab-two">
<input type="radio" name="tabs" id="tab-three">
<input type="radio" name="tabs" id="tab-four">
<div class="cube">
<div class="tab-content">
<h1>Tab 1</h1>
<p>THIS IS AWESOME</p>
</div>
<div class="tab-content">
<h1>Tab 2</h1>
<p>THIS IS COOL</p>
</div>
<div class="tab-content">
<h1>Tab 3</h1>
<p>THIS IS SWEET</p>
</div>
<div class="tab-content">
<h1>Tab 4</h1>
<p>THIS IS Good JOB</p>
</div>
</div>
</div>
width: 100% !important;
please add your code to your question next time you ask someone to help you.
.featured_widgets {
margin: 4% 0px;
}
.featured_widgets .columns {
display: table;
margin-bottom: 20px;
text-align: center;
}
.featured_widgets .widget_box {
height: 156px;
text-align: center;
margin: 0px 1%;
vertical-align: middle;
width: 100%;
display: table-cell;
padding: 0px 20px;
}
.featured_widgets .widget_box .front img {
height: 120px;
}
.featured_widgets .widget_box .front {
height: 140px;
}
.featured_widgets .widget_box .back {
height: 140px;
padding-top: 40px;
color: #fff;
font-size: 17px;
}
.featured_widgets .columns .title {
display: table-row;
}
.featured_widgets .columns .title h5 {
color: #999;
padding: 0px 15px;
font-size: 15px;
}
.flip-container {
transform: perspective(1000px);
transform-style: preserve-3d;
}
.flip-container:hover .back,
.flip-container.hover .back {
transform: rotateY(0deg);
}
.flip-container:hover .front,
.flip-container.hover .front {
transform: rotateY(180deg);
}
.flipper {
perspective: 800px;
perspective-origin: 50% 100px;
position: relative;
transform: perspective(1000px);
transform-style: preserve-3d;
transition: all 0.6s ease 0s;
}
.front,
.back {
backface-visibility: hidden;
position: relative;
transform: rotateY(0deg);
transform-style: preserve-3d;
transition: all 1s ease 0.3s;
}
.front {
z-index: 2;
}
.back {
margin-top: -180px;
text-align: center;
transform: rotateY(-180deg);
}
.vertical.flip-container {
position: relative;
}
.vertical .back {
transform: rotateX(180deg);
}
.vertical.flip-container .flipper {
transform-origin: 100% 213.5px 0;
}
.vertical.flip-container:hover .back,
.vertical.flip-container.hover .back {
transform: rotateX(0deg);
}
.vertical.flip-container:hover .front,
.vertical.flip-container.hover .front {
transform: rotateX(180deg);
}
.seagreen_bg {
background: #1cbec9;
}
.inxblue_bg {
background: #0075ba;
}
.inxorange_bg {
background: #f37b20;
}
.inxyellow_bg {
background: #fdb813;
}
.btn_line {
border: 1px solid #fff;
border-radius: 5px;
display: inline-block;
font-size: 14px;
font-weight: normal;
margin-top: 10px;
padding: 8px 15px;
color: #fff;
}
.btn_line:hover {
background: #333 none repeat scroll 0 0;
border: 1px solid #000;
color: #fff;
text-decoration: none;
}
<div class="container">
<div class="row featured_widgets">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 columns flip-container vertical">
<div class="widget_box flipper seagreen_bg">
<div class="front">
<img src="https://cdn.sparkfun.com/assets/9/9/2/5/e/51f9a101757b7f032ab7f724.png" alt="">
</div>
<div class="back">
<h5>text text text text text text.</h5>
<h5><a class="btn_line" href="#">Learn More ›</a></h5>
</div>
</div>
<div class="title">
<h4>text</h4>
<h5>text text text text text text.</h5>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 columns flip-container vertical">
<div class="widget_box flipper inxblue_bg">
<div class="front">
<img src="https://cdn.sparkfun.com/assets/9/9/2/5/e/51f9a101757b7f032ab7f724.png" alt="">
</div>
<div class="back">
<h5>text text text text text text.</h5>
<h5><a class="btn_line" href="#">Learn More ›</a></h5>
</div>
</div>
<div class="title">
<h4>text</h4>
<h5>text text text text text text.</h5>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 columns flip-container vertical">
<div class="widget_box flipper inxorange_bg">
<div class="front">
<img src="https://cdn.sparkfun.com/assets/9/9/2/5/e/51f9a101757b7f032ab7f724.png" alt="">
</div>
<div class="back">
<h5>text text text text text text.</h5>
<h5><a class="btn_line" href="#">Learn More ›</a></h5>
</div>
</div>
<div class="title">
<h4>text</h4>
<h5>text text text text text text</h5>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 columns flip-container vertical">
<div class="widget_box flipper inxyellow_bg">
<div class="front">
<img src="https://cdn.sparkfun.com/assets/9/9/2/5/e/51f9a101757b7f032ab7f724.png" alt="">
</div>
<div class="back">
<h5>text text text text text text.</h5>
<h5><a class="btn_line" href="">Learn More ›</a></h>
</div>
</div>
<div class="title">
<h4>text</h4>
<h5>text</h5>
</div>
</div>
</div>
</div>
You need the -webkit- prefix to make it work in safari:
-webkit-transform: rotateY(180deg);
See compatibility table:
http://caniuse.com/#search=transform
Try This-
.featured_widgets {
margin: 4% 0px;
}
.featured_widgets .columns {
display: table;
margin-bottom: 20px;
text-align: center;
}
.featured_widgets .widget_box {
height: 156px;
text-align: center;
margin: 0px 1%;
vertical-align: middle;
width: 100%;
display: table-cell;
padding: 0px 20px;
}
.featured_widgets .widget_box .front img {
height: 120px;
}
.featured_widgets .widget_box .front {
height: 140px;
}
.featured_widgets .widget_box .back {
height: 140px;
padding-top: 40px;
color: #fff;
font-size: 17px;
}
.featured_widgets .columns .title {
display: table-row;
}
.featured_widgets .columns .title h5 {
color: #999;
padding: 0px 15px;
font-size: 15px;
}
.flip-container {
transform:perspective(1000px);
-moz-transform:perspective(1000px);
-ms-transform:perspective(1000px);
-o-transform:perspective(1000px);
-webkit-transform:perspective(1000px);
transform-style:preserve-3d;
}
.flip-container:hover .back ,
.flip-container.hover .back {
transform: rotateY(0deg);
-moz-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
-o-transform: rotateY(0deg);
-webkit-transform: rotateY(0deg);
}
.flip-container:hover .front ,
.flip-container.hover .front {
transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
-webkit-transform: rotateY(180deg);
}
.flipper {
perspective: 800px;
perspective-origin: 50% 100px;
position: relative;
transform: perspective(1000px);
-moz-transform: perspective(1000px);
-ms-transform: perspective(1000px);
-o-transform: perspective(1000px);
-webkit-transform: perspective(1000px);
transform-style: preserve-3d;
transition: all 0.6s ease 0s;
-moz-transition: all 0.6s ease 0s;
-ms-transition: all 0.6s ease 0s;
-o-transition: all 0.6s ease 0s;
-webkit-transition: all 0.6s ease 0s;
}
.front {
backface-visibility: hidden;
position: relative;
transform: rotateY(0deg);
-moz-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
-o-transform: rotateY(0deg);
-webkit-transform: rotateY(0deg);
transform-style: preserve-3d;
transition: all 1s ease 0.3s;
-moz-transition: all 1s ease 0.3s;
-ms-transition: all 1s ease 0.3s;
-o-transition: all 1s ease 0.3s;
-webkit-transition: all 1s ease 0.3s;
z-index: 2;
}
.back {
backface-visibility: hidden;
position: relative;
transform: rotateY(0deg);
-moz-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
-o-transform: rotateY(0deg);
-webkit-transform: rotateY(0deg);
transform-style: preserve-3d;
transition: all 1s ease 0.3s;
-moz-transition: all 1s ease 0.3s;
-ms-transition: all 1s ease 0.3s;
-o-transition: all 1s ease 0.3s;
-webkit-transition: all 1s ease 0.3s;
}
.back {
margin-top: -180px;
text-align: center;
transform: rotateY(-180deg);
-moz-transform: rotateY(-180deg);
-ms-transform: rotateY(-180deg);
-o-transform: rotateY(-180deg);
-webkit-transform: rotateY(-180deg);
}
.vertical.flip-container {
position: relative;
}
.vertical .back {
transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
-o-transform: rotateX(180deg);
-webkit-transform: rotateX(180deg);
}
.vertical.flip-container .flipper {
transform-origin: 100% 213.5px 0;
}
.vertical.flip-container:hover .back ,
.vertical.flip-container.hover .back {
transform: rotateX(0deg);
-moz-transform: rotateX(0deg);
-ms-transform: rotateX(0deg);
-o-transform: rotateX(0deg);
-webkit-transform: rotateX(0deg);
}
.vertical.flip-container:hover .front ,
.vertical.flip-container.hover .front {
transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
-o-transform: rotateX(180deg);
-webkit-transform: rotateX(180deg);
}
.seagreen_bg {
background: #1cbec9;
}
.inxblue_bg {
background: #0075ba;
}
.inxorange_bg {
background: #f37b20;
}
.inxyellow_bg {
background: #fdb813;
}
.btn_line {
border: 1px solid #fff;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
display: inline-block;
font-size: 14px;
font-weight: normal;
margin-top: 10px;
padding: 8px 15px;
color: #fff;
}
.btn_line:hover {
background: #333 none repeat scroll 0 0;
border: 1px solid #000;
color: #fff;
text-decoration: none;
}