Animating text as Handrawn with CSS

Recently, I wanted to animate text to reveal like it was drawn by hand. This makes the header text of certain pages, like celebration and wedding websites, stand out much more and look sophisticated. This is what this short blog post is about.

First, I thought about a simple wipe animation. It looks fine, just fine:

This is not much work, as you can see in the CSS, and it works with all fonts. What we essentially do is to animate the area shown of the text (kind of the clip(path)):

@keyframes wipe-reveal {
  from { clip-path: inset(-50% 100% -50% 0); } /* right=100%: fully hidden */
  to   { clip-path: inset(-50%   0% -50% 0); } /* right=  0%: fully revealed */
}

This starts with a clip-path that doesn’t cover anything and ends with one that reveals everything, creating a wiping animation.

Assume now we would create a hand-drawn path over the text that barely covers the letters, using a tool like Inkscape. We can also animate it:

As you can see in the CSS, it’s slightly easier because we can animate it directly. I split the CSS path into two parts because capital letters are usually animated more slowly and have thicker lines than lowercase letters. Play around with the different animation values in the interactive editor yourself to explore the animation.

You can observe that our hand-drawn animation essentially encodes the path our pen would take while drawing, including the parts where we move it over the paper without drawing. This is because we can now combine the first and the second demo and use the hand-drawn path as the clip-path for the text:

The CSS looks close to the second demo, because we encode the clip-path property directly in the SVG. What works best is to also have the text as a path, since you usually want to tweak it anyway, and use the big font only for a few letters, which also saves some memory.

This is how you can easily create hand-drawn animations in your browser. I thought I would share this technique. See you next week for something JDK related.

Celebrating 15 years of SAP’s involvement in the OpenJDK

Almost exactly 15 years ago, on the 14th of July 2011, SAP became a member of the OpenJDK and one of its biggest contributors (source), helping to keep Java alive. To quote Ian Brown from the Java Platform Team at Netflix:

The superpower of #OpenJDK is that companies like #SAP can build what they need on top of the #JVM and then share those innovations back upstream for the benefit of the ecosystem. Congratulations to the #SAPMachine team on a decade and a half of advancing the state of the art in managed runtimes and being an awesome member of the community!

Mastodon

The Early Days

But of course, SAP’s involvement in the Java community didn’t start there. Java became more and more important in the late 90ties, so SAP wanted to have a JVM tightly integrated with the SAP technology stack (including ABAP) and in 2000/2001 started participating in the Java Community Process (JCP), when it became a licensee of J2EE and J2SE, with Michael Bechauf becoming a representative in the executive committee in 2002 to guide the Java platform to become “the foundation for a next generation service composition platform that can rapidly deliver applications that support those business processes deemed most critical for a company.” (source)

Continue reading