From d6a20059d7428d280df5ab2902ed6264a9725016 Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Sun, 16 Feb 2025 17:00:48 -0800 Subject: [PATCH 1/2] feat: remove hubspot and create our own dialog CTA --- .vscode/settings.json | 8 ++++- eslint.config.js | 3 +- index.html | 11 ++++++- src/index.ts | 73 +++++++++++++++++++++++++++++++++++++------ 4 files changed, 82 insertions(+), 13 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2beb504..a059214 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,11 @@ "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" }, - "eslint.validate": ["typescript"] + "eslint.validate": [ + "typescript" + ], + "sonarlint.connectedMode.project": { + "connectionId": "nhcarrigan", + "projectKey": "nhcarrigan_website-headers" + } } diff --git a/eslint.config.js b/eslint.config.js index 792ad5e..b9206dd 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -12,7 +12,8 @@ export default [ }, { rules: { - "no-console": "off" + "no-console": "off", + "max-lines": "off" } } ]; diff --git a/index.html b/index.html index 6d8d243..224946e 100644 --- a/index.html +++ b/index.html @@ -1 +1,10 @@ -Security Audits

Security Audits

A collection of the various reporting tools we run against our repositories.

alt-generator

anon-bot

anthropic-bot

autokey

boost-monitor

campfire-vscode

code-evaluator

deepgram-ringtones

denna

docs

email-complaint-monitoring

eslint-config

hacktoberfest

kaitlyn

librarian

links-detector

merlin

mod-bot

naomi

ocean-breeze

portfolio

profile

rig-task-bot

script-runner

security

social-media-bridge

starfazers

status

template

tingle-bot

translation-bot

trick-or-treat

user-task-bot

website-headers

+ + Test + + +
+

Test

+

Just a demo page.

+
+ + diff --git a/src/index.ts b/src/index.ts index 34a0f2e..c6fd20c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -165,7 +165,7 @@ footer { position: fixed; bottom: 0; height: 75px; - padding-left: 100px; + padding: 0 10px; } a { color: unset; @@ -185,9 +185,6 @@ a { #tree-nation-offset-website { display: none; } - footer { - padding-right: 100px; - } } `; @@ -221,6 +218,7 @@ videoOverlay.style.opacity = "0.25"; videoOverlay.style.width = "100vw"; videoOverlay.style.height = "100vh"; videoOverlay.style.objectFit = "cover"; +videoOverlay.style.zIndex = "10000"; // #endregion @@ -249,11 +247,6 @@ const interval = setInterval(() => { `; const fontAwesome = document.createElement("script"); fontAwesome.src = "https://kit.fontawesome.com/f949111719.js"; -const hubspot = document.createElement("script"); -hubspot.src = "https://js.hs-scripts.com/47086586.js"; -hubspot.async = true; -hubspot.defer = true; -hubspot.id = "hs-script-loader"; const analytics = document.createElement("script"); analytics.defer = true; analytics.setAttribute("domain", "nhcarrigan.com"); @@ -293,7 +286,6 @@ head?.appendChild(styles); head?.appendChild(treeNation); head?.appendChild(fontAwesome); -head?.appendChild(hubspot); head?.appendChild(analytics); head?.appendChild(analytics2); @@ -318,3 +310,64 @@ playButton?.addEventListener("click", () => { playButton.innerHTML = ""; } }); + +// #endregion + +// #region CTA + +const cta = document.createElement("dialog"); +cta.style.position = "fixed"; +cta.style.top = "50%"; +cta.style.left = "50%"; +cta.style.transform = "translate(-50%, -50%)"; +cta.style.padding = "10px"; +cta.style.borderRadius = "10px"; +cta.style.backgroundColor = "var(--background)"; +cta.style.color = "var(--foreground)"; +cta.style.textAlign = "center"; +cta.style.width = "95%"; +cta.style.maxWidth = "400px"; +cta.id = "community-cta"; +cta.innerHTML = ` +

Before You Go!

+
+ Naomi Carrigan +

+ Consider joining our community so you can keep up to date on all of our latest activities! +

+
+ Okay, take me there~! +`; + +const modalBg = document.createElement("div"); +modalBg.style.zIndex = "4999"; +modalBg.style.position = "fixed"; +modalBg.style.top = "0"; +modalBg.style.left = "0"; +modalBg.style.width = "100vw"; +modalBg.style.height = "100vh"; +modalBg.style.backgroundColor = "rgba(0, 0, 0, 0.5)"; +modalBg.style.display = "none"; +modalBg.id = "modal-bg"; +const closeModal = (): void => { + cta.close(); + modalBg.style.display = "none"; +}; +const handleModalClick = (event: MouseEvent): void => { + event.stopPropagation(); + if (event.target === cta) { + closeModal(); + } +}; +const showModal = (): void => { + cta.showModal(); + modalBg.style.display = "block"; + modalBg.addEventListener("click", closeModal); + const closeButton = cta.querySelector("button"); + closeButton?.addEventListener("click", closeModal); + cta.addEventListener("click", handleModalClick); +}; + +body?.appendChild(cta); +body?.appendChild(modalBg); +setTimeout(showModal, 1000 * 30); -- 2.47.2 From 9ef8d631267105c30bccf76aaec0eb621c78dda5 Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Sun, 16 Feb 2025 17:08:25 -0800 Subject: [PATCH 2/2] feat: update modal title, show immediately --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index c6fd20c..2ec3448 100644 --- a/src/index.ts +++ b/src/index.ts @@ -329,7 +329,7 @@ cta.style.width = "95%"; cta.style.maxWidth = "400px"; cta.id = "community-cta"; cta.innerHTML = ` -

Before You Go!

+

Hello~!

Naomi Carrigan

@@ -370,4 +370,4 @@ const showModal = (): void => { body?.appendChild(cta); body?.appendChild(modalBg); -setTimeout(showModal, 1000 * 30); +showModal(); -- 2.47.2