Skip to content
Snippets Groups Projects
Commit d9f274bf authored by Philipp Stadler's avatar Philipp Stadler
Browse files

fix: verhindere Layout-Sprünge nachdem Zeichen geladen sind

Wenn die Rückseite einer Karte geladen wird, hüpft das Layout jetzt bei kürzeren Texten nicht mehr. Platz für eine Zeile an Zeichen wird jetzt im Vorhinein reserviert.

Closes #332
parent 8c5f2ad0
Branches
Tags
1 merge request!125fix: verhindere Layout-Sprünge nachdem Zeichen geladen sind
Pipeline #12619 passed
.strichfolge-animation {
min-height: 85px;
font-size: 0;
}
.strichfolge-animation.is-large {
min-height: 140px;
}
.writers {
/** Don't show spaces */
font-size: 0;
......
......@@ -11,7 +11,6 @@ import { type GetHanziDataKind, getHanziData } from '../hanzi-data'
import { isMaybeHanzi } from '../is-hanzi'
import { error } from '../debug/log'
const globalId = 'strichfolge-animation'
/** Pause between strokes */
const delayBetweenStrokes = 300
/**
......@@ -107,8 +106,8 @@ interface Writer {
export async function createWriter (userOpts: WriterOpts): Promise<void> {
const opts = { ...writerOptsDefaults, ...userOpts }
const container = opts.addTo
if (!(container instanceof Element)) {
throw new Error(`Could not find element #${globalId} for the Hanz writer`)
if (!(container instanceof HTMLElement)) {
throw new Error(`#${container.outerHTML} is not a HTMLElement`)
}
const writersContainer = document.createElement('div')
writersContainer.classList.add('writers')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment