Skip to content

Commit 7143509

Browse files
committed
refactor: switch to iconify
1 parent 3fee582 commit 7143509

6 files changed

Lines changed: 23 additions & 11 deletions

File tree

src/components/Icon.svelte

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
<script>
2+
import { icons } from "@iconify-json/simple-icons/icons.json";
3+
import { height } from "@iconify-json/simple-icons/info.json";
4+
25
let { icon, class: classes, ...rest } = $props();
36
</script>
47

5-
<span class="bi bi-{icon} {classes}" {...rest}></span>
8+
<svg
9+
xmlns="http://www.w3.org/2000/svg"
10+
width={height}
11+
{height}
12+
fill="currentColor"
13+
viewBox="0 0 {height} {height}"
14+
class={classes}
15+
{...rest}>{@html icons[icon]?.body ?? ""}</svg>

src/components/Navbar.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
const pages = [
66
{
77
name: "Blog",
8-
icon: "book-half",
8+
icon: "bookstack",
99
url: "/blogs",
1010
},
1111
];
@@ -27,7 +27,7 @@
2727
<ul class="flex flex-row gap-4">
2828
{#each menu as { name, icon, url } (url)}
2929
<li>
30-
<a href={url} title={name} class="hover:text-neutral-300">
30+
<a href={url} title={name} class="flex gap-2 hover:text-neutral-300">
3131
<Icon {icon} />
3232
<span class="hidden md:inline">{name}</span>
3333
</a>

src/routes/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<p class="**:inline">
6060
Halo, saya <b>Hyper-Z11</b>. Seorang programmer pemula. Nama asli saya adalah
6161
<b>Firjatullah Zeroun</b>. Saya dari
62-
<a href="https://id.wikipedia.org/wiki/Indonesia"><b><Icon icon="pin-map" class="mx-1" />Indonesia</b></a>. Saya
62+
<a href="https://id.wikipedia.org/wiki/Indonesia"><b><Icon icon="googlemaps" class="h-5" />Indonesia</b></a>. Saya
6363
suka koding sebagai hobi saya dan berkontribusi ke proyek sumber terbuka jika saya mau. Anda mungkin tidak akan
6464
menemukan banyak hal disini. Jadi terima kasih sudah berkunjung. Dan jika anda mau, mungkin anda bisa mengunjungi
6565
<a href="/blogs">kumpulan blog saya</a>.

src/routes/data-for-home.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
{
3131
"name": "JSON",
32-
"icon": "braces",
32+
"icon": "json",
3333
"color": "orange"
3434
},
3535
{
@@ -39,7 +39,7 @@
3939
},
4040
{
4141
"name": "HTML",
42-
"icon": "code-slash",
42+
"icon": "html5",
4343
"color": "orange"
4444
},
4545
{
@@ -56,22 +56,22 @@
5656
},
5757
{
5858
"name": "Node.js",
59-
"icon": "app",
59+
"icon": "nodedotjs",
6060
"color": "green"
6161
},
6262
{
6363
"name": "Vite",
64-
"icon": "lightning",
64+
"icon": "vite",
6565
"color": "darkviolet"
6666
},
6767
{
6868
"name": "NPM",
69-
"icon": "app",
69+
"icon": "npm",
7070
"color": "red"
7171
},
7272
{
7373
"name": "PNPM",
74-
"icon": "app",
74+
"icon": "pnpm",
7575
"color": "yellow"
7676
}
7777
]

src/styles/index.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@import "tailwindcss";
2-
@import "bootstrap-icons/font/bootstrap-icons.css";
32

43
@keyframes down {
54
from {

vite.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ import tailwindcss from "@tailwindcss/vite";
44

55
export default defineConfig({
66
plugins: [sveltekit(), tailwindcss()],
7+
json: {
8+
namedExports: true,
9+
},
710
});

0 commit comments

Comments
 (0)