Skip to content

Commit

Permalink
Merge pull request #2 from Ankit-Roy-CSE/main
Browse files Browse the repository at this point in the history
leaderboard cards
  • Loading branch information
Pudi-Sravan authored Sep 1, 2024
2 parents 457ea2a + 5312058 commit cd02932
Show file tree
Hide file tree
Showing 15 changed files with 313 additions and 55 deletions.
7 changes: 7 additions & 0 deletions app/(home)/page.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@

// Main styles
.main {
height: 100vh;
width: 100vw;
background-image: url('/Extentedbackground.svg');
background-repeat: no-repeat;
background-size: cover;
background-position: center;
position: relative;
height: 100vh;
width: 100vw;
background-image: url('/Extentedbackground.svg');
Expand Down
4 changes: 0 additions & 4 deletions app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ export default function Home() {
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
let frame = 0;

<<<<<<< HEAD
const randomizeText = (txt: string) => {
=======
const randomizeText = (txt : string) => {
>>>>>>> 137a176ee44b0d9b680febdbf7eb8857586f21f4
return txt
.split("")
.map(() => chars[Math.floor(Math.random() * chars.length)])
Expand Down
45 changes: 0 additions & 45 deletions app/leaderboard/components/Positions.tsx

This file was deleted.

6 changes: 4 additions & 2 deletions app/leaderboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import Navbar from "@/components/Navbar/navbar";
import { FaGithub, FaInstagram, FaLinkedin, FaGoogle } from "react-icons/fa";
import { FaSquareFacebook } from "react-icons/fa6";
import { FloatingDock } from "@/components/floatingdock/floatingicons";
import Positions from "./components/Positions";
import Positions from "@/components/Positions/Positions";
import Tiles from "@/components/projects/index";

export default function Leaderboard(){
const [loading, setLoading] = useState(true);
Expand Down Expand Up @@ -50,8 +51,9 @@ export default function Leaderboard(){
) : (
<>
<Navbar />
<div style={{display:"flex" , justifyContent : "center" , alignItems : "center" , height: "100%"}}>
<div style={{display:"flex" , flexDirection:"column" , justifyContent : "center" , alignItems : "center" , height: "100%"}}>
<Positions />
{/* <Tiles /> */}
</div>

<div className={styles.login}></div>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const MatrixRainingLetters = (props : any ) => {
return (
<>
<canvas key={keyName} className={thisClassName} ref={ref}
style={{height:"100%", width:"100%"}}/>
style={{height:"100%", width:"100%" , position:"absolute" , borderRadius:"10px"}}/>
</>
);
};
Expand Down
31 changes: 31 additions & 0 deletions components/Positions/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Canvas from "./Canvas"
import styles from "./Positions.module.scss"

interface CardProps{
pos : any ;
username : string ;
avatar : string ;
score : string ;
}

const Card : React.FC<CardProps> = ({ pos , username , avatar , score })=>{
let color , height ;
if(pos=='first')

return (
<div className={`${styles.leaderboardItem}`}>
<div className={styles.canvasContainer}>
<Canvas />
<div className={`${styles.userInfo} , ${styles.pos}`}
style={{}}>
<h1 className={styles.position}>{pos}</h1>
<img src={avatar} alt="Avatar" className={styles.avatar}/>
<h1 className={styles.username}>{username}</h1>
<h1 className={styles.score}>{score}</h1>
</div>
</div>
</div>
) ;
}

export default Card ;
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
height: 15rem;
box-shadow: 0 0 20px #FFD700;
border: 2px solid #FFD700;
background-color: rgba(255, 215, 0 , 0.2);
transition: all 0.3s ease-in-out;

}

.first:hover{
Expand All @@ -36,8 +39,11 @@

.second{
position: relative;
border-radius: 10px;
box-shadow: 0 0 20px #C0C0C0;
border: 2px solid #C0C0C0;
background-color: rgba(192, 192, 192 , 0.5) ;
transition: all 0.3s ease-in-out;
}

.second:hover{
Expand All @@ -47,6 +53,7 @@
.third{
position: relative;
box-shadow: 0 0 20px #cd7f32;
background-color: rgba(228, 255, 180 , 0.5);
border: 2px solid #cd7f32;
}

Expand All @@ -55,15 +62,16 @@
}


.canvas{
.canvasContainer{
border-radius: 10px;
position: absolute;
width: 100%;
height: 100%;
width: 30rem;
height: 12rem;
z-index: 0;
}

.userInfo{
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
Expand Down
53 changes: 53 additions & 0 deletions components/Positions/Positions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"use client" ;
import { useState } from 'react';

import styles from './Positions.module.scss';
import clsx from 'clsx';
import Canvas from './Canvas';
// import Matrix from './Matrix';
import Card from "./Card" ;

export default function Positions() {
const [pos , setPos] = useState("first");
return (
<div className={styles.container}>
<div className={`${styles.leaderboardItem}`}>
<div className={styles.canvasContainer}>
<Canvas color="#c0c0c0"/>
<div className={`${styles.userInfo} , ${styles.second}`}>
<h1 className={styles.position}>Second</h1>
<img src="https://www.w3schools.com/howto/img_avatar.png" alt="Avatar" className={styles.avatar}/>
<h1 className={styles.username}>John Doe</h1>
<h1 className={styles.score}>900</h1>
</div>
</div>

</div>
<Card pos={pos} username="Jane Doe" avatar="https://www.w3schools.com/howto/img_avatar.png" score="900" />
{/* <div className={`${styles.leaderboardItem} , ${styles.first}`}>
<div className={styles.canvasContainer}>
<Canvas />
<div className={`${styles.userInfo} , ${styles.first}`}>
<h1 className={styles.position}>First</h1>
<img src="https://www.w3schools.com/howto/img_avatar.png" alt="Avatar" className={styles.avatar}/>
<h1 className={styles.username}>John Doe</h1>
<h1 className={styles.score}>900</h1>
</div>
</div>
</div> */}
<Card pos='first' username="John Doe" avatar="https://www.w3schools.com/howto/img_avatar.png" score="1000" />
<div className={`${styles.leaderboardItem} , ${styles.third}`}>
<div className={styles.canvas}>
<Canvas color="#cd7f32"/>
</div>
<div className={styles.userInfo}>
<h1 className={styles.position}>Third</h1>
<img src="https://www.w3schools.com/howto/img_avatar.png" alt="Avatar" className={styles.avatar}/>
<h1 className={styles.username}>John Doe</h1>
<h1 className={styles.score}>900</h1>
</div>
</div>
{/* <Card pos='third' username="Jack Doe" avatar="https://www.w3schools.com/howto/img_avatar.png" score="800" /> */}
</div>
);
}
30 changes: 30 additions & 0 deletions components/projects/descriptions/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use client"
import React from 'react'
import styles from './style.module.scss';

export default function index({data , selectedProject} : any) {

const crop = (string: string, maxLength: number) => {
return string.substring(0, maxLength);
}

return (
<div className={styles.descriptions}>
{
data.map( (project: { title: any; description: any; } , i: number) => {
const { title, description } = project;
return (
<div
key={i}
className={styles.description}
style={{clipPath: selectedProject == i ? "inset(0 0 0)" : "inset(50% 0 50%"}}
>
<p>{crop(title, 9)}</p>
<p>{description}</p>
</div>
)
})
}
</div>
)
}
36 changes: 36 additions & 0 deletions components/projects/descriptions/style.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.descriptions{
position: absolute;
top: 3px;
height: 100%;
width: 100%;
z-index: 2;
pointer-events: none;
.description{
background-color: #2CFF05;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 10%;
padding-right: 10%;
clip-path: inset(50% 0 50%);
transition: clip-path .4s;

p{
&:nth-of-type(1){
color: #010101;
text-transform: uppercase;
font-weight: 700;
font-size: 6vw;
line-height: 5.5vw;
margin: 0px;
position: relative;
z-index: 1;
}
&:nth-of-type(2){
width: 40%;
font-size: 1vw;
font-weight: 700;
}
}
}
}
48 changes: 48 additions & 0 deletions components/projects/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use client';
import { useState } from 'react';
import styles from './style.module.scss';
import Titles from './titles';
import Descriptions from './descriptions';

const data = [
{
title: "Ford",
description: "Working on the Next-Generation HMI Experience without no driving experience.",
speed: 0.5
},
{
title: "UFC",
description: "Developed the Future of UFC Sports Ecosystem despite not being a sports fan.",
speed: 0.5
},
{
title: "Lincoln",
description: "Defined the visual concept and design language for the Lincoln Zephyr 2022 but never seen it in real life.",
speed: 0.67
},
{
title: "Royal Caribbean",
description: "I was just one person on a massive team that created an entire Royal Caribbean eco-system.",
speed: 0.8
},
{
title: "Sleepiq",
description: "Designed a 1M+ users product utilizing my best personal experience: sleeping.",
speed: 0.8
},
{
title: "NFL",
description: "Explored the Future of Fantasy Football while being in a country where football means a total different sport.",
speed: 0.8
}
]

export default function Projects() {
const [selectedProject, setSelectedProject] = useState(null)
return (
<div className={styles.container}>
<Titles data={data} setSelectedProject={setSelectedProject}/>
<Descriptions data={data} selectedProject={selectedProject}/>
</div>
)
}
5 changes: 5 additions & 0 deletions components/projects/style.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.container{
// position: absolute;
z-index: 1;
width: 100%;
}
Loading

0 comments on commit cd02932

Please sign in to comment.