@ -1,51 +1,12 @@
|
|||||||
// Import vue component
|
|
||||||
import Vue from 'vue';
|
|
||||||
import MeshkeeToast from './MeshkeeToast.vue';
|
|
||||||
import { useToast } from './api';
|
import { useToast } from './api';
|
||||||
|
|
||||||
// Vue.prototype.$meshkeeToast = function () {
|
// To allow use as module (npm/webpack/etc.) export component
|
||||||
// console.log(324);
|
|
||||||
// return 321;
|
|
||||||
// }
|
|
||||||
// // Declare install function executed by Vue.use()
|
|
||||||
// export function install(Vue) {
|
|
||||||
// console.log(43);
|
|
||||||
|
|
||||||
// if (install.installed) return;
|
|
||||||
// install.installed = true;
|
|
||||||
// Vue.prototype.$meshkeeToast = function () {
|
|
||||||
// console.log(324);
|
|
||||||
// return 321;
|
|
||||||
// }
|
|
||||||
// Vue.component('MeshkeeToast', MeshkeeToast);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Create module definition for Vue.use()
|
|
||||||
// const plugin = {
|
|
||||||
// install,
|
|
||||||
// };
|
|
||||||
|
|
||||||
// // Auto-install when vue is found (eg. in browser via <script> tag)
|
|
||||||
// let GlobalVue = null;
|
|
||||||
// if (typeof window !== 'undefined') {
|
|
||||||
// GlobalVue = window.Vue;
|
|
||||||
// } else if (typeof global !== 'undefined') {
|
|
||||||
// GlobalVue = global.Vue;
|
|
||||||
// }
|
|
||||||
// console.log(global, GlobalVue);
|
|
||||||
// if (GlobalVue) {
|
|
||||||
// GlobalVue.use(plugin);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // To allow use as module (npm/webpack/etc.) export component
|
|
||||||
// export default MeshkeeToast;
|
|
||||||
export default {
|
export default {
|
||||||
install(Vue, options) {
|
install(Vue, options) {
|
||||||
// Let's register our component globally
|
// Let's register our component globally
|
||||||
// https://vuejs.org/v2/guide/components-registration.html
|
// https://vuejs.org/v2/guide/components-registration.html
|
||||||
Vue.prototype.$meshkeeToast = function () {
|
Vue.prototype.$metoast = () => {
|
||||||
const { open } = useToast(options);
|
return new useToast(options);
|
||||||
open('Vue');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
@ -1 +0,0 @@
|
|||||||
$toast-icons-path: "./theme/sugar/icons" !default;
|
|
@ -1,5 +0,0 @@
|
|||||||
@import '../default/variables';
|
|
||||||
@import 'variables';
|
|
||||||
@import '../animations';
|
|
||||||
@import '../default/main';
|
|
||||||
@import '../sugar/icons';
|
|
@ -1,3 +1,4 @@
|
|||||||
@import 'variables';
|
@import 'variables';
|
||||||
@import '../animations';
|
@import '../animations';
|
||||||
@import 'main';
|
@import 'main';
|
||||||
|
@import '../sugar/icons';
|
After Width: | Height: | Size: 759 B |
After Width: | Height: | Size: 759 B |
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 616 B |
Before Width: | Height: | Size: 142 B |
After Width: | Height: | Size: 211 B |
Before Width: | Height: | Size: 453 B After Width: | Height: | Size: 211 B |
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 474 B |
Before Width: | Height: | Size: 589 B |
@ -1,24 +0,0 @@
|
|||||||
export default class Timer {
|
|
||||||
constructor(callback, delay) {
|
|
||||||
this.startedAt = Date.now();
|
|
||||||
this.callback = callback;
|
|
||||||
this.delay = delay;
|
|
||||||
|
|
||||||
this.timer = setTimeout(callback, delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
pause() {
|
|
||||||
this.stop();
|
|
||||||
this.delay -= Date.now() - this.startedAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
resume() {
|
|
||||||
this.stop();
|
|
||||||
this.startedAt = Date.now();
|
|
||||||
this.timer = setTimeout(this.callback, this.delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
|
||||||
clearTimeout(this.timer);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,47 @@
|
|||||||
|
export default class Timer {
|
||||||
|
constructor(callback, delay) {
|
||||||
|
this.startedAt = Date.now();
|
||||||
|
this.callback = callback;
|
||||||
|
this.delay = delay;
|
||||||
|
this.timer = setTimeout(callback, delay);
|
||||||
|
this.index = 0;
|
||||||
|
this.width = 0;
|
||||||
|
this.widthTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
pause() {
|
||||||
|
this.stop();
|
||||||
|
this.delay -= Date.now() - this.startedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
resume() {
|
||||||
|
this.stop();
|
||||||
|
this.startedAt = Date.now();
|
||||||
|
this.timer = setTimeout(this.callback, this.delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
}
|
||||||
|
|
||||||
|
move(elem, stop) {
|
||||||
|
if (stop) {
|
||||||
|
this.index = 0;
|
||||||
|
return clearInterval(this.widthTimer);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.index == 0) {
|
||||||
|
this.index = 1;
|
||||||
|
this.widthTimer = setInterval(() => {
|
||||||
|
if (this.width >= 100) {
|
||||||
|
clearInterval(this.widthTimer);
|
||||||
|
this.index = 0;
|
||||||
|
} else {
|
||||||
|
this.width++;
|
||||||
|
elem.style.width = this.width + "%";
|
||||||
|
}
|
||||||
|
}, (this.delay / 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|