This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/layouts/default.vue

73 lines
2.2 KiB
Vue
Raw Normal View History

2020-07-22 13:19:23 -07:00
<template>
2021-07-10 07:46:29 -07:00
<div class="d-flex flex-column vh-100 body">
2020-07-22 13:19:23 -07:00
<div class="flex-grow-1">
2020-09-23 11:34:35 -07:00
<Header/>
2021-05-13 03:09:08 -07:00
<main class="container">
2021-05-03 07:15:48 -07:00
<Nuxt/>
<ScrollButton/>
</main>
2020-07-22 13:19:23 -07:00
</div>
2021-05-13 03:09:08 -07:00
<div class="container">
2020-07-22 13:19:23 -07:00
<Footer/>
</div>
<DialogueBox ref="dialogue"/>
2021-01-06 06:21:20 -08:00
<Lightbox/>
2020-07-22 13:19:23 -07:00
</div>
</template>
2020-10-24 13:32:12 -07:00
<script>
import Vue from 'vue';
2021-06-15 03:57:50 -07:00
import dark from "../plugins/dark";
2021-06-18 08:33:25 -07:00
import sorter from "avris-sorter";
2020-10-24 13:32:12 -07:00
export default {
2021-06-15 03:57:50 -07:00
mixins: [dark],
2020-10-24 13:32:12 -07:00
mounted() {
Vue.prototype.$alert = (message, color='primary') => {
return new Promise((resolve, reject) => {
this.$refs.dialogue.show(false, message, color, resolve, reject);
});
};
2020-10-24 13:32:12 -07:00
Vue.prototype.$confirm = (message, color='primary') => {
return new Promise((resolve, reject) => {
this.$refs.dialogue.show(true, message, color, resolve, reject);
2020-10-24 13:32:12 -07:00
});
};
Vue.prototype.$post = (url, data, options = {}, timeout = 30000) => {
return new Promise((resolve, reject) => {
this.$axios.$post(url, data, {...options, timeout})
.then(data => resolve(data))
.catch(async e => {
console.error(e);
await this.$alert(this.$t('error.generic'), 'danger');
reject();
});
});
2021-06-09 23:45:13 -07:00
};
2021-06-15 03:57:50 -07:00
this.setMode(this.detectDark());
2021-06-18 08:33:25 -07:00
if (process.client) {
sorter();
}
2021-07-10 10:02:08 -07:00
if (process.env.NODE_ENV === 'production') {
this.$loadScript('arc', 'https://arc.io/widget.min.js#yHdNYRkC');
}
2020-10-24 13:32:12 -07:00
}
}
</script>
2020-07-22 13:19:23 -07:00
<style lang="scss">
@import "assets/style";
2021-06-18 08:55:50 -07:00
@import "~avris-sorter/dist/Sorter.min.css";
2021-07-10 07:46:29 -07:00
@include media-breakpoint-up('lg', $grid-breakpoints) {
.body {
margin-top: $header-margin;
}
.sticky-top {
top: $header-height - 1px;
}
}
2020-07-22 13:19:23 -07:00
</style>