Skip to content

Commit 733673f

Browse files
committed
Demos: grunticon add example of scalling svg vs png
1 parent 743e8b9 commit 733673f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

demos/icons-grunticon/index.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,28 @@
7373
$( "#icon-page" ).removeClass( "ui-page-theme-a ui-page-theme-b" ).addClass( themeClass );
7474
}
7575
});
76-
var stylesheet = $( "head" ).find( "link" ).eq( "1" ).attr( "href" ),
76+
var eye,
77+
stylesheet = $( "head" ).find( "link" ).eq( "1" ).attr( "href" ),
7778
svg = /svg/.test( "svg" ),
7879
external = /external/.test( stylesheet ),
7980
using = ( ( external? "External ":"Inline " ) + ( svg? "SVG's " : "PNG's" ) );
8081

8182
$( "#grunticon-stylesheet" ).text( stylesheet );
83+
$( "<span>&nbsp;</span>" ).css({
84+
"width": "200px",
85+
"height": "200px",
86+
"display": "block",
87+
"background-size": "200px 200px",
88+
"background-image": svg? "url('data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2210px%22%20viewBox%3D%220%200%2014%2010%22%20style%3D%22enable-background%3Anew%200%200%2014%2010%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M7%2C0C3%2C0%2C0%2C5%2C0%2C5s3%2C5%2C7%2C5s7-5%2C7-5S11%2C0%2C7%2C0z%20M7%2C8C5.343%2C8%2C4%2C6.657%2C4%2C5s1.343-3%2C3-3s3%2C1.343%2C3%2C3S8.657%2C8%2C7%2C8z%20M7%2C4%20C6.448%2C4%2C6%2C4.447%2C6%2C5s0.448%2C1%2C1%2C1s1-0.447%2C1-1S7.552%2C4%2C7%2C4z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E')": "url(../../css/themes/default/images/icons-png/eye-white.png)",
89+
"background-color": "rgba(0,0,0,.3)"
90+
})
91+
.insertAfter("#grunticon-icon-type");
92+
93+
if( !svg ) {
94+
$("#grunticon-icon-type").after("<p>Pixels make me sad :(</p>");
95+
} else {
96+
$("#grunticon-icon-type").after("<p>Woo! Vector graphics!</p>");
97+
}
8298
$( "#grunticon-icon-type" ).text( using );
8399
});
84100
</script>

0 commit comments

Comments
 (0)