Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS 3D Switch-like hover

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #39594
    vonKristoff
    Member

    Hey guys,
    Im trying to build a simple 3D pop over thingy, >update (see hot link below in other comment for view )< when I roll over an image - the image lifts like a trap door, and reveals the accompanying text underneath. So I have built it thus far .. For starters - the animation hovers are all over the place although they are set to be the same times - it makes syncing animations real sucky...
    Anyone up for turning this into something cool?
    HTML




    descripton goes here

    CSS

    .shadow{
    background-image: -webkit-gradient(linear,
    left top, left bottom,
    from(rgba(0,0,0,.3)), to(rgba(0,0,0,0)),
    color-stop(1,#000));
    }
    .flipper{
    overflow:hidden;
    width:150px;
    height:300px;
    background:black;
    -webkit-transition: all 1s;
    box-shadow: 0px 0px 0px rgba(0,0,0,.4);
    .door{
    position:absolute;
    -webkit-transition: all .3s linear;
    -webkit-transform-origin:0% 0;
    background:url(img/flip.jpg);
    width:150px;
    height:300px;

    }
    .trap{
    position:relative;
    -webkit-transition: all .3s linear;
    width:150px;
    height:50px;
    background:blue;
    margin-top:300px;

    text-align:center;
    line-height:50px;
    }
    .shadow{
    -webkit-transition: all .3s linear;
    width:150px;
    height:0px;
    position:absolute;
    }
    }
    .flipper:hover{
    box-shadow:0px -5px 10px rgba(0, 0, 0, 0.4);
    .door{
    -webkit-transform:rotateX(34deg);
    }
    .trap{
    margin-top:250px;
    }
    .shadow{
    height:250px;
    }
    }

    SORRY – JUST DOING IT IN WEBKIT

    #108818
    Paulie_D
    Member
    #108821
    vonKristoff
    Member

    No .. this is what it’s like at the moment – you’ll spot the subtle difference .. >

    ps.
    sorry for the messy code – it was pasted in ../

    #108824
    Paulie_D
    Member

    Not sure you need all those divs…I’ve usually found that the figure & figcaption elements work better. No need for those background images.

    I haven’t done anything about the 3D thing you are trying or the transitions but this is a little cleaner code-wise, I feel.: http://codepen.io/Paulie-D/pen/AJfgy

    #108835

    Is this the sort of thing that you are after? http://codepen.io/joshnh/pen/FlvJr

    #108843
    vonKristoff
    Member

    hey bro – thats good! it works really well. Nice touch of perspective makes it look cool.
    Ultimately I was looking to ‘attach’ the caption on to the end of the trap door, as if it were attached perpendicularly. Thus the caption would be 3D too.
    yet I like it just as, and its simple code :)

    #108844
    vonKristoff
    Member

    QUICK Q – I notice in code pen u use ‘transition’ etc is this because it’s standard css3 now – or does codepen convert it into the right css dependant on the viewers browser?

    #108847

    Ahh, I think I get what you mean now. Here’s something I made a while ago: http://codepen.io/joshnh/full/qhGfE

    Oh, and I am using Prefix-Free so that I don’t have to write out all the browser prefixes.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.