FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CSSsprite/csssprite.example.php at master · spacedevin/CSSsprite · GitHub
spacedevin
CSSsprite
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
CSSsprite
/
csssprite.example.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
55 lines (46 loc) · 1.36 KB
Breadcrumbs
CSSsprite
/
csssprite.example.php
Copy path
File metadata and controls
executable file
·
55 lines (46 loc) · 1.36 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<?php
/**
*
* PHP CSS Sprite generator example
*
* this is an example usage of the css sprite library
* chmod your outpath so its script writeable.
*
* Devin Smith www.devin-smith.com 2009.06.18
*
*/
require_once
'
CssSprite.php
'
;
$
images
[
'
devin
'
][
'
file
'
] =
'
devinsmith.logo.png
'
;
$
images
[
'
devin
'
][
'
style
'
][
'
margin
'
] =
'
0 auto
'
;
$
images
[
'
charitycall
'
][
'
file
'
] =
'
charitycall.logo.png
'
;
$
images
[
'
charitycall
'
][
'
style
'
][
'
margin
'
] =
'
0 auto
'
;
$
sprite
=
new
CssSpriteMap
();
$
sprite
->
setImages
(
$
images
)
->
setInPath
(
'
./
'
)
->
setForceRefresh
(
false
)
->
setCssPrefix
(
'
csssprite
'
)
->
setOutPath
(
'
./cache/
'
)
->
setOutUrl
(
'
cache/
'
)
->
create
();
/**
* get the css and display it in your header
*/
$
css
=
$
sprite
->
getCss
();
/**
* contains the image information of the sprite you want (optional)
*/
$
mySprite
=
$
sprite
->
getImg
(
'
devin
'
);
/**
* sloppy output!
*/
?>
<html><head><title>Css Sprite Generator Example</title>
<style type="text/css">
<?=
$
css
?>
.
<?=
$
sprite
->
getCssPrefix
()
?>
span { display: none; }
</style>
</head><body>
<div class="
<?=
$
sprite
->
getCssPrefix
()
?>
<?=
$
sprite
->
getCssPrefix
()
?>
devin center"><span>www.devin-smith.com</span></div>
<br /><br />
<div class="
<?=
$
sprite
->
getCssPrefix
()
?>
<?=
$
sprite
->
getCssPrefix
()
?>
charitycall center"><span>charitycalliphone.com</span></div>
</body></html>
Back
|
FazBrowse Home
|
New Git URL