Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert tabs to spaces in non-JS files. (#404)
Also add EOF missing newlines.
- Loading branch information
Showing
24 changed files
with
8,227 additions
and
8,227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
body { | ||
margin: 0; | ||
padding: 2em; | ||
font-family: Arial, Helvetica, sans-serif; | ||
margin: 0; | ||
padding: 2em; | ||
font-family: Arial, Helvetica, sans-serif; | ||
} | ||
.icon-background { | ||
display: inline-block; | ||
background-repeat: no-repeat; | ||
text-indent: 200%; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
border: 1px solid #ccc; | ||
display: inline-block; | ||
background-repeat: no-repeat; | ||
text-indent: 200%; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
border: 1px solid #ccc; | ||
} | ||
table { | ||
border-collapse: collapse; | ||
border-collapse: collapse; | ||
} | ||
td, th { | ||
padding: 1em; | ||
padding: 1em; | ||
} | ||
th { | ||
text-align: left; | ||
text-align: left; | ||
} | ||
td { | ||
border-top: 1px solid #ccc; | ||
height: 100px; | ||
} | ||
border-top: 1px solid #ccc; | ||
height: 100px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>svg-sprite example: SVG sprite (defs mode)</title> | ||
<link rel="stylesheet" href="../../css/main.css"/> | ||
<style> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>svg-sprite example: SVG sprite (defs mode)</title> | ||
<link rel="stylesheet" href="../../css/main.css"/> | ||
<style> | ||
.icon-original { | ||
width: 48px; | ||
height: 48px; | ||
width: 48px; | ||
height: 48px; | ||
} | ||
.icon-double { | ||
width: 96px; | ||
height: 96px; | ||
width: 96px; | ||
height: 96px; | ||
} | ||
.icon-weather-clear-svg { | ||
background-image: url(../../svg/sprite/weather-svg.svg); | ||
background-image: url(../../svg/sprite/weather-svg.svg); | ||
} | ||
.icon-weather-clear-png { | ||
background-image: url(../../png/sprite/weather-svg.png); | ||
background-image: url(../../png/sprite/weather-svg.png); | ||
} | ||
.icon-absolute { | ||
background-position: 0 -384px; | ||
background-position: 0 -384px; | ||
} | ||
.icon-relative { | ||
background-position: 0 88.888888%; | ||
/* y-part 80% / (100% - 10%) = */ | ||
/* x-part 173px / (1000px - 80px) = 0.1880434783 ->> 18.80434783% */ | ||
background-position: 0 88.888888%; | ||
/* y-part 80% / (100% - 10%) = */ | ||
/* x-part 173px / (1000px - 80px) = 0.1880434783 ->> 18.80434783% */ | ||
} | ||
.icon-background { | ||
background-size: 100% auto; | ||
background-size: 100% auto; | ||
} | ||
pre { | ||
padding: 1em; | ||
font-size: 120%; | ||
border: 1px solid #ccc; | ||
padding: 1em; | ||
font-size: 120%; | ||
border: 1px solid #ccc; | ||
} | ||
code { | ||
font-size: 120%; | ||
background-color: #eee; | ||
padding: .1em .3em; | ||
font-size: 120%; | ||
background-color: #eee; | ||
padding: .1em .3em; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>SVG sprite (defs mode)</h1> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>SVG</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td> | ||
<svg viewBox="0 0 48 48" class="icon"> | ||
<use xlink:href="../../svg/sprite/weather-defs#weather-clear"></use> | ||
</svg> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</body> | ||
</html> | ||
</style> | ||
</head> | ||
<body> | ||
<h1>SVG sprite (defs mode)</h1> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>SVG</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td> | ||
<svg viewBox="0 0 48 48" class="icon"> | ||
<use xlink:href="../../svg/sprite/weather-defs#weather-clear"></use> | ||
</svg> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,93 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>svg-sprite example: SVG sprite (background mode)</title> | ||
<link rel="stylesheet" href="../../css/main.css"/> | ||
<style> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>svg-sprite example: SVG sprite (background mode)</title> | ||
<link rel="stylesheet" href="../../css/main.css"/> | ||
<style> | ||
.icon-original { | ||
width: 48px; | ||
height: 48px; | ||
width: 48px; | ||
height: 48px; | ||
} | ||
.icon-double { | ||
width: 96px; | ||
height: 96px; | ||
width: 96px; | ||
height: 96px; | ||
} | ||
.icon-weather-clear-svg { | ||
background-image: url(../../svg/sprite/weather-svg.svg); | ||
background-image: url(../../svg/sprite/weather-svg.svg); | ||
} | ||
.icon-weather-clear-png { | ||
background-image: url(../../png/sprite/weather-svg.png); | ||
background-image: url(../../png/sprite/weather-svg.png); | ||
} | ||
.icon-absolute { | ||
background-position: 0 -384px; | ||
background-position: 0 -384px; | ||
} | ||
.icon-relative { | ||
background-position: 0 88.888888%; | ||
/* y-part 80% / (100% - 10%) = */ | ||
/* x-part 173px / (1000px - 80px) = 0.1880434783 ->> 18.80434783% */ | ||
background-position: 0 88.888888%; | ||
/* y-part 80% / (100% - 10%) = */ | ||
/* x-part 173px / (1000px - 80px) = 0.1880434783 ->> 18.80434783% */ | ||
} | ||
.icon-background { | ||
background-size: 100% auto; | ||
background-size: 100% auto; | ||
} | ||
pre { | ||
padding: 1em; | ||
font-size: 120%; | ||
border: 1px solid #ccc; | ||
padding: 1em; | ||
font-size: 120%; | ||
border: 1px solid #ccc; | ||
} | ||
code { | ||
font-size: 120%; | ||
background-color: #eee; | ||
padding: .1em .3em; | ||
font-size: 120%; | ||
background-color: #eee; | ||
padding: .1em .3em; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>SVG sprite (background mode)</h1> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Positioning</th> | ||
<th>Size</th> | ||
<th>SVG</th> | ||
<th>PNG</th> | ||
<th>Comment</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>Absolute (px)</td> | ||
<td>Original</td> | ||
<td><i class="icon-background icon-original icon-absolute icon-weather-clear-svg">Clear weather icon</i></td> | ||
<td><i class="icon-background icon-original icon-absolute icon-weather-clear-png">Clear weather icon</i></td> | ||
<td> </td> | ||
</tr> | ||
<tr> | ||
<td>Absolute (px)</td> | ||
<td>Double</td> | ||
<td><i class="icon-background icon-double icon-absolute icon-weather-clear-svg">Clear weather icon</i></td> | ||
<td><i class="icon-background icon-double icon-absolute icon-weather-clear-png">Clear weather icon</i></td> | ||
<td>Can't work without setting an absolute size for <code>background-size</code>. Scaling the absolutely positioned sprite screws up the image offset (which would have to be scaled as well)</td> | ||
</tr> | ||
<tr> | ||
<td>Relative (%)</td> | ||
<td>Original</td> | ||
<td><i class="icon-background icon-original icon-relative icon-weather-clear-svg">Clear weather icon</i></td> | ||
<td><i class="icon-background icon-original icon-relative icon-weather-clear-png">Clear weather icon</i></td> | ||
<td> </td> | ||
</tr> | ||
<tr> | ||
<td>Relative (%)</td> | ||
<td>Double</td> | ||
<td><i class="icon-background icon-double icon-relative icon-weather-clear-svg">Clear weather icon</i></td> | ||
<td><i class="icon-background icon-double icon-relative icon-weather-clear-png">Clear weather icon</i></td> | ||
<td> </td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<p>The formular for calculating the relative position of a particular sprite image is as follows:</p> | ||
<pre>$percentage = $imageOffset / ($spriteDimension - $imageDimension) * 100%</pre> | ||
<p>This holds true for both absolute as well als relative values. The following example will display the 7th image of the above sprites, with each original image being 48 x 48 pixels and the sprites holding 10 images each:</p> | ||
<pre>$percentage = 288px / (480px - 48px) = 60% / (100% - 10%) = 0.666666 = 66.666666%</pre> | ||
</body> | ||
</html> | ||
</style> | ||
</head> | ||
<body> | ||
<h1>SVG sprite (background mode)</h1> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Positioning</th> | ||
<th>Size</th> | ||
<th>SVG</th> | ||
<th>PNG</th> | ||
<th>Comment</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>Absolute (px)</td> | ||
<td>Original</td> | ||
<td><i class="icon-background icon-original icon-absolute icon-weather-clear-svg">Clear weather icon</i></td> | ||
<td><i class="icon-background icon-original icon-absolute icon-weather-clear-png">Clear weather icon</i></td> | ||
<td> </td> | ||
</tr> | ||
<tr> | ||
<td>Absolute (px)</td> | ||
<td>Double</td> | ||
<td><i class="icon-background icon-double icon-absolute icon-weather-clear-svg">Clear weather icon</i></td> | ||
<td><i class="icon-background icon-double icon-absolute icon-weather-clear-png">Clear weather icon</i></td> | ||
<td>Can't work without setting an absolute size for <code>background-size</code>. Scaling the absolutely positioned sprite screws up the image offset (which would have to be scaled as well)</td> | ||
</tr> | ||
<tr> | ||
<td>Relative (%)</td> | ||
<td>Original</td> | ||
<td><i class="icon-background icon-original icon-relative icon-weather-clear-svg">Clear weather icon</i></td> | ||
<td><i class="icon-background icon-original icon-relative icon-weather-clear-png">Clear weather icon</i></td> | ||
<td> </td> | ||
</tr> | ||
<tr> | ||
<td>Relative (%)</td> | ||
<td>Double</td> | ||
<td><i class="icon-background icon-double icon-relative icon-weather-clear-svg">Clear weather icon</i></td> | ||
<td><i class="icon-background icon-double icon-relative icon-weather-clear-png">Clear weather icon</i></td> | ||
<td> </td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<p>The formular for calculating the relative position of a particular sprite image is as follows:</p> | ||
<pre>$percentage = $imageOffset / ($spriteDimension - $imageDimension) * 100%</pre> | ||
<p>This holds true for both absolute as well als relative values. The following example will display the 7th image of the above sprites, with each original image being 48 x 48 pixels and the sprites holding 10 images each:</p> | ||
<pre>$percentage = 288px / (480px - 48px) = 60% / (100% - 10%) = 0.666666 = 66.666666%</pre> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
{ | ||
"red":"#f00", | ||
"green":"#0f0", | ||
"blue":"#00f", | ||
"cyan":"#0ff", | ||
"magenta":"#f0f", | ||
"yellow":"#ff0", | ||
"black":"#000 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
{ | ||
"red":"#f00", | ||
"green":"#0f0", | ||
"blue":"#00f", | ||
"cyan":"#0ff", | ||
"magenta":"#f0f", | ||
"yellow":"#ff0", | ||
"black":"#000" | ||
} | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.