Skip to content

Commit 44c51c4

Browse files
committed
added partially coded events page under src/pages dir
1 parent 08469ed commit 44c51c4

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

src/pages/Events/EventPage.jsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import React from 'react';
2+
import Card from './card';
3+
4+
5+
const EventPage = () => {
6+
const borderStyle = {
7+
color: 'transparent',
8+
WebkitTextStrokeWidth: '0.5px',
9+
WebkitTextStrokeColor: 'white',
10+
}
11+
12+
13+
return (
14+
15+
<div className="bg-zinc-950">
16+
<div className="TheFlotingThing">
17+
<marquee>
18+
<p className="text-white text-7xl py-10 font-extrabold inline-block px-1" style={borderStyle}>EVENTS</p>
19+
<p className='text-white text-7xl py-10 font-extrabold inline-block px-2'> EVENTS</p>
20+
<p className='text-white text-7xl py-10 font-extrabold inline-block px-2'style={borderStyle}>EVENTS</p>
21+
<p className='text-white text-7xl py-10 font-extrabold inline-block px-2'> EVENTS</p>
22+
<p className='text-white text-7xl py-10 font-extrabold inline-block px-2'style={borderStyle}>EVENTS</p>
23+
<p className='text-white text-7xl py-10 font-extrabold inline-block px-2'> EVENTS</p>
24+
25+
26+
</marquee>
27+
28+
</div>
29+
<div className="TheScrollingThing flex space-x-10 overflow-x-auto py-10">
30+
{/* Add enough content to exceed the width of the container */}
31+
<div className="min-w-80"><Card/></div>
32+
<div className="min-w-80"><Card/></div>
33+
<div className="min-w-80"><Card/></div>
34+
<div className="min-w-80"><Card/></div>
35+
<div className="min-w-80"><Card/></div>
36+
<div className="min-w-80"><Card/></div>
37+
<div className="min-w-80"><Card/></div>
38+
<div className="min-w-80"><Card/></div>
39+
<div className="min-w-80"><Card/></div>
40+
<div className="min-w-80"><Card/></div>
41+
</div>
42+
</div>
43+
);
44+
};
45+
46+
export default EventPage;

src/pages/Events/card.jsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React, { useState, useEffect } from 'react';
2+
3+
export default function Card() {
4+
const [truncatedText, setTruncatedText] = useState('');
5+
const maxLength = 25; // Maximum number of words
6+
7+
useEffect(() => {
8+
const text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean id nunc volutpat, auctor sapien et, condimentum dolor. Aenean magna justo, vulputate quis feugiat non, maximus bibendum augue. Ut ligula odio, tristique fermentum libero a, ornare mattis arcu. Cras suscipit nisi purus, eget malesuada tortor tincidunt vitae. Vivamus vitae nibh ut est sollicitudin bibendum. Vestibulum interdum quis metus laoreet cursus. Donec eu sodales neque. Praesent suscipit nec nisi in rutrum. Sed varius odio nec ante vulputate, id egestas tellus dapibus.";
9+
const words = text.split(' ');
10+
if (words.length > maxLength) {
11+
setTruncatedText(words.slice(0, maxLength).join(' ') + '...');
12+
} else {
13+
setTruncatedText(text);
14+
}
15+
}, []);
16+
return (
17+
<>
18+
<div className="shadow-lg bg-zinc-600 rounded-2xl max-w-96 h-[30rem] relative">
19+
<img className="w-mag rounded-se-2xl rounded-ss-2xl" src="src/assets/images/example_pic.jpeg" alt="its-5am-im-tired-AF.jpeg" />
20+
<div className='content-box px-4 pt-2'>
21+
<p className="py-1 font-medium text-white break-words">Some Title Here</p>
22+
<p className="date font-thin py-2 pr-3 text-zinc-400">17/02/2024</p>
23+
<p className="description text-white font-light ">{truncatedText}</p>
24+
</div>
25+
<a href="https://example.com" className="absolute bottom-0 left-0 right-0 text-center tracking-widest font-thin drop-shadow-lg text-white py-7 hover:text-red-600">READ MORE</a>
26+
</div>
27+
</>
28+
);
29+
}

0 commit comments

Comments
 (0)