-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·118 lines (116 loc) · 2.66 KB
/
index.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
function innericons($class){
for($i=1; $i<=4; $i++){
echo '<div class="'.$class.$i.'"></div>';
}
}
function drawtrack($class){
for($i=1; $i<=6; $i++){
echo '<div class="'.$class.$i.'"></div>';
}
}
function draw8divs($class){
for($i=1; $i<=8; $i++){
echo '<div class="'.$class.$i.'"></div>';
}
}
function stylemaker($class){
$wid=0;
if($class=='gbat' || $class=='gbbt' || $class=='gbct'){
for($i=1; $i<=6; $i++){
echo '.'.$class.$i.'{
position:absolute;
left:'.$wid.'px;
}';
$wid=30*$i;
}
}
for($i=1; $i<=6; $i++){
echo '.'.$class.$i.'{ border:1px solid black; width:30px; height:30px; }'.PHP_EOL;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ludo</title>
<link rel="stylesheet" href="style.css">
</head>
<style type="text/css">
<?php
stylemaker('rgat');
stylemaker('rgbt');
stylemaker('rgct');
stylemaker('gbat');
stylemaker('gbbt');
stylemaker('gbct');
stylemaker('byat');
stylemaker('bybt');
stylemaker('byct');
?>
</style>
<body>
<div class="container">
<div class="red">
<?php innericons('red') ?>
</div>
<div class="gotorg">
<div class="rga">
<?php drawtrack('rgat'); ?>
</div>
<div class="rgb">
<?php drawtrack('rgbt'); ?>
</div>
<div class="rgc">
<?php drawtrack('rgct'); ?>
</div>
</div>
<div class="green">
<?php innericons('green') ?>
</div>
<div class="gotogb">
<div class="gba">
<?php drawtrack('gbat'); ?>
</div>
<div class="gbb">
<?php drawtrack('gbbt'); ?>
</div>
<div class="gbc">
<?php drawtrack('gbct'); ?>
</div>
</div>
<div class="blue">
<?php innericons('blue') ?>
</div>
<div class="gotoby">
<div class="bya">
<?php drawtrack('byat'); ?>
</div>
<div class="byb">
<?php drawtrack('bybt'); ?>
</div>
<div class="byc">
<?php drawtrack('byct'); ?>
</div>
</div>
<div class="yellow">
<?php innericons('yellow') ?>
</div>
<div class="gotoyr">
<div class="gba">
<?php drawtrack('gbat'); ?>
</div>
<div class="gbb">
<?php drawtrack('gbbt'); ?>
</div>
<div class="gbc">
<?php drawtrack('gbct'); ?>
</div>
</div>
<div class="centerarea">
<?php draw8divs('carea'); ?>
</div>
</div>
</body>
</html>