Skip to content

Commit 43c06da

Browse files
🎨 Add parallax hover effect to laracon ticket image
1 parent 412aaae commit 43c06da

File tree

7 files changed

+55
-10
lines changed

7 files changed

+55
-10
lines changed

‎package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@tailwindcss/postcss": "^4.1.8",
1616
"@tailwindcss/typography": "^0.5.16",
1717
"alpinejs": "^3.14.9",
18+
"atropos": "^2.0.2",
1819
"axios": "^1.9.0",
1920
"gsap": "^3.13.0",
2021
"laravel-vite-plugin": "^0.7.8",
8.76 KB
Binary file not shown.
Binary file not shown.
-45.5 KB
Binary file not shown.

‎resources/js/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import {
88
} from '../../vendor/livewire/livewire/dist/livewire.esm'
99
import codeBlock from './alpine/codeBlock.js'
1010
import docsearch from '@docsearch/js'
11+
import Atropos from 'atropos'
1112
import '@docsearch/css'
13+
import 'atropos/css'
1214

1315
import.meta.glob(['../images/**', '../svg/**'])
1416
import {
@@ -50,6 +52,9 @@ window.motion = {
5052
cubicBezier: cubicBezier,
5153
}
5254

55+
// Atropos
56+
window.Atropos = Atropos
57+
5358
// GSAP
5459
window.gsap = gsap
5560

‎resources/views/laracon-us-2025-competition.blade.php

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<x-layout>
22
{{-- Hero Section --}}
33
<section class="mx-auto mt-12 max-w-5xl px-5">
4-
<div class="grid place-items-center text-center">
4+
<div
5+
x-ref="ticketEvent"
6+
class="grid place-items-center text-center"
7+
>
58
{{-- Countdown Header --}}
69
<h2
710
x-init="
@@ -114,21 +117,46 @@ class="text-base text-slate-600 uppercase dark:text-white/60"
114117
})
115118
}
116119
"
117-
class="relative isolate mt-8"
120+
class="relative isolate p-10"
118121
>
119-
<img
120-
src="{{ Vite::asset('resources/images/laraconus2025ticket.webp') }}"
121-
alt="Laracon US 2025 Ticket"
122-
class="max-w-130"
123-
/>
122+
<div
123+
x-init="
124+
() => {
125+
Atropos({
126+
el: $el,
127+
activeOffset: 10,
128+
shadow: false,
129+
highlight: false,
130+
eventsEl: $refs.ticketEvent,
131+
})
132+
}
133+
"
134+
class="atropos"
135+
>
136+
<div class="atropos-scale">
137+
<div class="atropos-rotate">
138+
<div class="atropos-inner">
139+
<img
140+
src="{{ Vite::asset('resources/images/laracon/laraconus2025ticket.webp') }}"
141+
alt="Laracon US 2025 Ticket"
142+
class="max-w-130"
143+
/>
144+
<img
145+
data-atropos-offset="8"
146+
src="{{ Vite::asset('resources/images/laracon/laracon.webp') }}"
147+
alt="Laracon"
148+
class="absolute right-34 bottom-6 w-58"
149+
/>
150+
</div>
151+
</div>
152+
</div>
153+
</div>
124154
<div
125155
class="absolute top-1/2 right-1/2 -z-10 hidden h-full w-full translate-x-1/2 -translate-y-1/2 rounded-full bg-slate-500/25 blur-3xl dark:block"
126156
></div>
127157
</div>
128158

129-
<header
130-
class="relative z-10 mt-10 grid place-items-center text-center"
131-
>
159+
<header class="relative z-10 grid place-items-center text-center">
132160
{{-- Primary Heading --}}
133161
<h1
134162
id="hero-heading"

0 commit comments

Comments
 (0)