Skip to content

Commit

Permalink
style: mobile, sidebar, editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Salatskyi authored and Anton Salatskyi committed Sep 25, 2023
1 parent 9d3d560 commit 42a4bd1
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 10 deletions.
4 changes: 4 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
body {
margin: 0;
}
p {
margin: 12px 0;
}
</style>
19 changes: 14 additions & 5 deletions components/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ function formatDate(d: string): string {
</div>
</div>
<div class="date"> {{ formatDate(data.updatedAt || data.createdAt) }} </div>
<div v-show="isMarked" class="textarea-wrap">
<div v-html="formatedTitle"></div>
<div v-show="isMarked" class="textarea-wrap textarea-mark">
<div v-html="formatedTitle" class="title"></div>
<div v-html="formatedText"></div>
</div>
<div v-show="!isMarked" class="textarea-wrap">
Expand Down Expand Up @@ -101,21 +101,30 @@ function formatDate(d: string): string {
color: #838280;
}
.title {
font-weight: bold;
}
.textarea-wrap {
padding: 15px 10px;
font-size: 14px;
padding: 10px;
height: 100%;
}
.textarea-mark {
padding: 0px 12px;
}
.textarea {
font-family: 'Roboto', sans-serif;
font-size: 14px;
width: 100% !important;
width: 100%;
border: none;
outline: none;
}
.textarea.title {
font-weight: bold;
height: 22px;
}
.textarea.text {
Expand Down
13 changes: 8 additions & 5 deletions components/sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ let notes: Ref<Array<Note.TNote>> = ref([]);
let noteToEdit: Ref<Note.TNote | null> = ref(null);
let q: Ref<string> = ref("");
onBeforeMount(async () => {
notes.value = await Note.getAll();
});
const filteredNotes = computed<Array<Note.TNote>>(() => {
return notes.value.filter(
(n: Note.TNote) => (
Expand All @@ -15,10 +19,6 @@ const filteredNotes = computed<Array<Note.TNote>>(() => {
);
});
onBeforeMount(async () => {
notes.value = await Note.getAll();
});
const removeNote = async () => {
const note = notes.value.find(n => n.isActive);
if (!note) return;
Expand Down Expand Up @@ -91,7 +91,7 @@ function formatDate(d: string): string {
:class="['note', { _active: note.isActive }]">
<div class="border">
<div class="title">{{ note.title }}</div>
<div>
<div class="note-content">
<span class="time">{{ formatDate(note.updatedAt || note.createdAt) }}</span>
<span class="text">{{ truncateText(note.text) }}</span>
</div>
Expand Down Expand Up @@ -122,6 +122,9 @@ function formatDate(d: string): string {
.border {
padding: 16px 0;
}
.note:not(:last-child) .border {
border-bottom: 1px solid #e5e5e5;
}
Expand Down
25 changes: 25 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,29 @@
width: 14px;
cursor: pointer;
}
@media screen and (max-width: 400px) {
.sidebar {
padding: 5px;
width: 30%;
}
.note-content {
display: flex;
flex-direction: column;
}
.editor {
padding: 10px;
width: 70%;
}
.icon {
margin: 5px 10px;
}
.editor .date {
margin-top: 15px;
}
}
</style>

0 comments on commit 42a4bd1

Please sign in to comment.