-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
1 parent
ee3d3d6
commit 41e2eef
Showing
1 changed file
with
79 additions
and
82 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,82 +1,79 @@ | ||
<script> | ||
import LazyImg from '$lib/components/Image/LazyImg.svelte' | ||
export let heroBanners | ||
</script> | ||
|
||
{#if heroBanners?.length > 0} | ||
<div> | ||
<div class="grid grid-cols-1 sm:grid-cols-2"> | ||
<a | ||
href="{heroBanners[0]?.link || '##'}" | ||
aria-label="Click here to view the banner's related products" | ||
> | ||
<LazyImg | ||
src="{heroBanners[0]?.img}" | ||
alt="" | ||
height="390" | ||
aspect_ratio="2:1" | ||
class="col-span-1 h-full w-full object-cover" | ||
/> | ||
</a> | ||
|
||
<a | ||
href="{heroBanners[1]?.link || '##'}" | ||
aria-label="Click here to view the banner's related products" | ||
> | ||
<LazyImg | ||
src="{heroBanners[1]?.img}" | ||
alt="" | ||
height="390" | ||
aspect_ratio="2:1" | ||
class="col-span-1 h-full w-full object-cover" | ||
/> | ||
</a> | ||
</div> | ||
|
||
<div class="grid grid-cols-1 sm:grid-cols-2"> | ||
<div class="grid grid-cols-2"> | ||
<a | ||
href="{heroBanners[2]?.link || '##'}" | ||
aria-label="Click here to view the banner's related products" | ||
> | ||
<LazyImg | ||
src="{heroBanners[2]?.img}" | ||
alt="" | ||
height="390" | ||
aspect_ratio="1:1" | ||
class="col-span-1 h-full w-full object-cover" | ||
/> | ||
</a> | ||
|
||
<a | ||
href="{heroBanners[2]?.link || '##'}" | ||
aria-label="Click here to view the banner's related products" | ||
> | ||
<LazyImg | ||
src="{heroBanners[3]?.img}" | ||
alt="" | ||
height="390" | ||
aspect_ratio="1:1" | ||
class="col-span-1 h-full w-full object-cover" | ||
/> | ||
</a> | ||
</div> | ||
|
||
<div> | ||
<a | ||
href="{heroBanners[4]?.link || '##'}" | ||
aria-label="Click here to view the banner's related products" | ||
> | ||
<LazyImg | ||
src="{heroBanners[4]?.img}" | ||
alt="" | ||
height="390" | ||
aspect_ratio="2:1" | ||
class="col-span-1 h-full w-full object-cover" | ||
/> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
{/if} | ||
<script> | ||
import LazyImg from '$lib/components/Image/LazyImg.svelte' | ||
export let heroBanners | ||
function generateRandomImage() { | ||
const randomNum = Math.floor(Math.random() * 10) // Generates a random number between 0 and 9 | ||
// Replace the image source with a random image URL | ||
return 'https://source.unsplash.com/random/' + randomNum | ||
} | ||
</script> | ||
|
||
{#if heroBanners?.length > 0} | ||
<div> | ||
<div class="grid grid-cols-1 sm:grid-cols-2"> | ||
<a | ||
href="{heroBanners[0]?.link || '##'}" | ||
aria-label="Click here to view the banner's related products"> | ||
<LazyImg | ||
src="{heroBanners[0]?.img || generateRandomImage()}" | ||
alt="" | ||
height="390" | ||
aspect_ratio="2:1" | ||
class="col-span-1 h-full max-h-[390px] w-full object-cover aspect-video" /> | ||
</a> | ||
|
||
<a | ||
href="{heroBanners[1]?.link || '##'}" | ||
aria-label="Click here to view the banner's related products"> | ||
<LazyImg | ||
src="{heroBanners[1]?.img || generateRandomImage()}" | ||
alt="" | ||
height="390" | ||
aspect_ratio="2:1" | ||
class="col-span-1 h-full max-h-[390px] w-full object-cover aspect-video" /> | ||
</a> | ||
</div> | ||
|
||
<div class="grid grid-cols-1 sm:grid-cols-2"> | ||
<div class="grid grid-cols-2"> | ||
<a | ||
href="{heroBanners[2]?.link || '##'}" | ||
aria-label="Click here to view the banner's related products"> | ||
<LazyImg | ||
src="{heroBanners[2]?.img || generateRandomImage()}" | ||
alt="" | ||
height="390" | ||
aspect_ratio="1:1" | ||
class="col-span-1 h-full max-h-[390px] w-full object-cover aspect-square" /> | ||
</a> | ||
|
||
<a | ||
href="{heroBanners[2]?.link || '##'}" | ||
aria-label="Click here to view the banner's related products"> | ||
<LazyImg | ||
src="{heroBanners[3]?.img || generateRandomImage()}" | ||
alt="" | ||
height="390" | ||
aspect_ratio="1:1" | ||
class="col-span-1 h-full max-h-[390px] w-full object-cover aspect-square" /> | ||
</a> | ||
</div> | ||
|
||
<div> | ||
<a | ||
href="{heroBanners[4]?.link || '##'}" | ||
aria-label="Click here to view the banner's related products"> | ||
<LazyImg | ||
src="{heroBanners[4]?.img || generateRandomImage()}" | ||
alt="" | ||
height="390" | ||
aspect_ratio="2:1" | ||
class="col-span-1 h-full max-h-[390px] w-full object-cover aspect-video" /> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
{/if} |
41e2eef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
svelte-commerce – ./
oxaaa.com
arialmall.com
arialshop.com
happyhappy.in
svelte-commerce-rho.vercel.app
misiki.in
www.misiki.in
hopyshopy.com
www.oxaaa.com
food.misiki.in
svelte-commerce-git-master-itswadesh.vercel.app
www.arialmall.com
www.happyhappy.in
svelte-commerce-itswadesh.vercel.app
www.arialshop.com
www.hopyshopy.com