Skip to content

Commit 89fd217

Browse files
💥 Redesign everything according to new design
1 parent 0532889 commit 89fd217

File tree

16 files changed

+273
-106
lines changed

16 files changed

+273
-106
lines changed

components/Button.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { ButtonHTMLAttributes, PropsWithChildren } from 'react';
2+
3+
type ButtonProps = {
4+
className?: string;
5+
} & ButtonHTMLAttributes<HTMLButtonElement>;
6+
7+
function Button({
8+
children,
9+
className,
10+
...props
11+
}: PropsWithChildren<ButtonProps>) {
12+
return (
13+
<div className="relative group m-3 w-fit inline-block">
14+
<div className="absolute -inset-0 group-hover:bg-gradient-to-r from-2023-bavarian-red-2 via-2023-bavarian-gold-2 to-2023-bavarian-blue-2 rounded-lg blur opacity-25 group-hover:opacity-100 transition duration-1000 group-hover:duration-200"></div>
15+
<button
16+
className={`relative p-6 bg-2023-void-2 hover:bg-2023-void-2 btn btn-lg text-white ring-1 ring-2023-manga-3 rounded-2xl leading-none hover:text-shadow hover:shadow-2023-bavarian-gold-3 ${className}`}
17+
{...props}
18+
>
19+
{children}
20+
</button>
21+
</div>
22+
);
23+
}
24+
25+
export default Button;

components/Card.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { emojify } from '@twuni/emojify';
22
import { GoStar, GoRepoForked } from 'react-icons/go';
3+
import { RepoItem } from 'types';
34

45
interface Props {
5-
repo: any;
6+
repo: RepoItem;
67
}
78

