campaignTrail_temp.modBoxTheme = { "header_color" : "#720F20", "header_text_color" : "#FFFFFF", "description_text_color" : "#FFFFFF", "description_background_color" : "#C64E48", "main_color" : "#A51F28", "secondary_color" : "#7C1F28", "ui_text_color": "#FFFFFF" } if(campaignTrail_temp.election_json.length!=1) { e=campaignTrail_temp campaignTrail_temp.election_json = JSON.parse("[{\"model\": \"campaign_trail.election\", \"pk\": 4, \"fields\": {\"year\": 1952, \"summary\": \"

Since his victory over Henry Wallace four years ago, Harold Stassen has presided over a successful—if tumultuous term in office. The Treaty of Hong Kong promises to build a lasting peace by splitting China down the Yangtze, and Civil War in Korea has roped the United States into another proxy war in East Asia. Though Stassen swept to power on a program of interventionism, his willingness to send American troops marching abroad has grown increasingly unpopular. Meanwhile, since Communist organizations were outlawed by the Walter-Nixon Act, the passions of the HUAC appears to have manifested in the Senate in the form of Senator Joseph McCarthy's innumerable accusations against suspected agents of Communism.
" HistHexcolour=["#c44141","#0020c1","#506526","#c46300"]; HistName=[" Harold Stassen"," Sid McMath"," Vincent Hallinan/Other"," Unpledged Electors"]; HistEV=[401,130,0,0]; HistPV=["33,051,881","28,675,031","625,192","125,038"]; HistPVP=["52.9%","45.9%","1.0%","0.2%"]; $("#game_window")[0].style.borderColor = "#A51F28" $(".container")[0].style.backgroundColor = "#A51F28" $("#game_window")[0].style.backgroundColor = "#c64e48" nct_stuff.themes[nct_stuff.selectedTheme].coloring_title = "#720F20" nct_stuff.themes[nct_stuff.selectedTheme].coloring_window = "#AF968A" //Banner changer thing (stole from italy1976) bannerlist=["https://i.imgur.com/fuZN1mz.png", "https://i.imgur.com/Hta3NLk.png"] document.getElementById("header").src = bannerlist[Math.floor((Math.random() * bannerlist.length))] document.body.background = "https://i.imgur.com/6rvPmFl.jpg" quotes = ["“The Wisconsin Senator has started a fire which neither he nor anyone else may be able to control. ” ~ Sen. Fulbright", '"Stassen again!"', "“McMath runs but stands for nothing.” ~ Sen. Taylor"] customquote = quotes[Math.floor((Math.random() * quotes.length))] corrr=`\n

CAMPAIGN TRAIL SHOWCASE

`+customquote+`` next0 = function() { text = "

In the 1952 Election, President Stassen faces Arkansas governor and reformer Sid McMath, a figure largely unknown nationally who swept the Democratic Nomination in the fifth ballot in a triumph that shocked the nation. In order to be the first Republican re-elected in over a generation, Stassen must prove to the nation that his unique brand of outsider politics can continue to successfully govern the nation, and that the Second Red Scare he's helped foster is truly necessary to eliminate foreign subversions. Meanwhile, Sid McMath will be forced to define himself nationally whilst keeping his own party in order to surmount all odds and win this election.

" document.getElementById("election_summary").innerHTML = text } back0 = function() { text = "

Since his victory over Henry Wallace four years ago, Harold Stassen has presided over a successful—if tumultuous term in office. The Treaty of Hong Kong promises to build a lasting peace by splitting China down the Yangtze, and Civil War in Korea has roped the United States into another proxy war in East Asia. Though Stassen swept to power on a program of interventionism, his willingness to send American troops marching abroad has grown increasingly unpopular. Meanwhile, since Communist organizations were outlawed by the Walter-Nixon Act, the passions of the HUAC appears to have manifested in the Senate in the form of Senator Joseph McCarthy's innumerable accusations against suspected agents of Communism.

" document.getElementById("election_summary").innerHTML = text } musicMode = () => { // Initialise custom music $("#music_player")[0].children[0].style.display = "none" $("#music_player")[0].children[1].style.display = "none" document.getElementById("modLoadReveal").style.display = "none" document.getElementById("modloaddiv").style.display = "none" musicBox = document.getElementById("music_player") musicBox.style.display = "" var trackSel; e = campaignTrail_temp e.selectedSoundtrack = 0 toTime = (seconds) => { var date = new Date(null); date.setSeconds(seconds); return date.toISOString().substr(11, 8); } generateTime = () => { // Get the audio element var audio = document.getElementById("campaigntrailmusic"); timeTracker = document.createElement("div"); timeTracker.style = ` text-align:left; border-style:solid; border-width:3px; height:150px; width:200px; background-color:#999999; float:right; padding: 10px; ` $("#trackSelParent")[0].prepend(timeTracker); $("#trackSelParent")[0].prepend(document.createElement("br")); // Create a new element to display the current position of the audio var positionDisplay = document.createElement("gg"); positionDisplay.id = "position-display"; // Create a new slider element to change the time var timeSlider = document.createElement("input"); timeSlider.type = "range"; timeSlider.min = 0; timeSlider.max = 1; timeSlider.step = 0.001; timeSlider.value = 0; timeSlider.style.width = "200px"; timeSlider.id = "time-slider"; var pausePlay = document.createElement("button"); pausePlay.id = "position-display"; pausePlay.innerHTML = "Pause" pausePlay.style.width = "100%"; pausePlay.addEventListener("click", event => { event.preventDefault(); updatePositionDisplay(); let audio = document.getElementById("campaigntrailmusic"); if (audio.paused) { audio.play(); event.target.innerHTML = "Pause"; return; } audio.pause(); event.target.innerHTML = "Play"; return; }) var volumeLabel = document.createElement("gg"); volumeLabel.id = "volume-label"; volumeLabel.innerHTML = "
Volume: " var volumeSlider = document.createElement("input"); volumeSlider.type = "range"; volumeSlider.min = 0; volumeSlider.max = 1; volumeSlider.step = 0.001; volumeSlider.value = 0; volumeSlider.style.width = "200px"; volumeSlider.id = "volume-slider"; volumeSlider.value = audio.volume; timeTracker.appendChild(pausePlay); timeTracker.appendChild(document.createElement("br")); timeTracker.appendChild(document.createElement("br")); timeTracker.appendChild(positionDisplay); timeTracker.appendChild(timeSlider); timeTracker.appendChild(volumeLabel); timeTracker.appendChild(volumeSlider); updatePositionDisplay(); //for (let i = 0; i < 10; i++) //timeTracker.append(document.createElement("br")); // Function to update the position display function updatePositionDisplay() { positionDisplay.innerHTML = "Time: " + toTime(audio.currentTime) + "
"; timeSlider.value = audio.duration ? audio.currentTime / audio.duration : 0; } // Function to change the time of the audio function changeTime() { positionDisplay.innerHTML = "Time: " + toTime(audio.currentTime) + "
"; audio.currentTime = timeSlider.value * audio.duration; } updateVolume = event => { audio.volume = event.target.value; } // Update the position display and slider every second setInterval(updatePositionDisplay, 1000); // Listen for changes to the time slider and change the time of the audio timeSlider.addEventListener("input", changeTime); volumeSlider.addEventListener("input", updateVolume) } function newMusicPlayer() { trackSel = document.createElement("div"); trackSel.id = "trackSelParent" let z = `









` z += `

` //
for (i in soundtracks[e.selectedSoundtrack].tracklist) { let a = soundtracks[e.selectedSoundtrack].tracklist[i] let b = `
` z += b } z += "


" trackSel.innerHTML = z // select correct song musicBox.appendChild(trackSel); Array.from(document.getElementById("trackSel").children).filter(f => { return f.tagName == "LABEL" }).map(f => f.children[0])[0].checked = true // set soundtrack changer soundtrackSelector = document.getElementById("selectSoundtrack") soundtrackSelector.onchange = function() { for (i in soundtracks) { if (soundtracks[i].name == soundtrackSelector.value) { e.selectedSoundtrack = i break } } document.getElementById("trackSelParent").remove() newMusicPlayer() } var matches = document.querySelectorAll('.trackSelector'); for (match in matches) { matches[match].onchange = function() { audio = $("#campaigntrailmusic")[0]; audio.src = soundtracks[e.selectedSoundtrack].tracklist[this.value].url audio.currentTime = 0 } } musicBox.children[2].loop = false musicBox.children[2].src = soundtracks[e.selectedSoundtrack].tracklist[0].url musicBox.children[2].onended = function() { console.log("next track") let selected = Number(document.querySelector('input[name="trackSelector"]:checked').value); let newSel = clamp(selected + 1, soundtracks[e.selectedSoundtrack].tracklist.length - 1, 0) let buttons = Array.from(document.getElementById("trackSel").children).filter(f => { return f.tagName == "LABEL" }).map(f => f.children[0]) //let selectedIndex = buttons.map(f=>f.children[0]).map(f=>f.checked) buttons[newSel].click() } for (w = 0; w < 7; w++) { document.getElementById("trackSelParent").appendChild(document.createElement("br")) } generateTime(); } clamp = function(a, max, min, overflow = true) { if (overflow) { return a > max ? min : a < min ? max : a; } return a > max ? max : a < min ? min : a; } // Track list var soundtracks = { 0: { name: "Stassen Rock N Pop!", tracklist: [ { "name": "Kiss Of Fire - Georgia Gibbs", "url": "https://audio.jukehost.co.uk/jIAt0ObmHBGRZnGbHNGZhrEZKL2nRQFg" }, { "name": "Gee - The Crows", "url": "https://audio.jukehost.co.uk/w0ODLdZ3ZZvjIC8P6J9uvXbycFir44hV" }, { "name": "Rose Rose I Love You - Frankie Laine", "url": "https://audio.jukehost.co.uk/uawoP1YjcyvHCoOuvpinAyh9Szc8aROt" }, { "name": "Hawaiian War Chant - Ames Brothers", "url": "https://audio.jukehost.co.uk/qC4gQSzSssNrYipQFzP0d2LvmFPkqhVT" }, { "name": "A Trumpeter’s Lullaby - Leroy Anderson", "url": "https://audio.jukehost.co.uk/zsPILPkxEG8SgUyjTrL26geVBEkRiftq" } ] }, 1: { name: "Sids Jukebox", tracklist: [ { "name": "Walking My Baby Back Home - Johnny Ray", "url": "https://audio.jukehost.co.uk/SvsNSWK1c45WQliPFF7xDthNxFLCsWFV" }, { "name": "Blue Tango - Leroy Anderson", "url": "https://audio.jukehost.co.uk/HKczg3tChxuPAwPR4fbcmJ7MWjy6SuAY" }, { "name": "Sound Off (The Duckworth Chant) - Vaughn Monroe", "url": "https://audio.jukehost.co.uk/2Vo6BDFZNtXMeR5ts2F3t0x6ACOYT27v" }, { "name": "Zing Zing--Zoom Zoom - Perry Como", "url": "https://audio.jukehost.co.uk/NZJDHzVu6CR0XdKHcH2x23Itq7IXhzIq" }, { "name": "Tzena Tzena Tzena - The Weavers & Gordon Jenkins", "url": "https://audio.jukehost.co.uk/FMGNMw31AqNiaxbNsfY5Ntt1HvwcmaJE" } ] } } // Set up new music player newMusicPlayer() } $("#game_start").click((event) => { event.preventDefault(); $("#election_id_button").click((event) => { musicMode() setInterval(changeFontColour, 200) }) }) }