forked from thedevdojo/pines
-
Notifications
You must be signed in to change notification settings - Fork 0
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
10 changed files
with
330 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<div x-data="{ | ||
hoverCardHovered: false, | ||
hoverCardTimout: null, | ||
hoverCardLeaveTimeout: null, | ||
hoverCardDelay: 1000, | ||
hoverCardLeaveDelay: 500, | ||
hoverCardEnter () { | ||
clearTimeout(this.hoverCardLeaveTimeout); | ||
if(this.hoverCardHovered) return; | ||
clearTimeout(this.hoverCardTimout); | ||
this.hoverCardTimout = setTimeout(() => { | ||
this.hoverCardHovered = true; | ||
}, this.hoverCardDelay); | ||
}, | ||
hoverCardLeave () { | ||
clearTimeout(this.hoverCardTimout); | ||
if(!this.hoverCardHovered) return; | ||
clearTimeout(this.hoverCardLeaveTimeout); | ||
this.hoverCardLeaveTimeout = setTimeout(() => { | ||
this.hoverCardHovered = false; | ||
}, this.hoverCardLeaveDelay); | ||
} | ||
}" class="relative" @mouseover="hoverCardEnter()" @mouseleave="hoverCardLeave()"> | ||
<a href="#_" class="hover:underline">@thedevdojo</a> | ||
<div x-show="hoverCardHovered" class="absolute top-0 w-[365px] max-w-lg mt-5 z-30 -translate-x-1/2 translate-y-3 left-1/2" x-cloak> | ||
<div x-show="hoverCardHovered" class="w-[full] h-auto bg-white space-x-3 p-5 flex items-start rounded-md shadow-sm border border-neutral-200/70" x-transition> | ||
<img src="https://cdn.devdojo.com/users/June2022/devdojo.jpg" alt="devdojo image" class="rounded-full w-14 h-14" /> | ||
<div class="relative"> | ||
<p class="mb-1 font-bold">@thedevdojo</p> | ||
<p class="mb-1 text-sm text-gray-600">The creative platform for developers. Community, tools, products, and more</p> | ||
<p class="flex items-center space-x-1 text-xs text-gray-400"> | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5"> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5m-9-6h.008v.008H12v-.008zM12 15h.008v.008H12V15zm0 2.25h.008v.008H12v-.008zM9.75 15h.008v.008H9.75V15zm0 2.25h.008v.008H9.75v-.008zM7.5 15h.008v.008H7.5V15zm0 2.25h.008v.008H7.5v-.008zm6.75-4.5h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V15zm0 2.25h.008v.008h-.008v-.008zm2.25-4.5h.008v.008H16.5v-.008zm0 2.25h.008v.008H16.5V15z" /> | ||
</svg> | ||
<span>Joined June 2020</span> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<div x-data="{ | ||
imageGalleryShow: false, | ||
activeImageUrl: null, | ||
index: null, | ||
imageGalleryOpen(event) { | ||
this.index = event.target.dataset.index; | ||
this.activeImageUrl = event.target.src; | ||
this.imageGalleryShow = true; | ||
}, | ||
imageGalleryClose() { | ||
this.imageGalleryShow = false; | ||
setTimeout(() => this.activeImageUrl = null, 300); | ||
}, | ||
imageGalleryNext(){ | ||
if(this.index == 10){ | ||
this.index = 1; | ||
} else { | ||
this.index = parseInt(this.index) + 1; | ||
} | ||
this.activeImageUrl = this.$refs.gallery.querySelector('[data-index=\'' + this.index + '\']').src; | ||
}, | ||
imageGalleryPrev() { | ||
if(this.index == 1){ | ||
this.index = 10; | ||
} else { | ||
this.index = parseInt(this.index) - 1; | ||
} | ||
this.activeImageUrl = this.$refs.gallery.querySelector('[data-index=\'' + this.index + '\']').src; | ||
} | ||
}" | ||
@image-gallery-next.window="imageGalleryNext()" | ||
@image-gallery-prev.window="imageGalleryPrev()" | ||
@keyup.right.window="imageGalleryNext();" | ||
@keyup.left.window="imageGalleryPrev();" | ||
x-init=" | ||
imageGalleryPhotos = $refs.gallery.querySelectorAll('img'); | ||
for(let i=0; i<imageGalleryPhotos.length; i++){ | ||
imageGalleryPhotos[i].setAttribute('data-index', i+1); | ||
} | ||
" | ||
class="w-full h-full select-none"> | ||
<div class="max-w-6xl mx-auto duration-1000 delay-300 opacity-0 select-none ease animate-fade-in-view" style="translate: none; rotate: none; scale: none; opacity: 1; transform: translate(0px, 0px);"> | ||
<ul x-ref="gallery" id="gallery" class="grid grid-cols-2 gap-5 lg:grid-cols-5"> | ||
<li><img x-on:click="imageGalleryOpen" src="https://cdn.devdojo.com/images/june2023/mountains-01.jpeg" class="object-cover select-none w-full h-auto bg-gray-200 rounded cursor-zoom-in aspect-[5/6] lg:aspect-[2/3] xl:aspect-[3/4]" alt="photo gallery image 01"></li> | ||
<li><img x-on:click="imageGalleryOpen" src="https://cdn.devdojo.com/images/june2023/mountains-02.jpeg" class="object-cover select-none w-full h-auto bg-gray-200 rounded cursor-zoom-in aspect-[5/6] lg:aspect-[2/3] xl:aspect-[3/4]" alt="photo gallery image 02"></li> | ||
<li><img x-on:click="imageGalleryOpen" src="https://cdn.devdojo.com/images/june2023/mountains-03.jpeg" class="object-cover select-none w-full h-auto bg-gray-200 rounded cursor-zoom-in aspect-[5/6] lg:aspect-[2/3] xl:aspect-[3/4]" alt="photo gallery image 03"></li> | ||
<li><img x-on:click="imageGalleryOpen" src="https://cdn.devdojo.com/images/june2023/mountains-04.jpeg" class="object-cover select-none w-full h-auto bg-gray-200 rounded cursor-zoom-in aspect-[5/6] lg:aspect-[2/3] xl:aspect-[3/4]" alt="photo gallery image 04"></li> | ||
<li><img x-on:click="imageGalleryOpen" src="https://cdn.devdojo.com/images/june2023/mountains-05.jpeg" class="object-cover select-none w-full h-auto bg-gray-200 rounded cursor-zoom-in aspect-[5/6] lg:aspect-[2/3] xl:aspect-[3/4]" alt="photo gallery image 05"></li> | ||
<li><img x-on:click="imageGalleryOpen" src="https://cdn.devdojo.com/images/june2023/mountains-06.jpeg" class="object-cover select-none w-full h-auto bg-gray-200 rounded cursor-zoom-in aspect-[5/6] lg:aspect-[2/3] xl:aspect-[3/4]" alt="photo gallery image 06"></li> | ||
<li><img x-on:click="imageGalleryOpen" src="https://cdn.devdojo.com/images/june2023/mountains-07.jpeg" class="object-cover select-none w-full h-auto bg-gray-200 rounded cursor-zoom-in aspect-[5/6] lg:aspect-[2/3] xl:aspect-[3/4]" alt="photo gallery image 07"></li> | ||
<li><img x-on:click="imageGalleryOpen" src="https://cdn.devdojo.com/images/june2023/mountains-08.jpeg" class="object-cover select-none w-full h-auto bg-gray-200 rounded cursor-zoom-in aspect-[5/6] lg:aspect-[2/3] xl:aspect-[3/4]" alt="photo gallery image 08"></li> | ||
<li><img x-on:click="imageGalleryOpen" src="https://cdn.devdojo.com/images/june2023/mountains-09.jpeg" class="object-cover select-none w-full h-auto bg-gray-200 rounded cursor-zoom-in aspect-[5/6] lg:aspect-[2/3] xl:aspect-[3/4]" alt="photo gallery image 09"></li> | ||
<li><img x-on:click="imageGalleryOpen"" src="https://cdn.devdojo.com/images/june2023/mountains-10.jpeg" class="object-cover select-none w-full h-auto bg-gray-200 rounded cursor-zoom-in aspect-[5/6] lg:aspect-[2/3] xl:aspect-[3/4]" alt="photo gallery image 10"></li> | ||
</ul> | ||
</div> | ||
<template x-teleport="body"> | ||
<div | ||
x-show="imageGalleryShow" | ||
x-transition:enter="transition ease-in-out duration-300" | ||
x-transition:enter-start="opacity-0" | ||
x-transition:leave="transition ease-in-in duration-300" | ||
x-transition:leave-end="opacity-0" | ||
@click="imageGalleryClose" | ||
@keydown.window.escape="imageGalleryClose" | ||
x-trap.inert.noscroll="imageGalleryShow" | ||
class="fixed inset-0 z-[99] flex items-center justify-center bg-black bg-opacity-50 select-none cursor-zoom-out" x-cloak> | ||
<div class="relative flex items-center justify-center w-11/12 xl:w-4/5 h-11/12"> | ||
<div @click="$event.stopPropagation(); $dispatch('image-gallery-prev')" class="absolute left-0 flex items-center justify-center text-white translate-x-10 rounded-full cursor-pointer xl:-translate-x-24 2xl:-translate-x-32 bg-white/10 w-14 h-14 hover:bg-white/20"> | ||
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5L8.25 12l7.5-7.5" /></svg> | ||
</div> | ||
<img | ||
x-show="imageGalleryShow" | ||
x-transition:enter="transition ease-in-out duration-300" | ||
x-transition:enter-start="opacity-0 transform scale-50" | ||
x-transition:leave="transition ease-in-in duration-300" | ||
x-transition:leave-end="opacity-0 transform scale-50" | ||
class="object-contain object-center w-full h-full select-none cursor-zoom-out" :src="activeImageUrl" alt="" style="display: none;"> | ||
<div @click="$event.stopPropagation(); $dispatch('image-gallery-next');" class="absolute right-0 flex items-center justify-center text-white -translate-x-10 rounded-full cursor-pointer xl:translate-x-24 2xl:translate-x-32 bg-white/10 w-14 h-14 hover:bg-white/20"> | ||
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" /></svg> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
</div> |
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div x-data="{ | ||
radioGroupSelectedValue: null, | ||
radioGroupOptions: [ | ||
{ | ||
title: 'Tailwind CSS', | ||
description: 'A utility-first CSS framework for rapid UI development.', | ||
value: 'tailwind' | ||
}, | ||
{ | ||
title: 'Alpine JS', | ||
description: 'A rugged and lightweight JavaScript framework.', | ||
value: 'alpine' | ||
}, | ||
{ | ||
title: 'Laravel', | ||
description: 'The PHP Framework for Web Artisans.', | ||
value: 'laravel' | ||
} | ||
] | ||
}" class="space-y-3"> | ||
<template x-for="(option, index) in radioGroupOptions" :key="index"> | ||
<label @click="radioGroupSelectedValue=option.value" class="flex items-start p-5 space-x-3 bg-white border rounded-md shadow-sm hover:bg-gray-50 border-neutral-200/70"> | ||
<input type="radio" name="radio-group" :value="option.value" class="translate-y-px" /> | ||
<span class="relative flex flex-col space-y-1.5 leading-none"> | ||
<span x-text="option.title" class="font-semibold"></span> | ||
<span x-text="option.description" class="text-sm opacity-50"></span> | ||
</span> | ||
</label> | ||
</template> | ||
</div> |
Oops, something went wrong.