Skip to content

Instantly share code, notes, and snippets.

@Ciantic
Created May 29, 2019 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ciantic/fe29487b6b98d7eaf44113b8467e2488 to your computer and use it in GitHub Desktop.
Save Ciantic/fe29487b6b98d7eaf44113b8467e2488 to your computer and use it in GitHub Desktop.
Just some grid ball animation thing I threw away
<?php
$w = 20;
$h = 3;
$spacing = 7;
$padding = 2;
?>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="<?php echo -$padding; ?> <?php echo -$padding; ?> <?php echo $w * $spacing + $padding * 2; ?> <?php echo $h * $spacing + $padding * 2; ?>"
version="1.1">
<?php foreach (range(0, $w) as $x): ?>
<?php foreach (range(0, $h) as $y): ?>
<circle
cx="<?php echo $x * $spacing; ?>"
cy="<?php echo $y * $spacing; ?>"
r="0.4"
>
<animate attributeName="r" begin="0s" dur="3s" repeatCount="indefinite"
values="0.4;0.7;0.4"
keyTimes="0;0.5;1"
repeatCount="indefinite" />
</circle>
<?php endforeach; ?>
<?php endforeach; ?>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment