-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerator.php
53 lines (50 loc) · 1.18 KB
/
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
<?php
$icons = array(
'generic',
'youtube',
'twitter',
'rss',
'flickr',
'facebook',
'printer',
);
$sizes = array(
'32' => 0,
'24' => 2*32,
'16' => 2*(32+24),
'52' => 2*(32+24+16),
'64' => 2*(32+24+16+52),
);
?><html>
<head>
<style TYPE="text/css"><!--
<?php foreach ($sizes as $size => $y): ?>
.social-icon-block {
margin: 5px;
display: block;
}
.social-icon-<?php print $size; ?> {
width: <?php print $size; ?>px;
height: <?php print $size; ?>px;
background: url(sprite.png);
text-indent: -20000px;
}
<?php foreach ($icons as $n => $icon): ?>
.social-icon-<?php print $icon; ?>.social-icon-<?php print $size; ?> {
background-position: -<?php print $n*$size; ?>px -<?php print $y; ?>px;
}
.social-icon-<?php print $icon; ?>.social-icon-<?php print $size; ?>:hover {
background-position: -<?php print $n*$size; ?>px -<?php print $y+$size; ?>px;
}
<?php endforeach; ?>
<?php endforeach; ?>
--></style>
</head>
<body>
<?php foreach ($icons as $icon): ?>
<?php foreach ($sizes as $size => $pos): ?>
<a href="#" class="social-icon-block social-icon-<?php print $icon; ?> social-icon-<?php print $size ?>">test</a>
<?php endforeach; ?>
<?php endforeach; ?>
</body>
</html>