Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: conference countdown added #378 #382

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions components/Countdown/countdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@ import Countdown from 'react-countdown';
const dates = [
{
name: 'London, UK',
date: 'September 20, 2023',
date: 'September 18, 2024',
},
{
name: 'Madrid, Spain',
date: 'October 19, 2023',
},
{
name: 'Bangalore, India',
date: 'November 30, 2023',
name: 'Online ,Edition',
date: 'October 30, 2024',
},
{
name: 'Paris, France',
date: 'December 6, 2023',
date: 'December 3, 2024',
},
];

Expand All @@ -32,6 +28,7 @@ function Countdowns() {
dateRef.current.classList.remove('hidden');
dateRef.current.classList.add('home-title');
setSelectedIndex((prevIndex) => (prevIndex + 1) % dates.length);

setTimeout(() => {
if(locationRef?.current) {
locationRef.current.classList.remove('home-title');
Expand Down Expand Up @@ -74,31 +71,31 @@ function Countdowns() {
ref={dateRef}
>
<div>
<span className='glitch text-white text-[30px] sm:text-[18px]'>
{days}:
<span className=' text-white text-[30px] sm:text-[18px] flex flex-col justify-center items-center '>
{days} <span className='text-sm'>DAYS</span>
</span>
</div>
<div>
<span className='glitch text-white text-[30px] sm:text-[18px]'>
{hours}:
<span className='glitch text-white text-[30px] sm:text-[18px] flex flex-col justify-center items-center'>
{hours} <span className='text-sm'>HOURS</span>
</span>
</div>
<div>
<span className='glitch text-white text-[30px] sm:text-[18px]'>
{minutes}:
<span className='glitch text-white text-[30px] sm:text-[18px] flex flex-col justify-center items-center'>
{minutes} <span className='text-sm'>MIN</span>
</span>
</div>
<div>
<span className='glitch text-white text-[30px] sm:text-[18px]'>
{seconds}
<span className='glitch text-white text-[30px] sm:text-[18px] flex flex-col justify-center items-center'>
{seconds} <span className='text-sm'>SEC</span>
</span>
</div>
</div>
);
}
};
return (
<div className='mt-[400px] sm:mt-[150px] flex items-center justify-between'>
<div className=' flex flex-col gap-y-5 px-10 py-5 items-center justify-between '>
<div className='h-[40px]'>
<div className='home-title' ref={locationRef}>
<span className='text-[25px] sm:text-[18px] text-white font-bold'>
Expand Down
2 changes: 2 additions & 0 deletions components/Header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Venue from '../Venue/venue';
import Announcement from '../announcement';
import Link from 'next/link';


function Header() {
return (
<div className='relative'>
Expand All @@ -25,6 +26,7 @@ function Header() {
AsyncAPI Conf On Tour 2024
</Heading>
</div>

<div className='w-[624px] sm:w-full text-center'>
<Paragraph className='mt-[16px]' textColor='text-gray-200'>
Join us for the AsyncAPI Conference on Tour,
Expand Down
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"react-globe.gl": "^2.24.2",
"react-gtm-module": "^2.0.11",
"react-hot-toast": "^2.4.1",
"react-icons": "^5.3.0",
"react-responsive": "^9.0.0",
"react-select": "^5.7.5",
"react-slick": "^0.29.0",
Expand Down
16 changes: 15 additions & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ import speakers from '../config/speakers.json';
import Link from 'next/link';
import Button from '../components/Buttons/button';
import Dropdown from '../components/Dropdown/dropdown';
import Countdowns from '../components/Countdown/countdown';
import { FaArrowLeft } from "react-icons/fa";
import { FaArrowRight } from "react-icons/fa";


export default function Home() {
const isTablet = useMediaQuery({ maxWidth: '1118px' });
const [speakersList, setSpeakersList] = useState([]);
const [city, setCity] = useState("");
const [showCountdown ,setShowCountdown] = useState(true);
speakers[0].lists = [];
speakers.map((speaker) => {
if (Array.isArray(speaker.lists) && Object.keys(speaker.lists).length > 0) {
Expand All @@ -36,8 +41,12 @@ export default function Home() {
setCity(speakers[0]);
setSpeakersList(speakers[0].lists);
},[]);

const handleCountDown = () =>{
setShowCountdown(!showCountdown);
}
return (
<div>
<div className='relative'>
<Head>
<title>AsyncAPI Conference</title>
<meta name='description' content='Generated by create next app' />
Expand Down Expand Up @@ -183,6 +192,11 @@ export default function Home() {
<div className='mt-5'>
<Subscription/>
</div>
<div className={`z-50 fixed ${showCountdown ? 'bottom-20 right-0' : 'bottom-40 right-0'} gradient-bg flex`}>
{showCountdown && <Countdowns/>}

<span className=' text-white text-2xl px-2 cursor-pointer py-2 transition-all' onClick={handleCountDown}>{showCountdown ?<FaArrowRight/>: <FaArrowLeft/>}</span>
</div>
</div>
);
}
Loading