8-
const Card = ({ repo }: Props) => {
9+
function Card({ repo }: Props) {
910
return (
10-
<div className="shadow-sm card bg-base-300 mx-4">
11+
<div className="shadow-sm card bg-2023-void-2 ring-1 ring-2023-manga-3">
1112
<div className="relative card-body">
1213
<div className="avatar">
1314
<div className="w-10 h-10 mb-2 rounded-full">
@@ -33,7 +34,7 @@ const Card = ({ repo }: Props) => {
3334
title={repo.name}
3435
target="_blank"
3536
rel="noreferrer"
36-
className={`text-3xl card-title link link-hover text-primary`}
37+
className={`text-3xl card-title link link-hover text-2023-bavarian-gold-2`}
3738
>
3839
{repo.name}
3940
</a>
@@ -49,8 +50,8 @@ const Card = ({ repo }: Props) => {
4950
rel="noreferrer"
5051
className={`badge ${
5152
topic === 'hacktoberfest'
52-
? 'bg-primary text-gray-900'
53-
: 'bg-accent'
53+
? 'bg-2023-bavarian-gold-1 text-2023-void-2'
54+
: 'bg-2023-bavarian-blue-2 text-2023-void-2'
5455
}`}
5556
>
5657
{topic}
@@ -59,7 +60,7 @@ const Card = ({ repo }: Props) => {
5960
</div>
6061

6162
<div className="items-end justify-center h-full card-actions">
62-
<div className="shadow stats">
63+
<div className="shadow stats bg-transparent ring-1 ring-2023-manga-2">
6364
<div className="stat">
6465
<div className="text-center stat-title items-center inline-flex">
6566
<GoStar /> <span className="ml-0.5">Stars</span>
@@ -69,7 +70,7 @@ const Card = ({ repo }: Props) => {
6970
</div>
7071
</div>
7172
</div>
72-
<div className="shadow stats">
73+
<div className="shadow stats bg-transparent ring-1 ring-2023-manga-2">
7374
<div className="stat">
7475
<div className="text-center stat-title items-center inline-flex">
7576
<GoRepoForked /> <span className="ml-0.5">Forks</span>
@@ -81,6 +82,6 @@ const Card = ({ repo }: Props) => {
8182
</div>
8283
</div>
8384
);
84-
};
85+
}
8586

8687
export default Card;

components/Footer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
const creators: Record<string, string> = {
22
Usman: 'https://twitter.com/MaxProgramming1/',
3-
Sunrit: 'https://twitter.com/JanaSunrise/'
3+
Sunrit: 'https://twitter.com/JanaSunrise/',
4+
'You all': '/contributors'
45
};
56

67
const Footer = () => {
78
return (
8-
<footer className="bg-base-200 text-center text-white py-4 text-lg">
9+
<footer className="text-center text-white py-4 text-lg border-t-[0.5px] border-dashed border-t-2023-manga-3">
910
<div className="container mx-auto px-4">
1011
<p>
1112
Made with <span className="text-red-500">💗</span> by{' '}
@@ -15,7 +16,7 @@ const Footer = () => {
1516
href={creators[creator]}
1617
target="_blank"
1718
rel="noreferrer"
18-
className="text-primary-500 hover:text-primary-400"
19+
className="text-2023-bavarian-gold-2"
1920
>
2021
{creator}
2122
{index === Object.keys(creators).length - 2

components/Header.tsx

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,32 @@ function Header() {
1111
const router = useRouter();
1212

1313
return (
14-
<div className="justify-between px-2 mb-2 ml-1.5 w-[99.2%] shadow-lg navbar rounded-box">
15-
<Link href="/">
16-
<img src="/hacktoberfest.svg" alt="Hacktoberfest" />
17-
</Link>
18-
{router.pathname === '/repos/[language]' && (
19-
<div className="justify-center flex-1">
20-
<Search />
21-
</div>
22-
)}
23-
<div className="flex-none">
24-
<Link
25-
href="/contributors"
26-
className="btn btn-square btn-ghost umami--click--contributors-button"
27-
>
28-
<BsPeopleFill size="1.5rem" title="Contributors" />
14+
<div className="border-b-[0.5px] border-dashed border-b-2023-manga-3 flex justify-center mb-5">
15+
<div className="justify-between px-2 mb-2 ml-1.5 w-3/4 shadow-lg navbar rounded-box">
16+
<Link href="/">
17+
<img src="/hacktoberfest.svg" alt="Hacktoberfest" />
2918
</Link>
30-
<a
31-
href="https://github.com/max-programming/hacktoberfest-projects"
32-
target="_blank"
33-
rel="noreferrer"
34-
className="btn btn-square btn-ghost umami--click--github-button"
35-
>
36-
<IoLogoGithub size="1.5rem" title="GitHub" />
37-
</a>
19+
{router.pathname === '/repos/[language]' && (
20+
<div className="justify-center flex-1">
21+
<Search />
22+
</div>
23+
)}
24+
<div className="flex-none">
25+
<Link
26+
href="/contributors"
27+
className="btn btn-square btn-ghost umami--click--contributors-button"
28+
>
29+
<BsPeopleFill size="1.5rem" title="Contributors" />
30+
</Link>
31+
<a
32+
href="https://github.com/max-programming/hacktoberfest-projects"
33+
target="_blank"
34+
rel="noreferrer"
35+
className="btn btn-square btn-ghost umami--click--github-button"
36+
>
37+
<IoLogoGithub size="1.5rem" title="GitHub" />
38+
</a>
39+
</div>
3840
</div>
3941
</div>
4042
);

components/Hero.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import languages from 'assets/languages.json';
55
import LanguageButton from './LanguageButton';
66
import { useRouter } from 'next/router';
77
import sortByName from 'utils/sortByName';
8+
import Button from './Button';
89

910
const { main: mainLanguages, others: otherLanguages } = languages;
1011

11-
const Hero = () => {
12+
function Hero() {
1213
const router = useRouter();
1314
const handleSubmit: FormEventHandler = e => {
1415
e.preventDefault();
@@ -17,12 +18,14 @@ const Hero = () => {
1718
router.push(`/repos/${search}`);
1819
};
1920
return (
20-
<div className="min-h-screen hero">
21+
<div className="min-h-screen hero bg-gradient-radial from-2023-bavarian-gold-4 to-2023-void-2 bg-blend-overlay pt-10">
2122
<div className="hero-overlay w-0 bg-opacity-60"></div>
2223
<div className="text-center hero-content">
2324
<div className="max-w-md">
24-
<h1 className="mb-5 text-5xl font-bold">Select your language</h1>
25-
<p className="mb-5">
25+
<h1 className="mb-5 text-5xl font-bold uppercase">
26+
Select your language
27+
</h1>
28+
<p className="mb-5 uppercase">
2629
Select the programming language you would like to find repositories
2730
for.
2831
</p>
@@ -32,12 +35,9 @@ const Hero = () => {
3235
))}
3336

3437
<div className="dropdown dropdown-top">
35-
<div
36-
tabIndex={0}
37-
className="m-1 btn btn-lg btn-clip hover:bg-primary-2 hover:text-black umami--click--otherlangs-button"
38-
>
38+
<Button tabIndex={0} className="umami--click--otherlangs-button">
3939
Other languages
40-
</div>
40+
</Button>
4141

4242
<ul
4343
tabIndex={0}
@@ -63,27 +63,27 @@ const Hero = () => {
6363
<input
6464
type="text"
6565
placeholder="Search for your language"
66-
className="input input-bordered w-full input-info max-w-xs rounded-tr-none rounded-br-none"
66+
className="input input-bordered w-full border-2023-bavarian-gold-2 focus:outline-2023-bavarian-gold-2 max-w-xs rounded-tr-none rounded-br-none bg-transparent"
6767
name="search"
6868
/>
6969
<button
7070
type="submit"
71-
className="btn btn-square hover:bg-primary-2 hover:text-black rounded-tl-none rounded-bl-none"
71+
className="btn btn-square rounded-tl-none rounded-bl-none bg-transparent border-2023-manga-3 hover:bg-2023-manga-2 hover:text-2023-void-2 hover:border-2023-manga-2"
7272
>
7373
<SearchIcon />
7474
</button>
7575
</div>
7676
</form>
7777
{/* <a href="https://github.com/max-programming/hacktoberfest-projects/">
78-
<button className="m-2 border-0 hover:bg-primary-2 hover:text-black btn btn-lg">
79-
Add another language
80-
</button>
81-
</a> */}
78+
<button className="m-2 border-0 hover:bg-primary-2 hover:text-black btn btn-lg">
79+
Add another language
80+
</button>
81+
</a> */}
8282
</div>
8383
</div>
8484
</div>
8585
);
86-
};
86+
}
8787

8888
const SearchIcon = () => (
8989
<svg

components/LanguageButton.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
import { motion } from 'framer-motion';
21
import Link from 'next/link';
2+
import Button from './Button';
33

4-
const LanguageButton = ({ language }: { language: string }) => {
4+
function LanguageButton({ language }: { language: string }) {
55
return (
66
<Link href={`/repos/${language.toLowerCase()}`}>
7-
<motion.button
8-
initial={{ scale: 0.2 }}
9-
animate={{ scale: 1 }}
10-
transition={{ duration: 0.3 }}
11-
whileHover={{ rotate: '4deg' }}
12-
className={`m-2 button border-0 btn btn-lg btn-clip umami--click--${language.toLowerCase()}-button`}
13-
>
14-
{language}
15-
</motion.button>
7+
<Button>{language}</Button>
168
</Link>
179
);
18-
};
10+
}
1911

2012
export default LanguageButton;

components/Pagination.tsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Link from 'next/link';
22
import { useRouter } from 'next/router';
33
import { BsArrowLeft, BsArrowRight } from 'react-icons/bs';
4+
import Button from './Button';
45

56
interface Props {
67
page: number;
@@ -9,31 +10,29 @@ interface Props {
910

1011
const MAX_PER_PAGE = 21;
1112

12-
const Pagination = ({ page, totalCount }: Props) => {
13+
function Pagination({ page, totalCount }: Props) {
1314
const router = useRouter();
1415
return (
1516
<div className="items-center flex justify-evenly my-6 flex-col gap-4 sm:gap-0 sm:flex-row">
1617
{page > 1 && (
17-
<Link
18-
href={{ query: { ...router.query, p: page - 1 } }}
19-
className="btn btn-wide"
20-
>
21-
<BsArrowLeft />
22-
<span className="ml-2">Previous Page</span>
18+
<Link href={{ query: { ...router.query, p: page - 1 } }}>
19+
<Button className="btn-wide">
20+
<BsArrowLeft />
21+
<span className="ml-2">Previous Page</span>
22+
</Button>
2323
</Link>
2424
)}
2525
{totalCount >= MAX_PER_PAGE &&
2626
page < Math.ceil(totalCount / MAX_PER_PAGE) && (
27-
<Link
28-
href={{ query: { ...router.query, p: page + 1 } }}
29-
className="btn btn-wide"
30-
>
31-
<span className="mr-2">Next Page</span>
32-
<BsArrowRight />
27+
<Link href={{ query: { ...router.query, p: page + 1 } }}>
28+
<Button className="btn-wide">
29+
<span className="mr-2">Next Page</span>
30+
<BsArrowRight />
31+
</Button>
3332
</Link>
3433
)}
3534
</div>
3635
);
37-
};
36+
}
3837

3938
export default Pagination;

components/Search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function Search() {
2525
<div className="relative">
2626
<input
2727
placeholder="Search"
28-
className="w-full pr-16 input input-primary input-bordered border-primary"
28+
className="w-full pr-16 input input-bordered border-2023-bavarian-gold-2 focus:outline-2023-bavarian-gold-2 bg-transparent"
2929
type="text"
3030
{...register('searchQuery', { required: true })}
3131
/>

components/Sort.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
66
import { faCode } from '@fortawesome/free-solid-svg-icons';
77
import { faArrowUpAZ } from '@fortawesome/free-solid-svg-icons';
88
import sortByName from 'utils/sortByName';
9+
import Button from './Button';
910

1011
const { mainLanguages } = languages;
1112

@@ -42,14 +43,14 @@ export default function Sort() {
4243
return (
4344
<div className="flex justify-center items-center mb-2 flex-col gap-2">
4445
<div className="dropdown dropdown-hover">
45-
<div tabIndex={0} className="m-1 btn w-60">
46+
<Button tabIndex={0} className="m-1 py-2">
4647
<FontAwesomeIcon
4748
icon={faCode}
4849
className=" w-6 h-6 mr-3"
4950
></FontAwesomeIcon>
5051
Language
51-
</div>
52-
<div className="h-64 p-2 overflow-y-scroll shadow dropdown-content bg-base-100 rounded-box w-60">
52+
</Button>
53+
<div className="h-64 p-2 overflow-y-scroll shadow dropdown-content z-50 bg-base-100 rounded-box w-60">
5354
<ul tabIndex={0} className="menu menu-vertical">
5455
{mainLanguages.sort(sortByName).map(language => (
5556
<li key={language}>
@@ -62,14 +63,14 @@ export default function Sort() {
6263
</div>
6364
</div>
6465
<div className="dropdown dropdown-hover">
65-
<div tabIndex={0} className="btn mb-3 w-60">
66+
<Button tabIndex={0} className="py-2">
6667
<FontAwesomeIcon
6768
icon={faArrowUpAZ}
6869
className=" w-6 h-6 mr-3"
6970
></FontAwesomeIcon>
7071
{selectedSort()}
71-
</div>
72-
<div className="h-64 p-2 overflow-y-scroll shadow dropdown-content bg-base-100 rounded-box w-60">
72+
</Button>
73+
<div className="h-64 p-2 z-50 overflow-y-scroll shadow dropdown-content bg-base-100 rounded-box w-60">
7374
<ul tabIndex={0} className="menu menu-vertical">
7475
<li>
7576
<Link href={{ query: { ...router.query } }}>Best match</Link>

0 commit comments

Comments
 (0)