/**
* Live Update Script
* Overrides the quote on the homepage with a specific message if enabled.
*/
const liveUpdateConfig = {
enabled: false,
message: "We have enabled the AWS Always Unblocked link but the link has changed",
linkUrl: "page6.html"
};
function applyLiveUpdate() {
if (!liveUpdateConfig.enabled || !liveUpdateConfig.message) {
return;
}
const quoteElement = document.getElementById('quote-text');
if (quoteElement) {
// Donate button
const donateBtn = `Donate`;
// Construct the message with the link and donate button
const linkHtml = liveUpdateConfig.linkUrl
? `
Links${donateBtn}`
: '';
// Add the red dot and "Emergency Update" tag
// Adjusted positioning to move it further to the edge
const emergencyTag = `
Emergency Update
`;
// Ensure the quoteElement is relative for absolute positioning to work
quoteElement.classList.add('relative');
// Reduce top padding to bring the text closer to the top, as the tag is moved further out
quoteElement.classList.remove('pt-8'); // Remove previous padding
quoteElement.classList.add('pt-4');
// Wrap the main message content for proper flow after the absolute tag
const messageContent = `${liveUpdateConfig.message}${linkHtml}`;
const fullMessage = `${emergencyTag}${messageContent}`;
// Override the content
quoteElement.innerHTML = fullMessage;
// Remove italic style for important announcements and bold the text
quoteElement.classList.remove('italic');
quoteElement.classList.add('font-bold');
}
}
// Run on DOMContentLoaded with a small delay to ensure it overrides the default quote script
document.addEventListener('DOMContentLoaded', () => {
setTimeout(applyLiveUpdate, 100);
});