Skip to content

Commit

Permalink
Fix: made images not selectable and undraggable
Browse files Browse the repository at this point in the history
  • Loading branch information
SRINJAYDASGUPTA-Git committed Dec 28, 2023
1 parent 8894c95 commit b8c200e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions apps/web/app/components/Killers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const Killers = ({ image, twitterUserName }: KillersProps) => {
height={36}
width={37}
alt={`${image}`}
className='unselectable'
draggable='false'
/>
</div>
<div className={`flex flex-col justify-center items-center gap-1 ${inter.className}`}>
Expand Down
2 changes: 2 additions & 0 deletions apps/web/app/components/Links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const Links = ({ icon, description, link }: LinksProps) => {
alt={`${icon}`}
height={12}
width={13}
className='unselectable'
draggable='false'
/>
<p className="text-white text-sm">{description}</p>
</div>
Expand Down
9 changes: 9 additions & 0 deletions apps/web/app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@
margin: 0;
padding: 0;
}

.unselectable {
user-drag: none;
user-select: none;
-moz-user-select: none;
-webkit-user-drag: none;
-webkit-user-select: none;
-ms-user-select: none;
}
6 changes: 3 additions & 3 deletions apps/web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ export default async function Index() {
</div>
<div className="bg-[#03080B] w-full min-h-screen flex justify-center items-center absolute">
<div className='h-[69.16vh] w-[61.23vw] absolute'>
<Image src="./grid.svg" alt="grid" fill />
<Image src="./grid.svg" alt="grid" fill className='unselectable' draggable='false' />
</div>
<div className='h-[47.51vh] w-[87.92vw] absolute'>
<Image src="./stars.svg" alt="stars" fill />
<Image src="./stars.svg" alt="stars" fill className='unselectable' draggable='false' />
</div>
<div className="bg-transparent w-fit h-[75%] flex flex-col p-1 mt-20 gap-10 z-20">
<div className="flex flex-col items-center justify-center gap-10 min-w-screen">
<div className="flex items-center justify-center">
<Image src="./logo.svg" height={60} width={61} alt="logo" />
<Image src="./logo.svg" height={60} width={61} alt="logo" className='unselectable' draggable='false' />
<h1
className={`px-4 bg-gradient-to-br from-[#727576] to-[#fafafb] inline-block text-transparent bg-clip-text text-6xl ${poppins.className} py-1 md:text-5xl lg:text-7xl`}
>
Expand Down

0 comments on commit b8c200e

Please sign in to comment.