Browse Source

Change notes to canvas instead of own page;

modulation
Nero Ignis 3 years ago
parent
commit
1be7efaff7
  1. 3
      src/App.vue
  2. 6
      src/router/index.js
  3. 13
      src/views/Menu.vue
  4. 31
      src/views/Notes.vue

3
src/App.vue

@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
<TasksForTracker/>
<Tasks/>
<History/>
<Notes/>
<Settings/>
</template>
@ -27,10 +28,12 @@ import HistoryForTracker from "./views/HistoryForTracker"; @@ -27,10 +28,12 @@ import HistoryForTracker from "./views/HistoryForTracker";
import CustomBookForTracker from "./views/CustomBookForTracker";
import Settings from "./views/Settings";
import Tasks from "./views/Tasks";
import Notes from "./views/Notes";
export default {
el: '#root',
components: {
Notes,
Tasks,
Settings,
CustomBookForTracker,

6
src/router/index.js

@ -3,7 +3,6 @@ import Trackers from "../views/Trackers"; @@ -3,7 +3,6 @@ import Trackers from "../views/Trackers";
import Settings from "../views/Settings";
import TrackersDetail from "../views/TrackersDetail";
import Archive from "../views/Archive";
import Notes from "../views/Notes";
Array.prototype.pushToBeginning = function (toPush) {
return this.unshift.apply(this, [toPush]);
@ -25,11 +24,6 @@ const routes = [ @@ -25,11 +24,6 @@ const routes = [
name: 'Archive',
component: Archive
},
{
path: '/notes',
name: 'Notes',
component: Notes
},
{
path: '/settings',
name: 'Settings',

13
src/views/Menu.vue

@ -46,14 +46,15 @@ @@ -46,14 +46,15 @@
</router-link>
</div>
<div class="left-menu-item">
<router-link to="/notes"
type="button"
class="btn btn-warning bottom-menu-item"
<a type="button"
class="btn btn-info text-light bottom-menu-item"
style="background-color: #ffea77;"
data-bs-placement="left"
data-bs-toggle="offcanvas"
data-bs-target="#notesCanvas"
data-bs-placement="top"
title="Notizen">
<i class="fas fa-pen"></i>
</router-link>
</a>
</div>
<div class="left-menu-item" v-if="($store.state.trackers.length + $store.state.archive.length) > 0">
<a type="button"
@ -122,7 +123,7 @@ export default { @@ -122,7 +123,7 @@ export default {
margin-bottom: 1em;
}
.fas, .far {
.fas {
text-shadow: 1px 1px grey;
}

31
src/views/Notes.vue

@ -1,13 +1,14 @@ @@ -1,13 +1,14 @@
<template>
<div class="row">
<div class="col-sm-12">
<div class="offcanvas offcanvas-end" id="notesCanvas"
aria-hidden="true">
<div class="offcanvas-header">
<h5><i class="fa fa-pen"></i> Notizen</h5>
<div class="float-end">
<a href="javascript:" v-on:click="createNote()" class="btn btn-sm btn-success">Neue Notiz</a>
</div>
<h5><i class="fa fa-pen"></i> Notizen</h5>
</div>
<div class="col-sm-12" v-if="$store.state.notes.length > 0">
<div class="filter-wrapper">
<div v-if="$store.state.notes.length > 0">
<a href="javascript:"
v-if="colorToFilter !== ''"
v-on:click="colorToFilter = ''"
@ -26,13 +27,16 @@ @@ -26,13 +27,16 @@
</a>
</span>
</div>
</div>
<div class="offcanvas-body">
<div class="row">
<div id="note-container">
<span v-for="(note, noteIndex) in $store.state.notes" v-bind:key="noteIndex">
<template v-for="(note, noteIndex) in $store.state.notes" v-bind:key="noteIndex">
<div class="col-lg-4 col-md-6" v-if="colorToFilter === '' || note.color === colorToFilter">
<div class="card">
<div class="card-body note" :style="'background-color:' + note.color ?? '#ffea77'">
<textarea v-model="note.body" spellcheck="false" @keydown="this.$store.commit('saveNotes')"></textarea>
<textarea v-model="note.body" spellcheck="false"
@keydown="this.$store.commit('saveNotes')"></textarea>
<div class="color-changer">
<span v-for="color in noteColors"
v-bind:key="color">
@ -45,12 +49,15 @@ @@ -45,12 +49,15 @@
</span>
</div>
<div class="float-end">
<a href="javascript:" class="delete-button" @click="$store.commit('deleteNote', noteIndex)"><i class="fas fa-trash"></i></a>
<a href="javascript:" class="delete-button"
@click="$store.commit('deleteNote', noteIndex)"><i class="fas fa-trash"></i></a>
</div>
</div>
</div>
</div>
</span>
</template>
</div>
</div>
</div>
</div>
</template>
@ -159,4 +166,8 @@ textarea:focus { @@ -159,4 +166,8 @@ textarea:focus {
color: white;
background-color: grey;
}
.filter-wrapper {
margin: 0.3em 1em;
}
</style>
Loading…
Cancel
Save