%PDF- %PDF-
Direktori : /var/www/html/evablog/resources/assets/js/ |
Current File : /var/www/html/evablog/resources/assets/js/app.js |
import Vue from "vue"; import App from "./App.vue"; import router from "./router"; import BootstrapVue from "bootstrap-vue"; import VueCarousel from "vue-carousel"; Vue.router = router; Vue.config.productionTip = false; Vue.use(BootstrapVue); Vue.use(VueCarousel); Vue.component('App', App); Vue.directive('squareImage', { // When the bound element is inserted into the DOM... inserted: function (el) { function handle () { setTimeout(function () { el.style.height = el.style.width + 'px'; }, 100); } window.addEventListener('resize', handle); handle(); } }); Vue.directive('scrollToTop', { // When the bound element is inserted into the DOM... inserted: function (el) { function handle () { setTimeout(function () { const scroll = $(document).scrollTop(); if (scroll > 100) { showElement(); } else { hideElement(); } }, 100); } function showElement () { el.style.opacity = 1; } function hideElement () { el.style.opacity = 0; } el.addEventListener('click', function () { $("html, body").animate({scrollTop: 0}, 500); return false; }); window.addEventListener('resize', handle); window.addEventListener('scroll', handle); handle(); } }); /* eslint-disable no-new */ const app = new Vue({ el: '#app', router, components: {App}, template: '<App/>' });