Css3 transform not applying - css

I m trying to achieve this.
The smooth hover animation is not applied and the image goes up beyond the div (as shown in pic) in Chrome.
ASPX:
<div class="favDiv">
<table width="100%" cellspacing="15">
<tr>
<td width="30%">
<div class="grid effect">
<figure>
<asp:Image ID="img" runat="server" width="100%" height="150px"
Imageurl="~/abc.jpg"/>
<figCaption>
<h5>Test</h5>
</figCaption>
</figure>
</div>
</td>
<td width="70%"></td>
</tr>
</table>
</div>
CSS:
.favDiv
{
//to centre div in the page
display:inline-block;
position:fixed;
top:0;
bottom:0;
left:0;
right:0;
width:65%;
height:65%;
margin:auto;
}
.grid
{
border:1px solid gray;
height:150px;
}
figure
{
padding:0;
margin:0;
position:relative;
}
figCaption
{
position:absolute;
top:0;
left:0;
width:100%;
background:#2c3f52;
color:#ed4e6e;
}
figCaption h5
{
margin:0;
padding:0;
color:#fff;
}
.effect figure
{
overflow:hidden;
}
.effect figure:hover img
{
-webkit-transform:translateY(-50px);
-moz-transform:translateY(-50px);
}
.effect figCaption
{
height:50px;
width:100%;
top:auto;
bottom:0;
opacity:0;
-webkit-transform:translateY(100%);
-moz-transform:translateY(100%);
-webkit-transition:transform 0.4s, opacity 0.1s 0.3s;
-moz-transition:transform 0.4s, opacity 0.1s 0.3s;
}
.effect figure:hover figCaption
{
opacity:1;
-webkit-transform:translateY(0px);
-moz-transform:translateY(0px);
-webkit-transition:transform 0.4s, opacity 0.1s 0.3s;
-moz-transition:transform 0.4s, opacity 0.1s 0.3s;
}
What am i missing here?

Your code is not working because Tympanus wrote styles for non-touch devices. Its defined by mordernizr (Automatically add class to body).
I have modified the fiddle. Now its working fine.
Working Demo
HTML
<div class="favDiv">
<table width="100%" cellspacing="15">
<tr>
<td width="70%">
<div class="grid cs-style-3">
<figure>
<img src="http://tympanus.net/Tutorials/CaptionHoverEffects/images/3.png" alt="img03">
<figcaption>
<h3>test</h3>
</figcaption>
</figure>
</div>
</td>
<td width="70%"></td>
</tr>
</table>
</div>
CSS
.grid {
padding: 20px 20px 100px 20px;
max-width: 1300px;
margin: 0 auto;
list-style: none;
text-align: center;
}
.grid li {
display: inline-block;
width: 440px;
margin: 0;
padding: 20px;
text-align: left;
position: relative;
}
.grid figure {
margin: 0;
position: relative;
}
.grid figure img {
max-width: 100%;
display: block;
position: relative;
}
.grid figcaption {
position: absolute;
top: 0;
left: 0;
padding: 20px;
background: #2c3f52;
color: #ed4e6e;
}
.grid figcaption h3 {
margin: 0;
padding: 0;
color: #fff;
}
/* Caption Style 3 */
.cs-style-3 figure {
overflow: hidden;
}
.cs-style-3 figure img {
-webkit-transition: -webkit-transform 0.4s;
-moz-transition: -moz-transform 0.4s;
transition: transform 0.4s;
}
.cs-style-3 figure:hover img {
-webkit-transform: translateY(-30px);
-moz-transform: translateY(-30px);
-ms-transform: translateY(-30px);
transform: translateY(-30px);
}
.cs-style-3 figcaption {
height: 30px;
width: 100%;
top: auto;
bottom: 0;
opacity: 0;
-webkit-transform: translateY(100%);
-moz-transform: translateY(100%);
-ms-transform: translateY(100%);
transform: translateY(100%);
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transition: -webkit-transform 0.4s, opacity 0.1s 0.3s;
-moz-transition: -moz-transform 0.4s, opacity 0.1s 0.3s;
transition: transform 0.4s, opacity 0.1s 0.3s;
}
.cs-style-3 figure:hover figcaption {
opacity: 1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
transform: translateY(0px);
-webkit-transition: -webkit-transform 0.4s, opacity 0.1s;
-moz-transition: -moz-transform 0.4s, opacity 0.1s;
transition: transform 0.4s, opacity 0.1s;
}
.cs-style-3 figcaption a {
position: absolute;
bottom: 20px;
right: 20px;
}

Related

Safari - Transition is not working in Safari ( Phone version)

