improved workflow

This commit is contained in:
iaphetes 2024-12-20 12:17:18 +01:00
parent 340833ea7b
commit a1de20f0ec
5 changed files with 126 additions and 48 deletions

View file

@ -2,6 +2,11 @@
This template should help get you started developing with Tauri in vanilla HTML, CSS and Javascript. This template should help get you started developing with Tauri in vanilla HTML, CSS and Javascript.
# Develop
## Prerequisites
- [Tauri](https://tauri.app/start/prerequisites/)
## Recommended IDE Setup ## Recommended IDE Setup
- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)

View file

@ -0,0 +1,2 @@
<?xml version="1.0" ?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><defs><style>.a,.b{fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px;}.b{fill-rule:evenodd;}</style></defs><circle class="a" cx="7" cy="16" r="2"/><circle class="a" cx="16" cy="6" r="3"/><circle class="a" cx="18" cy="18" r="4"/><circle class="a" cx="4" cy="4" r="2"/><line class="a" x1="14" x2="8.75774" y1="18" y2="16.95155"/><line class="a" x1="16.95928" x2="18.2766" y1="8.83997" y2="14.01668"/><line class="a" x1="6" x2="13.16407" y1="4" y2="5.02344"/><path class="b" d="M6.7441,14.01668C7,14,4.35961,5.96728,4.35961,5.96728"/></svg>

After

Width:  |  Height:  |  Size: 766 B

View file

@ -1,19 +1,30 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="stylesheet" href="styles.css" /> <link rel="stylesheet" href="styles.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tauri App</title> <title>Tauri App</title>
<script type="module" src="/main.js" defer></script> <script type="module" src="./main.js" defer></script>
</head> <script src="./main.js"></script>
</head>
<body> <body>
<main class="container"> <div class="main">
<div class="main_editor"> <div class="top-bar">
<div class='markdown_input' id="markdown_input" contenteditable></div> <button class="topbar_button" id="hide-sidebar"><img class="topbar_icon" src="images/graph_icon.svg" /></button>
<div class="rendered_markdown" id="rendered_markdown"></div> </div>
<div class="container">
<div id="sidebar">
<button class="sidebar_button"><img class="sidebar_icon" src="images/graph_icon.svg" /></button>
<button class="sidebar_button"><img class="sidebar_icon" src="images/graph_icon.svg" /></button>
<button class="sidebar_button"><img class="sidebar_icon" src="images/graph_icon.svg" /></button>
</div>
<div class="row" id="main_editor">
<div class="col" id="markdown_input" contenteditable></div>
<div class="col" id="rendered_markdown"></div>
</div>
</div>
</div> </div>
</main> </body>
</body>
</html> </html>

View file

@ -30,3 +30,16 @@ textarea.addEventListener('input', ()=> {
// }); // });
}); });
document.getElementById("hide-sidebar").onclick = function() {toggle_visibility("sidebar");};
function toggle_visibility(id) {
if (document.getElementById(id).style.visibility == "hidden"){
document.getElementById(id).style.visibility = "visible";
var style = window.getComputedStyle(document.body);
document.getElementById(id).style.width = style.getPropertyValue("--sidebar-width");
}else{
document.getElementById(id).style.visibility = "hidden";
document.getElementById(id).style.width = 0;
}
}

View file

@ -1,23 +1,33 @@
.logo.vanilla:hover { .logo.vanilla:hover {
filter: drop-shadow(0 0 2em #ffe21c); filter: drop-shadow(0 0 2em #ffe21c);
} }
:root { :root {
font-family: Avenir, Helvetica, Arial, sans-serif; --main-bg-color: #4f4f4f;
font-size: 16px; --sidebar-width: 3em;
line-height: 24px; font-family: Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
color: #f6f6f6;
background-color: var(--main-bg-color);
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
color: #f6f6f6;
background-color: #2f2f2f;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
} }
*{
box-sizing: border-box;
padding: 0;
margin: 0;
}
.container { .container {
height: 90vh; height: 100%;
margin: 0; margin: 0;
padding-top: 1vh; padding-top: 1vh;
display: flex; display: flex;
@ -26,40 +36,44 @@
text-align: left; text-align: left;
} }
.row {
display: flex;
justify-content: left;
}
.markdown_input
{
border-style: solid;
width: 49%;
height: 100%;
text-align: left;
float:left;
color: #f6f6f6;
background: #2f2f2f;
}
.rendered_markdown {
border-style: solid; .col {
width: 49%; width: 50%;
height: 100%; padding: 0.5em;
float:right; margin: .1em;
text-align: left; border: solid;
color: #f6f6f6; border-radius: .5em;
background-color: #2f2f2f; }
#markdown_input
{
grid-column: 1;
grid-row: 1;
text-align: left;
/*float:left;*/
color: #f6f6f6;
background: var(--main-bg-color);
}
#rendered_markdown {
grid-column: 2;
grid-row: 1;
/*float:right;*/
text-align: left;
color: #f6f6f6;
background-color: var(--main-bg-color);
} }
.main_editor{ .main_editor{
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
line-height: 18px; line-height: 18px;
display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
color: #f6f6f6; color: #f6f6f6;
background-color: #2f2f2f; background-color: var(--main-bg-color);
} }
h1 { h1 {
text-align: left; text-align: left;
@ -69,11 +83,44 @@ h1 {
} }
.sidebar_button {
width: 100%;
background-color: var(--main-bg-color);
border: none;
}
.sidebar_icon {
width: 100%;
}
.topbar_button {
height: 2em;
background-color: var(--main-bg-color);
/*border: none;*/
}
.topbar_icon {
height: 100%;
}
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
color: #f6f6f6; color: #f6f6f6;
background-color: #2f2f2f; background-color: var(--main-bg-color);
} }
} }
#main_editor {
display: flex;
width: 100%;
height: 100%;
}
.main {
display: flex;
height:100vh;
flex-direction: column;
}
#sidebar {
visibility: visible;
width: var(--sidebar-width);
}