Skip to content

Commit

Permalink
minor galley optimizations #7
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Aug 24, 2023
1 parent d90d87c commit d0f6c5c
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/gallery/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Metadata} from 'next';
import Gallery from '@/components/Gallery/Gallery';
import './styles.css';

export const metadata: Metadata = {
title: 'Gallery',
Expand Down
8 changes: 8 additions & 0 deletions app/gallery/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.pswp__img {
cursor: none !important;
}

.pswp {
z-index: 1000 !important;
--pswp-bg: theme("colors.alternate");
}
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Footer from '@/components/Footer/Footer';
import WithGtag from '@/lib/gtag/WithGtag';
import meta from './metadata';
import {kumbhSans, robotoMono} from './fonts';
import './globals.css';
import './styles.css';

export const metadata = meta;

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions app/teachers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default function Teachers() {
text="BOOK A LESSON"
className={CATLinkCn}
path="/contact"
customTransition={{delay: 0.5}}
/>
</div>
);
Expand Down
12 changes: 10 additions & 2 deletions components/CATLink/CATLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ type CATLinkProps = {
path: LinkProps['href'];
className?: string;
customVariants?: HTMLMotionProps<'div'>['variants'];
customTransition?: HTMLMotionProps<'div'>['transition'];
};

const defaultTransition = {delay: 1.2};
const defaultVariants = {
visible: {opacity: 1, y: 0, scale: 1},
hidden: {opacity: 0, y: '2rem', scale: 0.9},
Expand All @@ -30,10 +32,16 @@ const linkCn = clsx('tracking-wider', 'animated-link');
* @param {CATLinkProps} props Props.
* @returns React component.
*/
export default function CATLink({text, className, customVariants, path}: CATLinkProps) {
export default function CATLink({
text,
className,
customVariants,
path,
customTransition,
}: CATLinkProps) {
return (
<AppearInViewport
transition={{delay: 1.2}}
transition={{...defaultTransition, ...customTransition}}
className={twMerge(containerCn, className)}
variants={{...defaultVariants, ...customVariants}}
>
Expand Down
3 changes: 2 additions & 1 deletion components/Gallery/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import GalleryItem from './GalleryItem';
const containerCn = clsx('flex', 'flex-wrap', 'gap-4', 'justify-center');
const galleryId = 'images';
const photoSwipeOptions: GalleryProps['options'] = {
zoom: true,
zoom: false,
bgOpacity: 0.9,
closeOnVerticalDrag: true,
showHideAnimationType: 'fade',
doubleTapAction: false,
};

/**
Expand Down
9 changes: 1 addition & 8 deletions components/Teachers/Teacher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@ const variants = {
};

const cardCn = clsx('aspect-square', 'relative', 'filter grayscale-50', 'overflow-hidden');
const imgCn = clsx(
'object-cover',
'w-full',
'h-full',
'hover:transform hover:scale-110 hover:duration-2000',
'duration-500',
'ease-in',
);
const imgCn = clsx('object-cover', 'w-full', 'h-full');

/**
* @param {TeacherBlockProps} props Props.
Expand Down
4 changes: 4 additions & 0 deletions lib/customCursor/customCursorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const options: Options = {
innerSize: 12,
outerStyle: {
border: '2px solid white',
zIndex: 1001,
},
innerStyle: {
zIndex: 1001,
},
outerSize: 20,
outerScale: 2,
Expand Down

0 comments on commit d0f6c5c

Please sign in to comment.