DEV Community

Cover image for Website page transition with CSS
Naman vyas
Naman vyas

Posted on • Edited on

7 5

Website page transition with CSS

I am a beginner in website development. i was working on a project and i wanted to use page transition(but without javascript) in that but i was unable to find many methods and all methods are complex and using JavaScript.

After some time of research and google I found a library called swup.js . It's a easy to use library which uses CSS transition instead of JavaScript and you can also create cool things with swup events and javascript.

How to Use :

  1. First include this library using CDN (https://unpkg.com/swup@latest/dist/swup.min.js).

  2. wrap all code into a main tag and give it a id with name "swap" and class with any name
    (example: id="swup" class="transition-fade")

  3. Enable swup using JS :-
    (only single line of javascript is needed)
    const swup = new Swup();

  4. animate main using CSS with class identifier :-
    .transition-fade {
    transition: 0.4s;
    opacity: 1;
    }

My Project with swup JS :- https://nvnamanvyas.github.io/portfolio/

My Project using CSS page transition

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (2)

Collapse
 
manishfoodtechs profile image
manish srivastava

Naman very nice 👌👌👌👌

Collapse
 
namanvyas profile image
Naman vyas

Thanks manish :)

The best way to debug slow web pages cover image

The best way to debug slow web pages

Tools like Page Speed Insights and Google Lighthouse are great for providing advice for front end performance issues. But what these tools can’t do, is evaluate performance across your entire stack of distributed services and applications.

Watch video