Skip to content

djalilhebal/dr-back-and-forth

Repository files navigation

Danganronpa: Back and Forth

#Danganronpa-inspired #SVG #CSS

This was an attempt at recreating Danganronpa transition effects.

Danganronpa games are known for their 2.5D style, I liked their transition effect, so I tried to recreate it using SVG and CSS.

Demo
Camera panning (SVG ver.)


This animation is inspired by Danganronpa in general and Danganronpa F specifically.
Notice how the camera switches (back and forth) between the black-haired girl (Cancel) and the red-haired one (Moraiteru):

One of Danganronpa F's creators made a video tutorial about it. They use After Effects, but their techniques can be employed in other contexts, like Web technologies.

Attempts / Versions

  • HTML + CSS

  • SVG

  • Three.js

  • Other (Shotcut? Blender? Ren'Py?)

Notes

  • Something like this could be used with Monogatari, a Web visual novel engine.

  • SVG felt like a good choice. It was easy to imagine the animation could be made using its primitives (mainly symbol and viewBox).

  • Sadly, SVG did not handle 3D transforms (translateZ), so I ended up hacking something using HTML and CSS.

  • Tested with Microsoft Edge (Chromium) 120.

Pseudocode

const script = [
    {
        speaker: 'Nagito',
        text: 'Sore wa chigau yo~',
    },
    {
        speaker: 'Hajime',
        text: 'Sore wa chigau zo!',
    },
]
<svg>
    <g id="world">
        <image id="background" />
        
        <image id="nagito" />
        <image id="hajime" />
    </g>

    <symbol id="camera" viewBox="0 0 500 500">
        <use href="#world" />
    </symbol>
    <use href="#camera" />

    <g id="ui">
        <rect id="speaker-box" />
        <text id="speaker" />
        <rect id="text-box" />
        <text id="text" />
    </g>
</svg>

Design

Goals:

  • Transition from one sprite to the other and back (hence the name "back and forth").
    • Using perspective and translateZ.
  • Camera overlay.
    • Using clip-path.

Non-goals:

UI inspirations

Mikan from Danganronpa 2

Nagito (Servant) from Danganronpa Ultra Despair Girls

Cancel from Danganronpa F

Impl

My first thought was to use SVG, but due to complications (mainly translateZ), I ended up using HTML.

Using GSAP and the likes

GSAP or any other animation library.

If I recall correctly, I watched a FEM course in 2020 and thought of recreating the DR/F effect using GSAP. I believe the course was SVG Essentials & Animation (v2) by Sarah Drasner.

Using SVG

SVG + SMIL or CSS.

Was going to use the following primitives image and text in addition to rect and whatever to build the UI.

Was planning on using groups to designate different layers.

As for the camera, I was planning on utilizing use and symbol and animating its viewBox.

Using HTML

Position scene elements absolutely, a la SVG.

Animate stuff using CSS animation and transition.

Learning

Credits

Resources

Disclaimer

DR Back and Forth is a fan-made demo and is not affiliated with or endorsed by Spike Chunsoft. All intellectual property, including but not limited to characters, names, and assets from the Danganronpa series, are the property of Spike Chunsoft. The use of these assets is done under the belief that it constitutes fair use for the purpose of creating a non-commercial, transformative work. No challenge to the rights of Spike Chunsoft is intended or implied.

DR Back and Forth is a non-commercial project created for educational purposes.