static: keep url <pre> at constant rendering height

This commit is contained in:
Astro 2023-10-27 01:44:22 +02:00
parent 1ce14cb152
commit 2b9ad7b4a2
2 changed files with 5 additions and 3 deletions

View file

@ -50,14 +50,16 @@
<div> <div>
<input id="tag" len="20" placeholder="tag"/> <input id="tag" len="20" placeholder="tag"/>
</div> </div>
<pre id="tag-url"></pre> <pre id="tag-url">
</pre>
</article> </article>
<article> <article>
<h2>Follow posts by instance</h2> <h2>Follow posts by instance</h2>
<div> <div>
<input id="instance" len="20" placeholder="example.xyz"/> <input id="instance" len="20" placeholder="example.xyz"/>
</div> </div>
<pre id="instance-url"></pre> <pre id="instance-url">
</pre>
</article> </article>
</section> </section>

View file

@ -7,7 +7,7 @@
var value = encodeURIComponent(inputEl.value.replace(/^#/, "")); var value = encodeURIComponent(inputEl.value.replace(/^#/, ""));
preEl.innerText = value ? preEl.innerText = value ?
"https://" + document.location.host + "/" + id + "/" + value : "https://" + document.location.host + "/" + id + "/" + value :
""; "\n";
}, 10); }, 10);
} }
inputEl.addEventListener('change', onChange); inputEl.addEventListener('change', onChange);