My first exploration into moiré patterns in css animations. Inspired by http://i.imgur.com/p0NQtgI.jpg
Last active
August 29, 2015 14:02
-
-
Save ruzz311/d82c64863cf525204b74 to your computer and use it in GitHub Desktop.
A Pen by Russell.
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
| #circle1.circle | |
| #circle2.circle |
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
| $(function(){ | |
| var max = 50, | |
| circle1 = $('#circle1'), | |
| circle2 = $('#circle2'), | |
| html = '<div></div>'; | |
| for(var i=1;i<= max; i++) { | |
| circle1.append(html); | |
| circle2.append(html); | |
| } | |
| }); |
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
| $height = 400px | |
| $numCircles = 50 | |
| $line-width = 1px | |
| .circle | |
| height: $height | |
| width: @height | |
| .circle > div | |
| border-radius 50% | |
| border-width: $line-width | |
| border-color: #000 | |
| border-style: solid | |
| height: $height; | |
| width: @height; | |
| .circle | |
| float: left | |
| position: relative | |
| div | |
| position: absolute | |
| top: 50% | |
| left: 50% | |
| margin-top: -($height * 0.5) | |
| for num in (0..$numCircles) | |
| &:nth-child({num}) | |
| height: ceil($height - (($height*(1/$numCircles))*num)) | |
| width: @height | |
| margin-top: -(@height * 0.5) | |
| margin-left: @margin-top | |
| @keyframes mergeCircle | |
| from { | |
| transform: translate3d(0,0,0) | |
| } | |
| to { | |
| transform: translate3d($height,0,0) | |
| } | |
| #circle1 | |
| animation-duration: 15s | |
| animation-name: mergeCircle | |
| animation-iteration-count: infinite | |
| animation-direction: alternate | |
| animation-timing-function: ease-out | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment