Menu

What I learned making a wipe sign in and sign up
📰

What I learned making a wipe sign in and sign up

DEV Community: css·UI Motion AI·5 days ago
#TVX3OSu1
#devtocss#devto#dev#clip#path
Reading 0:00
15s threshold

One panel, two faces, and a line that leads the wipe.

A sign in and sign up card where a link wipes the other form open from right to left with a thin edge line leading it.

The trick

Both forms share one grid cell, and the sign-up face is revealed by transitioning clip-path from inset(0 0 0 100%) to inset(0).

A 2px edge element animates across at the same time with the same cubic-bezier, so it stays glued to the wipe front.

The hidden form is marked inert and aria-hidden, which means it can never take focus, then the first input of the new face gets focus after 380ms.

.stack { position : relative ; display : grid ; overflow : hidden } .f { grid-area : 1 / 1 ; background : var ( --fx-bg ) } .f2 { clip-path : inset ( 0 0 0 100 % ) ; transition : clip-path . 36s cubic-bezier ( . 65 , 0 , . 25 , 1 ) } .stack.two .f2 { clip-path : inset ( 0 ) } stack .classList.toggle ( 'two' , two ) ; f1 .inert = two ; f2 .inert =!…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.