Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ebazhanov/nextjs-tailwind-landing-page

Landing page template based on Nextjs and TailwindCss
https://github.com/ebazhanov/nextjs-tailwind-landing-page

landing-page nextjs slider tailwindcss typescript vercel

Last synced: 3 months ago
JSON representation

Landing page template based on Nextjs and TailwindCss

Awesome Lists containing this project

README

        

### What you can find useful in this project:

- [x] Responsive design (mobile, tablet, desktop)
- [x] 'NavBar' freezed when you start scrolling
- [x] Simple 'Slider' implementation
- [x] Project build based on TypeScript using Nextjs, TailwindCss

-------

### Also below some more interesting things i have learned

- Example of freezed NavBar [components/NavigationBar/NavBar.tsx](components/NavigationBar/NavBar.tsx)

```tsx
useEffect(() => {
const changeColor = () => {
if (window.scrollY >= 90) {
setColor("#ffffff");
setTextColor("#000000");
} else {
setColor("transparent");
setTextColor("#ffffff");
}
};
window.addEventListener("scroll", changeColor);
}, []);
```
--------

- Slider [components/Slider/Slider.tsx](components/Slider/Slider.tsx)

```tsx
const Slider = ({ slides }: Props) => {
const [current, setCurrent] = useState(0);
const length = slides.length;

const nextSlide = () => {
setCurrent(current === length - 1 ? 0 : current + 1);
};
const prevSlide = () => {
setCurrent(current === 0 ? length - 1 : current - 1);
};

if (!Array.isArray(slides) || slides.length <= 0) {
return null;
}

return (


Gallery



{SliderData.map((slide, index) => {
return (


{index === current && (

)}


);
})}


);
};
```

--------

- Set the root to navigate to different part of the page (please do not forget to put `id="portfolio"` for smooth scrolling)
```js
My roads
```

```js
const Portfolio = () => {
return (


Amazing roads





```
---------

#### Reference:
- thanks goes to @Clint Briley [youtube](https://www.youtube.com/watch?v=HVyct9EUNP8), [repo](https://github.com/fireclint/NextJS-Tailwind-Responsive)
- try it out [Pesticide for Chrome](https://chrome.google.com/webstore/detail/pesticide-for-chrome/bakpbgckdnepkmkeaiomhmfcnejndkbi)