Skip to main content

Add a custom HTML code layer to your animated designs

Upload your own HTML file as a layer in animated designs, and refresh its preview after resizing so it fills the layer.

Native layers and animations cover most designs, but some effects are out of their reach: a chart that builds itself, generative motion, custom text effects, or an element viewers can hover or tap in an HTML5 ad. The Custom HTML code layer fills that gap. You upload your own HTML file and place it on the canvas like any other layer. Abyssale records a preview of your HTML at the size of the layer, and you can refresh that preview whenever you resize the layer.


What you can build with it

In each example below, the content that changes from one variation to the next (product, price, headline, button) stays in native layers. The Custom HTML code layer only adds what the editor cannot do on its own, on a transparent background.

Animated data: a chart that builds itself

A results post where the bars grow one by one and a trend line draws in. The headline, the +38% figure, the button and the URL are native layers. The HTML layer only draws the chart, and its transparent background lets the design background show through.

An animated background behind your text

A launch-week visual with wave bands drifting along the bottom, made with CSS animations only. The HTML layer is sent behind the other layers (Arrange > Send to back), so the date and the Save my seat button stay on top. In the MP4 export, the waves move for the whole length of the design.

Offer conditions that appear on hover in an HTML5 ad

A 300 × 600 HTML5 banner shows a price with an asterisk. The product name and the price are native text layers. On top of them, a transparent HTML layer adds an Offer conditions label: when viewers hover it, or tap it on a touch screen, the conditions slide over the price. Enabled interactions is turned on for this layer. The Check eligibility button is a native layer outside the HTML layer, so clicking it still opens the banner click-through URL.


Add the layer

The Custom HTML code layer is available in animated designs.

  1. Open your animated design in the Design Builder.

  2. In the top toolbar, click the last icon (the + dropdown).

  3. Select Custom HTML code.

A layer named code_0 is added to the canvas and to the layer manager. On a 1920 × 1080 format, it is 336 × 336 px by default.

Note: In static designs, the dropdown only lists QR Code, Rating and Illustration & icons.


Upload your HTML

  1. Select the layer. In the right panel, open the Custom code section.

  2. Click Select HTML, then choose Computer.

  3. Drop your HTML file or click to browse. The maximum file size is 10 MB.

  4. Wait while the Saving the html file window generates the preview, and keep your window open. A small file takes about 10 seconds.

Once the upload is done, the layer shows your HTML on the canvas and the button changes to Update HTML. Click it to replace the file.


Keep the preview in sync with the layer size

The preview is recorded at the size of the layer when you upload your HTML. If you resize the layer afterwards, the preview is not recorded again by itself. Click Refresh preview to record the HTML again at the current size of the layer.

For example, you upload a countdown card on the default 336 × 336 px layer, and it fills the layer exactly. You then set the size to 560 × 300 px. The preview stays the old square and sits on the left of the wider box.

Click Refresh preview, under Update HTML. After a few seconds, the HTML is recorded again at 560 × 300 px and fills the layer.

Tip: Set the final size of the layer first, then click Refresh preview once.


Enabled interactions

The Enabled interactions toggle is off by default and only changes HTML5 exports:

  • On: viewers can hover and click inside the HTML layer, and your HTML reacts, for example by opening a panel. Clicks inside the layer area go to your HTML, not to the banner click-through URL.

  • Off: the HTML still plays but does not react to the mouse. Clicks on it open the banner click-through URL, like the rest of the banner.

Tip: Keep an interactive HTML layer only as large as the element people interact with. The rest of the banner then keeps opening your click-through URL.


How the HTML appears in exports

  • MP4 and GIF: the HTML is animated and plays from the start of the design, in sync with the timeline.

  • HTML5: the HTML runs live inside the banner, at the position and size of the layer.

  • A transparent page background lets the layers behind the HTML layer show through, in the editor and in every export.


Prepare your HTML file

  • Keep everything that changes from one variation to the next (product names, prices, headlines, button text, images, logos) in native layers, so you can still change it like any other layer. Use the HTML layer only for the animation or the interaction, on a transparent background, above or below the native layers.

  • Use one .html file of up to 10 MB, with its CSS and JavaScript inside the file.

  • Size everything in relative units (vw, vh, vmin, %) so the content fills the layer at any size. After resizing the layer, click Refresh preview.

  • Make the animation loop (infinite) or last at least as long as the design, so it does not stop before the end.

  • Set background: transparent on the page when the design should show behind the HTML.

  • Web fonts (for example a Google Fonts link) and images loaded from an https URL work in the preview and in exports.

  • Keep at least one visible text element on the page (see below).

Note: Text inside the HTML file is the same in every variation. For example, if you generate the banner with another price, the price layer changes, but the conditions written in the HTML file do not. Update the HTML file to change them.

Here is a starter file: a label that pulses on a transparent background and adapts to any layer size.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
background: transparent; /* lets your design show through */
display: flex; align-items: center; justify-content: center;
font: 700 12vmin/1 Arial, sans-serif; color: #0A363A;
}
.badge { padding: 3vmin 6vmin; border-radius: 99vmin; background: #68FFAD;
animation: pulse 2s ease-in-out infinite; } /* loops forever */
@keyframes pulse { 50% { transform: scale(1.08); } }
</style>
</head>
<body>
<div class="badge">-30%</div>
</body>
</html>

If the preview fails

If the Saving the html file window shows The preview generation failed with Timeout of 30000ms exceeded, click Cancel. The layer keeps its previous HTML. Then:

  • Add a visible text element if the page has none. A page made only of shapes (canvas, SVG or CSS) can fail, and the same page works once it shows some text.

  • Lighten the animation. Effects that redraw the whole layer with many moving elements, such as hundreds of lines or particles, can exceed the time limit.

  • Upload the file again, or click Try again.


Things to note

  • The layer is only available in animated designs.

  • The HTML file can be up to 10 MB.

  • Refresh preview starts right away, with no confirmation step.

Did this answer your question?