rewrite in vanilla js

This commit is contained in:
Adrian Osterwind 2024-11-13 15:46:13 +01:00
parent 590aec5260
commit e1ea47052d
4 changed files with 10 additions and 29 deletions

View file

@ -10,31 +10,9 @@
<body>
<main class="container">
<h1>Welcome to Tauri</h1>
<div class="row">
<a href="https://tauri.app" target="_blank">
<img src="/assets/tauri.svg" class="logo tauri" alt="Tauri logo" />
</a>
<a
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"
target="_blank"
>
<img
src="/assets/javascript.svg"
class="logo vanilla"
alt="JavaScript logo"
/>
</a>
</div>
<p>Click on the Tauri logo to learn more about the framework</p>
<textarea id="markdown_input"></textarea>
<div class="row" id="rendered_markdown">
<div class="rendered_markdown" id="rendered_markdown">
</div>
</main>
</body>
</html>

View file

@ -16,7 +16,7 @@ window.addEventListener("DOMContentLoaded", () => {
invoke("parse_markdown", { document: text }).then(
(ret)=>{
var tag_id = document.getElementById('rendered_markdown');
tag_id.innerHTML = ret;
tag_id.innerHTML = "<pre>".concat("", ret).concat("", "</pre>");
}
);

View file

@ -22,8 +22,8 @@
padding-top: 10vh;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
justify-content: left;
text-align: left;
}
.logo {
@ -39,9 +39,13 @@
.row {
display: flex;
justify-content: center;
justify-content: left;
}
.rendered_markdown {
text-align: left;
}
a {
font-weight: 500;
color: #646cff;