api-client/layouts/default.vue

64 lines
1.8 KiB
Vue
Raw Normal View History

2019-08-24 03:06:57 +00:00
<template>
2019-11-01 11:15:53 +00:00
<div class="wrapper">
<div class="content">
<div class="columns">
2020-03-04 01:17:02 +00:00
<sidenav />
<div class="main" id="main">
2020-03-04 01:17:02 +00:00
<pw-header />
<nuxt />
2020-03-04 01:17:02 +00:00
<pw-footer />
</div>
2019-11-01 11:15:53 +00:00
</div>
</div>
2019-09-02 04:48:01 +00:00
</div>
2019-08-24 03:06:57 +00:00
</template>
2019-10-25 08:14:34 +00:00
2019-09-02 04:48:01 +00:00
<script>
2019-11-12 04:18:57 +00:00
export default {
components: {
sidenav: () => import("~/components/layout/sidenav"),
"pw-header": () => import("~/components/layout/header"),
"pw-footer": () => import("~/components/layout/footer"),
2019-11-12 04:18:57 +00:00
},
2019-09-02 04:48:01 +00:00
2019-11-12 04:18:57 +00:00
beforeMount() {
// Load theme settings
2020-02-24 18:44:50 +00:00
;(() => {
2019-11-12 04:18:57 +00:00
// Apply theme from settings.
document.documentElement.className = this.$store.state.postwoman.settings.THEME_CLASS || ""
2019-11-12 04:18:57 +00:00
// Load theme color data from settings, or use default color.
let color = this.$store.state.postwoman.settings.THEME_COLOR || "#50fa7b"
2020-02-24 18:44:50 +00:00
let vibrant = this.$store.state.postwoman.settings.THEME_COLOR_VIBRANT || true
document.documentElement.style.setProperty("--ac-color", color)
2019-11-12 04:18:57 +00:00
document.documentElement.style.setProperty(
"--act-color",
vibrant ? "rgba(32, 33, 36, 1)" : "rgba(255, 255, 255, 1)"
2020-02-24 18:44:50 +00:00
)
})()
2019-11-12 04:18:57 +00:00
},
2019-11-12 04:18:57 +00:00
mounted() {
if (process.client) {
document.body.classList.add("afterLoad")
2019-11-12 04:18:57 +00:00
}
2019-11-01 11:15:53 +00:00
2019-11-12 04:18:57 +00:00
document
.querySelector("meta[name=theme-color]")
.setAttribute("content", this.$store.state.postwoman.settings.THEME_TAB_COLOR || "#202124")
2019-11-01 11:15:53 +00:00
console.log(
"%cWe ❤︎ open source!",
"background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;"
2020-02-24 18:44:50 +00:00
)
console.log(
"%cContribute: https://github.com/liyasthomas/postwoman",
"background-color:black;padding:4px 8px;border-radius:8px;font-size:16px;color:white;"
2020-02-24 18:44:50 +00:00
)
2019-11-12 04:18:57 +00:00
},
beforeDestroy() {
document.removeEventListener("keydown", this._keyListener)
2020-02-24 18:44:50 +00:00
},
}
2019-08-24 03:06:57 +00:00
</script>