"tailwindcss": "^1.0.4",
"vue": "^2.6.10",
"vue-slide-up-down": "^1.7.2",
- "vue-template-compiler": "^2.6.10"
+ "vue-template-compiler": "^2.6.10",
+ "element-closest": "^3.0.1"
},
- "dependencies": {}
+ "dependencies": {
+
+ }
}
require('./menu');
require('../../vendor/cubist/cms-back/src/public/emailobfuscator/emailobfuscator');
+var glob = require( 'glob' );
+var path = require( 'path' );
+
window.Vue = require('vue');
window.eventBus = new Vue();
--- /dev/null
+require('element-closest');
+
+document.addEventListener('DOMContentLoaded', function () {
+ Array.prototype.forEach.call(document.querySelectorAll('meta[data-ga]'), function (el, i) {
+ handleGtag(el)
+ });
+});
+
+document.addEventListener('click', function (e) {
+
+ if (e.target.matches('[data-ga]')) {
+ handleGtag(e.target);
+ }
+ if (e.target.closest('[data-ga]')) {
+ handleGtag(e.target.closest('[data-ga]'));
+ }
+}, false);
+
+function handleGtag(el) {
+ if (el.getAttribute('data-ga') === 'event') {
+ console.log(el);
+ let action = el.getAttribute('data-ga-action');
+ let category = el.getAttribute('data-ga-category');
+ let label = el.getAttribute('data-ga-label');
+ let value = el.getAttribute('data-ga-value');
+ let options = {non_interaction: el.getAttribute('data-ga-noninteraction') === 1};
+ if (null !== category) {
+ options.event_category = category;
+ }
+ if (null !== label) {
+ options.event_label = label;
+ }
+ if (null !== value) {
+ options.value = value;
+ }
+ gtag('event', action, options)
+ }
+}
@prepend('scripts')
<script src="{{ mix('/js/app.js') }}"></script>
+ <script src="{{ mix('/js/vendor.js') }}"></script>
@endprepend
@include('cubist::head.htmldeclaration')
{!! nl2br($global->get('footer_text')) !!}
</div>
<div class="footer-social flex">
- <a class="text-white hover:text-blue mr-6" href="{{ $global->get('social.twitter') }}" target="_blank"
+ <a class="text-white hover:text-blue mr-6" data-ga="event" data-ga-category="social"
+ data-ga-action="click" data-ga-label="twitter" href="{{ $global->get('social.twitter') }}"
+ target="_blank"
rel="noopener">
@svg('icon-twitter')
</a>
- <a class="text-white hover:text-blue" href="{{ $global->get('social.linkedin') }}" target="_blank"
+ <a class="text-white hover:text-blue" data-ga="event" data-ga-category="social" data-ga-action="click"
+ data-ga-label="linkedin" href="{{ $global->get('social.linkedin') }}" target="_blank"
rel="noopener">
@svg('icon-linkedin')
</a>
<ul>
@foreach ($global->get('strengths', []) as $strength)
<li class="flex items-center mb-6">
- <img src="{{ $global->getImageURLByCollection($strength['icon']) }}" alt="{{ $strength['title'] }}" class="flex-shrink-0 w-12 h-12 mr-4">
+ <img src="{{ $global->getImageURLByCollection($strength['icon']) }}"
+ alt="{{ $strength['title'] }}" class="flex-shrink-0 w-12 h-12 mr-4">
<div>
<span class="font-display font-semibold">{{ $strength['title'] }}</span>
<br/>
|
*/
+mix.webpackConfig({
+ node: {
+ fs: "empty"
+ }
+});
+
mix.browserSync({
proxy: process.env.APP_URL,
open: false // Don't automatically open a new tab when the watcher starts
});
mix.js('resources/js/app.js', 'public/js')
+ .js('resources/js/vendor/**/**/app.js','public/js/vendor.js')
.stylus('resources/styles/app.styl', 'public/css', {
use: [
require('rupture')()