Afegir compoentn de tecnologia

This commit is contained in:
Pau Figueras 2024-03-27 14:39:49 +01:00
pare d23a4c3127
commit a8648eca77

24
src/lib/tech.svelte Normal file
Veure arxiu

@ -0,0 +1,24 @@
<script lang="ts">
export let tech: string;
export let logoBaseDir: string;
export let logoFiletype: 'svg'| 'png' = 'svg';
export let size: 'small' | 'medium' | 'big' = 'small'
let logoDir: string = `/${logoBaseDir}/${tech}-logo.${logoFiletype}`;
let logoAlt: string = `${tech} logo`;
let isSmall = size === 'small';
let isMedium = size === 'medium';
let isBig = size === 'big';
</script>
<img src={logoDir} alt={logoAlt} class:small={isSmall} class:medium={isMedium} class:big={isBig}>
<style>
.small {
height: 3rem;
}
.medium {
height: 3.5rem;
}
.big {
height: 4rem;
}
</style>