Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tmpl/defs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 25 additions & 26 deletions tmpl/preview-defs.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,17 @@

</head>
<body>
{svgInline|s}
<%= svgInline %>
<header>
<h1 id="logo">Gulp SVG Sprites <small>({svg.length} icons in &lt;defs&gt; mode)</small></h1>
<h1 id="logo">Gulp SVG Sprites <small>(<%= svg.length %> icons in &lt;defs&gt; mode)</small></h1>
<h4>Files Generated:</h4>
<ol>
<li><a href="{config.svg.defs}">{config.svg.defs}</a></li>
<li><a href="{config.svg.defs}"><%= config.svg.defs %></a></li>
</ol>
<h4>Usage:</h4>
<ol>
<li>
Include the <strong>contents</strong> of the <a href="{config.svg.defs}">SVG file</a> just after the opening <code>&lt;body&gt;</code> tag.
Include the <strong>contents</strong> of the <a href="<%= config.svg.defs %>">SVG file</a> just after the opening <code>&lt;body&gt;</code> tag.
</li>
<li>
Paste one of the snippets anywhere into your website.
Expand All @@ -173,27 +173,26 @@ <h4>Usage:</h4>

</header>
<section>
<ul class="icon-boxes">
{#svg}
<li title="{name}">
<div class="icon-box" id="icon-box-{name}">
<svg viewBox="0 0 {width} {height}" class="{#common}{common} {/common}{#selector}{raw}{/selector}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<use xlink:href="#{name}"></use>
</svg>
</div>
<h2>{name}</h2>
<button onclick="showPopover('snippet-{name}')">Show Snippet</button>
<br/>
<button onclick="invertBackground('icon-box-{name}')">Invert Background</button>
<div class="snippet-popover" id="snippet-{name}">
<pre><code>&lt;svg viewBox=&quot;{viewBox}&quot; class=&quot;{#common}{common} {/common}{#selector}{raw}{/selector}&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;use xlink:href=&quot;#svg-arr-black-reversed&quot;&gt;&lt;/use&gt;
&lt;/svg&gt;</code></pre>
<button onclick="hidePopover()">Close</button>
</div>
</li>
{/svg}
</ul>
<ul class="icon-boxes">
<% _.forEach(svg, function(svgItem) { %>

<li title="<%= svgItem.name %>">
<div class="icon-box" id="icon-box-<%= svgItem.name %>">
<svg class="<%= common %> <%= svgItem.name %>" viewbox="<%= svgItem.viewBox %>">
<use xlink:href="#<%= svgItem.name %>" />
</svg>
</div>
<h2><%= svgItem.name %></h2>
<button onclick="showPopover('snippet-<%= svgItem.name %>')">Show Snippet</button>
<br/>
<button onclick="invertBackground('icon-box-<%= svgItem.name %>')">Invert Background</button>
<div class="snippet-popover" id="snippet-<%= svgItem.name %>">
<pre><code>&lt;svg class=&quot;<%= common %> <%= svgItem.name %>&quot;&gt;&lt;use xlink:href=&quot;#<%= svgItem.name %>&quot;&gt;&lt;/use&gt;&lt;/svg&gt;</code></pre>
<button onclick="hidePopover()">Close</button>
</div>
</li>
<% }); %>
</ul>
</section>
<footer>
<p>Generated by <a href="https://github.com/shakyshane/gulp-svg-sprites">Gulp Svg Sprites</a> - Preview page courtesy of <a href="http://iconizr.com" target="_blank">iconizr</a>.</p>
Expand All @@ -214,4 +213,4 @@ <h2>{name}</h2>
}
</script>
</body>
</html>
</html>