system-uicons/src/index.html
2021-03-28 18:25:11 +08:00

424 lines
16 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<title>System UIcons</title>
<meta name="title" content="System UIcons" />
<meta
name="description"
content="A free icon set designed for systems and products. Use how you want, without attribution."
/>
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://systemuicons.com/" />
<meta property="og:title" content="System UIcons" />
<meta
property="og:description"
content="A free icon set designed for systems and products. Use how you want, without attribution."
/>
<meta
property="og:image"
content="https://systemuicons.com/images/ogp/systemuicons_banner.png"
/>
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://systemuicons.com/" />
<meta property="twitter:title" content="System UIcons" />
<meta
property="twitter:description"
content="A free icon set designed for systems and products. Use how you want, without attribution."
/>
<meta
property="twitter:image"
content="https://systemuicons.com/images/ogp/systemuicons_banner.png"
/>
<script
src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.3.5/dist/alpine.min.js"
defer
></script>
<link rel="icon" type="image/svg+xml" href="/images/favicons/favicon.svg" />
<link
rel="mask-icon"
href="/images/favicons/safari-pinned-tab.svg"
color="#2A2E3B"
/>
<!-- Primary Meta Tags -->
</head>
<body
class="flex flex-col min-h-screen font-mono leading-normal tracking-normal bg-white"
x-data="loadIcons()"
>
<main class="flex-grow">
<nav class="flex justify-between p-4 text-sm md:p-6 lg:p-8 md:text-base">
<a class="font-extrabold" href="/">System UIcons</a>
<div class="space-x-3 md:space-x-8">
<!-- <a class="hover:underline" href="/about">Behind the design</a>
<a class="hover:underline" href="/changelog">Changelog</a> -->
<a
class="hover:underline"
href="https://github.com/CoreyGinnivan/system-uicons"
rel="noreferrer"
target="_blank"
>GitHub</a
>
<a
class="hover:underline"
href="https://github.com/sponsors/CoreyGinnivan"
rel="noreferrer"
target="_blank"
>Sponsor</a
>
</div>
</nav>
<div class="p-4 md:p-6 lg:p-8">
<p class="text-xl leading-tight text-black lg:text-3xl xl:text-5xl">
A growing collection of simple and consistent icons specifically
designed for systems and products.
<strong class="italic underline"
>Use how you want, without attribution.</strong
>
</p>
</div>
<div
class="flex flex-row items-center px-4 py-4 mt-4 text-gray-400 bg-white md:px-6 lg:px-8 md:mt-6 lg:mt-8"
>
<svg
viewBox="0 0 21 21"
xmlns="http://www.w3.org/2000/svg"
class="w-6 h-6 mr-4 md:w-7 lg:w-12 md:h-7 lg:h-12"
>
<g
fill="none"
fill-rule="evenodd"
stroke="currentcolor"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="8.5" cy="8.5" r="5" />
<path d="m17.571 17.5-5.571-5.5" />
</g>
</svg>
<input
onFocus="this.select()"
autofocus="autofocus"
x-ref="searchField"
x-model="search"
x-on:keydown.window.prevent.slash="$refs.searchField.focus()"
x-bind:placeholder="'Search ' + myForData.length + ' System UIcons'"
type="text"
name="search"
value=""
autocapitalize="off"
autocomplete="off"
autocorrect="off"
spellcheck="false"
class="flex flex-1 w-full text-xl tracking-tighter text-black placeholder-gray-400 appearance-none focus:outline-none focus:text-black lg:text-3xl xl:text-5xl"
/>
</div>
<div
class="sticky top-0 z-10 flex flex-col px-4 py-4 space-y-2 bg-white border-t border-gray-300 md:space-y-0 md:flex-row md:px-6 lg:px-8"
>
<div
class="flex flex-col p-1 space-x-0 space-y-1 bg-gray-200 rounded md:flex-row md:space-x-1 md:space-y-0"
>
<label
class="inline-flex flex-no-wrap items-center w-full h-full px-2 py-2 text-sm transition duration-200 rounded cursor-pointer lg:text-base hover:bg-gray-100 hover:text-black md:w-auto md:py-0"
:class="downloadType === 'copy-svg' ? 'bg-white shadow' : 'text-gray-600'"
>
<input
type="radio"
class="hidden"
name="copy-svg"
x-model="downloadType"
:value="'copy-svg'"
checked
/>
<span class="mr-2">
<svg
xmlns="http://www.w3.org/2000/svg"
width="21"
height="21"
viewBox="0 0 21 21"
>
<g
fill="none"
fill-rule="evenodd"
stroke="currentcolor"
stroke-linecap="round"
stroke-linejoin="round"
transform="translate(2 3)"
>
<line x1="10.5" x2="6.5" y1=".5" y2="14.5" />
<polyline
points="7.328 2.672 7.328 8.328 1.672 8.328"
transform="rotate(135 4.5 5.5)"
/>
<polyline
points="15.328 6.672 15.328 12.328 9.672 12.328"
transform="scale(1 -1) rotate(-45 -10.435 0)"
/>
</g>
</svg>
</span>
<span class="whitespace-no-wrap">Copy SVG Code</span>
</label>
<label
class="inline-flex flex-no-wrap items-center w-full h-full px-2 py-2 text-sm transition duration-200 rounded cursor-pointer lg:text-base hover:bg-gray-100 hover:text-black md:w-auto md:py-0"
:class="downloadType === 'copy-cdn' ? 'bg-white shadow' : 'text-gray-600'"
>
<input
type="radio"
class="hidden"
name="copy-cdn"
x-model="downloadType"
:value="'copy-cdn'"
/>
<span class="mr-2">
<svg
height="21"
viewBox="0 0 21 21"
width="21"
xmlns="http://www.w3.org/2000/svg"
>
<g
fill="none"
fill-rule="evenodd"
stroke="currentcolor"
stroke-linecap="round"
stroke-linejoin="round"
transform="translate(4 4)"
>
<path
d="m5.5 7.5c.96940983 1.36718798 3.01111566 1.12727011 4.01111565 0l1.98888435-2c1.1243486-1.22807966 1.1641276-2.81388365 0-4-1.135619-1.15706921-2.86438099-1.15706947-4 0l-2 2"
/>
<path
d="m.64175661 12.3971156c.96940983 1.367188 3 1.1970433 4 .0697732l2-1.9748738c1.12434863-1.22807961 1.16412758-2.83900987 0-4.02512622-1.13561902-1.15706922-2.86438099-1.15706948-4 0l-2 2"
transform="matrix(-1 0 0 -1 8.14 18.966)"
/>
</g>
</svg>
</span>
<span class="whitespace-no-wrap">Copy CDN Link</span>
</label>
<label
class="inline-flex flex-no-wrap items-center w-full h-full px-2 py-2 text-sm transition duration-200 rounded cursor-pointer lg:text-base hover:bg-gray-100 hover:text-black md:w-auto md:py-0"
:class="downloadType === 'download-svg' ? 'bg-white shadow' : 'text-gray-600'"
>
<input
type="radio"
class="hidden"
name="download-svg"
x-model="downloadType"
:value="'download-svg'"
/>
<span class="mr-2">
<svg
height="21"
viewBox="0 0 21 21"
width="21"
xmlns="http://www.w3.org/2000/svg"
>
<g
fill="none"
fill-rule="evenodd"
stroke="currentcolor"
stroke-linecap="round"
stroke-linejoin="round"
transform="translate(4 3)"
>
<path
d="m9.221 4.716.165 5.821-5.792-.135"
transform="matrix(-.70710678 .70710678 .70710678 .70710678 5.685139 -2.354861)"
/>
<path d="m6.5.5v11" />
<path d="m.5 14.5h12" />
</g>
</svg>
</span>
<span class="whitespace-no-wrap">Download SVG Icon</span>
</label>
</div>
<a
href="images/System UIcons.zip"
class="flex flex-row items-center w-full p-3 ml-auto text-sm text-white bg-black rounded lg:text-base hover:bg-gray-900 md:w-auto"
download
>
<span class="mr-2">
<svg
height="21"
viewBox="0 0 21 21"
width="21"
xmlns="http://www.w3.org/2000/svg"
>
<g
fill="none"
fill-rule="evenodd"
stroke="currentcolor"
stroke-linecap="round"
stroke-linejoin="round"
transform="translate(4 3)"
>
<path
d="m9.221 4.716.165 5.821-5.792-.135"
transform="matrix(-.70710678 .70710678 .70710678 .70710678 5.685139 -2.354861)"
/>
<path d="m6.5.5v11" />
<path d="m.5 14.5h12" />
</g>
</svg>
</span>
<span class="whitespace-no-wrap">Download All Icons</span>
</a>
</div>
<div
class="grid grid-cols-2 gap-2 p-4 md:p-6 lg:p-8 md:grid-cols-3 lg:grid-cols-6 xl:grid-cols-8 md:gap-4"
>
<template x-for="(item, index) in filteredIcons" :key="index">
<a
href=""
x-bind:href="document.location.protocol +
'//' +
document.location.host +
`/images/icons/` +
item.icon_path +
`.svg`"
x-bind:download="downloadType === 'download-svg' && item.icon_name"
class="relative flex flex-col items-center justify-center h-32 p-2 text-gray-700 transition duration-150 ease-in-out bg-white rounded shadow cursor-pointer group hover:shadow-xl md:h-40"
@click="handleClick(item, downloadType, $event, $dispatch)"
>
<div>
<div
role="alert"
x-show="copied === item.icon_name"
x-on:show:toast.document="copied = $event.detail"
x-cloak
class="absolute top-0 left-0 right-0 z-50 px-2 py-1 mx-auto -mt-8 text-sm text-center text-white bg-black rounded"
style="width: fit-content"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 transform scale-90"
x-transition:enter-end="opacity-100 transform scale-100"
x-transition:leave="transition ease-in duration-500 "
x-transition:leave-start="opacity-100 transform scale-100"
x-transition:leave-end="opacity-0 transform scale-90"
>
<template x-if="downloadType == 'download-svg'"
><span>Downloading!</span></template
>
<template x-if="downloadType == 'copy-cdn'"
><span>Copied URL</span></template
>
<template x-if="downloadType == 'copy-svg'"
><span>Copied SVG Code</span></template
>
</div>
</div>
<img
:src="`images/icons/` + item.icon_path + `.svg`"
:alt="item.icon_name"
class="transition duration-200 transform group-hover:scale-200"
loading="lazy"
/>
<p
class="mt-4 text-xs leading-none tracking-tight text-center text-gray-600 md:mt-8"
x-text="item.icon_name"
></p>
<span class="hidden" x-text="item.icon_keywords"></span>
</a>
</template>
<div x-show="filteredIcons.length === 0" class="col-span-2">
<h3 class="text-xl text-gray-500">No Matches Found</h3>
</div>
</div>
</main>
<footer
class="flex flex-col py-8 mx-8 space-y-4 text-gray-700 border-t border-gray-300 md:space-y-0 md:flex-row"
>
<span>
Project by
<a
href="https://twitter.com/CoreyGinnivan"
rel="noreferrer"
target="_blank"
class="text-black hover:underline"
>Corey Ginnivan</a
>
</span>
<span class="md:ml-auto">Use how you want, without attribution</span>
</footer>
<script type="text/javascript" src="/js/data.js"></script>
<script>
function loadIcons() {
return {
search: "",
downloadType: "copy-svg",
myForData: sourceData,
copied: false,
get filteredIcons() {
if (this.search === "") {
return this.myForData;
}
return this.myForData.filter((item) => {
return item.icon_keywords
.toLowerCase()
.includes(this.search.toLowerCase());
});
},
handleClick(item, downloadType, event, $dispatch) {
if (downloadType === "copy-svg") {
event.preventDefault();
var url =
document.location.protocol +
"//" +
document.location.host +
`/images/icons/` +
item.icon_path +
`.svg`;
fetch(url).then(function (response) {
if (response.ok) {
response.text().then(function (svg) {
navigator.clipboard.writeText(svg);
$dispatch("show:toast", item.icon_name);
setTimeout(() => $dispatch("show:toast", false), 1000);
});
}
});
}
if (downloadType === "copy-cdn") {
event.preventDefault();
var url =
document.location.protocol +
"//" +
document.location.host +
`/images/icons/` +
item.icon_path +
`.svg`;
navigator.clipboard.writeText(url);
$dispatch("show:toast", item.icon_name);
setTimeout(() => $dispatch("show:toast", false), 1000);
} else {
$dispatch("show:toast", item.icon_name);
setTimeout(() => $dispatch("show:toast", false), 1000);
}
},
};
}
</script>
<!-- Fathom - beautiful, simple website analytics -->
<script
src="https://cdn.usefathom.com/script.js"
site="BBRZGFHT"
defer
></script>
<!-- / Fathom -->
</body>
</html>