Skip to content

Instantly share code, notes, and snippets.

View paultreny's full-sized avatar

Paul Reny paultreny

View GitHub Profile

Direction-aware 3D hover effect

After seeing this site http://fitzfitzpatrick.com/ I decided to give a try to the "direction-aware hover effect". My first thought was to do it with a pure CSS, not too late I changed my mind and decided to use JS (I need to sleep anyway).

It's kind of simple, using JS we can easily detect the direction the cursor is coming, then, I am using CSS animations for each case (8 in total).

A Pen by Paul Reny on CodePen.

License.

@paultreny
paultreny / Countdown-Clock.markdown
Created January 11, 2014 04:41
A Pen by Paul Reny.
@paultreny
paultreny / Absolute-Centering.markdown
Created January 11, 2014 04:40
A Pen by Paul Reny.

Absolute Centering

Perfect horizontal AND vertical centering in CSS, at any width or height!

Works with percentage based width/height, min-/max- width, images, position: fixed and even variable content heights.

Updated Aug 13: Added a comparison table, an explanation, more documentation, and a Modernizr test for variable height

Updated Aug 16: Minor corrections and clarifications

@paultreny
paultreny / Hyperspace.markdown
Created January 11, 2014 04:40
A Pen by Paul Reny.
@paultreny
paultreny / A-Pen-by-Paul-Reny.markdown
Created January 11, 2014 04:39
A Pen by Paul Reny.

Single Element Pure CSS MacBook Pro

This is just an experiment! There are certainly better ways to show an image of a MacBook, but none as fun as this :)

A Pen by Paul Reny on CodePen.

License.

@paultreny
paultreny / Opening-type.markdown
Created January 11, 2014 04:38
A Pen by Paul Reny.