mirror of
https://github.com/thejakubruzicka/MNotes.git
synced 2025-07-10 14:34:05 +02:00
92 lines
3.8 KiB
HTML
92 lines
3.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>MNotes</title>
|
|
|
|
<!-- Material Symbols -->
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
|
|
|
|
<!-- Roboto Font -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
|
|
|
|
<link rel="stylesheet" href="style.css">
|
|
|
|
<!-- CRITICAL FIX: Expanded Import Map for resolving bare module specifiers -->
|
|
<!-- Switched ALL CDN links to unpkg.com for better path resolution -->
|
|
<script type="importmap">
|
|
{
|
|
"imports": {
|
|
"tslib": "https://unpkg.com/tslib@2.6.2/tslib.es6.min.js",
|
|
"@material/web/": "https://unpkg.com/@material/web@1.4.1/",
|
|
"lit": "https://unpkg.com/lit@3.1.2/index.js",
|
|
"lit/decorators.js": "https://unpkg.com/lit@3.1.2/decorators.js",
|
|
"lit/directives/class-map.js": "https://unpkg.com/lit@3.1.2/directives/class-map.js",
|
|
"lit/directives/when.js": "https://unpkg.com/lit@3.1.2/directives/when.js",
|
|
"lit/html.js": "https://unpkg.com/lit@3.1.2/html.js",
|
|
"lit/preact-render-to-string.js": "https://unpkg.com/lit@3.1.2/preact-render-to-string.js",
|
|
"lit/reactive-element.js": "https://unpkg.com/lit@3.1.2/reactive-element.js",
|
|
"@lit/reactive-element/": "https://unpkg.com/@lit/reactive-element@3.1.2/"
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<!-- Material Web Components (MWC) - This MUST come AFTER the importmap -->
|
|
<!-- Switched to unpkg.com -->
|
|
<script type="module" src="https://unpkg.com/@material/web@1.4.1/all.js"></script>
|
|
|
|
<style>
|
|
body {
|
|
font-family: 'Roboto', sans-serif;
|
|
margin: 0;
|
|
background-color: #fff; /* Fallback */
|
|
color: #000; /* Fallback */
|
|
opacity: 0; /* Hidden by default to prevent FOUC */
|
|
transition: opacity 0.3s ease-in-out;
|
|
}
|
|
body.loaded {
|
|
opacity: 1; /* Shown when MWC and app script are ready */
|
|
}
|
|
/* Hide dialog by default to prevent flash of unstyled content */
|
|
md-dialog:not([open]) {
|
|
display: none !important;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<h1 id="appTitle">MNotes</h1>
|
|
<md-icon-button id="themeToggleBtn" aria-label="Toggle theme">
|
|
<md-icon>dark_mode</md-icon>
|
|
</md-icon-button>
|
|
</header>
|
|
|
|
<div id="notesList">
|
|
<!-- Notes will be rendered here -->
|
|
</div>
|
|
|
|
<md-fab aria-label="Add Note" id="addNoteFab" variant="primary">
|
|
<md-icon slot="icon">add</md-icon>
|
|
</md-fab>
|
|
</div>
|
|
|
|
<md-dialog id="noteDialog">
|
|
<div slot="headline">Add/Edit Note</div>
|
|
<form slot="content" id="noteForm" method="dialog">
|
|
<input type="hidden" id="noteIdInput">
|
|
<md-filled-text-field label="Title" id="noteTitleInput" required style="width: 100%; margin-bottom: 16px;"></md-filled-text-field>
|
|
<md-outlined-text-field label="Content" id="noteContentInput" type="textarea" rows="5" required style="width: 100%; margin-bottom: 16px;"></md-outlined-text-field>
|
|
</form>
|
|
<div slot="actions">
|
|
<md-text-button form="noteForm" value="cancel">Cancel</md-text-button>
|
|
<md-filled-button form="noteForm" value="save" type="submit">Save</md-filled-button>
|
|
</div>
|
|
</md-dialog>
|
|
|
|
<script src="script.js"></script>
|
|
</body>
|
|
</html>
|