-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
190 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,65 @@ | ||
<script lang='ts'> | ||
export let layersettings:any; | ||
export let name:string; | ||
export let selectedSettingsTab:string; | ||
export let runSettingsAdapt:any; | ||
export let urlicon:string; | ||
export let change:string; | ||
<script lang="ts"> | ||
export let layersettings: any; | ||
export let name: string; | ||
export let selectedSettingsTab: string; | ||
export let runSettingsAdapt: any; | ||
export let urlicon: string; | ||
export let change: string; | ||
export let nestedchange: string = ''; | ||
</script> | ||
|
||
<!-- {#if layersettings} --> | ||
<!-- {#if layersettings[selectedSettingsTab]} --> | ||
<div on:click={() => { | ||
layersettings[selectedSettingsTab][change] = !layersettings[selectedSettingsTab][change] ; | ||
runSettingsAdapt(); | ||
}} | ||
|
||
on:keydown={() => { | ||
layersettings[selectedSettingsTab][change] = !layersettings[selectedSettingsTab][change] ; | ||
runSettingsAdapt(); | ||
}} | ||
<div | ||
role="button" | ||
tabindex="0" | ||
on:click={() => { | ||
if (nestedchange != '') { | ||
Object.keys(layersettings[selectedSettingsTab][change]).forEach(element => { | ||
console.log(element) | ||
layersettings[selectedSettingsTab][change][element] = false; | ||
}); | ||
layersettings[selectedSettingsTab][change][nestedchange] = true; | ||
} else { | ||
layersettings[selectedSettingsTab][change] = !layersettings[selectedSettingsTab][change]; | ||
} | ||
runSettingsAdapt(); | ||
}} | ||
on:keydown={() => { | ||
if (nestedchange != '') { | ||
Object.keys(layersettings[selectedSettingsTab][change]).forEach(element => { | ||
layersettings[selectedSettingsTab][change][element] = false; | ||
}); | ||
layersettings[selectedSettingsTab][change][nestedchange] = true; | ||
} else { | ||
layersettings[selectedSettingsTab][change] = !layersettings[selectedSettingsTab][change]; | ||
} | ||
runSettingsAdapt(); | ||
}} | ||
> | ||
<!--Toggle Routes--> | ||
<div | ||
aria-label={`${name} button`} | ||
class:border-blue-500={layersettings[selectedSettingsTab][change] == true} | ||
class:dark:border-blue-50={layersettings[selectedSettingsTab][change] == true} | ||
class:border-transparent={layersettings[selectedSettingsTab][change] == false} | ||
class={`bg-[#f5f1f0] dark:bg-[#1C2738] rounded-xl border-2`}><img src={urlicon} class='w-14 h-14' alt='' /></div> | ||
<p class='text-sm text-center '>{name}</p> | ||
{#if nestedchange} | ||
<!--Toggle Routes--> | ||
<div | ||
aria-label={`${name} button`} | ||
class:border-blue-500={layersettings[selectedSettingsTab][change][nestedchange] == true} | ||
class:dark:border-blue-50={layersettings[selectedSettingsTab][change][nestedchange] == true} | ||
class:border-transparent={layersettings[selectedSettingsTab][change][nestedchange] == false} | ||
class={`bg-[#f5f1f0] dark:bg-[#1C2738] rounded-xl border-2`} | ||
> | ||
<img src={urlicon} class="w-14 h-14" alt="" /> | ||
</div> | ||
<p class="text-sm text-center">{name}</p> | ||
{:else} | ||
<div | ||
aria-label={`${name} button`} | ||
class:border-blue-500={layersettings[selectedSettingsTab][change] == true} | ||
class:dark:border-blue-50={layersettings[selectedSettingsTab][change] == true} | ||
class:border-transparent={layersettings[selectedSettingsTab][change] == false} | ||
class={`bg-[#f5f1f0] dark:bg-[#1C2738] rounded-xl border-2`} | ||
> | ||
<img src={urlicon} class="w-14 h-14" alt="" /> | ||
</div> | ||
<p class="text-sm text-center">{name}</p> | ||
{/if} | ||
</div> | ||
<!-- {/if}{/if} --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters