if(!e.loaded_mod) { e.loaded_mod = true RecReading = true campaignTrail_temp.election_json = [ { "model": "campaign_trail.election", "pk": 9, "fields": { "year": 1996, "summary": "

The Democrats have suffered routine humiliations since the loss of Carter. Burned on the traditional liberalism of Kennedy and Humphrey and burned on the Third Way centrism of Clinton, they're a carcass of what they once were. A strong congressional majority is only so much, they yearn for a great man. Who'll lead the charge?

A feeling of malaise and apathy coat the gentrified landscape. Beyond the backyards and driveways, cities and trailer parks, a curious sense of unease pierces the American mind. Where do we go from here?

", "image_url": "https://i.imgur.com/vijVE3F.jpeg", "winning_electoral_vote_number": 270, "advisor_url": "https://i.imgur.com/szybKU2.jpeg", "recommended_reading": "

Ted Turner

Porter Bibb - It Ain't as Easy as It Looks (1993)
Bill Burke & Ted Turner - Call Me Ted (2008)
Lisa Napoli - Up All Night: Ted Turner, CNN, and the Birth of 24-Hour News (2020)

Newt Gingrich

Steve Gunderson & Rob Morris - House and Home: The Personal and Political Journey of a Gay Republican Congressman (1996)
Steven M. Gillon - The Pact: Bill Clinton, Newt Gingrich, and the Rivalry that Defined a Generation (2008)
Craig Shirley - Citizen Newt: The Making of a Reagan Conservative (2017)


", "has_visits": 1, "no_electoral_majority_image": "https://www.jetsimon.com/public/static/images/2012-no-majority.jpg", "display_year": "1996 - Mouths of the South" } } ] campaignTrail_temp.candidate_json = [ { "model": "campaign_trail.candidate", "pk": 78, "fields": { "first_name": "Ted", "last_name": "Turner", "election": 9, "party": "Democratic", "state": "Georgia", "priority": 2, "description": "

He's a larger than life figure who has, in just the last two decades, completely conquered American pop culture. Be it in sports, news, wrestling, cable television, film, he's done it all and planted his name right on it all. Everybody knows Ted Turner. It was only a matter of time until he entered politics.

Only thing is there's more to politics than branding and marketing, you have to have defined positions. Turner, as of late, is a political chameleon. Sure, his position on environmentalism is clear as day, same with nuclear proliferation and even abortion. But on everything else, he's all over the place. Digging past the many, many controversial statements, you have an (alleged) atheist married to Jane Fonda who has attacked unions, fired employees for smoking outside of work, ran defense for China and Cuba, and has some, rather interesting opinions on overpopulation. But doesn't America just love a character?

", "color_hex": "#1a9cff", "secondary_color_hex": "#90C0FF", "is_active": 1, "image_url": "https://i.imgur.com/muipyXM.jpeg", "electoral_victory_message": "

Congratulations! You have won the 2000 election.

Though it was perhaps expected, you could have easily faltered at a number of points. Credit to you for pulling through.

On the political front, you can continue the Clinton legacy and strengthen Social Security for generations to come. Perhaps you can succeed on health care where Clinton came up short? Or maybe you can create a future of renewable energy for America. Just be wary of a (George or Jeb?) Bush challenge in 2004.

", "electoral_loss_message": "

Sorry! You have lost the 2000 election.

Surely the second-guessing will be intense, but if things were close you could probably run again in 2004.

It seems that with George W. Bush and a Republican majority, the United States can expect some conservative policy-making over the next four years. Hopefully Bush comes through on his promise to govern in a bipartisan, conciliatory manner. A lot should depend on the margin of his victory, and whether it was large or small.

", "no_electoral_majority_message": "

Sorry! You have lost in a squeaker.

No candidate achieved a majority of the electoral votes, for the first time since 1824. Unfortunately for you, a majority of states have Republican controlled congressional delegations.

It seems that with George W. Bush and a Republican majority, the United States can expect some conservative policy-making over the next four years. Hopefully Bush comes through on his promise to govern in a bipartisan, conciliatory manner.

", "description_as_running_mate": "''", "candidate_score": 1, "running_mate": false } }, { "model": "campaign_trail.candidate", "pk": 79, "fields": { "first_name": "Ross", "last_name": "Perot", "election": 9, "party": "Reform", "state": "Texas", "priority": 3, "description": "", "color_hex": "#d313ec", "secondary_color_hex": "#A1FFA1", "is_active": 0, "image_url": "https://i.imgur.com/BTPub9f.jpeg", "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": "Ralph", "last_name": "Nader", "election": 9, "party": "Independent", "state": "Connecticut", "priority": 4, "description": "", "color_hex": "#46d609", "secondary_color_hex": "#3ba80c", "is_active": 0, "image_url": "https://www.jetsimon.com/public/static/images/ralph-nader-2000.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": 85, "fields": { "first_name": "Herb", "last_name": "Kohl", "election": 9, "party": "Democratic", "state": "Wisconsin", "priority": 9, "description": "

Kohl is your standard Democrat, and a great choice for your number two. He helps diversify the ticket, complementing your southern bombast with an air of midwest cool. A popular politician in his home state, he's made his career out of fighting for their interests specifically, especially when it comes to the dairy industry and in criticizing NAFTA.

With Kohl, you've got a good fighting chance at the Rust Belt. While he's not the most progressive or liberal member of the Democratic caucus, you're more likely to see him with Joe Lieberman than someone like Dianne Feinstein, he makes up for it in being relatively inoffensive. Plus, you and he would make this the first presidential ticket in history to be headlined by two basketball team owners.", "color_hex": "#148eff", "secondary_color_hex": "#90C0FF", "is_active": 0, "image_url": "https://i.imgur.com/Pweyc54.jpeg", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

Kohl is your standard Democrat, and a great choice for your number two. He helps diversify the ticket, complementing your southern bombast with an air of midwest cool. A popular politician in his home state, he's made his career out of fighting for their interests specifically, especially when it comes to the dairy industry and in criticizing NAFTA.

With Kohl, you've got a good fighting chance at the Rust Belt. While he's not the most progressive or liberal member of the Democratic caucus, you're more likely to see him with Joe Lieberman than someone like Dianne Feinstein, he makes up for it in being relatively inoffensive. Plus, you and he would make this the first presidential ticket in history to be headlined by two basketball team owners.", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 86, "fields": { "first_name": "Jesse", "last_name": "Jackson", "election": 9, "party": "Democratic", "state": "Washington, D.C.", "priority": 9, "description": "

Jackson is a progressive icon, and a modern civil rights champion. His activist base could only prove advantagous to your campaign. Perhaps in Clinton having given him the cold shoulder back in '92, that's what cost him the election? Or at least contributed? These thoughts quickly bounce from and out your mind.

There are issues, however. He's not an elected official, in fact he's only slightly more experienced politically than you are and that's only due to his years of campaigning and activism. Hearing someone be called a “professional activist” is also not ideal for a Democratic ticket. His relationship with you can be pretty frosty, but nothing that would prove too bad a hinderance.", "color_hex": "#148eff", "secondary_color_hex": "#90C0FF", "is_active": 0, "image_url": "https://i.imgur.com/HQb5Do3.jpeg", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

Jackson is a progressive icon, and a modern civil rights champion. His activist base could only prove advantagous to your campaign. Perhaps in Clinton having given him the cold shoulder back in '92, that's what cost him the election? Or at least contributed? These thoughts quickly bounce from and out your mind.

There are issues, however. He's not an elected official, in fact he's only slightly more experienced politically than you are and that's only due to his years of campaigning and activism. Hearing someone be called a “professional activist” is also not ideal for a Democratic ticket. His relationship with you can be pretty frosty, but nothing that would prove too bad a hinderance.", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 87, "fields": { "first_name": "John", "last_name": "Kerry", "election": 9, "party": "Democratic", "state": "Massachusetts", "priority": 9, "description": "

Kerry is the safe pick, the safest of the picks you've got lined up. He's inoffensive to a fault, though he can easily be spun into a coastal elitist of such proportions that even Georgia might just drop you. Keep him away from select parts of the country and you figure he'll work just fine.

A Vietnam veteran, he's a decorated war hero, but famously was against the war itself. It seems you have a knack for attracting such personalities. This would likely be Kerry's weakest spot if picked for the role however, especially in association with your wife, the potential First Lady. Doubtless, though, you can overcome such handicaps and turn this Yankee blue blood into a diamond.", "color_hex": "#148eff", "secondary_color_hex": "#90C0FF", "is_active": 0, "image_url": "https://i.imgur.com/x09Wj1b.jpeg", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

Kerry is the safe pick, the safest of the picks you've got lined up. He's inoffensive to a fault, though he can easily be spun into a coastal elitist of such proportions that even Georgia might just drop you. Keep him away from select parts of the country and you figure he'll work just fine.

A Vietnam veteran, he's a decorated war hero, but famously was against the war itself. It seems you have a knack for attracting such personalities. This would likely be Kerry's weakest spot if picked for the role however, especially in association with your wife, the potential First Lady. Doubtless, though, you can overcome such handicaps and turn this Yankee blue blood into a diamond.", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 77, "fields": { "first_name": "Newt", "last_name": "Gingrich", "election": 9, "party": "Republican", "state": "Georgia", "priority": 1, "description": "", "color_hex": "#f91010", "secondary_color_hex": null, "is_active": 0, "image_url": "https://i.imgur.com/rVjdhW7.jpeg", "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": 90, "fields": { "first_name": "Mike", "last_name": "DeWine", "election": 9, "party": "Republican", "state": "Ohio", "priority": 9, "description": "

Mike DeWine is a Senator from Ohio, elected in a narrow upset over rival Democrat Bernadine Healy in 1994, the only Senate gain for the Republicans in a sea of crushing defeats. He has had a long career based in his native Buckeye State, having served as lieutenant governor, as a U.S. representative and State Senator prior. DeWine is politically the perfect, least offensive running mate on offer, promising no drawbacks and potential gains from home state advantage in the ever crucial swing-state he calls home.

His only setback could stem from disagreements he holds with the wider Republican base on certain issues, mainly gun control. DeWine has expressed support for legislation that would ban the sale and production of semiautomatic assault weapons. This could create friction with lobbying groups, such as the National Rifle Association, that you'll be counting on supporting you this November. If you can figure that one out, there likely won't be any further issues.", "color_hex": "#148eff", "secondary_color_hex": "#90C0FF", "is_active": 0, "image_url": "https://i.imgur.com/ryGoRNN.jpeg", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

Mike DeWine is a Senator from Ohio, elected in a narrow upset over rival Democrat Bernadine Healy in 1994, the only Senate gain for the Republicans in a sea of crushing defeats. He has had a long career based in his native Buckeye State, having served as lieutenant governor, as a U.S. representative and State Senator prior. DeWine is politically the perfect, least offensive running mate on offer, promising no drawbacks and potential gains from home state advantage in the ever crucial swing-state he calls home.

His only setback could stem from disagreements he holds with the wider Republican base on certain issues, mainly gun control. DeWine has expressed support for legislation that would ban the sale and production of semiautomatic assault weapons. This could create friction with lobbying groups, such as the National Rifle Association, that you'll be counting on supporting you this November. If you can figure that one out, there likely won't be any further issues.", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 91, "fields": { "first_name": "Sonny", "last_name": "Bono", "election": 9, "party": "Republican", "state": "California", "priority": 9, "description": "

Sonny Bono is the representative for California's 44th congressional district, having only recently been elected there amid the Democratic wave of electoral victories in 1994. He previously served as mayor of Palm Springs, California, and made his name as wife to singer Cher, finding fame with singles like “I Got You Babe” in the 1960s before later co-hosting the The Sonny & Cher Comedy Hour in the early 70s.

Bono is a sensible pick. Though he's mostly a political newcomer, he has experience, and his celebrity grants the ticket a modicum of levity keeping in mind your less than desirable approval ratings. He's a fairly standard conservative Republican politically, however his personal and professional stances, such as where gay marriage is concerned, might become a hinderance on the campaign trail if not dealt with effectively. Otherwise, Bono seems the best pick where favorability is of concern.", "color_hex": "#148eff", "secondary_color_hex": "#90C0FF", "is_active": 0, "image_url": "https://i.imgur.com/gV3FX9G.jpeg", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

Sonny Bono is the representative for California's 44th congressional district, having only recently been elected there amid the Democratic wave of electoral victories in 1994. He previously served as mayor of Palm Springs, California, and made his name as wife to singer Cher, finding fame with singles like “I Got You Babe” in the 1960s before later co-hosting the The Sonny & Cher Comedy Hour in the early 70s.

Bono is a sensible pick. Though he's mostly a political newcomer, he has experience, and his celebrity grants the ticket a modicum of levity keeping in mind your less than desirable approval ratings. He's a fairly standard conservative Republican politically, however his personal and professional stances, such as where gay marriage is concerned, might become a hinderance on the campaign trail if not dealt with effectively. Otherwise, Bono seems the best pick where favorability is of concern.", "candidate_score": 0, "running_mate": true } }, { "model": "campaign_trail.candidate", "pk": 92, "fields": { "first_name": "Steve", "last_name": "Gunderson", "election": 9, "party": "Republican", "state": "Wisconsin", "priority": 9, "description": "

Steve Gunderson is the representative for Wisconsin's 3rd congressional district, serving there since 1981. A fiscal conservative and social moderate, he's been called a Rockefeller Republican and increasingly seems to be an odd fit for the party of Lincoln. He was infamously outed as a homosexual by California Representative Bob Dornan, a member of the party's right-wing, two years prior after coming out against defunding schools if they were found to be “encouraging or supporting” homosexuality.

Gunderson and you have a close relationship. You appointed him to serve as chief deputy whip for strategy, before he would resign after making his disapproval known with the 1992 Republican National Convention and its appeals to the more reactionary elements of the party. You were aware of his homosexuality, and he is aware of your affair with his staffer Callista Bisek, but are you both aware what will happen if you choose to go down this route?", "color_hex": "#148eff", "secondary_color_hex": "#90C0FF", "is_active": 0, "image_url": "https://i.imgur.com/faFWjtC.jpeg", "electoral_victory_message": "''", "electoral_loss_message": "''", "no_electoral_majority_message": "''", "description_as_running_mate": "

Steve Gunderson is the representative for Wisconsin's 3rd congressional district, serving there since 1981. A fiscal conservative and social moderate, he's been called a Rockefeller Republican and increasingly seems to be an odd fit for the party of Lincoln. He was infamously outed as a homosexual by California Representative Bob Dornan, a member of the party's right-wing, two years prior after coming out against defunding schools if they were found to be “encouraging or supporting” homosexuality.

Gunderson and you have a close relationship. You appointed him to serve as chief deputy whip for strategy, before he would resign after making his disapproval known with the 1992 Republican National Convention and its appeals to the more reactionary elements of the party. You were aware of his homosexuality, and he is aware of your affair with his staffer Callista Bisek, but are you both aware what will happen if you choose to go down this route?", "candidate_score": 0, "running_mate": true } }, ] campaignTrail_temp.running_mate_json = [ { "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": 77, "running_mate": 90 } }, { "model": "campaign_trail.running_mate", "pk": 56, "fields": { "candidate": 77, "running_mate": 91 } }, { "model": "campaign_trail.running_mate", "pk": 57, "fields": { "candidate": 77, "running_mate": 92 } }, ] campaignTrail_temp.credits = "Accurate_Feature9970
Special thanks to NightlyGothic for playtesting and Nina for code consultation
2000N for Music Player" 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.opponents_default_json = [ { "election": 9, "candidates": [ 78, 79, 80, 77 ] } ] campaignTrail_temp.opponents_weighted_json = [ { "election": 9, "candidates": [ 78, 79, 80, 77 ] } ] campaignTrail_temp.temp_election_list = [ { "id": 9, "year": 1996, "is_premium": 0, "display_year": "1996 - Mouths of the South" } ] jet_data = { "headerColor": "#9e1362", "windowColor": "#3c4f7a", "containerColor": "#582466", "innerWindowColor": "#1ec5e6", "bannerImageUrl": "https://i.imgur.com/ScGBmPE.jpeg", "backgroundImageUrl": "https://i.imgur.com/3p3GMG2.jpeg", "endingTextColor": "#000000", "gameTitle": "MOUTHS OF THE SOUTH" } campaignTrail_temp.modBoxTheme = { "header_color": "#cc0000", "header_text_color": "#ffffff", "description_text_color": "#000000", "description_background_color": "#ffffff", "main_color": "#cc0000", "secondary_color": "#282828", "ui_text_color": "#ffffff" } //#startcode corrr = '\n

MOUTHS OF THE SOUTH

\n '; nct_stuff.themes[nct_stuff.selectedTheme].coloring_title = "#cc0000"; $("#game_window")[0].style.backgroundImage = "url(https://i.imgur.com/apejvCD.jpeg)" 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 = "#000000"; document.getElementById("header").src = "https://i.imgur.com/ScGBmPE.jpeg"; document.body.background = "https://i.imgur.com/3p3GMG2.jpeg"; document.head.innerHTML += ""; setInterval(changeFontColour, 200) function changeFontColour() { if (document.getElementById('final_results_description') != null) { document.getElementById('final_results_description').style.color = "white" } } //#endcode HistHexcolour=["#1a9cff","#f91010","#d313ec","#46d609"]; HistName=[" Ted Turner"," Newt Gingrich"," Ross Perot", " Ralph Nader"]; HistEV=[317,221,0,0]; HistPV=["50,795,219","50,229,809","4,613,604","365,954"]; HistPVP=["47.9%","47.4%","4.4%","0.3%"]; campaignTrail_temp.achievements = { "Captain Planet" : { "image" : "https://i.imgur.com/RIvPKfy.jpeg", "description" : "Win over 350 electoral votes.", "cannotBeCheated" : true }, "Captain Outrageous" : { "image" : "https://i.imgur.com/FNgglZX.jpeg", "description" : "Get zero electoral votes.", "cannotBeCheated" : true }, "Barbarella Goes to Washington" : { "image" : "https://i.imgur.com/QQ4tx7R.jpeg", "description" : "Keep Jane Fonda happy with your campaign until the very end and win.", "cannotBeCheated" : true }, "My True Love, Teddy Jr." : { "image" : "https://i.imgur.com/RINxsYQ.jpeg", "description" : "Return back to your Montana ranch.", "cannotBeCheated" : true }, "Most Trusted Name in News" : { "image" : "https://i.imgur.com/tXiB53U.jpeg", "description" : "Have your opponents' October Surprises leak but not yours.", "cannotBeCheated" : true }, "Of Cavaliers and Cotton Fields" : { "image" : "https://i.imgur.com/mXBBt9i.jpeg", "description" : "Agree to a backroom deal with Newt Gingrich.", "cannotBeCheated" : true }, "The Super-Rich Have Saved Us!" : { "image" : "https://i.imgur.com/K57qJy6.jpeg", "description" : "Have Ralph Nader agree to serve in your potential administration.", "cannotBeCheated" : true }, "No Chance in Hell" : { "image" : "https://i.imgur.com/VLGcRRD.jpeg", "description" : "Face an old foe in the general election.", "cannotBeCheated" : true }, "Jesus Freaks" : { "image" : "https://i.imgur.com/L389G83.jpeg", "description" : "Win the election even after declaring you're an atheist.", "cannotBeCheated" : true }, "I'll Eat Bison, You Can Eat Crow" : { "image" : "https://i.imgur.com/dTPgyf5.jpeg", "description" : "Win Montana.", "cannotBeCheated" : true }, "The Washington Screwjob" : { "image" : "https://i.imgur.com/NF5xoH6.jpeg", "description" : "Lose the Election Night War.", "cannotBeCheated" : true }, "Bozo" : { "image" : "https://i.imgur.com/L8fudUp.jpeg", "description" : "Keep abortion safe and legal.", "cannotBeCheated" : true } } $("#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:#cc0000; 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() { musicBox.children[2].src = soundtracks[e.selectedSoundtrack].tracklist[this.value].url musicBox.children[2].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: "Opening", tracklist: [ { name: "He's a Rebel - The Crystals", url: "https://file.garden/ZfEj4RRLOwjmdfp6/TheCrystals-HesARebel1962.mp3", }, ], }, 1: { name: "Turner Tracklist", tracklist: [ { name: "Neon Wilderness - The Verve", url: "https://file.garden/ZfEj4RRLOwjmdfp6/Neon%20Wilderness.mp3", }, { name: "Circles - Soul Coughing", url: "https://file.garden/Zd8F-7mXyXjgTDST/Circles.mp3", }, { name: "Crash (The '95 Mix) - The Primitives", url: "https://file.garden/ZeZ2Dxo9KEiz9e_I/Crash.mp3", }, { name: "Pepper - Butthole Surfers", url: "https://file.garden/ZeZ2Dxo9KEiz9e_I/Pepper.mp3", }, { name: "The Alternative Polka - 'Weird Al' Yankovic", url: "https://file.garden/Zdy7s7wq23DtYAm3/TAP%20(BH).mp3", }, ], }, 3: { name: "Gingrich Tracklist", tracklist: [ { name: "(I Want to Be) Elected - Bruce Dickinson", url: "https://file.garden/ZgkBkef9jVgn5cGd/I%20Want%20to%20Be%20Elected.mp3", }, { name: "March of the Pigs - Nine Inch Nails", url: "https://file.garden/ZgkBkef9jVgn5cGd/March%20of%20the%20Pigs.mp3", }, { name: "Smash It Up - The Offspring", url: "https://file.garden/Zg1dATRWi0hjfX5L/Smash%20It%20Up.mp3", }, { name: "Mutt - blink-182", url: "https://file.garden/ZgkBkef9jVgn5cGd/Mutt.mp3", }, { name: "Ratfinks, Suicide Tanks and Cannibal Girls - White Zombie", url: "https://file.garden/ZgkBkef9jVgn5cGd/Ratfinks.mp3", }, ], }, } newMusicPlayer() }