feat: login component, icon svg symbols, project structure

This commit is contained in:
NGPixel
2017-12-30 02:00:49 -05:00
parent 2d5a3203db
commit 8b30d31457
37 changed files with 863 additions and 23300 deletions

View File

@@ -1,7 +1,6 @@
import Vue from 'vue'
import Vuex from 'vuex'
import alert from './modules/alert'
import anchor from './modules/anchor'
import editor from './modules/editor'
import editorCodeblock from './modules/editor-codeblock'
@@ -15,6 +14,7 @@ import modalDiscardPage from './modules/modal-discard-page'
import modalMovePage from './modules/modal-move-page'
import modalProfile2fa from './modules/modal-profile-2fa'
import modalUpgradeSystem from './modules/modal-upgrade-system'
import navigator from './modules/navigator'
import pageLoader from './modules/page-loader'
Vue.use(Vuex)
@@ -27,12 +27,12 @@ export default new Vuex.Store({
loadingChange: (state, loadingState) => { state.loading = loadingState }
},
actions: {
alert({ dispatch }, opts) { dispatch('navigator/alert', opts) },
startLoading({ commit }) { commit('loadingChange', true) },
stopLoading({ commit }) { commit('loadingChange', false) }
},
getters: {},
modules: {
alert,
anchor,
editor,
editorCodeblock,
@@ -46,6 +46,7 @@ export default new Vuex.Store({
modalMovePage,
modalProfile2fa,
modalUpgradeSystem,
navigator,
pageLoader
}
})

View File

@@ -1,32 +0,0 @@
'use strict'
import debounce from 'lodash/debounce'
export default {
state: {
shown: false,
style: 'green',
icon: 'check',
msg: ''
},
getters: {},
mutations: {
alertChange: (state, opts) => {
state.shown = (opts.shown === true)
state.style = opts.style || 'green'
state.icon = opts.icon || 'check'
state.msg = opts.msg || ''
}
},
actions: {
alert({ commit, dispatch }, opts) {
opts.shown = true
commit('alertChange', opts)
dispatch('alertDismiss')
},
alertDismiss: debounce(({ commit }) => {
let opts = { shown: false }
commit('alertChange', opts)
}, 3000)
}
}

View File

@@ -0,0 +1,40 @@
import debounce from 'lodash/debounce'
export default {
namespaced: true,
state: {
subtitleShown: false,
subtitleStyle: '',
subtitleIcon: false,
subtitleText: '',
subtitleStatic: 'Welcome'
},
getters: {},
mutations: {
subtitleChange (state, opts) {
state.subtitleShown = (opts.shown === true)
state.subtitleStyle = opts.style || ''
state.subtitleIcon = opts.icon || false
state.subtitleText = opts.msg || ''
},
subtitleStatic (state, text) {
state.subtitleText = text
state.subtitleStatic = text
}
},
actions: {
alert ({ commit, dispatch }, opts) {
opts.shown = true
commit('subtitleChange', opts)
dispatch('alertDismiss')
},
alertDismiss: debounce(({ commit, state }) => {
let opts = {
shown: false,
style: state.subtitleStyle,
msg: state.subtitleStatic
}
commit('subtitleChange', opts)
}, 5000)
}
}