-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a notice about missing adblockers to my site
Credit to fourtonfish for the idea and text
- Loading branch information
Showing
5 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.ftf-dma-note{ | ||
position: fixed; | ||
bottom: 5px; | ||
left: 5px; | ||
right: 5px; | ||
z-index: 9999999; | ||
padding: 0 20px 0; | ||
text-align: start; | ||
background: #fff; | ||
color: #3a3a3a; | ||
border: 5px solid #3a3a3a; | ||
|
||
// @media (pointer:none), (pointer:coarse) { | ||
// display: none !important; | ||
// } | ||
} | ||
|
||
.ftf-dma-note-content-wrapper{ | ||
position: relative; | ||
} | ||
|
||
.ftf-dma-note-header{ | ||
margin-top: 1rem; | ||
font-size: 1.3rem; | ||
font-weight: bold; | ||
} | ||
|
||
.ftf-dma-close-btn{ | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
cursor: pointer; | ||
} | ||
|
||
.ftf-dma-close-btn:hover{ | ||
text-decoration: underline; | ||
} | ||
|
||
#ftf-dma-note.d-none{ | ||
display: none !important; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.ftf-dma-note{ | ||
display: block !important; | ||
pointer-events: all !important; | ||
} | ||
|
||
.ftf-dma-note.d-none{ | ||
display: none !important; | ||
pointer-events: none !important; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function ready(fn) { | ||
if (document.readyState != "loading") { | ||
fn(); | ||
} else { | ||
document.addEventListener("DOMContentLoaded", fn); | ||
} | ||
} | ||
|
||
ready(function () { | ||
const e = document.createElement("div"); | ||
e.id = "ftf-dma-target"; | ||
e.style.display = "none"; | ||
document.body.appendChild(e); | ||
}); | ||
|
||
ready(() => { | ||
const cookieNameValue = "ftf-dma-notice=shown"; | ||
const note = document.getElementById("ftf-dma-note"); | ||
const noteCloseButton = document.getElementById("ftf-dma-close-btn"); | ||
|
||
if (note !== null && noteCloseButton !== null) { | ||
noteCloseButton.onclick = (ev) => { | ||
note.classList.add("d-none"); | ||
document.cookie = cookieNameValue; | ||
}; | ||
} | ||
|
||
if (document.cookie.indexOf(cookieNameValue) === -1) { | ||
if (note !== null) { | ||
note.classList.remove("d-none"); | ||
} | ||
} | ||
}); |
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