Add example
This commit is contained in:
30
snippets/legacy-banner.conf
Normal file
30
snippets/legacy-banner.conf
Normal file
@ -0,0 +1,30 @@
|
||||
set $legacy "
|
||||
<script src='/legacywarn.js'></script>
|
||||
<style>
|
||||
#legacywarnoverlay {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.9);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
#legacywarnoverlay p {
|
||||
padding: 10px;
|
||||
color: white;
|
||||
}
|
||||
#legacywarnoverlay p a {
|
||||
text-decoration: underline;
|
||||
color: white;
|
||||
}
|
||||
#legavywarnoverlay p a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
<div id='legacywarnoverlay'>
|
||||
<p>Du besuchst diese Seite mit einem <strong>veralteten</strong> IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte Frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.<br>
|
||||
You are visiting this site with an <strong>outdated</strong> IPv4 internet access. Possibly in the future you may experience problems with accessibility and performance. Please ask your ISP or network administrator for IPv6 support.<br>
|
||||
<a href='https://margau.net/ipv6' target='_blank'>Weitere Infos | More Information</a><br>Klicke zum schließen | Click to close</p></div></body>";
|
18
snippets/legacy-js.conf
Normal file
18
snippets/legacy-js.conf
Normal file
@ -0,0 +1,18 @@
|
||||
location /legacywarn.js {
|
||||
return 200 "
|
||||
function legacywarnon() {
|
||||
document.getElementById('legacywarnoverlay').style.display = 'block';
|
||||
}
|
||||
|
||||
function legacywarnoff() {
|
||||
document.getElementById('legacywarnoverlay').style.display = 'none';
|
||||
document.cookie = 'legacywarn=true; max-age=60*60*24 ; path=/';
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
document.getElementById('legacywarnoverlay').onclick = legacywarnoff;
|
||||
if (document.cookie.indexOf('legacywarn=') > -1) {
|
||||
document.getElementById('legacywarnoverlay').style.display = 'none';
|
||||
console.log('Hide Legacy IP warn');
|
||||
}
|
||||
});";
|
||||
}
|
Reference in New Issue
Block a user