This can be implemented in several ways:
1) in modern browsers in pure CSS using clip-path
Codepen Demo
HTML
<div> <a href="#1"></a> <a href="#2"></a> </div>
CSS
a { position: absolute; top: 0; left: 0; height: 100vh; width: 100%; display: block; } a:first-child { -webkit-clip-path: polygon(0 0, 0 100vh, 100% 100vh); clip-path: polygon(0 0, 0 100vh, 100% 100vh); background: #d6d6d6; } a:last-child { -webkit-clip-path: polygon(0 0, 100% 0, 100% 100vh); clip-path: polygon(0 0, 100% 0, 100% 100vh); background: #212121; }
2) In lesser browsers containing only a bit of javascript and 2D Transformation
Codepen Demo
HTML
<div> <section><a href="#1"></a></section> <section><a href="#2"></a></section> </div>
CSS
html, body, div{ height: 100%; width: 100%; padding: 0; margin: 0; } div { overflow : hidden; position: relative; } section { position : absolute; top : -100%; height : 500vw; width : 500vh; background : #ccc; -webkit-transform-origin: 0 0; -moz-transform-origin: 0 0; transform-origin: 0 0; } section + section { background : #333; top : 0%; } section a { display: block; width: 100%; height: 100%; cursor: pointer; }
Js / jquery
$(function() { $(window).on('resize', function() { var h = $(document).height(), w = $(document).width(); var angle = Math.atan(h/w) * 57.29577; var rotateProperty = "rotate(" + angle + "deg)"; $('section').css({ "-webkit-transform": rotateProperty, "-moz-transform": rotateProperty, "transform": rotateProperty }); }) .triggerHandler('resize'); });
source share