For the same side project I created the fully-responsive sticky note, I also created a hand-drawn border effect and animation:
The skewing of the border is achieved by using border-radius
: With the /
notation, I can make the border look like it was drawn by the stroke of a pen.
The animation was a lot of effort. Using clip-path, I had to create five different polygons (one for each line and one for the content) and combine them, so only the borders are cut out. Using calc()
and min()
I can work precisely around the content and guarantee that no bit of the border is left out, even with larger elements.
(The auto-animation in the CodePen is achieved by using setInterval
and toggling two classes that do the animation forward and in reverse.)
For good measure, here's my post about the sticky note:
![thormeier](https://res.cloudinary.com/practicaldev/image/fetch/s--sb48-IFH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/practicaldev/image/fetch/s--wbt3mQFY--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/436259/00cde9af-e704-48b7-a00a-32cdc4997190.jpeg)
π ποΈ Fully responsive HTML+CSS Sticky note
Pascal Thormeier γ» Sep 19 '20
That's it, have a nice evening!
Top comments (0)