Sac Metro Amplify footer Backup Code
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
const footer = document.querySelector("footer");
if (!footer) return;
const container = footer.querySelector(".container.pure-g");
if (!container) return;
const columns = container.children;
if (columns.length < 2) return;
// Adjust columns to 1/3 width
Array.from(columns).forEach(col => {
col.classList.remove("pure-u-md-1-2");
col.classList.add("pure-u-md-1-3");
});
// Ensure third column exists
let thirdColumn = container.querySelector(".third-column");
if (!thirdColumn) {
thirdColumn = document.createElement("div");
thirdColumn.className = "pure-u-1 pure-u-md-1-3 third-column";
container.appendChild(thirdColumn);
}
// Add logo
const leftColumn = columns[0];
if (leftColumn && !leftColumn.querySelector(".footer-logo")) {
const logoDiv = document.createElement("div");
logoDiv.className = "footer-logo";
logoDiv.style.textAlign = "left";
logoDiv.style.marginBottom = "1rem";
const logoImg = document.createElement("img");
logoImg.src = "https://streamline.imgix.net/8dd2697a-cbc0-48ff-a9ad-d69c6db53c2a/8e4f1bc1-3ae2-432f-803b-f7d1127fae0c/Metro%20Bar%20Logo-white-lettering.png?ixlib=rb-1.1.0&or=0&w=800&h=800&fit=max&auto=format%2Ccompress&s=2afb12bc9257d246b3d086d4caa4540b";
logoImg.width = 235;
logoImg.alt = "Sacramento Metropolitan Fire District";
logoDiv.appendChild(logoImg);
leftColumn.insertBefore(logoDiv, leftColumn.firstChild);
}
// Insert hours after address
const addressLine = Array.from(leftColumn.querySelectorAll("div")).find(div =>
div.textContent.includes("10545 Armstrong Ave")
);
if (addressLine) {
addressLine.style.fontWeight = "bold";
addressLine.style.marginBottom = "1rem";
const hoursLine = document.createElement("div");
hoursLine.textContent = "Monday – Friday 8:00 AM – 5:00 PM";
hoursLine.style.marginBottom = "1rem";
leftColumn.insertBefore(hoursLine, addressLine.nextSibling);
}
// Insert fax after phone and label phone number
const phoneLine = Array.from(leftColumn.querySelectorAll("div")).find(div =>
div.textContent.trim().includes("(916) 859-4300")
);
if (phoneLine) {
phoneLine.textContent = "Phone: (916) 859-4300";
phoneLine.style.fontWeight = "bold";
phoneLine.style.marginBottom = "1rem";
const faxLine = document.createElement("div");
faxLine.textContent = "Fax: (916) 859-3702";
faxLine.style.fontWeight = "bold";
faxLine.style.marginBottom = "1rem";
phoneLine.insertAdjacentElement("afterend", faxLine);
}
// Move Powered by + Sign In
const footerNav = footer.querySelector('nav[aria-label="Footer"]');
if (footerNav) {
const listItems = footerNav.querySelectorAll("ul > li");
const poweredByItem = Array.from(listItems).find(li =>
li.textContent.includes("Powered by")
);
const signInItem = Array.from(listItems).find(li =>
li.textContent.includes("Sign In")
);
if (poweredByItem && signInItem) {
const infoLine = document.createElement("div");
infoLine.className = "footer-meta-line";
infoLine.style.display = "flex";
infoLine.style.alignItems = "center";
infoLine.style.gap = "16px";
infoLine.style.marginTop = "1.2rem";
const poweredLink = poweredByItem.querySelector("a");
const signInLink = signInItem.querySelector("a");
if (poweredLink && signInLink) {
const separator = document.createElement("span");
separator.textContent = " | ";
separator.style.margin = "0 8px";
separator.style.color = "#ffffff";
infoLine.appendChild(poweredLink);
infoLine.appendChild(separator);
infoLine.appendChild(signInLink);
}
leftColumn.appendChild(infoLine);
}
// Insert Website Accessibility Statement link above "Transparency"
if (footerNav) {
const navList = footerNav.querySelector("ul");
if (navList) {
// Clean up any empty <li> elements first
const emptyItems = navList.querySelectorAll("li");
emptyItems.forEach(li => {
if (!li.textContent.trim()) {
navList.removeChild(li);
}
});
// Find the "Transparency" <li>
const transparencyItem = Array.from(navList.querySelectorAll("li")).find(li =>
li.textContent.includes("Transparency")
);
// Create and insert new accessibility link
const accessibilityItem = document.createElement("li");
accessibilityItem.style.margin = "0";
accessibilityItem.style.padding = "0";
const accessibilityLink = document.createElement("a");
accessibilityLink.href = "/website-accessibility-statement.html#";
accessibilityLink.textContent = "Website Accessibility Statement";
accessibilityLink.setAttribute("data-toggle", "modal");
accessibilityLink.setAttribute("data-target", "#website-accessibility-policy-modal");
// Styling
accessibilityLink.style.color = "#ffffff";
accessibilityLink.style.textDecoration = "none";
accessibilityLink.style.fontWeight = "bold";
accessibilityLink.style.display = "inline-block";
accessibilityItem.appendChild(accessibilityLink);
// Insert before Transparency
if (transparencyItem) {
navList.insertBefore(accessibilityItem, transparencyItem);
} else {
navList.appendChild(accessibilityItem); // fallback
}
}
}
// Style nav
footerNav.style.textAlign = "left";
const navListElem = footerNav.querySelector("ul");
if (navListElem) {
navListElem.style.paddingLeft = "5rem";
navListElem.style.listStyle = "none";
navListElem.style.display = "flex";
navListElem.style.flexDirection = "column";
navListElem.style.gap = "12px";
}
const navLinks = footerNav.querySelectorAll("a");
navLinks.forEach(link => {
link.style.color = "#ffffff";
link.style.textDecoration = "none";
});
}
// Move social media
const socialMediaDiv = footer.querySelector(".social-media");
if (socialMediaDiv && !thirdColumn.contains(socialMediaDiv)) {
thirdColumn.appendChild(socialMediaDiv);
socialMediaDiv.style.display = "flex";
socialMediaDiv.style.justifyContent = "flex-end";
socialMediaDiv.style.gap = "12px";
socialMediaDiv.style.marginTop = "1rem";
socialMediaDiv.style.color = "#ffffff";
}
// Move copyright
const copyrightLine = Array.from(leftColumn.querySelectorAll("div")).find(div =>
div.textContent.includes("Copyright")
);
if (copyrightLine) {
copyrightLine.style.marginTop = "1rem";
copyrightLine.style.fontSize = "14px";
copyrightLine.style.color = "#ffffff";
leftColumn.appendChild(copyrightLine);
}
// CSS Injection
const style = document.createElement("style");
style.textContent = `
footer .container.pure-g {
font-size: 16px;
line-height: 1.5;
}
nav[aria-label="Footer"] a {
font-weight: bold;
}
.footer-meta-line a {
color: #ffffff !important;
font-size: 14px !important;
text-decoration: none;
font-weight: normal;
}
.footer-meta-line a:hover {
text-decoration: underline;
}
.third-column .social-media a svg {
width: 45px;
height: 45px;
transition: transform 0.2s ease-in-out;
}
.third-column .social-media a:hover svg {
transform: scale(1.1);
}
.third-column .social-media a svg path {
fill: white !important;
}
.footer-logo + div {
margin-top: 0.5rem;
}
.footer-meta-line {
margin-top: 1rem;
}
`;
document.head.appendChild(style);
});
</script>
