From bbd5e5d33f378ab3e4cbb6eaddeeb3e590361fed Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Tue, 13 Aug 2024 11:45:04 +0200 Subject: [PATCH] auto change font size to small if text is too long --- snippets/shx-3d-render-input.liquid | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index ec98c02..890f26d 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -1019,10 +1019,10 @@ // show info text that the text is too long and we set the font size to small document.querySelector('#shx-info-text').style.display = 'block'; - // hide the text after 5 seconds + // hide the text after 8 seconds this.infoTextTimeout = setTimeout(() => { document.querySelector('#shx-info-text').style.display = 'none'; - }, 5000); + }, 8000); } } @@ -1148,6 +1148,7 @@ this.infoText = document.createElement('span'); this.infoText.id = 'shx-info-text'; this.infoText.style.display = 'none'; + this.infoText.style.color = 'red'; this.infoText.innerText = 'Text ist zu lang. Wir haben die Schriftgröße auf klein gesetzt. Bitte überprüfe deinen Text.'; this.container.appendChild(this.infoText); }