my visitors with the Iphone (Safari browser) complain that my menu isn't working. So I tried it in an emulator and found that there is not working hover or transition. On Android it's working all great.
/* Content menu */
.navigation_bg {
width:100%;
height:65px;
background:#272d33;
display:block;
}
.navigation_content {
min-width:400px;
height:65px;
max-width:1200px;
background:#272d33;
margin:0 auto;
text-align:center;
display: table;
width:100%;
overflow:hidden;
}
a.navigation {
display: table-cell;
vertical-align: middle;
border:0px;
text-align:center;
width:140px;
height:65px;
text-transform:uppercase;
font-weight:normal;
background:transparent;
overflow: hidden;
font-size:14px;
word-wrap: break-word;
padding-top:5px;
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
a.navigation img {
height:35px;
width:35px;
}
a.navigation::after {
content: '';
display: block;
width: 100%;
height: 5px;
background: #f23030;
-webkit-transition: all 0.4s ease-out;
-moz-transition: all 0.4s ease-out;
-o-transition: all 0.4s ease-out;
transition: all 0.4s ease-out;
position:relative;
top:23px;
}
a.navigation:hover::after {
-webkit-transform: translateY(-5px);
transform: translateY(-5px);
}
a.navigation:focus::after {
-webkit-transform: translateY(-5px);
transform: translateY(-5px);
}
a.navigation:active::after {
-webkit-transform: translateY(-5px);
transform: translateY(-5px);
}
.mobile_menu {
display:none;
min-width:400px;
max-width:750px;
width:100%;
height:65px;
background:transparent url('../img/menu.png') no-repeat;
background-position: right 10px center;
}
#media only screen and (max-width: 750px) {
.mobile_menu {
display:block;
}
.navigation_content {
display:block;
background:#272d33;
-webkit-transition: all 0.4s ease-out;
-moz-transition: all 0.4s ease-out;
-o-transition: all 0.4s ease-out;
transition: all 0.4s ease-out;
height:305px;
}
a.navigation::after {
top:10px;
}
a.navigation {
min-width:400px;
width:100%;
display:block;
padding-top:10px;
height:40px;
background:#272d33;
}
a.navigation img {
height:25px;
width:25px;
}
.navigation_bg {
height:65px;
overflow:hidden;
-webkit-transition: all 0.4s ease-out;
-moz-transition: all 0.4s ease-out;
-o-transition: all 0.4s ease-out;
transition: all 0.4s ease-out;
}
.navigation_bg:hover {
height:305px;
background:#f23030;
}
}
/* End Content menu */
<div class='navigation_bg'>
<div class='mobile_menu'>
</div>
<div class='navigation_content'>
<a href='/novinky' class='navigation white'>Novinky</a>
<a href='/navody' class='navigation white'>Návody</a>
<a href='/forum' class='navigation white'>Fórum</a>
<a href='' class='navigation white'>---</a>
<a href='/ostatni' class='navigation white'>Ostatní</a>
<a href='/social' class='navigation'><img src='img/yt.png' alt='Youtube'> <img src='img/fb.png' alt='Facebook'></a>
</div>
</div>
Do you have any idea where the problem could be?
There is an issue with hovering status and transition rendering iOs Safari. Note that busing an :hover pseudo-class is a non complient way to make menu works.
For example 2 ways to make a menu :
1. Use a label (linked to a hidden checkbox) and place it your toggle button
2. Use javascript to make menus toggle a class

Overlay covers whole dive - but keep fonts white

