Init git.
This commit is contained in:
2
app/application/resources/volt/js/app.js
Normal file
2
app/application/resources/volt/js/app.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import './bootstrap';
|
||||
import './volt.js';
|
32
app/application/resources/volt/js/bootstrap.js
vendored
Normal file
32
app/application/resources/volt/js/bootstrap.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
window.axios = axios;
|
||||
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
||||
/**
|
||||
* Echo exposes an expressive API for subscribing to channels and listening
|
||||
* for events that are broadcast by Laravel. Echo and event broadcasting
|
||||
* allows your team to easily build robust real-time web applications.
|
||||
*/
|
||||
|
||||
// import Echo from 'laravel-echo';
|
||||
|
||||
// import Pusher from 'pusher-js';
|
||||
// window.Pusher = Pusher;
|
||||
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'pusher',
|
||||
// key: import.meta.env.VITE_PUSHER_APP_KEY,
|
||||
// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
|
||||
// wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
|
||||
// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
|
||||
// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
|
||||
// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
|
||||
// enabledTransports: ['ws', 'wss'],
|
||||
// });
|
90
app/application/resources/volt/js/volt.js
Normal file
90
app/application/resources/volt/js/volt.js
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
|
||||
=========================================================
|
||||
* Volt Pro - Premium Bootstrap 5 Dashboard
|
||||
=========================================================
|
||||
|
||||
* Product Page: https://themesberg.com/product/admin-dashboard/volt-bootstrap-5-dashboard
|
||||
* Copyright 2021 Themesberg (https://www.themesberg.com)
|
||||
|
||||
* Designed and coded by https://themesberg.com
|
||||
|
||||
=========================================================
|
||||
|
||||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Please contact us to request a removal. Contact us if you want to remove it.
|
||||
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
const d = document;
|
||||
|
||||
import * as bootstrap from 'bootstrap';
|
||||
import SmoothScroll from 'smooth-scroll';
|
||||
|
||||
d.addEventListener("DOMContentLoaded", function(event) {
|
||||
|
||||
// options
|
||||
const breakpoints = {
|
||||
sm: 540,
|
||||
md: 720,
|
||||
lg: 960,
|
||||
xl: 1140
|
||||
};
|
||||
|
||||
var sidebar = document.getElementById('sidebarMenu')
|
||||
if(sidebar && d.body.clientWidth < breakpoints.lg) {
|
||||
sidebar.addEventListener('shown.bs.collapse', function () {
|
||||
document.querySelector('body').style.position = 'fixed';
|
||||
});
|
||||
sidebar.addEventListener('hidden.bs.collapse', function () {
|
||||
document.querySelector('body').style.position = 'relative';
|
||||
});
|
||||
}
|
||||
|
||||
[].slice.call(d.querySelectorAll('[data-background]')).map(function(el) {
|
||||
el.style.background = 'url(' + el.getAttribute('data-background') + ')';
|
||||
});
|
||||
|
||||
[].slice.call(d.querySelectorAll('[data-background-lg]')).map(function(el) {
|
||||
if(document.body.clientWidth > breakpoints.lg) {
|
||||
el.style.background = 'url(' + el.getAttribute('data-background-lg') + ')';
|
||||
}
|
||||
});
|
||||
|
||||
[].slice.call(d.querySelectorAll('[data-background-color]')).map(function(el) {
|
||||
el.style.background = 'url(' + el.getAttribute('data-background-color') + ')';
|
||||
});
|
||||
|
||||
[].slice.call(d.querySelectorAll('[data-color]')).map(function(el) {
|
||||
el.style.color = 'url(' + el.getAttribute('data-color') + ')';
|
||||
});
|
||||
|
||||
//Tooltips
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
||||
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl)
|
||||
})
|
||||
|
||||
// Popovers
|
||||
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
|
||||
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
|
||||
return new bootstrap.Popover(popoverTriggerEl)
|
||||
})
|
||||
|
||||
// Datepicker
|
||||
var datepickers = [].slice.call(d.querySelectorAll('[data-datepicker]'))
|
||||
var datepickersList = datepickers.map(function (el) {
|
||||
return new Datepicker(el, {
|
||||
buttonClass: 'btn'
|
||||
});
|
||||
})
|
||||
|
||||
var scroll = new SmoothScroll('a[href*="#"]', {
|
||||
speed: 500,
|
||||
speedAsDuration: true
|
||||
});
|
||||
|
||||
if(d.querySelector('.current-year')){
|
||||
d.querySelector('.current-year').textContent = new Date().getFullYear();
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user