2
0
mirror of https://github.com/offen/website.git synced 2024-11-22 09:00:28 +01:00

add conditional embed demo

This commit is contained in:
Frederik Ring 2022-06-09 12:05:04 +02:00
parent e870e5574e
commit 5ff006971d
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,40 @@
title: Consent
description: tbd
date: 2022-04-03
slug: consent-tool
url: /blog/consent-tool/
sitemap_priority: 0
image_url: /theme/images/offen-blog-0220-complete-stable.jpg
author: Hendrik Niefeld
bottom_cta: protocol
# Consent tool
<div class="tweet-container">
</div>
<script src="https://consent.offen.dev/client.js"></script>
<script>
const client = new window.ConsentClient({
host: document.querySelector('.tweet-container'),
ui: {
styles: {
position: 'relative'
}
}
})
client.acquire('twitter')
.then(function (result) {
if (result && result.decisions && result.decisions.twitter) {
const blockquote = document.createElement('p')
blockquote.innerHTML = '<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Once again; loud and slow for the people at the back:<br><br>COOKIE POPUPS DID NOT COME FROM THE GDPR. <br><br>Cookie popups came from the adtech industrys disinclination to comply with ePrivacy law and make it so annoying to avoid surveillance advertising that people wouldnt bother</p>&mdash; Miss IG Geek (she/her) 🏳️‍🌈 (@MissIG_Geek) <a href="https://twitter.com/MissIG_Geek/status/1524353593385574400?ref_src=twsrc%5Etfw">May 11, 2022</a></blockquote>'
document.querySelector('.tweet-container').appendChild(blockquote)
const script = document.createElement('script')
script.src = 'https://platform.twitter.com/widgets.js'
document.querySelector('.tweet-container').appendChild(script)
}
})
.catch(function (err) {
console.error(err)
})
</script>

View File

@ -6,7 +6,7 @@
{% block title %}{{ title }}{% endblock %} {% block title %}{{ title }}{% endblock %}
</title> </title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' *.offen.dev; frame-src 'self' *.offen.dev; style-src 'self' 'unsafe-inline'"> <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' *.offen.dev platform.twitter.com; frame-src 'self' *.offen.dev platform.twitter.com; style-src 'self' 'unsafe-inline'">
<meta name="referrer" content="origin"> <meta name="referrer" content="origin">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">