fix(carousel): restore center start, fix drag events, remove favicon from manifest, optimize framer-motion
This commit is contained in:
@@ -10,11 +10,7 @@ export default function manifest(): MetadataRoute.Manifest {
|
|||||||
background_color: '#001a4d',
|
background_color: '#001a4d',
|
||||||
theme_color: '#001a4d',
|
theme_color: '#001a4d',
|
||||||
icons: [
|
icons: [
|
||||||
{
|
|
||||||
src: '/favicon.ico',
|
|
||||||
sizes: 'any',
|
|
||||||
type: 'image/x-icon',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
src: '/logo.png',
|
src: '/logo.png',
|
||||||
sizes: '512x512',
|
sizes: '512x512',
|
||||||
|
|||||||
@@ -107,18 +107,18 @@ export function ReferencesSlider(props: ReferencesSliderProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="container relative z-10">
|
<div className="relative z-10">
|
||||||
<div className="absolute right-0 top-0 bottom-0 w-16 bg-gradient-to-l from-neutral-dark to-transparent z-20 md:hidden pointer-events-none" />
|
<div className="absolute right-0 top-0 bottom-0 w-16 bg-gradient-to-l from-neutral-dark to-transparent z-20 md:hidden pointer-events-none" />
|
||||||
|
|
||||||
{/* Carousel: stays inside container for left alignment, breaks right to viewport edge */}
|
{/* Carousel: breaks viewport edge on both sides but initial padding aligns with container */}
|
||||||
|
<LazyMotion features={domAnimation}>
|
||||||
<div
|
<div
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
onMouseDown={onMouseDown}
|
onMouseDown={onMouseDown}
|
||||||
onMouseLeave={onMouseLeave}
|
onMouseLeave={onMouseLeave}
|
||||||
onMouseUp={onMouseUp}
|
onMouseUp={onMouseUp}
|
||||||
onMouseMove={onMouseMove}
|
onMouseMove={onMouseMove}
|
||||||
style={{ marginRight: 'calc(-50vw + 50%)' }}
|
className={`select-none flex gap-6 overflow-x-auto pb-8 pt-4 px-6 md:px-[max(2rem,calc((100vw-1280px)/2))] lg:px-[max(2.5rem,calc((100vw-1280px)/2))] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden ${isDragging ? 'cursor-grabbing snap-none' : 'cursor-grab snap-x snap-mandatory'}`}
|
||||||
className={`select-none flex gap-6 overflow-x-auto pb-8 pt-4 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden ${isDragging ? 'cursor-grabbing snap-none' : 'cursor-grab snap-x snap-mandatory'}`}
|
|
||||||
>
|
>
|
||||||
{references.map((ref, i) => {
|
{references.map((ref, i) => {
|
||||||
const imgSrc = ref.image
|
const imgSrc = ref.image
|
||||||
@@ -126,8 +126,8 @@ export function ReferencesSlider(props: ReferencesSliderProps) {
|
|||||||
: fallbacks[i % fallbacks.length];
|
: fallbacks[i % fallbacks.length];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LazyMotion key={ref.id} features={domAnimation}>
|
|
||||||
<m.div
|
<m.div
|
||||||
|
key={ref.id}
|
||||||
initial={{ opacity: 0, x: 20 }}
|
initial={{ opacity: 0, x: 20 }}
|
||||||
whileInView={{ opacity: 1, x: 0 }}
|
whileInView={{ opacity: 1, x: 0 }}
|
||||||
viewport={{ once: true, margin: "-50px" }}
|
viewport={{ once: true, margin: "-50px" }}
|
||||||
@@ -167,12 +167,12 @@ export function ReferencesSlider(props: ReferencesSliderProps) {
|
|||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</m.div>
|
</m.div>
|
||||||
</LazyMotion>
|
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
{/* Right padding spacer so last card doesn't clip at viewport edge */}
|
{/* Right padding spacer so last card doesn't clip at viewport edge */}
|
||||||
<div className="flex-shrink-0 w-6" aria-hidden="true" />
|
<div className="flex-shrink-0 w-6" aria-hidden="true" />
|
||||||
</div>
|
</div>
|
||||||
|
</LazyMotion>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="container relative z-10 mt-4 flex justify-center">
|
<div className="container relative z-10 mt-4 flex justify-center">
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user