A Pen by Luciano Strika on CodePen.
Created
October 5, 2016 01:55
-
-
Save StrikingLoo/6ffb25651a637af2590309f18e5acd2f to your computer and use it in GitHub Desktop.
It's hip to be square
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<div class='container-fluid' align='center'> | |
<div class = 'row'> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg></div> | |
</div> | |
<div class='container-fluid' align='center'> | |
<div class = 'row'> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg></div> | |
<div class='container-fluid' align='center'> | |
<div class = 'row'> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg></div> | |
<div class='container-fluid' align='center'> | |
<div class = 'row'> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg></div> | |
<div class='container-fluid' align='center'> | |
<div class = 'row'> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg></div> | |
<div class='container-fluid' align='center'> | |
<div class = 'row'> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg></div> | |
<div class='container-fluid' align='center'> | |
<div class = 'row'> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg></div> | |
<div class='container-fluid' align='center'> | |
<div class = 'row'> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100' > | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'> | |
<rect width = '100' height = '100'> | |
</rect> | |
</svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg> | |
<svg width = '100' height = '100'><rect width = '100' height = '100'></rect></svg></div> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* event handler */ | |
$(document).ready(function() { | |
$('rect').on('mouseenter',function(){ /*pretty standard*/ | |
r = Math.floor(Math.random()*255).toString(); | |
g = Math.floor(Math.random()*255).toString(); | |
b = Math.floor(Math.random()*255).toString(); | |
/*we generate three random values, assign them as parameters for the colour*/ | |
colourshade='rgb('+r+','+g+','+b+')' | |
$(this).attr('fill',colourshade); | |
}/*thus the rectangle that triggered the event changes*/ | |
); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body {background-color:black;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment