feat: add icon mapping for skills component
- remove console debug
This commit is contained in:
@@ -1,19 +1,28 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { SkillEntry } from '$lib/types/data';
|
import type { LucideIconName, SkillEntry } from '$lib/types/data';
|
||||||
import { Languages } from '@lucide/svelte';
|
import { Languages } from '@lucide/svelte';
|
||||||
|
import { iconComponentMapping } from '$lib/mapping/icon-mapping.svelte';
|
||||||
|
|
||||||
let { icon, title, items }: SkillEntry = $props();
|
let { icon, title, items }: SkillEntry = $props();
|
||||||
|
|
||||||
let subtitle = $derived.by(() => {
|
let subtitle = $derived.by(() => {
|
||||||
return `${items.length} Einräge`;
|
return `${items.length} Einräge`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let component = iconComponentMapping[icon as LucideIconName];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<article>
|
<article>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="header-icon">
|
<div class="header-icon">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<Languages class="icon" />
|
{#if component}
|
||||||
|
{#await component then { default: Component }}
|
||||||
|
<Component class="icon" />
|
||||||
|
{/await}
|
||||||
|
{:else}
|
||||||
|
<Languages class="icon" />
|
||||||
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="headline">
|
<div class="headline">
|
||||||
@@ -34,9 +43,9 @@
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
article {
|
article {
|
||||||
grid-row: span 2;
|
grid-row: span 2;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-rows: subgrid;
|
grid-template-rows: subgrid;
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
|
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
@@ -108,7 +117,7 @@
|
|||||||
.item-tags {
|
.item-tags {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
align-content: start;
|
align-content: start;
|
||||||
justify-items: stretch;
|
justify-items: stretch;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
@@ -126,7 +135,7 @@
|
|||||||
background-color: var(--color-skill-card-item-background);
|
background-color: var(--color-skill-card-item-background);
|
||||||
|
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
@@ -134,7 +143,7 @@
|
|||||||
|
|
||||||
@media (min-width: 786px) {
|
@media (min-width: 786px) {
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.75rem 1rem;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@@ -148,7 +157,7 @@
|
|||||||
transition: scale ease-in-out 0.2s;
|
transition: scale ease-in-out 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-tags-tag:hover div {
|
.item-tags-tag:hover div {
|
||||||
scale: 1.05;
|
scale: 1.05;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -122,12 +122,12 @@
|
|||||||
"entries": [
|
"entries": [
|
||||||
{
|
{
|
||||||
"title": "Programmiersprachen",
|
"title": "Programmiersprachen",
|
||||||
"icon": "language",
|
"icon": "code-xml",
|
||||||
"items": ["Java", "JavaScript", "TypeScript", "Visual Basic", "C#", "SQL", "HTML", "CSS"]
|
"items": ["Java", "JavaScript", "TypeScript", "Visual Basic", "C#", "SQL", "HTML", "CSS"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Frameworks",
|
"title": "Frameworks",
|
||||||
"icon": "language",
|
"icon": "cpu",
|
||||||
"items": [
|
"items": [
|
||||||
"Spring Boot",
|
"Spring Boot",
|
||||||
"NodeJs",
|
"NodeJs",
|
||||||
@@ -140,47 +140,47 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Meta-Frameworks",
|
"title": "Meta-Frameworks",
|
||||||
"icon": "language",
|
"icon": "layers",
|
||||||
"items": ["Next.JS", "SvelteKit", "Express", "Fastify", "Sap Composable Storefront"]
|
"items": ["Next.JS", "SvelteKit", "Express", "Fastify", "Sap Composable Storefront"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Datenbanken",
|
"title": "Datenbanken",
|
||||||
"icon": "language",
|
"icon": "database",
|
||||||
"items": ["PostgreSQL", "MariaDB", "MySQL", "SQLite", "MongoDB", "Oracle", "MS SQL"]
|
"items": ["PostgreSQL", "MariaDB", "MySQL", "SQLite", "MongoDB", "Oracle", "MS SQL"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "CMS",
|
"title": "CMS",
|
||||||
"icon": "language",
|
"icon": "layout-template",
|
||||||
"items": ["Contentful", "Strapi", "Smartedit"]
|
"items": ["Contentful", "Strapi", "Smartedit"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Testing",
|
"title": "Testing",
|
||||||
"icon": "language",
|
"icon": "test-tubes",
|
||||||
"items": ["JUnit", "Playwright", "Cypres"]
|
"items": ["JUnit", "Playwright", "Cypres"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Sicherheitslösungen",
|
"title": "Sicherheitslösungen",
|
||||||
"icon": "language",
|
"icon": "shield-check",
|
||||||
"items": ["Keycloak", "JWT", "OAuth2"]
|
"items": ["Keycloak", "JWT", "OAuth2"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Entwicklungs Tools",
|
"title": "Entwicklungs Tools",
|
||||||
"icon": "language",
|
"icon": "wrench",
|
||||||
"items": ["Git", "Podman", "Docker", "WSL", "IntelliJ Idea", "Figma"]
|
"items": ["Git", "Podman", "Docker", "WSL", "IntelliJ Idea", "Figma"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Restful APIs und Dokumentation",
|
"title": "Restful APIs und Dokumentation",
|
||||||
"icon": "language",
|
"icon": "file-braces-corner",
|
||||||
"items": ["OpenAPI", "Swagger", "Confluence"]
|
"items": ["OpenAPI", "Swagger", "Confluence"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Methoden",
|
"title": "Methoden",
|
||||||
"icon": "language",
|
"icon": "clipboard-check",
|
||||||
"items": ["Scrum", "Kanban", "Jira"]
|
"items": ["Scrum", "Kanban", "Jira"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Sonstiges",
|
"title": "Sonstiges",
|
||||||
"icon": "language",
|
"icon": "sparkles",
|
||||||
"items": ["SEO", "Accessibility", "KI-basierte Tools"]
|
"items": ["SEO", "Accessibility", "KI-basierte Tools"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
20
src/lib/mapping/icon-mapping.svelte.ts
Normal file
20
src/lib/mapping/icon-mapping.svelte.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import type { LucideIconName } from '$lib/types/data';
|
||||||
|
import type { Component } from 'svelte';
|
||||||
|
|
||||||
|
export const iconComponentMapping: Partial<
|
||||||
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
||||||
|
Record<LucideIconName, Promise<{ default: Component<any> }>>
|
||||||
|
> = {
|
||||||
|
Languages: import('@lucide/svelte/icons/languages'),
|
||||||
|
CodeXml: import('@lucide/svelte/icons/code-xml'),
|
||||||
|
Cpu: import('@lucide/svelte/icons/cpu'),
|
||||||
|
Layers: import('@lucide/svelte/icons/layers'),
|
||||||
|
Database: import('@lucide/svelte/icons/database'),
|
||||||
|
LayoutTemplate: import('@lucide/svelte/icons/layout-template'),
|
||||||
|
TestTubes: import('@lucide/svelte/icons/test-tubes'),
|
||||||
|
ShieldCheck: import('@lucide/svelte/icons/shield-check'),
|
||||||
|
Wrench: import('@lucide/svelte/icons/wrench'),
|
||||||
|
FileBracesCorner: import('@lucide/svelte/icons/file-braces-corner'),
|
||||||
|
ClipboardCheck: import('@lucide/svelte/icons/clipboard-check'),
|
||||||
|
Sparkles: import('@lucide/svelte/icons/sparkles')
|
||||||
|
};
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
import CmsComponent from '$lib/components/cms/CmsComponent.svelte';
|
import CmsComponent from '$lib/components/cms/CmsComponent.svelte';
|
||||||
|
|
||||||
let { data }: PageProps = $props();
|
let { data }: PageProps = $props();
|
||||||
console.debug(data)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#each data.components as component, index (index)}
|
{#each data.components as component, index (index)}
|
||||||
|
|||||||
Reference in New Issue
Block a user