Skip to content

Instantly share code, notes, and snippets.

@maietta
Last active February 15, 2025 04:58
Show Gist options
  • Save maietta/c01c56bc2a9a2a60dfdc86f1b3b66616 to your computer and use it in GitHub Desktop.
Save maietta/c01c56bc2a9a2a60dfdc86f1b3b66616 to your computer and use it in GitHub Desktop.
SwiperJS with Svelte 5
<!-- Above the fold -->
<section class="container m-0 mx-auto flex p-0">
<div class="w-full md:w-1/2 lg:w-2/3">
{#if availableTabs.length > 1}
<Tabs.Root value="photos" class="relative z-0 border-2 p-4">
<!-- Tabs List -->
<Tabs.List class="absolute z-10 m-5">
{#each Object.values(availableTabs) as tab}
<Tabs.Trigger value={tab.value}>
{tab.label}
</Tabs.Trigger>
{/each}
</Tabs.List>
<!-- Tabs Content -->
{#each Object.values(availableTabs) as tab}
<Tabs.Content value={tab.value} class="m-0">
{#if tab.value === 'photos'}
<PhotoGallery {photos} />
{/if}
{#if tab.value === 'virtual-tour'}
<VirtualTour />
{/if}
{#if tab.value === 'drone-tour'}
<DroneTour />
{/if}
</Tabs.Content>
{/each}
</Tabs.Root>
{:else}
<!-- Show Photos Component Only -->
<div class="w-full">
<PhotoGallery {photos} />
</div>
{/if}
</div>
<!-- Secondary Content -->
<div class="w-full md:w-1/2 lg:w-1/3">
<!-- Property Inquiry Form -->
<div class="container sticky top-0">
<!-- <InqueryForm mlsid={mls.SystemID} {address} /> -->
</div>
</div>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment