Skip to content

Commit

Permalink
beta0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Aneks1 committed Mar 7, 2024
1 parent 78dabc0 commit 07f1106
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
20 changes: 13 additions & 7 deletions src/components/NotePreview/NotePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,24 @@ export default defineComponent({
titleSize: 50
}
},
mounted() {
this.stateTitle = this.title
this.stateDesc = this.description
if(this.title.length > 25) this.stateTitle = this.title.slice(0, 22).trimEnd() + '...'
if(this.description.length > 50) this.stateDesc = this.description.slice(0, 47) + '...'
if(this.stateTitle.length > 7) this.titleSize = 50 - (this.stateTitle.length + 7) / 2
if(this.stateTitle.length > 20) this.titleSize = 50 - (this.stateTitle.length + 10) / 2
mounted() { this.handleFontSize() },
watch: {
title: function() { this.handleFontSize() },
description: function() { this.handleFontSize() }
},
methods: {
openMenu(id: string, e: MouseEvent) {
console.log(id)
console.log(e.clientX, e.clientY)
},
handleFontSize() {
this.stateTitle = this.title
this.stateDesc = this.description
if(this.title.length > 25) this.stateTitle = this.title.slice(0, 22).trimEnd() + '...'
if(this.description.length > 50) this.stateDesc = this.description.slice(0, 47) + '...'
if(this.stateTitle.length > 7) this.titleSize = 50 - (this.stateTitle.length + 7) / 2
if(this.stateTitle.length > 20) this.titleSize = 50 - (this.stateTitle.length + 10) / 2
console.log(this.stateTitle)
}
}
})
Expand Down
14 changes: 8 additions & 6 deletions src/routes/HomePage/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export default defineComponent({
watch: {
currentBoard: function() {
if(this.currentBoard == null) return
this.loadedNotes = []
this.loadedNotes = Array.from(boardManager.boards.get(this.currentBoard)!.notes).map(x => x[1])
console.log(boardManager.boards.get(this.currentBoard)!.notes)
}
},
methods: {
Expand Down Expand Up @@ -154,12 +156,12 @@ export default defineComponent({
resizeNoteDisplay() {
// currently fixing
const winWidth = remote.getCurrentWindow().getBounds().width
const menuWidth = 16*16
const noteWidth = 13*16
const contWidth = winWidth - menuWidth - 6*16
const noteCount = Math.floor(contWidth / noteWidth)
this.homeContainer.gap = (contWidth - noteCount*noteWidth) / (noteCount - 1) - 3
// const winWidth = remote.getCurrentWindow().getBounds().width
// const menuWidth = 16*16
// const noteWidth = 13*16
// const contWidth = winWidth - menuWidth - 6*16
// const noteCount = Math.floor(contWidth / noteWidth)
// this.homeContainer.gap = (contWidth - noteCount*noteWidth) / (noteCount - 1) - 3
}
},
mounted() {
Expand Down

0 comments on commit 07f1106

Please sign in to comment.