diff --git a/index.html b/index.html index 66e1240..0870df6 100644 --- a/index.html +++ b/index.html @@ -25,62 +25,62 @@ + content="https://theradicalparty.com/memes/favicon.jpg"> + content="https://theradicalparty.com/memes/favicon.jpg"> - - + - + content="https://theradicalparty.com/memes/mickeymeta.PNG"> + content="https://theradicalparty.com/memes/mickeymeta.PNG"> + content="https://theradicalparty.com/memes/mickeymeta.PNG"> - + + href="https://theradicalparty.com/memes/favicon.jpg"> + href="https://theradicalparty.com/memes/favicon.jpg"> + href="https://theradicalparty.com/memes/favicon.jpg"> + href="https://theradicalparty.com/memes/favicon.jpg"> + href="https://theradicalparty.com/memes/favicon.jpg"> + href="https://theradicalparty.com/memes/favicon.jpg"> + href="https://theradicalparty.com/memes/favicon.jpg"> + href="https://theradicalparty.com/memes/favicon.jpg"> + href="https://theradicalparty.com/memes/favicon.jpg"> + href="https://theradicalparty.com/memes/favicon.jpg"> + href="https://theradicalparty.com/memes/favicon.jpg"> - - - - + + + + - + - + - + @@ -156,7 +156,7 @@ "@type": "WebSite", "name": "RADICAL", "description": "Australia's direct democracy movement. Share policy ideas, vote on proposals, take back control. Vibe, Vote, Veto.", - "image": "https://radical.omar-c29.workers.dev/memes/mickeymeta.PNG", + "image": "https://theradicalparty.com/memes/mickeymeta.PNG", "url": "https://theradicalparty.com", "author": { "@type": "Organization", @@ -265,12 +265,33 @@ function smartCopyShare(proposalId, proposalText) { copyToClipboard(link); } } - // Configuration - const API_BASE_URL = - window.location.hostname === 'localhost' - ? 'http://localhost:8787/api' - : 'https://theradicalparty.com/api'; - +function getAPIBaseURL() { + const hostname = window.location.hostname; + const protocol = window.location.protocol; + + switch(hostname) { + case 'localhost': + return 'http://localhost:8787/api'; + case 'theradicalparty.com': + case 'www.theradicalparty.com': + return `${protocol}//theradicalparty.com/api`; + case 'radical.omar-c29.workers.dev': + return `${protocol}//radical.omar-c29.workers.dev/api`; + default: + return `${protocol}//${hostname}/api`; + } +} + +const API_BASE_URL = getAPIBaseURL(); + +function getMediaURL(path) { + const baseURL = window.location.hostname === 'localhost' + ? 'http://localhost:8787' + : `https://${window.location.hostname}`; + return `${baseURL}${path}`; +} + + // Character limit const CHAR_LIMIT = 280; @@ -907,7 +928,7 @@ async function submitVote(proposalId, voteType, isPetition = false, petitionDeta ${netVotes > 0 ? '+' : ''}${netVotes}
- Share + Share
${formatDate(proposal.timestamp)}
@@ -1007,7 +1028,7 @@ updateCommentCount(proposal.id); const uploadIcon = document.createElement('img'); uploadIcon.className = 'meme-upload-icon'; -uploadIcon.src = 'https://radical.omar-c29.workers.dev/memes/pepe.jpg'; +uploadIcon.src = 'https://theradicalparty.com/memes/pepe.jpg'; uploadIcon.alt = 'Pepe'; uploadIcon.style.width = '20px'; uploadIcon.style.height = '20px'; @@ -2283,7 +2304,7 @@ document.addEventListener('DOMContentLoaded', () => { console.log("Music prompt element found, adding click listener"); // Audio file URL - this should point to your audio file in R2 - const audioUrl = 'https://radical.omar-c29.workers.dev/memes/steppingout.mp3'; + const audioUrl = getMediaURL('/audio/steppingout.mp3'); // Initialize music only when the "hit me" button is clicked musicPrompt.addEventListener('click', function(e) {