Skip to content

Commit

Permalink
Added sub scale
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Strachan committed Aug 16, 2023
1 parent 988cc15 commit f7f692c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bb-fontawesome",
"version": "6.2.1-free",
"version": "1.1_6.2.1-free",
"description": "A FontAwesome component for Budibase",
"license": "MIT",
"author": "Matthew Strachan",
Expand Down
8 changes: 8 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
"min": 1,
"max": 50
},
{
"type": "number",
"key": "iconSubScale",
"label": "Sub Scale",
"defaultValue": 0,
"min": 0,
"max": 9
},
{
"type": "color",
"key": "iconColour",
Expand Down
8 changes: 5 additions & 3 deletions src/Component.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
export let iconStyle;
export let iconName;
export let iconScale;
export let iconSubScale;
export let iconColour;
export let iconFlip;
export let iconAnimate;
Expand Down Expand Up @@ -47,15 +48,16 @@
return word[0].toUpperCase() + word.substring(1);
}).join("");
$: fScale = iconScale + (iconSubScale / 10);
</script>

<div use:styleable={$component.styles}>
{#if iconAnimate === "Spin"}
<Icon class="faIcon" data={faStyle[faName]} scale={iconScale} flip="{iconFlip.toLowerCase()}" spin style="color: {iconColour}"/>
<Icon class="faIcon" data={faStyle[faName]} scale="{fScale}" flip="{iconFlip.toLowerCase()}" spin style="color: {iconColour}"/>
{:else if iconAnimate === "Pulse"}
<Icon class="faIcon" data={faStyle[faName]} scale={iconScale} flip="{iconFlip.toLowerCase()}" pulse style="color: {iconColour}"/>
<Icon class="faIcon" data={faStyle[faName]} scale="{fScale}" flip="{iconFlip.toLowerCase()}" pulse style="color: {iconColour}"/>
{:else}
<Icon class="faIcon" data={faStyle[faName]} scale={iconScale} flip="{iconFlip.toLowerCase()}" style="color: {iconColour}"/>
<Icon class="faIcon" data={faStyle[faName]} scale="{fScale}" flip="{iconFlip.toLowerCase()}" style="color: {iconColour}"/>
{/if}
</div>

Expand Down

0 comments on commit f7f692c

Please sign in to comment.