This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vue.config.js | |
const path = require('path') | |
module.exports = { | |
outputDir: path.resolve(__dirname, 'dist-demo'), | |
chainWebpack: config => { | |
config | |
.entry('app') | |
.clear() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.video-container__image { | |
pointer-events: none; | |
transition: opacity 0.3s cubic-bezier(0, 0.1, 0.3, 1); | |
// Add play icon | |
&::after { | |
background-image: url('/images/icon_play_big.svg'); | |
background-position: center; | |
// Play icon in large containers should be larger than in small ones | |
background-size: calc(45px + 5%); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (hlsSupported || this.parsed) { | |
this.playVideo() | |
} else { | |
// hls.js attaches itself to the window, we use this to detect if it has already been downloaded | |
const { Hls } = window | |
if (Hls) { | |
this.parseHlsManifest() | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static hlsSupported() { | |
return localStorage.getItem('hlsSupport') === 'true' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
optOutController() { | |
if (this.usingStorage) { // A | |
FacebookPixelController.setStorage('opt-out') // B | |
} | |
FacebookPixelController.setCookie('opt-out') // C | |
if (window.hasOwnProperty('fbq')) { | |
FacebookPixelController.disableTrackingFunction() // D | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.$optOutButton = document.querySelector('.js-fb-opt-out') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- www.domain.tld/datenschutz/ --> | |
<h3>Facebook-Pixel</h3> | |
<p>Diese Seite verwendet einen Facebook-Pixel […]</p> | |
<section class="opt-out-control"> | |
<a href="#" class="js-fb-opt-out">Tracking deaktivieren</a> | |
</section> | |
<p>mehr Datenschutz […]</p> | |
<!-- rest der seite --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script data-pixel="fb"> | |
var optOutWish = function() { | |
var doNotTrack = navigator.doNotTrack === '1'; | |
var hasOptedOut = localStorage.getItem('fb-pixel-status') === 'opt-out'; | |
return doNotTrack || hasOptedOut; | |
} | |
if (optOutWish()) { | |
console.info('User prohibits tracking. Not embedding Facebook’s script.') | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check current status | |
const optOutWish = () => { | |
const doNotTrack = navigator.doNotTrack === '1' | |
const hasOptedOut = localStorage.getItem('fb-pixel-status') === 'opt-out' | |
return doNotTrack || hasOptedOut | |
} | |
// Output to an element in the document | |
const setDebugStatus = () => { |