whattofix.tech codes

 
Head
<link href="https://templates.bullet.so/what-fix-client/styles.css" rel="stylesheet"> <script type="text/javascript" src="https://platform-api.sharethis.com/js/sharethis.js#property=66e2de7e5ed17f00198b32e6&product=inline-share-buttons&source=platform" async="async"></script>
Body
<script> const alertBannerURL = "https://www.whattofix.tech/publications/content-to-payment/" const alertBannerText = "NEW REPORT - From Content To Payment: The Rise And Implications Of Social Media Ad Revenue Sharing" const styles = ` @import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap'); * { margin: 0; padding: 0; box-sizing: border-box; } .webinar-content { font-family: var(--primary-font); width: 100%; display: flex; align-items: center; justify-content: start; background: hsl(347, 99%, 56%); animation: transistionAnimation 0.75s ease-in-out; padding-top:.7rem; padding-bottom:.7rem; padding-left: var(--navbar-padding); padding-right: var(--navbar-padding); } .webinar-time { width: fit-content; color: #fff; font-size: 1.25rem; font-weight: regular; margin-right: 10px; } .webinar-cta-link { padding: 5px 15px; font-family: "Inter", sans-serif; width: fit-content; border-radius: 5px; background: #fff; color: #5D67CE; text-decoration: none; font-size: 1rem; margin: 10px 0px 10px 50px; font-weight: bold; } .webinar-cta-link:hover { transistion: 0.3s; opacity: 0.8; } .webinar-heading { color: #F7C23B; } @media (max-width: 1024px) { .webinar-time { font-size: 1.25rem; } .webinar-content { flex-direction: column; } .webinar-cta-link { margin: 10px 0px 10px 0px; padding: 10px; } } @keyframes transistionAnimation { 0% { opacity: 0; } 100% { transform: scale(1); } } .webinar-banner { position: sticky; top: 0; z-index: 100; } .bullet-container-card { top: calc(var(--navbar-height) + 60px); } .blog-nav-container .blog_navigator { top: calc(var(--navbar-height) + 60px); } @media (max-width: 450px) { .webinar-content { padding: 10px; } .webinar-time { font-size: .75rem; } } ` const webinarContent = ` <a href="${alertBannerURL}"> <div class="webinar-content"> <h1 class="webinar-time"> ${alertBannerText} </h1> </div> </a> `; let visible = true; const addWebinarBanner = () => { const bodyElement = document.querySelector('body'); const navbarElement = document.querySelector('.bullet-navbar'); const styleElement = document.createElement('style'); styleElement.innerHTML = styles; document.head.appendChild(styleElement); const webinarBanner = document.createElement('div'); const webinarContainer = document.createElement('div'); webinarContainer.setAttribute('class', 'webinar-banner'); webinarBanner.innerHTML = webinarContent; webinarContainer.appendChild(webinarBanner); webinarContainer.appendChild(navbarElement); bodyElement.insertBefore(webinarContainer, bodyElement.firstChild); visible = false; // navbarElement.parentNode.insertBefore(webinarBanner, navbarElement); } document.addEventListener('DOMContentLoaded', () => { if (visible === true) { addWebinarBanner(); } }); function createArrowElement(el) { // Create container div const container = document.createElement('span'); container.classList.add('arrow-container'); // Create circle const circle = document.createElement('span'); circle.classList.add('circle'); container.appendChild(circle); // Create line const line = document.createElement('div'); line.classList.add('line'); container.appendChild(line); // Create arrow const arrow = document.createElement('span'); arrow.classList.add('arrow', 'arrow-right'); container.appendChild(arrow); return container; } const domLinks = document.querySelectorAll(".notion-link"); const pageLinks = document.querySelectorAll('.notion-page-link .notion-page-title-text') const arrows = Array.from([...domLinks,...pageLinks]).filter((item) => { return item.textContent[0] === '→' // return item?.textContent.includes('→'); }) arrows.forEach(el => { const link = el; const arrowElement = createArrowElement(el); link.textContent = link.textContent.slice(1) link.classList.add('notion-link-arrow'); link?.insertBefore(arrowElement, link.firstChild) // el.appendChild(arrowElement) const parent = el.parentNode // console.log(parent) // parent.classList.add('arrow-red') // parent.insertBefore(arrowElement, parent.firstChild); }); const navbarLinks = document.querySelectorAll('.bullet-navbar-links a'); const currentPath = window.location.pathname; const firstSegment = currentPath.split('/')[1] || ''; navbarLinks.forEach((link) => { if (link) { const linkUrl = new URL(link.href); const isInFullURLSegments = window.location.href.split('/').includes(firstSegment) const isInCurrentSegment = link.href.split('/').includes(firstSegment); if ((linkUrl.pathname === currentPath || (isInFullURLSegments && isInCurrentSegment)) && currentPath !== '/') { link.classList.add("nav-active"); } } }); </script> <script src="https://templates.bullet.so/what-fix-client/script.js"></script>