-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcss_generator.php
65 lines (60 loc) · 1.45 KB
/
css_generator.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
// This file creates the CSS code for animating the pony
// when the Konami code is entered. It's not used by the program
// in any way, I just wrote it and ran it once to save me from
// actually writing it by hand.
$iter = 0;
$step = (100/60);
for($i = 0; $i < (100 + $step); $i += $step)
{
$iter += 1;
$css = "";
if($iter % 2 == 0)
{
$css .= "top: 10px; ";
if($iter < 15)
{
$css .= "transform: scaleX(1);";
}
else if($iter < 30)
{
$css .= "transform: rotate(90deg) ";
$css .= " scaleY(1);";
}
else if($iter < 45)
{
$css .= "transform: rotate(180deg) ";
$css .= " scaleY(1);";
}
else
{
$css .= "transform: rotate(270deg) ";
$css .= " scaleY(1);";
}
}
elseif($iter % 2 == 1)
{
$css .= "top: -10px; ";
if($iter < 15)
{
$css .= "transform: scaleX(-1);";
}
else if($iter < 30)
{
$css .= "transform: rotate(90deg) ";
$css .= " scaleY(-1);";
}
else if($iter < 45)
{
$css .= "transform: rotate(180deg) ";
$css .= " scaleY(-1);";
}
else
{
$css .= "transform: rotate(270deg) ";
$css .= " scaleY(-1);";
}
}
echo round($i, 2) . "% {". $css . "}<br />";
}
?>