Skip to content

Commit

Permalink
feat: add typewriter on homepage(#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodreddypandiri authored Feb 17, 2023
1 parent 153c52e commit b08abea
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"react-icons": "^4.7.1",
"react-spinners": "^0.13.8",
"react-transition-state": "^2.1.0",
"typescript": "4.9.4"
"typescript": "4.9.4",
"typewriter-effect": "^2.19.0"
},
"devDependencies": {
"autoprefixer": "^10.4.13",
Expand Down
29 changes: 25 additions & 4 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ import React from "react";
import Head from "next/head";
import Logo from "components/logo";
import { TopBar } from "components/TopBar/TopBar";

import TypewriterComponent from "typewriter-effect";
import { sidebarData } from "../database/data";
export default function Home() {
//storing sub categories names for using in typewriter effect
let subCategoriesNames:string[] = [];
sidebarData.forEach((c) => {
c.subcategory.forEach((a) =>{
subCategoriesNames.push(a.name.toUpperCase());
});
})
return (
<>
<Head>
Expand All @@ -14,9 +22,22 @@ export default function Home() {
</Head>
<main className="lg:h-[calc(100vh-85px)] h-[calc(100vh-150px)] flex flex-col">
<TopBar header="Home" />
<div className="m-auto md:text-7xl text-5xl gap-2 flex items-center justify-center">
<Logo />
<span>👾</span>
<div className=" m-auto flex flex-col items-start gap-2">
<div className="m-auto md:text-7xl text-5xl gap-2 flex items-center justify-center">
<Logo />
<span>👾</span>

</div>
<div className=" flex flex-col mt-6 justify-center items-start">
<p className="text-xl ">Navigate through menu for</p>
<p className='text-xl text-violet-500'><TypewriterComponent
options={{
strings: subCategoriesNames,
autoStart: true,
loop: true,
}}
/></p>
</div>
</div>
</main>
</>
Expand Down

1 comment on commit b08abea

@vercel
Copy link

@vercel vercel bot commented on b08abea Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

linkshub – ./

linkshub-rupali-codes.vercel.app
linkshub.vercel.app
linkshub-git-main-rupali-codes.vercel.app

Please sign in to comment.