Yes, Not using pre made gifs, just html, css and js, (you can make various dialogues that can be skipped by touching or pressing z), heres how:
Thats what you need:
yeah, just that, the rest i made it for you
First, add this at the start of your <style> tag:
and then, you add these to your style tag:
To Make custom borders, make sure that the border follows the original image template, and just change the border-image, if you want only to an especific dialogue to have custom borders, make another css category with the dialogue with the dialogue id (i will explain it later) after the name:
Example:
At this example, i had to change the css a bit, so it can look good:
Now that the box style is ready, we need the HTML elements to hold the box, the speaker icon, and the text.
Add this code inside your <body> tag where you want your dialogue box to appear:
class="dialogue-box": This applies the custom border and basic structure defined in your CSS.
id="dialogue-box-1": This is the unique identifier. The JavaScript will use this ID to target and control this specific box.
id="speaker-img-1": This element holds the character icon. The JavaScript will dynamically change the src attribute of this image as the dialogue progresses.
id="dialogue-text-1": This is where the dialogue text will be typed out using the animation effect.
To handle the typing effect, speaker changes, and user interaction (like skipping text by pressing 'Z' or tapping), you need the external JavaScript file. Place this line just before the closing </body> tag:
The final step is to create the actual dialogue script that the box will display. This is done by creating an array of objects, where each object represents one line of dialogue.
The text property is the line of dialogue. You can use \n to create a manual line break within the text.
The image property is the file path to the speaker icon for that specific line.
if you want to create another dialogue box with different messages:
and you need to change the name "dialogueLETTER" for each
After defining your dialogue arrays (like dialogueA and dialogueB), you must use the dialogueConfigs array to connect them to the correct HTML box ID (e.g., id: 1 connects to id="dialogue-box-1").