3D Subtitles
3/28/2024
Veneta Kochovska
This is a sample that shows how to create 3D subtitles in Gameface:
The subtitles are div
elements that use CSS transform with perspective .
Using CSS transformations you can rotate the subtitles in the same way that the character that is speaking is facing. 3D effects can emphasize the source of speaking. This sample uses a background image for simplicity, but it illustrates interesting ways of subtitle positioning.
The subtitle container is an absolutely positioned element that has perspective: 1000px
. Refer to the documentation for more information regarding css perspective.
The subtitle element is a <p>
element that has backdrop-filter: blur(7px);
style. The backdrop filter creates a blur effect on the background without affecting the text itself. The rotation is achieved using CSS transform: rotateY(310deg);
. The perspective style applied to the parent of the paragraph is what makes the rotated subtitle look 3D:
The pop-up effect is a CSS animation. It moves the subtitle over the Y axis and scales it from 0 to 1 which makes it look as if it appears from bellow:
The last keyframe stays on the same styles just to create a delay effect before the next iteration starts.