Skip to content

Commit be66a2d

Browse files
committed
feat(): Adding article feature
1 parent 7aeff71 commit be66a2d

26 files changed

Lines changed: 211 additions & 48 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "0.12.2",
44
"description": "Amit Raikwar Portfolio website",
55
"main": "index.tsx",
6-
"proxy": "http://static.amitraikwar.in",
76
"scripts": {
87
"start": "craco start",
98
"build": "craco build",

public/noise.webp

715 KB
Loading

src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ThemeProvider,
66
} from '@providers';
77
import { HelmetProvider } from 'react-helmet-async';
8-
import { CursorProvider } from '@components';
8+
import { CursorProvider, Noise } from '@components';
99
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
1010

1111
const queryClient = new QueryClient({
@@ -25,6 +25,7 @@ function App() {
2525
<HelmetProvider>
2626
<CursorProvider>
2727
<LocalizationProvider>
28+
<Noise />
2829
<AppRouterProvider />
2930
</LocalizationProvider>
3031
</CursorProvider>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { Box, HStack, Img, Text } from '@chakra-ui/react';
2+
3+
type ArticleCardProps = {
4+
title: string;
5+
image: string;
6+
description: string;
7+
group_name: string;
8+
views: number;
9+
likes: number;
10+
last_updated: string;
11+
};
12+
13+
const ArticleCard = ({
14+
title,
15+
last_updated,
16+
image,
17+
description,
18+
group_name,
19+
views,
20+
likes,
21+
}: ArticleCardProps) => {
22+
return (
23+
<Box
24+
bg={'black'}
25+
padding={4}
26+
borderRadius={10}
27+
border={'1px solid #ffffffa0'}
28+
width={'300px'}
29+
color={'white'}
30+
>
31+
<Text fontSize="2xl" fontWeight="bold" color="brand.900" marginBottom={2}>
32+
{title}
33+
</Text>
34+
<Img src={image} alt={title} h={'200px'} w={'100%'} />
35+
<HStack justifyContent="space-between">
36+
<Text
37+
fontSize="xs"
38+
fontWeight="500"
39+
color="brand.500"
40+
marginTop={2}
41+
marginBottom={2}
42+
>
43+
{new Date(last_updated).toDateString()}
44+
</Text>
45+
<HStack>
46+
<Text>👁️ {views}</Text>
47+
<Text>📝 0</Text>
48+
<Text>👍🏻 {likes}</Text>
49+
</HStack>
50+
</HStack>
51+
<Text
52+
fontSize="xs"
53+
fontWeight="500"
54+
color="brand.500"
55+
border={'1px solid #ffffffa0'}
56+
borderRadius={10}
57+
padding={2}
58+
>
59+
{group_name}
60+
</Text>
61+
<Text fontSize="sm" marginTop={2}>
62+
{description}
63+
</Text>
64+
</Box>
65+
);
66+
};
67+
68+
export default ArticleCard;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as ArticleCard } from './ArticleCard';
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Box, CircularProgress, Text } from '@chakra-ui/react';
2+
3+
const LoadingScreen = () => {
4+
return (
5+
<Box
6+
style={{
7+
display: 'flex',
8+
flexDirection: 'column',
9+
justifyContent: 'center',
10+
alignItems: 'center',
11+
height: '100vh',
12+
backgroundColor: '#000000',
13+
rowGap: '1rem',
14+
}}
15+
>
16+
<CircularProgress isIndeterminate color="violet" />
17+
<Text color="white" fontSize="lg" fontWeight="bold" textAlign="center">
18+
Loading...
19+
</Text>
20+
</Box>
21+
);
22+
};
23+
24+
export default LoadingScreen;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as LoadingSpinner } from './LoadingSpinner';

src/components/Noise/Noise.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const Noise = ({ type = 'bg' }: { type?: 'bg' | 'fg' }) => {
2+
return (
3+
<div
4+
className={`${type === 'bg' ? 'absolute inset-0 w-full h-full' : 'w-[100%] h-[100%]'} transform opacity-10 [mask-image:radial-gradient(#fff,transparent,75%)]`}
5+
style={{
6+
backgroundImage: 'url(/noise.webp)',
7+
backgroundSize: '30%',
8+
}}
9+
></div>
10+
);
11+
};
12+
13+
export default Noise;

src/components/Noise/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Noise } from './Noise';

src/components/Timeline/Timeline.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ const Timeline = ({
2929
const opacityTransform = useTransform(scrollYProgress, [0, 0.1], [0, 1]);
3030

3131
return (
32-
<div className="w-full bg-black font-sans md:px-10" ref={containerRef}>
32+
<div
33+
className="w-full bg-transparent font-sans md:px-10"
34+
ref={containerRef}
35+
>
3336
<div className="max-w-7xl mx-auto py-20 px-4 md:px-8 lg:px-10">
3437
<p className="text-neutral-900 dark:text-neutral-100 text-sm md:text-base max-w-xl">
3538
{title}

0 commit comments

Comments
 (0)