I trying to change the brightess of a div (not only an image brightness). Generaly there is an image in a div, description and caption, the main div background color is white. I want to show ovarlay div onmouse hover. Idea is to cover main div with overlay div. But now I getting only the image brightness change , what I want to achieve is to cover the hole div and keep whithe fonts.
When I add a thumbnail brightness effect it also influence the fonts to became darker. how to do that keeping fonts white.
col-sm-6, caption, thumbnail classes are defined by bootstrap.
The code of:
<div class="hovereffect thumbnail Staffinview1 delay1s">
<img src="./images/photo.jpg">
<div class="overlay">
<?php echo Person_description; ?>
</div>
<div class="caption">
<h3>Name Surname</h3>
</div>
</div>
</div>
The css code:
.thumbnail:hover {
transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-webkit-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.5);
}
.hovereffect {
width: 100%;
height: 100%;
float: left;
overflow: hidden;
position: relative;
text-align: center;
cursor: default;
}
.hovereffect .overlay {
position: absolute;
overflow: hidden;
width: 80%;
height: 80%;
left: 10%;
top: 10%;
border-bottom: 1px solid #FFF;
border-top: 1px solid #FFF;
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
-webkit-transform: scale(0,1);
-ms-transform: scale(0,1);
transform: scale(0,1);
color: #fff;
}
.hovereffect:hover .overlay {
opacity: 1;
filter: alpha(opacity=100);
-webkit-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.hovereffect img {
display: block;
position: relative;
-webkit-transition: all 0.35s;
transition: all 0.35s;
}
.hovereffect:hover img{
filter: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="filter"><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="linear" slope="0.6" /><feFuncG type="linear" slope="0.6" /><feFuncB type="linear" slope="0.6" /> </feComponentTransfer></filter></svg>#filter');
filter: brightness(0.3);
-webkit-filter: brightness(0.3);
}
I believe You are trying to achieve a mask
You can use z-index property and postion:absolute for that overlay div
css rule
.overlay {
position: absolute;
width: 100%;
height: 100%;
top: 0%;
z-index: 0;
transition: all 0.5s;
}
.overlay:hover {
z-index: 1;
background: rgb(173, 173, 173);
opacity: 0.5;
}
Snippet below
.thumbnail:hover {
transition: all 0.5s ease - in -out;
- moz - transition: all 0.5s ease - in -out;
- webkit - transition: all 0.5s ease - in -out;
- o - transition: all 0.5s ease - in -out;
- ms - transition: all 0.5s ease - in -out;
box - shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.5);
}
.hovereffect {
width: 100 %;
height: 100 %;
float: left;
overflow: hidden;
position: relative;
text - align: center;
cursor: default;
}
.hovereffect.overlay {
position: absolute;
overflow: hidden;
width: 80 %;
height: 80 %;
left: 10 %;
top: 10 %;
border - bottom: 1px solid# FFF;
border - top: 1px solid# FFF;
- webkit - transition: opacity 0.35s, -webkit - transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
- webkit - transform: scale(0, 1);
- ms - transform: scale(0, 1);
transform: scale(0, 1);
color: #fff;
}
.hovereffect:hover.overlay {
opacity: 1;
filter: alpha(opacity=100);
- webkit - transform: scale(1);
- ms - transform: scale(1);
transform: scale(1);
}
.hovereffect img {
display: block;
position: relative;
- webkit - transition: all 0.35s;
transition: all 0.35s;
}
.overlay {
position: absolute;
width: 100%;
height: 100%;
top: 0%;
z-index: 0;
transition: all 0.5s;
}
.overlay:hover {
z-index: 1;
background: rgb(173, 173, 173);
opacity: 0.5;
}
<div class="hovereffect thumbnail Staffinview1 delay1s">
<img src="./images/photo.jpg">
<div class="overlay">
<?php echo Person_description; ?>
</div>
<div class="caption">
<h3>Name Surname</h3>
</div>
</div>

Animation skipping in Chrome

