.
This commit is contained in:
1 parent
4cc0338e96
commit
9d4f7c3db8
5 files changed
+174
-26
No files matched your search
@@ -5,6 +5,10 @@
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"core:default",
|
||||
"core:window:allow-close",
|
||||
"core:window:allow-minimize",
|
||||
"core:window:allow-toggle-maximize",
|
||||
"core:window:allow-start-dragging",
|
||||
"opener:default"
|
||||
]
|
||||
}
|
||||
@@ -15,7 +15,8 @@
|
||||
"height": 600,
|
||||
"minWidth": 800,
|
||||
"minHeight": 500,
|
||||
"decorations": true
|
||||
"decorations": false,
|
||||
"transparent": true
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
|
||||
+29
-3
@@ -5,23 +5,48 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="stylesheet" href="styles_default.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Tauri App</title>
|
||||
<title>Notes</title>
|
||||
<script src="/main.js" defer></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="app-shell">
|
||||
<header class="window-titlebar">
|
||||
<div class="titlebar-drag">
|
||||
<span class="app-mark" aria-hidden="true">
|
||||
<svg viewBox="0 0 24 24" width="18" height="18">
|
||||
<path d="M6 3.75h8.5L19 8.25v12A1.75 1.75 0 0 1 17.25 22h-11A1.75 1.75 0 0 1 4.5 20.25v-14A2.5 2.5 0 0 1 7 3.75Zm7.75 1.5v3.5h3.5l-3.5-3.5ZM7.5 12v1.5h9V12h-9Zm0 4v1.5h9V16h-9Z" />
|
||||
</svg>
|
||||
</span>
|
||||
<span class="titlebar-copy">
|
||||
<span class="titlebar-title">Notes</span>
|
||||
<span class="titlebar-caption">Personal notebook</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="window-controls">
|
||||
<button class="window-control" id="minimize-window" type="button" aria-label="Minimize">
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h10" /></svg>
|
||||
</button>
|
||||
<button class="window-control" id="maximize-window" type="button" aria-label="Maximize">
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 3.5h9v9h-9z" /></svg>
|
||||
</button>
|
||||
<button class="window-control close-control" id="close-window" type="button" aria-label="Close">
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="m4 4 8 8M12 4l-8 8" /></svg>
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
<div class="center-page-content">
|
||||
|
||||
<div class="grid-container-horizontal notes-sidebar" style="width: 40%; max-width: 25rem; min-width: 15rem;">
|
||||
<div class="grid-container-vertical toolbar">
|
||||
<div>
|
||||
<div style="height: 3rem;">
|
||||
<div style="margin-left: 0.8rem;" class="button">
|
||||
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px">
|
||||
<path d="M3,18V16H21v2H3Zm0-5V11H21v2H3ZM3,8V6H21V8H3Z" />
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
<p style="font-weight: bold; ">Notes</p>
|
||||
<p style="font-weight: bold; "></p>
|
||||
<div style="margin-right: 0.8rem" class="button" onclick="toggle_search();">
|
||||
<svg id="search_icon" class="icon-accent" style="display: none;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px">
|
||||
<path
|
||||
@@ -54,6 +79,7 @@
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+11
-16
@@ -1,4 +1,13 @@
|
||||
const { invoke } = window.__TAURI__.core;
|
||||
const appWindow = window.__TAURI__.window.getCurrentWindow();
|
||||
|
||||
document.querySelector(".titlebar-drag").addEventListener("mousedown", (event) => {
|
||||
if (event.button === 0) appWindow.startDragging();
|
||||
});
|
||||
|
||||
document.querySelector("#minimize-window").addEventListener("click", () => appWindow.minimize());
|
||||
document.querySelector("#maximize-window").addEventListener("click", () => appWindow.toggleMaximize());
|
||||
document.querySelector("#close-window").addEventListener("click", () => appWindow.close());
|
||||
|
||||
let greetInputEl;
|
||||
let greetMsgEl;
|
||||
@@ -9,25 +18,11 @@ window.addEventListener('contextmenu', (e) => {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
let search_state = false;
|
||||
|
||||
function toggle_search() {
|
||||
document.querySelector("#search_input").value = "";
|
||||
|
||||
let search_bar = document.querySelector("#search_bar");
|
||||
let search_icon = document.querySelector("#search_icon");
|
||||
let search_quit_icon = document.querySelector("#search_quit_icon");
|
||||
|
||||
if (search_state) {
|
||||
search_bar.style.display = 'flex';
|
||||
search_quit_icon.style.display = 'block';
|
||||
search_icon.style.display = 'none';
|
||||
} else {
|
||||
search_bar.style.display = 'none';
|
||||
search_quit_icon.style.display = 'none';
|
||||
search_icon.style.display = 'block';
|
||||
}
|
||||
|
||||
search_state = !search_state;
|
||||
get_notes_list();
|
||||
}
|
||||
|
||||
function on_search_input() {
|
||||
|
||||
+128
-6
@@ -2,7 +2,7 @@
|
||||
--color-page: #1d1d20;
|
||||
--color-surface: #2e2e32;
|
||||
--color-control: #424246;
|
||||
--color-hover: #2f2f2f;
|
||||
--color-hover: #0001;
|
||||
--color-text: #aaa;
|
||||
--color-icon: #808080;
|
||||
--color-accent: #59a9ff;
|
||||
@@ -10,7 +10,7 @@
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--color-page);
|
||||
background-color: transparent;
|
||||
padding: 0px;
|
||||
margin: 0;
|
||||
width: 100vw;
|
||||
@@ -18,6 +18,121 @@ body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.app-shell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
border: 1px solid rgba(255, 255, 255, 0.14);
|
||||
border-radius: 10px;
|
||||
background-color: var(--color-page);
|
||||
}
|
||||
|
||||
.window-titlebar {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 48px;
|
||||
min-height: 48px;
|
||||
background-color: var(--color-surface);
|
||||
/* border-bottom: 1px solid #3a3a3a; */
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.titlebar-drag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-self: stretch;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
gap: 0.65rem;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
|
||||
.app-mark {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
flex: 0 0 28px;
|
||||
border-radius: 7px;
|
||||
background: var(--color-accent);
|
||||
fill: var(--color-on-accent);
|
||||
}
|
||||
|
||||
.titlebar-copy {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
}
|
||||
|
||||
.titlebar-title,
|
||||
.titlebar-caption {
|
||||
font-family: sans-serif;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.titlebar-title {
|
||||
color: #f6f5f4;
|
||||
font-size: 0.82rem;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.titlebar-caption {
|
||||
color: var(--color-icon);
|
||||
font-size: 0.68rem;
|
||||
}
|
||||
|
||||
.window-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.15rem;
|
||||
padding: 0 0.55rem;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.window-control {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 34px;
|
||||
height: 32px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 6px;
|
||||
background: transparent;
|
||||
color: #c0bfbc;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.window-control svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
fill: none;
|
||||
stroke: currentColor;
|
||||
stroke-width: 1.25;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
|
||||
.window-control:hover {
|
||||
background: #454545;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.window-control:active {
|
||||
background: #515151;
|
||||
}
|
||||
|
||||
.close-control:hover {
|
||||
background: #c01c28;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
p {
|
||||
color: var(--color-text);
|
||||
font-family: sans-serif;
|
||||
@@ -49,8 +164,9 @@ input:focus {
|
||||
flex-direction: row;
|
||||
justify-content: stretch;
|
||||
align-items: stretch;
|
||||
height: 100%;
|
||||
width: 100vw;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -87,7 +203,8 @@ input:focus {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 10px;
|
||||
padding: 0.2rem;
|
||||
padding: 0.6rem;
|
||||
transition: background-color 0.1s ease;
|
||||
|
||||
}
|
||||
|
||||
@@ -106,7 +223,7 @@ input:focus {
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background-color: var(--color-hover);
|
||||
background-color: color-mix(in srgb, var(--color-hover) 85%, black 15%);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -139,6 +256,7 @@ input:focus {
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: stretch;
|
||||
transition: background-color 0.1s ease;
|
||||
|
||||
}
|
||||
|
||||
@@ -151,6 +269,10 @@ input:focus {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.notes-list div div:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.notes-list-parent::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user