<button
v-if="currentView == views.home"
type="button"
- class="btn btn-light mx-1"
+ class="btn btn-sm btn-outline-dark mx-1"
@click="logout"
>
Logout
<button
v-if="currentView == views.home"
type="button"
- class="btn btn-primary mx-1"
+ class="btn btn-sm btn-outline-primary mx-1"
@click="newNote"
>
New
<button
v-if="currentView == 2 && editMode == false"
type="button"
- class="btn btn-secondary mx-1"
+ class="btn btn-sm btn-outline-secondary mx-1"
>
Close
</button>
<button
v-if="currentView == views.note && editMode == false"
type="button"
- class="btn btn-warning mx-1"
+ class="btn btn-sm btn-outline-warning mx-1"
@click="toggleEditMode"
>
Edit
<button
v-if="currentView == views.note && editMode == false"
type="button"
- class="btn btn-danger mx-1"
+ class="btn btn-sm btn-outline-danger mx-1"
@click="deleteNote"
>
Delete
<button
v-if="currentView == views.note && editMode == true"
type="button"
- class="btn btn-secondary mx-1"
+ class="btn btn-sm btn-outline-secondary mx-1"
@click="cancelNote"
>
Cancel
<button
v-if="currentView == views.note && editMode == true"
type="button"
- class="btn btn-success mx-1"
+ class="btn btn-sm btn-outline-success mx-1"
@click="saveNote"
>
Save
</div>
<!-- Note Loaded -->
- <div v-else class="mb-4">
- <!-- Viewer -->
- <div v-if="editMode == false">
- <viewer
- :initialValue="currentNote.content"
- height="600px"
- :options="viewerOptions"
- />
- </div>
+ <div v-else>
+ <h2 v-if="editMode == false" class="mb-4">{{currentNote.title}}</h2>
+ <input v-else type="text" class="h2 title-input" v-model="titleInput" />
- <!-- Editor -->
- <div v-else>
- <input type="text" class="form-control" v-model="titleInput" />
- <editor
- :initialValue="initialContent"
- initialEditType="markdown"
- previewStyle="tab"
- height="calc(100vh - 180px)"
- ref="toastUiEditor"
- :options="editorOptions"
- @change="startDraftSaveTimeout"
- />
+ <!-- Viewer -->
+ <div class="mb-4 note">
+ <div v-if="editMode == false" class="note-viewer">
+ <viewer
+ :initialValue="currentNote.content"
+ height="600px"
+ :options="viewerOptions"
+ />
+ </div>
+
+ <!-- Editor -->
+ <div v-else>
+ <editor
+ :initialValue="initialContent"
+ initialEditType="markdown"
+ previewStyle="tab"
+ height="calc(100vh - 230px)"
+ ref="toastUiEditor"
+ :options="editorOptions"
+ @change="startDraftSaveTimeout"
+ />
+ </div>
</div>
</div>
</div>
+// Bootstrap
@import "bootstrap/dist/css/bootstrap.css";
@import "bootstrap-vue/dist/bootstrap-vue.css";
+@import "node_modules/bootstrap/scss/functions";
+@import "node_modules/bootstrap/scss/variables";
+@import "node_modules/bootstrap/scss/mixins";
+// Toast UI Markdown Editor
@import "@toast-ui/editor/dist/toastui-editor.css";
@import "@toast-ui/editor/dist/toastui-editor-viewer.css";
+@import "prismjs/themes/prism.css";
+@import "@toast-ui/editor-plugin-code-syntax-highlight/dist/toastui-editor-plugin-code-syntax-highlight.css";
-@import 'prismjs/themes/prism.css';
-@import '@toast-ui/editor-plugin-code-syntax-highlight/dist/toastui-editor-plugin-code-syntax-highlight.css';
+
+// Variables
+$off-white: #f8f9fd70;
+
+
+// Mixins
+@mixin note-content {
+ padding: min(2vw, 30px) min(3vw, 40px);
+}
+
+
+// Elements & Classes
+body {
+ background-color: $off-white;
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
+}
.clickable-link {
cursor: pointer;
}
}
+.note {
+ background-color: white;
+ box-shadow: 0 0 10px #0000000a;
+}
+
+.note-viewer {
+ @include note-content;
+}
+
+.title-input {
+ border: none;
+
+ // Override user agent styling
+ background-color: $off-white;
+ color: #212529;
+ padding: 0;
+}
+
+.title-input:focus {
+ outline: none;
+}
+
+
+// Toast UI Overrides
.toastui-editor-contents {
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
h1,
h2 {
border-bottom: none;
}
}
+
+.toastui-editor-defaultUI {
+ border: none;
+}
+
+.toastui-editor-defaultUI .ProseMirror {
+ @include note-content;
+}