* Made splash page dark and updated description

* Cleaned up unused things
* Updated squire which had a comment typo update...thats it
* Background color picker has matching colors and styles to text color picker
* Added new black theme
* Moved search to main page, show it on mobile and added options to push things to notes from search with experimental tag searching
* Added active note menu buttons based on cursor location in text
* Added more instant updating if app is open in two locations for the same user Scratch Pad and home page update with new notes and new text in real time
This commit is contained in:
Max G
2020-05-15 23:12:09 +00:00
parent 67b218329b
commit e87e8513bc
20 changed files with 526 additions and 271 deletions

View File

@@ -41,38 +41,61 @@ export default new Vuex.Store({
state.token = null
state.username = null
},
toggleNightMode(state){
toggleNightMode(state, pastTheme){
//Toggle state and save to local storage
state.nightMode = !(state.nightMode)
localStorage.setItem('nightMode', state.nightMode)
//Default theme colors
let themeColors = {
'background_color': '#fff',
'text_color': '#3d3d3d',
'outline_color': 'rgba(34,36,38,0.15)',
'border_color': 'rgba(34,36,38,0.20)',
'menu-accent': '#cecece',
'menu-text': '#5e6268',
}
//Night mode colors
if(state.nightMode){
themeColors = {
const themes = {
'white':{
'background_color': '#fff',
'text_color': '#3d3d3d',
'outline_color': 'rgba(34,36,38,0.15)',
'border_color': 'rgba(34,36,38,0.20)',
'menu-accent': '#cecece',
'menu-text': '#5e6268',
},
'black':{
'background_color': '#000',
'text_color': '#FFF',
'outline_color': '#FFF',
'border_color': 'rgba(255, 255, 255, 0.70)',
'menu-accent': '#626262',
'menu-text': '#d9d9d9',
},
'night':{
'background_color': '#000',
'text_color': '#a98457',
'outline_color': '#a98457',
'border_color': 'rgba(255, 255, 255, 0.31)',
'menu-accent': '#626262',
'menu-text': '#d9d9d9',
}
},
}
//Catch values not in set
const totalThemes = Object.keys(themes).length
state.nightMode++
if(state.nightMode > totalThemes-1){
state.nightMode = 0
}
if(pastTheme != null){
state.nightMode = pastTheme
}
//Final catch for numbers
if(Number.isInteger(parseInt(state.nightMode)) == false){
state.nightMode = 0
}
const currentTheme = Object.keys(themes)[state.nightMode]
//Toggle state and save to local storage
localStorage.setItem('nightMode', state.nightMode)
//Go through each color and set CSS variable
let root = document.documentElement
Object.keys(themeColors).forEach( attribute => {
root.style.setProperty('--'+attribute, themeColors[attribute])
Object.keys( themes[currentTheme] ).forEach( attribute => {
root.style.setProperty('--'+attribute, themes[currentTheme][attribute])
})
},
detectIsUserOnMobile(state){