Created
September 23, 2014 03:38
-
-
Save phpfiddle/e00cf5924da15cb3fa42 to your computer and use it in GitHub Desktop.
[ Posted by Vince ] Makes a little circle of divs.
This file contains 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
<?php $size = 40; ?> | |
<style> | |
.ball{ | |
height:<?php echo $size;?>px; width:<?php echo $size;?>px; background-color:rgba(0,200,0,.025); | |
position:absolute; | |
border-radius: 50%; | |
text-align:center; | |
line-height:<?php echo $size;?>px; | |
color:rgba(0,59,0,.1); | |
font-family:sans-serif; | |
} | |
#william{ position:relative; | |
width:400px; | |
height:400px; | |
margin-left:200px; | |
margin-top:200px} | |
</style> | |
<div id="william"> | |
<?php | |
function divy($x = 0, $y = 0, $word = "panic"){ | |
echo '<div class="ball" style="top:'.$y.'px;right:'.$x.'px">'.$word.'</div>'; | |
} | |
$c=200; | |
for ($i = 0; $i <360; $i++){ | |
$x = cos($i)*$c; | |
$y = sin($i)*$c; | |
divy($x,$y); | |
if ($i%2){ | |
divy($x); | |
divy(0,$y); | |
} | |
} | |
?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment