2022-06-03 11:04:30 -05:00
|
|
|
<script lang="ts">
|
2023-10-25 09:48:25 -04:00
|
|
|
import Icon from '$lib/components/elements/icon.svelte';
|
2022-06-03 11:04:30 -05:00
|
|
|
|
2023-10-25 09:48:25 -04:00
|
|
|
export let icon: string;
|
2023-10-10 17:34:17 +03:00
|
|
|
export let backgroundColor = '';
|
2023-07-01 00:50:47 -04:00
|
|
|
export let hoverColor = '#e2e7e9';
|
2023-09-01 18:00:51 +02:00
|
|
|
export let padding = '3';
|
2023-07-01 00:50:47 -04:00
|
|
|
export let size = '24';
|
|
|
|
|
export let title = '';
|
|
|
|
|
export let isOpacity = false;
|
|
|
|
|
export let forceDark = false;
|
|
|
|
|
export let hideMobile = false;
|
2023-11-05 18:24:43 +01:00
|
|
|
export let iconColor = 'currentColor';
|
2023-12-07 03:03:28 +01:00
|
|
|
export let buttonSize: string | undefined = undefined;
|
2022-06-03 11:04:30 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<button
|
2023-07-01 00:50:47 -04:00
|
|
|
{title}
|
2023-12-07 03:03:28 +01:00
|
|
|
style:width={buttonSize ? buttonSize + 'px' : ''}
|
|
|
|
|
style:height={buttonSize ? buttonSize + 'px' : ''}
|
2023-07-01 00:50:47 -04:00
|
|
|
style:background-color={backgroundColor}
|
|
|
|
|
style:--immich-icon-button-hover-color={hoverColor}
|
|
|
|
|
class:dark:text-immich-dark-fg={!forceDark}
|
2023-09-01 18:00:51 +02:00
|
|
|
class="flex place-content-center place-items-center rounded-full p-{padding} transition-all
|
2023-06-14 20:47:18 -05:00
|
|
|
{isOpacity ? 'hover:bg-immich-bg/30' : 'immich-circle-icon-button hover:dark:text-immich-dark-gray'}
|
2023-06-20 16:36:38 +02:00
|
|
|
{forceDark && 'hover:text-black'}
|
|
|
|
|
{hideMobile && 'hidden sm:flex'}"
|
2023-07-01 00:50:47 -04:00
|
|
|
on:click
|
2022-06-03 11:04:30 -05:00
|
|
|
>
|
2023-11-05 18:24:43 +01:00
|
|
|
<Icon path={icon} {size} color={iconColor} />
|
2023-07-01 00:50:47 -04:00
|
|
|
<slot />
|
2022-06-03 11:04:30 -05:00
|
|
|
</button>
|
2022-07-23 13:08:49 -05:00
|
|
|
|
|
|
|
|
<style>
|
2023-07-01 00:50:47 -04:00
|
|
|
:root {
|
|
|
|
|
--immich-icon-button-hover-color: #d3d3d3;
|
|
|
|
|
}
|
2022-07-23 13:08:49 -05:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
.immich-circle-icon-button:hover {
|
|
|
|
|
background-color: var(--immich-icon-button-hover-color) !important;
|
|
|
|
|
}
|
2022-07-23 13:08:49 -05:00
|
|
|
</style>
|