the home site for me: also iteration 3 or 4 of my site
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add anti ad ad

+73
+48
sass/css/_nativeads.scss
··· 1 + #ad-note-hidden, 2 + #ad-note { 3 + display: none; 4 + } 5 + 6 + @media (min-height: 30em) { 7 + @media (min-width: 75em) { 8 + #ad-note { 9 + display: block; 10 + position: fixed; 11 + bottom: 1em; 12 + right: 1em; 13 + width: 15em; 14 + background: var(--bg); 15 + border: 1px solid var(--accent); 16 + border-bottom: 5px solid var(--bg-light); 17 + border-radius: 7px 7px 10px 10px; 18 + padding: 0.75em 1em; 19 + font-size: 0.85rem; 20 + color: var(--text); 21 + z-index: 100; 22 + } 23 + 24 + @media (prefers-reduced-motion: no-preference) { 25 + #ad-note { 26 + animation: bubbleIn 0.3s ease-out forwards; 27 + } 28 + } 29 + 30 + #ad-note a { 31 + color: var(--link); 32 + } 33 + 34 + #ad-note-content-wrapper { 35 + margin: 0; 36 + } 37 + 38 + #ad-note u { 39 + cursor: pointer; 40 + color: var(--text-light); 41 + text-decoration: underline; 42 + } 43 + 44 + #ad-note u:hover { 45 + color: var(--accent); 46 + } 47 + } 48 + }
+1
sass/css/main.scss
··· 8 8 @use "view-transitions"; 9 9 @use "emoji-inline"; 10 10 @use "lightbox"; 11 + @use "nativeads";
+14
static/js/nativeads.js
··· 1 + // static/js/nativeads.js 2 + 3 + function hideAdNote() { 4 + document.getElementById("ad-note").id = 'ad-note-hidden'; 5 + document.getElementById("ad-note-content-wrapper").innerHTML = ""; 6 + document.cookie = "notice-shown=true;path=/"; 7 + } 8 + 9 + if (!document.cookie.includes("notice-shown")) { 10 + document.getElementById("ad-note-hidden").id = 'ad-note'; 11 + document.getElementById("ad-note-content-wrapper").innerHTML = "No adblocker detected. " + 12 + "Consider using an extension like <a href=https://github.com/uBlockOrigin/uBOL-home/blob/main/README.md>uBlock Origin</a> to save time and bandwidth." + 13 + " <u onclick=hideAdNote()>Click here to close.</u>"; 14 + }
+10
templates/base.html
··· 8 8 <body> 9 9 <header>{% include "header.html" %}</header> 10 10 <main>{% block content %} {% endblock content %}</main> 11 + 12 + <script defer src="/js/nativeads.js"></script> 13 + <div 14 + id="ad-note-hidden" 15 + class="ftf-dma-note ad native-ad native-ad-1 ytd-j yxd-j yxd-jd aff-content-col aff-inner-col aff-item-list ark-ad-message inplayer-ad inplayer_banners in_stream_banner trafficjunky-float-right dbanner preroll-blocker happy-inside-player blocker-notice blocker-overlay exo-horizontal ave-pl bottom-hor-block brs-block advboxemb wgAdBlockMessage glx-watermark-container overlay-advertising-new header-menu-bottom-ads rkads mdp-deblocker-wrapper amp-ad-inner imggif bloc-pub bloc-pub2 hor_banner aan_fake aan_fake__video-units rps_player_ads fints-block__row full-ave-pl full-bns-block vertbars video-brs player-bns-block wps-player__happy-inside gallery-bns-bl stream-item-widget adsbyrunactive happy-under-player adde_modal_detector adde_modal-overlay ninja-recommend-block aoa_overlay message" 16 + > 17 + <p id="ad-note-content-wrapper"> 18 + </p> 19 + </div> 20 + 11 21 <footer>{% include "footer.html" %}</footer> 12 22 </body> 13 23 </html>