I'm currently working on this site, I've added an animation to this, however the animation seems to skip when hovering in and out. It seems very random, sometimes it will skip to the end of the animation, other times it will skip to the start.
/*** GRID ***/
* {
box-sizing: border-box;
}
.row:after, .row:before {
content: "";
display: block;
overflow: hidden;
}
.row:after {
clear: both;
}
.row>* {
float: left;
}
.col-1-2 {
width: 50%;
}
/*** CODE ***/
.post {
position: relative;
overflow: hidden;
}
.post img {
width: 100%;
height: auto;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
transition: all .5s ease;
}
.panel {
display: flex;
align-items: center;
position: absolute;
z-index: 10;
padding: 0 80px;
top: 0;
bottom: 0;
left: 0;
right: 0;
opacity: 1;
background: rgba(0,200,200,0.5);
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
transition: all .5s ease;
}
.post:hover .panel {
opacity: 0;
}
.post:hover img {
-webkit-transform: scale(2);
-moz-transform: scale(2);
-ms-transform: scale(2);
-o-transform: scale(2);
transform: scale(2);
}
<div class="row">
<div class="col-1-2">
<div class="post">
<div class="panel">
<div class="content">
<span>Text</span>
<h1>More Text</h1>
</div>
</div>
<img src="http://placeholdit.imgix.net/~text?txtsize=33&txt=800%C3%97550&w=800&h=550" />
</div>
</div>
<div class="col-1-2">
</div>
</div>
I've made a codepen to replicate it.
Hover over the image until the animation has fully stopped.
Hover out and back in again.
Does it cut to the end rather than transition?
Any help is much appreciated (it's driving me insane)
It seems to be a bug with Chrome using opacity. I've swapped to using rgba values instead.

Thumbnail grid image resize issue

So i'm trying to create a portfolio with an hover with text.
I tried to make it a little responsive with bootstrap, but I can't get it right how the image is centered in the div when you scaling down.
I really wanna get something like this ( https://www.weblounge.be/en/ )
With an high of 100% and a width of 100% to always show the full size of the image when resizing.
I guess I do something wrong but can't find the issue.
my buildup is
<div class="col-lg-4 col-sm-6 nopad">
<div class="box">
<img src="http://i.imgur.com/DuUtNax.jpg">
<div class="overlay">
<h5>Random website</h5>
<p class="text">Random text</p>
</div>
</div>
</div>
and the css
.container {
background-color: #fff;
padding: 100px 0px 100px 0px;
.nopad {
padding-left: 0px;
padding-right: 0px;
}
.box {
cursor: pointer;
height: 400px;
position: relative;
overflow: hidden;
width: 100%;
text-align: left;
img {
position: absolute;
width: 100%;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-o-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
}
.overlay {
background: rgba(0, 0, 0, 0.7);
position: absolute;
left: 0;
z-index: 100;
opacity: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
text-align: center;
padding-top: 20%;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-o-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
h5 {
color:#fff;
opacity: 0;
transition-delay: 0.1s;
transition-duration: 0.2s;
transform: translateY(60px);
-webkit-transform: translateY(60px);
}
p {
color: #fff;
opacity: 0;
transition-delay: 0.2s;
transition-duration: 0.2s;
transform: translateY(60x);
-webkit-transform: translateY(60px);
}
.button-white {
opacity: 0;
transition-delay: 0.2s;
transition-duration: 0.2s;
transform: translateY(60px);
-webkit-transform: translateY(60px);
margin: 0px;
}
}
&:hover img {
-webkit-transform: scale(1.05);
-moz-transform: scale(1.05);
-ms-transform: scale(1.05);
-o-transform: scale(1.05);
transform: scale(1.05);
}
&:hover .overlay {
opacity: 1;
h5 {
opacity: 1;
transform: translateX(0px);
-webkit-transform: translateX(0px);
}
p {
opacity: 1;
transform: translateX(0px);
-webkit-transform: translateX(0px);
}
}
}
}
My codepen to show what is wrong: http://codepen.io/denniswegereef/pen/MwJXde
You need to use the product images as a background-image in a product div:
<div class="box">
<div class="product-image" style="background-image: url(http://i.imgur.com/DuUtNax.jpg)"></div>
...
</div>
and then change your css from .box img, to .box .product-image:
.box {
.product-image {
position: absolute;
width: 100%;
height:100%;
-webkit-transition: all 300ms ease-out;
transition: all 300ms ease-out;
background-repeat: no-repeat;
background-size: cover;
}
&:hover .product-image {
-webkit-transform: scale(1.05);
transform: scale(1.05);
}
}
http://jsfiddle.net/8pfjdmb4/

Hover state on parent changes when hovering on child link

I have alot of CSS and its throwing me off. I need an image to become less opaque when I hover on it and a child element, but the child element slides in when the image is hovered on. I got half of it to work, but the image returns to full opacity when the child element is hovered on. I can't get the selector right. Here is whats working now http://www.fuzionvideos.com/#video_recent
Here is the code:
<ul><li id="vid_link" class="box 1"><img src="http://www.fuzionvideos.com/images/uploads/SF_BoT.jpg" alt="Belt - Truth"> <span class="caption description">Armor of the Lord: Belt of Truth</span><b class="title_line">Belt - Truth</b></li></ul>
and the CSS:
#vid_display .box {
cursor: pointer;
height: 199px;
overflow: hidden;
width: 300px;
float: left;
position: relative;
}
#vid_display .box img {
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-o-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
position: absolute;
left: 0;
}
#vid_display .box .caption {
position: absolute;
z-index: 100;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-o-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
left: 0;
}
#vid_display .box .description {
height: 90px;
width: 300px;
display: block;
bottom: -140px;
line-height: 25pt;
text-align: left;
padding-left: 8px;
line-height:normal;
}
#vid_display .box:hover .description {
-moz-transform: translateY(-150%);
-o-transform: translateY(-150%);
-webkit-transform: translateY(-150%);
transform: translateY(-150%);
}
#vid_display ul {
padding-left: 0px;
}
#vid_display li{
display: inline;
margin-right: 18px;
}
#vid_display img:hover {
opacity:0.4;
filter:alpha(opacity=40); /* For IE8 and earlier */
}
#vid_display a :hover {
color: #ed1c24;
}
.title_line {
background-color:#ebebeb;
position: absolute;
height: 25px;
width: 300px;
top: 169px;
left: 0;
z-index: 101;
padding-top: 8px;
}
and on jsfiddle : http://jsfiddle.net/blalan05/FkV2z/
You're applying opacity to the hovered image. So, when you hover on anchor, the image is no longer hovered. Try applying the :hover for the .box, so when you will hover on the anchor (which is a child of .box) the .box will be still considered as hovered.
Change this:
#vid_display img:hover {
opacity:0.4;
filter:alpha(opacity=40); /* For IE8 and earlier */
}
to this:
#vid_display .box:hover img {
opacity:0.4;
filter:alpha(opacity=40); /* For IE8 and earlier */
}

Resources