-
-
Notifications
You must be signed in to change notification settings - Fork 0
Update Contacting Bar #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5dcdc20
6d1bd99
ad10111
f7fe70b
1d82081
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||||||||||||||||
| "use client"; | ||||||||||||||||||||||||||||||
| import { FacebookIcon } from '@/components/icons/facebook'; | ||||||||||||||||||||||||||||||
| import { FigmaIcon } from '@/components/icons/figma'; | ||||||||||||||||||||||||||||||
| import { GitHubIcon } from '@/components/icons/github'; | ||||||||||||||||||||||||||||||
| import { motion } from 'framer-motion'; | ||||||||||||||||||||||||||||||
| import Link from 'next/link'; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export const ContactBar = () => { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| const headlineVariants = { | ||||||||||||||||||||||||||||||
| hidden: { opacity: 0, y: -10 }, | ||||||||||||||||||||||||||||||
| visible: { opacity: 1, y: 0, transition: { duration: 0.4, delay: 0.3 } } | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||
| <motion.div | ||||||||||||||||||||||||||||||
| variants={headlineVariants} | ||||||||||||||||||||||||||||||
| initial="hidden" | ||||||||||||||||||||||||||||||
| animate="visible" | ||||||||||||||||||||||||||||||
| className='flex-col flex absolute max-sm:right-3 right-0 max-sm:top-3 top-1/4'> | ||||||||||||||||||||||||||||||
| <ol className='items-center flex flex-col gap-5'> | ||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||
| <Link href="https://fb.me/chat.leatsophat" target='_blank'> <FacebookIcon className='size-6 text-foreground/50 hover:text-foreground' /> </Link> | ||||||||||||||||||||||||||||||
| </li> | ||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||
| <Link href="https://github.com/pphatdev" target='_blank'> <GitHubIcon className='size-6 text-foreground/50 hover:text-foreground' /> </Link> | ||||||||||||||||||||||||||||||
| </li> | ||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||
| <Link href="https://t.me/SophatLEAT" target='_blank'> <FigmaIcon className='stroke-1 size-6 text-foreground/50 hover:text-foreground' /> </Link> | ||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+29
|
||||||||||||||||||||||||||||||
| <Link href="https://fb.me/chat.leatsophat" target='_blank'> <FacebookIcon className='size-6 text-foreground/50 hover:text-foreground' /> </Link> | |
| </li> | |
| <li> | |
| <Link href="https://github.com/pphatdev" target='_blank'> <GitHubIcon className='size-6 text-foreground/50 hover:text-foreground' /> </Link> | |
| </li> | |
| <li> | |
| <Link href="https://t.me/SophatLEAT" target='_blank'> <FigmaIcon className='stroke-1 size-6 text-foreground/50 hover:text-foreground' /> </Link> | |
| <Link href="https://fb.me/chat.leatsophat" target='_blank' rel="noopener noreferrer"> <FacebookIcon className='size-6 text-foreground/50 hover:text-foreground' /> </Link> | |
| </li> | |
| <li> | |
| <Link href="https://github.com/pphatdev" target='_blank' rel="noopener noreferrer"> <GitHubIcon className='size-6 text-foreground/50 hover:text-foreground' /> </Link> | |
| </li> | |
| <li> | |
| <Link href="https://t.me/SophatLEAT" target='_blank' rel="noopener noreferrer"> <FigmaIcon className='stroke-1 size-6 text-foreground/50 hover:text-foreground' /> </Link> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,42 @@ | ||
| "use client"; | ||
| import { motion, type Variants } from 'framer-motion'; | ||
| import { useCallback } from 'react'; | ||
| import { RainbowGlow } from './rainbow-glow'; | ||
| import Image from 'next/image'; | ||
|
|
||
| export const Profile = () => { | ||
|
|
||
| const loadImage = (src: string): Promise<HTMLImageElement> => new Promise<HTMLImageElement>(resolve => { | ||
| const img = new Image(); | ||
| img.onload = () => resolve(img); | ||
| img.src = src; | ||
| }); | ||
| // const loadImage = (src: string): Promise<HTMLImageElement> => new Promise<HTMLImageElement>(resolve => { | ||
| // const img = new Image(); | ||
| // img.onload = () => resolve(img); | ||
| // img.src = src; | ||
| // }); | ||
|
|
||
| const renderCanvas = useCallback((canvas: HTMLCanvasElement | null): void => { | ||
| if (!canvas) return; | ||
| // const renderCanvas = useCallback((canvas: HTMLCanvasElement | null): void => { | ||
| // if (!canvas) return; | ||
|
|
||
| const ctx = canvas.getContext('2d'); | ||
| if (!ctx) return; | ||
| // const ctx = canvas.getContext('2d'); | ||
| // if (!ctx) return; | ||
|
|
||
| canvas.width = 500; | ||
| canvas.height = 500; | ||
| // canvas.width = 500; | ||
| // canvas.height = 500; | ||
|
|
||
| Promise.all([ | ||
| loadImage('/assets/gallery/WEBP/IMG_1915.webp'), | ||
| loadImage('/assets/masks/mask.webp') | ||
| ]).then(([img, mask]) => { | ||
| const scale = Math.max(canvas.width / img.width, canvas.height / img.height); | ||
| const x = (canvas.width - img.width * scale) / 2; | ||
| const y = (canvas.height - img.height * scale) / 2; | ||
| // Promise.all([ | ||
| // loadImage('/assets/avatars/profile.JPG'), | ||
| // // loadImage('/assets/gallery/WEBP/IMG_1915.webp'), | ||
| // loadImage('/assets/masks/mask.webp') | ||
| // ]).then(([img, mask]) => { | ||
| // const scale = Math.max(canvas.width / img.width, canvas.height / img.height); | ||
| // const x = (canvas.width - img.width * scale) / 2; | ||
| // const y = (canvas.height - img.height * scale) / 2; | ||
|
|
||
| // Draw image with object-cover behavior | ||
| ctx.drawImage(img, x, y, img.width * scale, img.height * scale); | ||
| // // Draw image with object-cover behavior | ||
| // ctx.drawImage(img, x, y, img.width * scale, img.height * scale); | ||
|
|
||
| // Apply mask | ||
| ctx.globalCompositeOperation = 'destination-in'; | ||
| ctx.drawImage(mask, 0, 0, 500, 500); | ||
| }); | ||
| }, []); | ||
| // // Apply mask | ||
| // ctx.globalCompositeOperation = 'destination-in'; | ||
| // ctx.drawImage(mask, 0, 0, 500, 500); | ||
| // }); | ||
| // }, []); | ||
|
|
||
|
Comment on lines
+8
to
40
|
||
| const contentDelay = 0.3; | ||
| const bannerVariants: Variants = { | ||
|
|
@@ -48,11 +49,9 @@ export const Profile = () => { | |
| variants={bannerVariants} | ||
| initial="hidden" | ||
| animate="visible" | ||
| className="max-w-sm w-full h-full relative max-sm:border inline-flex mt-2 items-center justify-center" | ||
| className="max-w-sm w-full h-full relative max-sm:border inline-flex items-center justify-center xl:p-7" | ||
| > | ||
| <div className="p-7 h-full w-full"> | ||
| <canvas ref={renderCanvas} className="h-full w-full bg-center m-1" /> | ||
| </div> | ||
| <Image src={'/assets/avatars/profile.webp'} width={512} height={512} className='w-full lg:rounded-4xl object-cover aspect-square' alt='Profile Image'></Image> | ||
| <RainbowGlow className="opacity-20" /> | ||
| </motion.div> | ||
| ); | ||
|
|
||
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.
The Telegram link is using the FigmaIcon; import and use a TelegramIcon component instead to correctly represent the platform.