campaignTrail_temp.global_parameter_json = [ { "model": "campaign_trail.global_parameter", "pk": 1, "fields": { "vote_variable": 1.125, "max_swing": 0.12, "start_point": 0.94, "candidate_issue_weight": 10, "running_mate_issue_weight": 3, "issue_stance_1_max": -0.71, "issue_stance_2_max": -0.3, "issue_stance_3_max": -0.125, "issue_stance_4_max": 0.125, "issue_stance_5_max": 0.3, "issue_stance_6_max": 0.71, "global_variance": 0.01, "state_variance": 0.005, "question_count": 25, "default_map_color_hex": "#C9C9C9", "no_state_map_color_hex": "#999999" } } ] campaignTrail_temp.election_json = [ { "model": "campaign_trail.election", "pk": 9, "fields": { "year": 2020, "summary": "

Over the last four years, Arnold Schwarzenegger has been in the White House as the first President to test the 28th Amendment passed in 2014, outlawing the natural-born requirement to run for President of the United States. He has been responsible for leading the country through some of America's most tumultuous times in recent years: A global pandemic and massive social unrest caused by the death of George Floyd. President Schwarzenegger's moderate, bipartisan agenda has proved to be quite popular among everyone except hardcore progressives and conservatives.

Can Arnold Schwarzenegger win the White House for another four-year term? Or can Ohio Representative Tim Ryan pull off the upset thanks to the populist movements and become the 46th President of the United States?

", "image_url": "https://i.imgur.com/0EpYul6.png", "winning_electoral_vote_number": 270, "advisor_url": "https://i.imgur.com/qU7rUoZ.png", "recommended_reading": "

Canon Map (1-5-10 Margins)



I hope you all enjoyed the updates to the 2020: Arnold Amendment mod. I am so, so sorry that 2020: Arnold Amendment only functioned on CTS. It's just that I used the wrong base scenario when I should've used 2000 because 2000 has three candidates playable. Now that I made that change, 2020: Arnold Amendment should now be playable and compatible with the TNCT mod loader. But anyways, production of 2024: Arnold Amendment will begin in December because I need to take a short break from modding to focus on my first semester of college. I would expect the mod to be released in early 2025 at some point. Stay tuned for future announcements regarding 2024: Arnold Amendment and more!

-Environmental_Cap104



", "has_visits": 1, "no_electoral_majority_image": "https://www.jetsimon.com/public/static/images/2012-no-majority.jpg", "creator": "Dan Bryan", "display_year": "2020ARNOLD" } } ] campaignTrail_temp.candidate_json = [ { "model": "campaign_trail.candidate", "pk": 77, "fields": { "first_name": "Arnold", "last_name": "Schwarzenegger", "election": 9, "party": "Republican", "state": "California", "priority": 1, "description": "

The worst thing I can be is the same as everybody else. I hate that.

Arnold Schwarzenegger, or the Presidator, has had quite a four years. He took office in 2017, becoming the first President to test the 28th Amendment, and the country has been through a lot since. It has gone through three Supreme Court appointments, a historic global pandemic, and Black Lives Matter demonstrations.

Extremists on both sides hate him, and Donald Trump tried to primary him again. Nevertheless, the President is quite popular due to his responses to the COVID-19 pandemic and the Black Lives Matter protests. Therefore, he is initially leading in the polling. Can Arnold fight the Republican opposition and rally Americans around the flag to win re-election, or will Tim Ryan terminate him to become the 46th President of the United States?

", "color_hex": "#bd0000", "secondary_color_hex": "#FFA0A0", "is_active": 1, "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Arnold_Schwarzenegger_by_Gage_Skidmore_4.jpg/330px-Arnold_Schwarzenegger_by_Gage_Skidmore_4.jpg", "electoral_victory_message": "", "electoral_loss_message": "", "no_electoral_majority_message": "", "description_as_running_mate": "''", "candidate_score": 1, "running_mate": false } }, { "model": "campaign_trail.candidate", "pk": 78, "fields": { "first_name": "Tim", "last_name": "Ryan", "election": 9, "party": "Democratic", "state": "Ohio", "priority": 1, "description": "

The key to - and magic of - good campaigns is when you pull people together. You unite them around a common theme.

After a rather contentious Democratic primary, Tim Ryan has won the Democratic nomination with the goal of defeating President Schwarzenegger. Tim Ryan was able to present himself as a moderate between the establishment and populist wings of the party in order to win the nomination. However, he is the underdog in this race. President Schwarzenegger's responses to the COVID-19 pandemic and the BLM protests have created a \"rally around the flag\" situation in this election. But who knows, Trump's candidacy is dividing the party heavily right now. Can Tim Ryan take advantage of the Republican division to become the 46th President of the United States?

", "color_hex": "#0000bd", "secondary_color_hex": null, "is_active": 1, "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/92/Tim_Ryan_portrait.jpg/330px-Tim_Ryan_portrait.jpg", "electoral_victory_message": "", "electoral_loss_message": "", "no_electoral_majority_message": "", "description_as_running_mate": null, "candidate_score": 1, "running_mate": false } }, { "model": "campaign_trail.candidate", "pk": 79, "fields": { "first_name": "Donald", "last_name": "Trump", "election": 9, "party": "America First", "state": "Florida", "priority": 3, "description": "

People are tired of seeing politicians as all talk and no action.

Donald Trump just can’t stop trying. Four years ago, he got second place in the Republican primaries, falling behind the current President Arnold Schwarzenegger. After calling the primary results \"rigged and stolen”, he would challenge the President in the primaries again, losing even worse but still pulling out a few states.

After losing the primaries for the second time in a row, he is ready for revenge and retribution after his losses over the years. Most think he has no chance to win the general election, but could Donald Trump deadlock the Electoral College and defy all odds? Or will Donald Trump remain a sore loser like he has over the last four years?

", "color_hex": "#8500cc", "secondary_color_hex": "#A1FFA1", "is_active": 1, "image_url": "https://upload.wikimedia.org/wikipedia/commons/7/70/Donald_Trump_October_2020.jpg", "electoral_victory_message": "", "electoral_loss_message": "", "no_electoral_majority_message": "", "description_as_running_mate": "''", "candidate_score": 1, "running_mate": false } }, { "model": "campaign_trail.candidate", "pk": 80, "fields": { "first_name": "Howie", "last_name": "Hawkins", "election": 9, "party": "Green", "state": "New York", "priority": 4, "description": "''", "color_hex": "#0ba300", "secondary_color_hex": "#FFFFC0", "is_active": 0, "image_url": "''", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "''", "candidate_score": 1, "running_mate": false } }, { "model": "campaign_trail.candidate", "pk": 81, "fields": { "first_name": "Lindsey", "last_name": "Graham", "election": 9, "party": "Republican", "state": "South Carolina", "priority": 5, "description": "''", "color_hex": "#FF0000", "secondary_color_hex": "#FFA0A0", "is_active": 0, "image_url": "https://i.imgur.com/9rIREaP.png", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

It's one thing to shoot yourself in the foot. Just don't reload the gun.

Lindsey Graham is the incumbent Vice President of the United States. He has worked alongside President Schwarzenegger vigorously for the last four years, fighting for a more inclusive Republican Party and working to get social conservatives and war hawks behind the more liberal Schwarzenegger. Most would find it foolish for President Schwarzenegger to drop Lindsey Graham, considering his ability to unite an already-divided Republican Party. Not to mention, his home region of the Southern Atlantic is vulnerable to flip blue with a split party.

", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 85, "fields": { "first_name": "Roy", "last_name": "Cooper", "election": 9, "party": "Democratic", "state": "North Carolina", "priority": 9, "description": "''", "color_hex": "#0000FF", "secondary_color_hex": "#90C0FF", "is_active": 0, "image_url": "https://i.imgur.com/h2uhPgm.png", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

We can respect our disagreements, but we must cherish our democracy.

Roy Cooper has served as the Governor of North Carolina since 2017, after defeating the controversial Republican Governor Pat McCrory. He was also Tim Ryan's strongest rival in the primaries. Also, North Carolina is expected to be a contentious state in this election, especially with a divided Republican Party. However, as much as Roy Cooper can double down on a moderate campaign and unify the party after a divisive primary, he could dishearten many progressives who were hoping for Tim Ryan to choose a minority and/or a woman to be Vice President, considering the scale of the Black Lives Matter movement.

", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 86, "fields": { "first_name": "Pete", "last_name": "Buttigieg", "election": 9, "party": "Democratic", "state": "Indiana", "priority": 10, "description": "''", "color_hex": "#0000FF", "secondary_color_hex": "#90C0FF", "is_active": 0, "image_url": "https://cdn.britannica.com/06/221506-050-EDDDCB0C/Democratic-presidential-candidate-Pete-Buttigieg-2020.jpg", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

I am a Democrat because I believe in protecting freedom, fairness, families, and the future.

Pete Buttigieg has served as Mayor of South Bend, Indiana since 2012, and would be the first openly gay Vice President of the United States if elected. As a trailblazer for LGBTQ rights, he was also one of Tim Ryan's biggest rivals in the Democratic primaries, and a VP slot could really help Ryan unify the party after such a divisive primary.

There could be a lot of concerns surrounding a Buttigieg Vice Presidency, considering his sexuality, lack of experience, and he may not do enough to balance the Democratic ticket. Not to mention, many progressives were hoping for a minority and/or a woman to be the Vice Presidential nominee this year. Nevertheless, a gay man would be quite historic. However, his home state of Indiana is not expected to go for Ryan this year.

", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 87, "fields": { "first_name": "Amy", "last_name": "Klobuchar", "election": 9, "party": "Democratic", "state": "Minnesota", "priority": 11, "description": "''", "color_hex": "#0000FF", "secondary_color_hex": "#90C0FF", "is_active": 0, "image_url": "https://pbs.twimg.com/profile_images/1220222507715686400/sugRph6d_400x400.jpg", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

I have tried to treat people on the other side civilly and look for common ground.

Amy Klobuchar has served Minnesota in the Senate since 2007. She was a candidate in the Democratic primaries, dropping out after New Hampshire. She would be a good choice if Tim Ryan wants to bring the two factions of the Democratic Party together, as she has appeal to both moderates and progressives. Not to mention, Minnesota and the rest of the Midwest was crucial in giving Schwarzenegger the White House in 2016, and Klobuchar can give Tim Ryan a huge boost there. She would also be the first female Vice President if elected, which could excite female voters and progressives, even though many were hoping for a minority woman to be Vice President.

", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 88, "fields": { "first_name": "Chris", "last_name": "Murphy", "election": 9, "party": "Democratic", "state": "Connecticut", "priority": 12, "description": "''", "color_hex": "#0000FF", "secondary_color_hex": "#90C0FF", "is_active": 0, "image_url": "https://i.imgur.com/PBje4Yk.png", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

Sympathy is important, but it rings hollow if not followed by action.

Chris Murphy has served Connecticut in the Senate since 2013, after being a Congressman there for 6 years prior. He is a strong progressive who can help Tim Ryan appeal to Bernie Sanders's supporters. He can also give a huge boost in his home state of Connecticut, where Schwarzenegger got too close for comfort in 2016 for the Democrats.

Murphy's strongest issues are on gun control and healthcare, and these issues are very important to progressives and the Democratic Party in general. He is also quite young and charismatic, which could help the ticket in some regards. However, some Democrats, especially minorities, were hoping for a minority and/or a woman to be on the ticket this year.

", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 89, "fields": { "first_name": "Michael", "last_name": "Flynn", "election": 9, "party": "Democratic", "state": "Rhode Island", "priority": 13, "description": "''", "color_hex": "#1700c2", "secondary_color_hex": "#A1FFA1", "is_active": 0, "image_url": "https://cdn.britannica.com/26/201626-050-80BBAA63/Michael-Flynn-2016.jpg", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

Frankly, Donald Trump won the candidacy for the Republican Party. Let's get on board and help him win.

Michael Flynn is a retired U.S. Army Lieutenant General, who also advised Trump's 2016 presidential campaign before he lost to the current President. He played a major role in handling the Afghanistan and Iraq Wars as a General, and was President Obama's Director of the Defense Intelligence Agency before getting kicked out due to his management style and vision for the agency. Although he is a Democrat, he is quite loyal to Donald Trump, supporting him from 2016 onward. Flynn could definitely be a double-edged sword for the Trump campaign, in that his appeal could be questionable for Trump and Huckabee's socially-conservative base, but could help appeal to other groups.

", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 50001, "fields": { "first_name": "Kamala", "last_name": "Harris", "election": 9, "party": "Democratic", "state": "California", "priority": 1, "description": "

Put description here

", "color_hex": "#0000FF", "secondary_color_hex": null, "is_active": 0, "image_url": "https://i.imgur.com/b405seM.png", "electoral_victory_message": "This guy wins!", "electoral_loss_message": "This guy loses!", "no_electoral_majority_message": "We all win?", "description_as_running_mate": "

I have only had one client: the people.

Kamala Harris is quite a trailblazer, alright. As a prosecutor, she has always put the people first. Her slogan for her unsuccessful presidential campaign this year was \"Kamala Harris for the People\". She started out as Attorney General of California right when Arnold left office as Governor in 2011, and then became a Senator in 2017. She is a strong advocate for LGBTQ rights, women's rights, civil rights, and for victims of abuse.

Despite a lack of name recognition, she is exactly who many Democrats were hoping Tim Ryan would select. A black and South Asian woman who has had experience in the courthouse and the United States Senate. Plus it never hurts to make sure the Presidator can't win his home state of California.

", "candidate_score": 1, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 50002, "fields": { "first_name": "Sarah", "last_name": "Palin", "election": 9, "party": "Republican", "state": "Alaska", "priority": 1, "description": "

Put description here

", "color_hex": "#ff0000", "secondary_color_hex": null, "is_active": 0, "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/Sarah_Palin_%2851769866572%29_%28cropped%29.jpg/330px-Sarah_Palin_%2851769866572%29_%28cropped%29.jpg", "electoral_victory_message": "This guy wins!", "electoral_loss_message": "This guy loses!", "no_electoral_majority_message": "We all win?", "description_as_running_mate": "

We don't need to fundamentally transform America. We need to restore America.

This is the same lady that lost John McCain the 2008 election to the man Trump asked for his birth certificate. But Palin does have some of the best in all worlds. She was Governor of Alaska giving her political experience, she ran in a presidential campaign with the man Trump said wasn't a war hero, and has the loyalty that Trump wants so badly. Palin has deeply hated Arnold Schwarzenegger from the beginning because he's not tough enough on the Republican platform, among other reasons. Palin is likely to fire up MAGA big time, at the expense of many independents who knew how 2008 turned out with this lady.

", "candidate_score": 1, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 50003, "fields": { "first_name": "Ben", "last_name": "Carson", "election": 9, "party": "Republican", "state": "Michigan", "priority": 1, "description": "

Put description here

", "color_hex": "#ff0000", "secondary_color_hex": null, "is_active": 0, "image_url": "https://i.imgur.com/eTKKZOW.png", "electoral_victory_message": "This guy wins!", "electoral_loss_message": "This guy loses!", "no_electoral_majority_message": "We all win?", "description_as_running_mate": "

I'm not a politician. I don't want to be a politician, because politicians do what is politically expedient. I want to do what's right.

This is a guy who ran against Donald and Arnie in 2016, and dropped out after Super Tuesday and helped Trump out to the best of his ability. Ben Carson is a pioneer in the field of neurosurgery, and a well-perceived figure among anti-Arnold evangelical Republicans. His strong social conservatism, his race, and anti-establishment persona can really help get anyone who is dissatisfied with the political establishment and Mike Huckabee's supporters four years ago. The only problem is his lack of political experience, but MAGA isn't gonna care right?

", "candidate_score": 1, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 50004, "fields": { "first_name": "Kanye", "last_name": "West", "election": 9, "party": "Independent", "state": "Wyoming", "priority": 1, "description": "

Put description here

", "color_hex": "#9900ff", "secondary_color_hex": null, "is_active": 0, "image_url": "https://ntvb.tmsimg.com/assets/assets/489020_v9_bc.jpg", "electoral_victory_message": "This guy wins!", "electoral_loss_message": "This guy loses!", "no_electoral_majority_message": "We all win?", "description_as_running_mate": "

Every time I say something that's extremely truthful out loud, it literally breaks the Internet.

Well Kanye West would be an interesting choice alright. It would be an absolute miracle if Kim Kardashian lets him get away with doing this. This guy has a lot of fame, but a lot of scrutiny for some anti-Semitic statements, abrupt changes in political positions over the years, and flat-out obscurity. Kanye surely gives Trump a lot of star power, and can appeal to young men who wear Yeezys. He also has shown loyalty to Trump during his Republican primary campaign this year, and ever since. It is gonna be hard to see where this choice will go, but it doesn't matter in all honesty because Trump is so unlikely to win the election anyways.", "candidate_score": 1, "running_mate": true } } ] campaignTrail_temp.running_mate_json = [ { "model": "campaign_trail.running_mate", "pk": 56, "fields": { "candidate": 79, "running_mate": 89 } }, { "model": "campaign_trail.running_mate", "pk": 48, "fields": { "candidate": 77, "running_mate": 81 } }, { "model": "campaign_trail.running_mate", "pk": 52, "fields": { "candidate": 78, "running_mate": 85 } }, { "model": "campaign_trail.running_mate", "pk": 53, "fields": { "candidate": 78, "running_mate": 86 } }, { "model": "campaign_trail.running_mate", "pk": 54, "fields": { "candidate": 78, "running_mate": 87 } }, { "model": "campaign_trail.running_mate", "pk": 55, "fields": { "candidate": 78, "running_mate": 88 } }, { "model": "campaign_trail.running_mate", "pk": 153606, "fields": { "candidate": 78, "running_mate": 50001 } }, { "model": "campaign_trail.running_mate", "pk": 145839, "fields": { "candidate": 79, "running_mate": 50002 } }, { "model": "campaign_trail.running_mate", "pk": 122988, "fields": { "candidate": 79, "running_mate": 50003 } }, { "model": "campaign_trail.running_mate", "pk": 89795, "fields": { "candidate": 79, "running_mate": 50004 } } ] campaignTrail_temp.credits = "Environmental_Cap104" campaignTrail_temp.opponents_default_json = [ { "election": 9, "candidates": [ 77, 78, 79, 80 ] } ] campaignTrail_temp.opponents_weighted_json = [ { "election": 9, "candidates": [ 77, 78, 79, 80 ] } ] campaignTrail_temp.temp_election_list = [ { "id": 9, "year": 2020, "is_premium": 0, "display_year": "2020ARNOLD" } ] jet_data = { "headerColor": "#800000", "windowColor": "#800000", "containerColor": "#000dbd", "innerWindowColor": "#a30000", "bannerImageUrl": "https://matrix.redditspace.com/_matrix/media/r0/download/reddit.com/c1hkhki64iic1", "backgroundImageUrl": "https://i.imgur.com/nEuoLnS.png", "endingTextColor": "#000000", "customQuote": "" } //#startcode nct_stuff.themes[nct_stuff.selectedTheme].coloring_title = "#800000"; nct_stuff.themes[nct_stuff.selectedTheme].coloring_window = "#800000"; document.getElementsByClassName("game_header")[0].style.backgroundColor = nct_stuff.themes[nct_stuff.selectedTheme].coloring_title; $("#game_window")[0].style.backgroundColor = nct_stuff.themes[nct_stuff.selectedTheme].coloring_window; $(".container")[0].style.backgroundColor = "#000dbd"; document.getElementById("header").src = "https://matrix.redditspace.com/_matrix/media/r0/download/reddit.com/c1hkhki64iic1"; document.body.background = "https://i.imgur.com/nEuoLnS.png"; document.head.innerHTML += ""; //#endcode HistHexcolour=["#bd0000","#0000bd","#8500cc","#0ba300"]; HistName=["Arnold Schwarzenegger","Tim Ryan","Donald Trump", "Howie Hawkins"]; HistEV=[304,234,0,0]; HistPV=["71,550,772","66,326,932","18,837,482","1,582,982"]; HistPVP=["45.2%","41.9%","11.9%","1.0%"]; var changeGameDisp = (hide) => { disp = ""; if (hide) { disp = "none"; } document.getElementsByClassName("inner_window_w_desc")[0].style.display = disp }; e.creditsPage = () => { credits_html = `

Coding

Environmental_Cap104

Writing

Environmental_Cap104

Misc.

DecstarG for the Music Player

Banner - u/thecupojo3

Music Credit

JibJab.com - 2020 Year in Review

Luke Million - Ice Ice Arnie

Total Recall - The Dream

George Thorogood & The Destroyers - Bad to the Bone

Village People - Macho Man

ELO - Mr. Blue Sky

Journey - Only the Young

Survivor - Eye of the Tiger

Guns N' Roses - Welcome to the Jungle

Lee Greenwood - God Bless the U.S.A.

Natasha Owens - Trump Won

Kid Rock - American Badass

Village People - Y.M.C.A.



` changeGameDisp(true); var spacer = document.createElement("amongusspacerthisisntarealelement"); spacer.innerHTML = "      "; document .getElementsByClassName("inner_window_w_desc")[0] .children[1].appendChild(spacer); changeGameDisp(true); var menuHeader = document.createElement("div"); menuHeader.classList.add("inner_window_front"); menuHeader.innerHTML = `

Credits

`; menuHeader.id = "SOTUheader"; menuHeader.style = "height: 50px;background-color:#2d2d2d"; var newMenu = document.createElement("div"); newMenu.classList.add("inner_window_front"); newMenu.id = "SOTUmenu"; newMenu.style = `height:260px;background-color:#2d2d2d;color:white;overflow-y: scroll;`; newMenu.innerHTML = credits_html; let z = document.getElementById("game_window"); var backButton = document.createElement("button"); backButton.style = "position: relative; bottom: -13px; left: -380px; width: 150px; height: 80px;font-size:40px;padding-top:5px;padding-left:8px"; backButton.id = "backSOTUBtn"; backButton.innerHTML = `BACK`; backButton.onclick = function () { document.getElementById("SOTUheader").remove(); document.getElementById("SOTUmenu").remove(); document.getElementById("backSOTUBtn").remove(); changeGameDisp(false); }; z.appendChild(menuHeader); z.appendChild(newMenu); z.appendChild(backButton); } e.credits = "" // 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: "2020: What a Year", tracklist: [ { "name": "JibJab.com - 2020 Year in Review", "url": "https://audio.jukehost.co.uk/APnsBN4zOp6cHOcdvD5UptBPJrUnYWOO" }, ] }, 1: { name: "Re-Elect the Presidator", tracklist: [ { "name": "Luke Million - Ice Ice Arnie", "url": "https://audio.jukehost.co.uk/sAGoHrEQmr1o9wJF6RYoLzGGMyKvKCFV" }, { "name": "Total Recall - The Dream", "url": "https://audio.jukehost.co.uk/kWbmMrfU0Gn9VYeTjk1rOuOeDUI0xg6l" }, { "name": "George Thorogood & The Destroyers - Bad to the Bone", "url": "https://audio.jukehost.co.uk/RMk31YZnKmF7uarFo7IT5wbnjVOSt6Fh" }, { "name": "Village People - Macho Man", "url": "https://audio.jukehost.co.uk/CS6hdRnaaeQFLVjyMZCGQVgmbFsMuTAx" }, ] }, 2: { name: "An Ass-Kicker for President", tracklist: [ { "name": "ELO - Mr. Blue Sky", "url": "https://audio.jukehost.co.uk/Sz2n65YlDGPwJ5MyH0qDC0LaxKNPN0Y1" }, { "name": "Journey - Only the Young", "url": "https://audio.jukehost.co.uk/S3G8L7k4hgclchm2rDcHAjXcLefpLWfl" }, { "name": "Survivor - Eye of the Tiger", "url": "https://audio.jukehost.co.uk/eWbh7eAz4x3YVlvyxH61SeY8jK15uy0K" }, { "name": "Guns N' Roses - Welcome to the Jungle", "url": "https://file.garden/ZRcfmLUQNGkxIJds/Guns'n%20Roses%20-%20Welcome%20to%20the%20Jungle%20(%20Studio%20Version%20)%20High%20Quality..mp3" }, ] }, 3: { name: "Stop the Steal", tracklist: [ { "name": "Kid Rock - American Badass", "url": "https://files.catbox.moe/vxragj.mp3" }, { "name": "Natasha Owens - Trump Won", "url": "https://audio.jukehost.co.uk/fvXjl2WyaoBZiZwnWCH94yKACB6EXBfD" }, { "name": "Village People - Y.M.C.A.", "url": "https://audio.jukehost.co.uk/xM7YOg2QhoCeqDYxWJAwBGhk28WVs02l" }, { "name": "Lee Greenwood - God Bless the U.S.A.", "url": "https://audio.jukehost.co.uk/m4nyXGWdocf366oV0n1u0bpScTXLpK3W" }, ] } } // Set up new music player newMusicPlayer() RecReading=true