01.
<?php
02.
$r
=
$_REQUEST
;
03.
if
( (
$no_rq
= !isset(
$r
[
'width'
])) ){
04.
$r
=
array
(
05.
'id'
=>
'div_1'
,
06.
'width'
=>30,
'height'
=>30,
07.
'left'
=>50,
'top'
=>100,
08.
'RW'
=>30,
'RH'
=>30,
09.
'degree'
=>45,
10.
'c1'
=>
'red'
,
'c1p'
=>0,
11.
'c2'
=>
'green'
,
'c2p'
=>100,
12.
'c3'
=>
'blue'
,
'c3p'
=>95
13.
);
14.
}
15.
$rd
=
"radial-gradient( $r[RW]px $r[RH]px $r[degree]deg, circle cover, $r[c1] $r[c1p]%, $r[c2] $r[c2p]%, $r[c3] $r[c3p]%)"
;
16.
$rd1
=
"radial-gradient( $r[RW]px $r[RH]px, circle cover, $r[c1] $r[c1p]%, $r[c2] $r[c2p]%, $r[c3] $r[c3p]%)"
;
17.
$ff
= preg_match(
'/Firefox/'
,
$_SERVER
[
'HTTP_USER_AGENT'
]);
18.
$ch
= !
$ff
&& preg_match(
'/Chrome/'
,
$_SERVER
[
'HTTP_USER_AGENT'
]);
19.
$ie
= !
$ff
&& !
$ch
;
20.
if
(
$no_rq
):
21.
?><!doctype html>
22.
<html>
23.
<head>
24.
<meta charset=
"utf-8"
>
25.
<title>Untitled Document</title>
26.
<style>
27.
@keyframes spin {
28.
from { transform: rotate(0deg); }
29.
to { transform: rotate(360deg); }
30.
}
31.
<?php
if
(
$ch
):?>
32.
@-webkit-keyframes spin {
33.
from { -webkit-transform: rotate(0deg); }
34.
to { -webkit-transform: rotate(360deg); }
35.
}
36.
<?php
endif
;?>
37.
<?php
if
(
$ff
): ?>
38.
@-moz-keyframes spin {
39.
from { -moz-transform: rotate(0deg); }
40.
to { -moz-transform: rotate(360deg); }
41.
}
42.
<?php
endif
;?>
43.
<?php
if
(
$ie
): ?>
44.
@-ms-keyframes spin {
45.
from { -ms-transform: rotate(0deg); }
46.
to { -ms-transform: rotate(360deg); }
47.
}
48.
<?php
endif
;?>
49.
</style>
50.
</head>
51.
<body>
52.
<?php
endif
;
53.
?>
54.
<div id=
"<?=$r['id']?>"
style="position: fixed; border-radius: 50%; display:block;
55.
width: <?=
$r
[
'width'
]?>px;
56.
height: <?=
$r
[
'height'
]?>px;
57.
left: <?=
$r
[
'left'
]?>px;
58.
top: <?=
$r
[
'top'
]?>px;
59.
background-image: <?=
$rd
?>;
60.
animation-name: spin;
61.
animation-duration: 3s;
62.
animation-iteration-
count
: infinite;
63.
animation-timing-
function
: linear;
64.
<?php
if
(
$ch
):?>
65.
background-image: -webkit-<?=
$rd1
?>;
66.
-webkit-animation-name: spin;
67.
-webkit-animation-duration: 3s;
68.
-webkit-animation-iteration-
count
: infinite;
69.
-webkit-animation-timing-
function
: linear;
70.
<?php
endif
;?>
71.
<?php
if
(
$ff
): ?>
72.
background-image: -moz-<?=
$rd
?>;
73.
-moz-animation-name: spin;
74.
-moz-animation-duration: 3s;
75.
-moz-animation-iteration-
count
: infinite;
76.
-moz-animation-timing-
function
: linear;
77.
<?php
endif
;?>
78.
<?php
if
(
$ie
): ?>
79.
background-image: -ms-<?=
$rd
?>;
80.
-ms-animation-name: spin;
81.
-ms-animation-duration: 3s;
82.
-ms-animation-iteration-
count
: infinite;
83.
-ms-animation-timing-
function
: linear;
84.
<?php
endif
;?>"
85.
></div>
86.
<?php
if
(
$no_rq
):?>
87.
</body>
88.
</html>
89.
<?php
endif
;?>