Skip to content

Commit

Permalink
Created responsive event section, fix navbar design glitch, setup new…
Browse files Browse the repository at this point in the history
… components library shadcn
  • Loading branch information
utsavdotdev committed Jul 13, 2024
1 parent cfda48a commit c344dd5
Show file tree
Hide file tree
Showing 15 changed files with 1,141 additions and 39 deletions.
17 changes: 17 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": false,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
10 changes: 10 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
// ...
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
// ...
}
}
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@
"preview": "vite preview"
},
"dependencies": {
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"lucide-react": "^0.407.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.24.0"
"react-router-dom": "^6.24.0",
"tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@types/react": "^18.3.3",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Links.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const Links = ({ index, to, text }) => {

const style =
hash === to
? "block py-2 px-3 hover:bg-gray md:hover:text-white rounded md:bg-transparent md:text-gray-900 md:p-0 md:hover:bg-black md:px-4 md:py-2 md:rounded-full transition delay-80 md:bg-black md:text-white"
: "block py-2 px-3 hover:bg-gray md:hover:text-white rounded md:bg-transparent md:text-gray-900 md:p-0 md:hover:bg-black md:px-4 md:py-2 md:rounded-full transition delay-80";
? "block py-2 px-3 hover:bg-gray md:hover:text-white rounded md:text-gray-900 md:p-0 md:hover:bg-black md:px-4 md:py-2 md:rounded-full md:bg-black md:text-white transition delay-80"
: "block py-2 px-3 hover:bg-gray md:hover:text-white rounded md:text-gray-900 md:p-0 md:hover:bg-black md:px-4 md:py-2 md:rounded-full transition delay-80";
return (
<>
<li key={index}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Navbar = () => {
<div className="flex lg:order-2 space-x-3 lg:space-x-0 rtl:space-x-reverse gap-4">
<button
type="button"
className="hidden md:flex text-black bg-white hover:bg-gray-500 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-md px-4 py-2 text-center rounded-full border-black border-2"
className="hidden md:flex text-black bg-white hover:bg-gray-500 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-md px-4 py-2 text-center rounded-full border-black border-2"
>
Become a Member!
</button>
Expand Down
35 changes: 35 additions & 0 deletions src/components/ui/avatar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use client"

import * as React from "react"
import * as AvatarPrimitive from "@radix-ui/react-avatar"

import { cn } from "@/lib/utils"

const Avatar = React.forwardRef(({ className, ...props }, ref) => (
<AvatarPrimitive.Root
ref={ref}
className={cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className)}
{...props} />
))
Avatar.displayName = AvatarPrimitive.Root.displayName

const AvatarImage = React.forwardRef(({ className, ...props }, ref) => (
<AvatarPrimitive.Image
ref={ref}
className={cn("aspect-square h-full w-full", className)}
{...props} />
))
AvatarImage.displayName = AvatarPrimitive.Image.displayName

const AvatarFallback = React.forwardRef(({ className, ...props }, ref) => (
<AvatarPrimitive.Fallback
ref={ref}
className={cn(
"flex h-full w-full items-center justify-center rounded-full bg-muted",
className
)}
{...props} />
))
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName

export { Avatar, AvatarImage, AvatarFallback }
47 changes: 47 additions & 0 deletions src/components/ui/button.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva } from "class-variance-authority";

import { cn } from "@/lib/utils"

const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline:
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
icon: "h-10 w-10",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)

const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
return (
(<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props} />)
);
})
Button.displayName = "Button"

export { Button, buttonVariants }
43 changes: 43 additions & 0 deletions src/components/ui/tabs.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"use client"

import * as React from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs"

import { cn } from "@/lib/utils"

const Tabs = TabsPrimitive.Root

const TabsList = React.forwardRef(({ className, ...props }, ref) => (
<TabsPrimitive.List
ref={ref}
className={cn(
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
className
)}
{...props} />
))
TabsList.displayName = TabsPrimitive.List.displayName

const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => (
<TabsPrimitive.Trigger
ref={ref}
className={cn(
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
className
)}
{...props} />
))
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName

const TabsContent = React.forwardRef(({ className, ...props }, ref) => (
<TabsPrimitive.Content
ref={ref}
className={cn(
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
className
)}
{...props} />
))
TabsContent.displayName = TabsPrimitive.Content.displayName

export { Tabs, TabsList, TabsTrigger, TabsContent }
38 changes: 36 additions & 2 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,41 @@
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 240 5.9% 10%;
--primary-foreground: 0 0% 98%;
--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 45%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 72% 51%;
--destructive-foreground: 0 0% 98%;
--border: 240 5.9% 90%;
--input: 240 5.9% 90%;
--ring: 240 5.9% 10%;
--radius: 0.5rem;
}
}

html {
scroll-behavior: smooth;
html{
scroll-behavior: smooth;
}

@layer base {
* {
@apply border-border;
}

body {
@apply bg-background text-foreground;
}
}
6 changes: 6 additions & 0 deletions src/lib/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { clsx } from "clsx"
import { twMerge } from "tailwind-merge"

export function cn(...inputs) {
return twMerge(clsx(inputs))
}
2 changes: 1 addition & 1 deletion src/sections/Aboutus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
const Aboutus = () => {
return (
<>
<section id="absolute aboutus" className="min-h-[100vh] flex justify-center items-center border-2 flex-col">
<section id="aboutus" className="min-h-[100vh] flex justify-center items-center flex-col">
<div className="relative image px-10 border-2 w-[95%] h-[50vh] mt-5 ">

</div>
Expand Down
Loading

0 comments on commit c344dd5

Please sign in to comment.