campaignTrail_temp.election_json = JSON.parse("[{\"model\": \"campaign_trail.election\", \"pk\": 4, \"fields\": {\"year\": 1, \"summary\": \"

After sixty years of single-party Communist rule, the United States of America was reborn on February 2nd, 1991. The Cold War against the Eurasian Union has been lost and America steadily integrates back to the world, all while facing hyperinflation, economic decline and political disintegration. The nominal victors of the 1992 legislative elections, the Democratic Socialists of America, forward Richard Cheney as their Presidential candidate, while the anti-communist forces gather around the exile diplomat Anthony Lake. A third powerful candidacy, the famed dissident Noam Chomsky, aims to topple them both, yet his victory seems unlikely.

\", \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_0.png\", \"winning_electoral_vote_number\": 269, \"advisor_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_1.png\", \"recommended_reading\": \"Learning to be Free Again: Electoral Wackiness in Post-Communist America\", \"has_visits\": 1, \"no_electoral_majority_image\": \"https://jetsimon.com/cts-media/public/1993PC_init_2.jpg\", \"site_image\": \"https://jetsimon.com/cts-media/public/1993PC_init_3.png\", \"site_description\": \"After sixty years of single-party Communist rule, the United States of America was reborn on February 2nd, 1991. The Cold War against the Eurasian Union has been lost and America steadily integrates back to the world, all while facing hyperinflation, economic decline and political disintegration. The first presidential elections in the restored United States will determine the country's future.\"}}]"); campaignTrail_temp.candidate_json = JSON.parse("[{\"model\": \"campaign_trail.candidate\", \"pk\": 23, \"fields\": {\"first_name\": \"Richard B.\", \"last_name\": \"Cheney\", \"election\": 4, \"party\": \"Democratic Socialist\", \"state\": \"Wyoming\", \"priority\": 1, \"description\": \"

A bulldog-like CPUSSA cadre who built up a career in Wyoming in the 70s and 80s, Richard Cheney held the largely inconsequential Department of Heavy Military Engineering in the last cabinet of General Secretary Walter Mondale and thus avoided getting under fire in the aftermath of the collapse of the Communist state. He championed the reform of the Party into the DSA and led it to victory in the 1992 Congressionals. While a capable political operator, he is seen as lacking charisma, and will have to rely on the unpopularity of Columbian shock therapy and appeals to Communist era nostalgia.

\", \"color_hex\": \"#de6900\", \"secondary_color_hex\": \"#ff8212\", \"is_active\": 1, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_CheneyBuchanan_0.png\", \"electoral_victory_message\": \"

Congratulations! You have won the 1993 election!

You always wanted to lead America, yet you never expected to achieve it like this. Regardless, you cannot complain, and now you are the first democratically elected President of the United States after the Socialist era.

Backed by minor parties in Congress - Republicans, Democrats and Beer & Barbecues - you control all branches of government. As long as your coalition stays afloat, you should be able to slow down shock therapy and give comfortable positions to plenty of cadres.

\", \"electoral_loss_message\": \"

Sorry, you have lost the 1993 election.

For a party which holds the plurality of seats in Congress, this is a great defeat, and it means the next four years will require a lot of balancing between President and parliament.

Unlike your opponents, you did not have much to lose - you can still enjoy a productive career in Congress. Still, the DSA will not let you run for President again. A more personally likeable cadre such as Robert J. Dole will likely bear the flag in 1997.

\", \"no_electoral_majority_message\": \"

No candidate holds a majority in the Electoral College.

This was not unexpected, as with three powerful campaigns, a majority of the electors might not be that easy to reach.

The situation is in your favor regardless - the DSA and its allied minor parties - Republicans, Democrats and Beer & Barbecues - hold a majority in the House of Representatives. With some concessions, you should get yourself or another DSA candidate in the White House.

\", \"description_as_running_mate\": null, \"candidate_score\": 0.666}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 24, \"fields\": {\"first_name\": \"Anthony K.\", \"last_name\": \"Lake\", \"election\": 4, \"party\": \"Independent Columbian\", \"state\": \"New York (American diaspora)\", \"priority\": 2, \"description\": \"

Anthony Lake was a leading diplomat in the diplomatic service of the United States in exile and a keynote speaker in the anticommunist exile radio station Voice of America. He returned to the States in 1991 and resigned his service in favor of the national government reestablished in Washington. Lake was recruited as the candidate of the Columbia Movement thanks to his name recognition, but he will have to grapple with the need to clarify his vision for America and find a way to distance himself from the unpopular Columbians.

\", \"color_hex\": \"#aad7ff\", \"secondary_color_hex\": \"#ddefff\", \"is_active\": 1, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_4.png\", \"electoral_victory_message\": \"

Congratulations! You have won the 1993 election!

Though Cheney posed a serious threat to your campaign, you managed to maintain the lead and are now the first democratically elected President of the United States since 1932.

However, the next four years are bound to be challenging. The DSA and its allies hold a majority in the House of Representatives, and depending on how you ran your campaign, your relationship with the Columbian Movement might not be best, either. You will have to conduct stellar foreign policy and unite the country if you wish to win reelection.

\", \"electoral_loss_message\": \"

Sorry, you have lost the 1993 election.

The results of the election are a shock to the Columbian Movement. Two years after the fall of the Socialist regime, the leaders of the anti-communist revolution are reduced to opposition and will have to grapple with the scaledown of Shock Therapy.

Clearly, Americans are not yet ready to integrate themselves back into the free world. As for you, your career in politics is likely over. Cheney is unlikely to appoint you as an Ambassador, aside from a token show of national unity, and Columbia has no use for you anymore. Get ready to retire and write plenty of books about the decades of exile struggle in Eurasia.

\", \"no_electoral_majority_message\": \"

Wow! No candidate achieved a majority in the electoral college.

This was not unexpected, as with three powerful campaigns, a majority of the electors might not be that easy to reach.

As the DSA and their allied minor parties hold a majority in the House of Representatives, they will likely seize the White House, but perhaps your party can squeeze a few concessions from Cheney. Factually, this is still a defeat for you. Get ready to retire and write plenty of books about the decades of struggle in Eurasia.

\", \"description_as_running_mate\": null, \"candidate_score\": 0.7}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 25, \"fields\": {\"first_name\": \"Noam A.\", \"last_name\": \"Chomsky\", \"election\": 4, \"party\": \"Independent\", \"state\": \"Pennsylvania (American diaspora)\", \"priority\": 3, \"description\": \"

Not currently playable.

Noam Chomsky is a renowned American dissident who had been campaigning to raise awareness of political repression in the United Socialist States of America since the 1960s. For his activism, he was stripped of his citizenship and deported to Eurasia in 1966. As a self-avowed “libertarian socialist”, he criticizes both the old Communist regime and the Eastern liberal capitalism that has come to replace it. While he has name recognition and charisma, he will have to restrain the loose collection of activists and clashing personalities that make up his campaign and deal with the scepticism of the new political establishment.

\", \"color_hex\": \"#ff128f\", \"secondary_color_hex\": \"#ff92cb\", \"is_active\": 1, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_5.png\", \"electoral_victory_message\": \"

Wow! You have won the 1968 election in a shocker!

Dixie forever! Even with the Long Hot Summer of 1967, nobody guessed that you could do well enough in the Northern states to win the election outright. You have instantly become most polarizing President-elect since Abraham Lincoln.

\", \"electoral_loss_message\": \"

Sorry, you did not prevent an electoral college majority.

You put in a good effort, but your dream of brokering an end to desegregation will not come to fruition in 1968. No winning candidate will negotiate that point with you unless they absolutely have no choice.

The best you can do for now is continue to sound the call for a return to sanity in American politics. Perhaps if the riots and discord continue, you will have a better chance of making your voice heard in 1972.

\", \"no_electoral_majority_message\": \"

Congratulations! You have deadlocked the electoral college with your votes in the South.

In a close election, your electoral votes in the South have prevented either candidate from winning a majority. Get ready to put the squeeze on Humphrey and Nixon.

Of course, you still have to deal with the possibility that Humphrey and Nixon dislike you so much that they will simply strike a deal with each other. Whatever happens, it's sure to be interesting.

\", \"description_as_running_mate\": null, \"candidate_score\": 1.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 55, \"fields\": {\"first_name\": \"Patrick J.\", \"last_name\": \"Buchanan\", \"election\": 4, \"party\": \"Democratic Socialist\", \"state\": \"Virginia\", \"priority\": 29, \"description\": \"n/a\", \"color_hex\": \"#FF0000\", \"secondary_color_hex\": \"#FFA0A0\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_CheneyBuchanan_1.jpg\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

Pat Buchanan was the regional director of the Department of Publishing, the propaganda and censorship ministry of the USSA, in the 1970s and 1980s. He reluctantly endorsed General Secretary Mondale’s course and joined the DSA in its founding.

As running mate, Buchanan will consolidate the party’s loyal rural and labour voters. However, he will not bring cross-party appeal, and since the fall of the Union he has grown increasingly conservative and hawkish, which may turn away moderates.

\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 56, \"fields\": {\"first_name\": \"Elizabeth A.\", \"last_name\": \"Dole\", \"election\": 4, \"party\": \"Independent DSA\", \"state\": \"North Carolina\", \"priority\": 30, \"description\": \"n/a\", \"color_hex\": \"#FF0000\", \"secondary_color_hex\": \"#FFA0A0\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_CheneyDole_0.jpg\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

The wife of Kansas CPUSSA Secretary Bob Dole, Elizabeth Dole had a long career in the party bureaucracy before leaving in the aftermath of the August Coup. She was elected to the Senate from North Carolina as an independent.

Though Dole is still seen as a former cadre, her independent position will help convince voters that Cheney is more than just a DSA candidate. Some view her with suspicion, however, as she is more critical of Eurasian alignment than the rest and has visited China.

\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 44, \"fields\": {\"first_name\": \"Newton L.\", \"last_name\": \"Gingrich\", \"election\": 4, \"party\": \"Democratic Socialist\", \"state\": \"Georgia\", \"priority\": 31, \"description\": \"n/a\", \"color_hex\": \"#FF0000\", \"secondary_color_hex\": \"#FFA0A0\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_CheneyGingrich_0.jpg\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

A longtime Professor of History in Atlanta, well-read on Marxist theory and a supporter of Mondale’s “pick-and-mix socialism”, Newt Gingrich founded a short-lived Social Democratic Party in 1990 which then merged into the DSA. Now, he is a representative from Georgia and a rare DSA member who is actually ideologically social-democratic.

Gingrich will give the campaign a more “modern” edge and improve Cheney’s chances in the cities. However, he is disliked by the party establishment and by the rural population, who see him as an out-of-touch urbanite.

\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 57, \"fields\": {\"first_name\": \"John S.\", \"last_name\": \"McCain\", \"election\": 4, \"party\": \"Democratic\", \"state\": \"Virginia\", \"priority\": 32, \"description\": \"n/a\", \"color_hex\": \"#FF0000\", \"secondary_color_hex\": \"#FFA0A0\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_CheneyMcCain_0.png\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

Former airforce commander in the American Red Army, John McCain used his position after the fall of the Union to seize control of military warehouses and sell unused equipment to private contractors, acquiring a significant fortune with which he “purchased” the reestablished Democratic Party.

He is viewed as a typical post-communist oligarch - however, he commands a significant following among disenchanted voters. Bringing him on will help form a national front against Columbia - if McCain’s ego can be contained.

\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 58, \"fields\": {\"first_name\": \"Eugene L. G.\", \"last_name\": \"Vidal\", \"election\": 4, \"party\": \"Columbian\", \"state\": \"New York\", \"priority\": 33, \"description\": \"n/a\", \"color_hex\": \"#0000FF\", \"secondary_color_hex\": \"#90C0FF\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_6.jpg\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

As a teenager, Gore Vidal was deported to Alaska alongside his upper class New Yorker parents, and only returned home after over a decade of hard work laying pipelines. During the Communist era, he was a dissident, and later joined the Columbia Movement, becoming one of its leaders.

Vidal has name recognition and will consolidate Lake’s popularity among traditional anticommunist voters. However, it will be much more difficult to pretend that he is running a campaign independent from the Columbia Movement.

\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 59, \"fields\": {\"first_name\": \"Amory B.\", \"last_name\": \"Lovins\", \"election\": 4, \"party\": \"Independent Green\", \"state\": \"Maryland\", \"priority\": 34, \"description\": \"n/a\", \"color_hex\": \"#0000FF\", \"secondary_color_hex\": \"#90C0FF\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_7.jpg\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

Amory Lovins is a professional engineer who cooperated with the Columbia Movement as a representative of the environmentalist opposition, and currently sits in the House of Representatives as an independent from Maryland.

Though Lovins has some unorthodox policy stances which won’t be very popular with the voters, he will give Lake an anti-communist running mate who is not a Columbian. However, he will only bring a handful of additional voters, and he also doesn’t seem that interested in actually campaigning.

\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 60, \"fields\": {\"first_name\": \"Johnny R.\", \"last_name\": \"Edwards\", \"election\": 4, \"party\": \"Columbian\", \"state\": \"North Carolina\", \"priority\": 35, \"description\": \"n/a\", \"color_hex\": \"#0000FF\", \"secondary_color_hex\": \"#90C0FF\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_8.jpg\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

Johnny Edwards was a defense lawyer in the Communist era and a member of human rights watch organizations during Mondale’s regime, which later merged into the Columbia Movement. Currently, he sits as a Columbian Senator from North Carolina.

Edwards is a talented new generation politician and will certainly help Lake carry the cities and South, but he is personally difficult to work with and prone to scandals. In addition, he will cement Lake as a Columbian candidate.

\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 61, \"fields\": {\"first_name\": \"William J.\", \"last_name\": \"Clinton\", \"election\": 4, \"party\": \"Independent\", \"state\": \"Arkansas\", \"priority\": 36, \"description\": \"n/a\", \"color_hex\": \"#0000FF\", \"secondary_color_hex\": \"#90C0FF\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_9.jpg\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

William Clinton was the general secretary of the Arkansas CPUSSA, but was one of the first to break with the centre during the collapse of the Union. Instead of joining the DSA, he remained an independent and turned sharply towards social conservatism.

Alongside his wife, he leads the Clinton Foundation, a national lobby for alcoholism awareness and alcohol prohibition. He will yield votes among rural voters, but the anti-communist bloc will surely recoil at the inclusion of a Communist cadre to the ticket.

\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 62, \"fields\": {\"first_name\": \"Gary\", \"last_name\": \"Snyder\", \"election\": 4, \"party\": \"Independent\", \"state\": \"California\", \"priority\": 37, \"description\": \"n/a\", \"color_hex\": \"#FF0000\", \"secondary_color_hex\": \"#FFA0A0\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_10.png\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

Professor of Anthropology Gary Snyder earned national attention as one of the first to lodge legal criticism against the Communist regime during the Mondale reforms, with a campaign to protest the nightmarish pollution of the Mississippi river by amassed industry.

Snyder refused to run for election in 1992, but would be willing to run with Chomsky. While having name recognition and bringing votes in the Mississippi states, he has no campaign experience.

\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 63, \"fields\": {\"first_name\": \"Joseph P.\", \"last_name\": \"Kirkland\", \"election\": 4, \"party\": \"Republican\", \"state\": \"South Carolina\", \"priority\": 38, \"description\": \"n/a\", \"color_hex\": \"#0000FF\", \"secondary_color_hex\": \"#90C0FF\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_11.jpg\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

A veteran of the Second World War and a longtime trade unionist, Lane Kirkland commanded the union of steelworkers within the state controlled IWW-AFL national trade union during the 1980s. However, he repudiated communism after the fall of the Union and established himself as leader of the reestablished Republican Party, a trade union outlet.

Kirkland would bring Chomsky’s campaign appeal among workers, but will undercut his message of opposition to the establishment, as he is a former CPUSSA cadre. He also does not share many political positions with Chomsky.

\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 64, \"fields\": {\"first_name\": \"Sandra\", \"last_name\": \"Cisneros\", \"election\": 4, \"party\": \"Independent\", \"state\": \"Arizona\", \"priority\": 39, \"description\": \"n/a\", \"color_hex\": \"#FF0000\", \"secondary_color_hex\": \"#FFA0A0\", \"is_active\": 0, \"image_url\": \"https://jetsimon.com/cts-media/public/1993PC_init_12.png\", \"electoral_victory_message\": \"n/a\", \"electoral_loss_message\": \"n/a\", \"no_electoral_majority_message\": \"n/a\", \"description_as_running_mate\": \"

Sandra Cisneros is a publicist and a writer who earned notoriety for her novels in the late Mondale era. Though she was formerly a member of the Columbia Movement, she left it as she saw it as too white Anglo-centric.

Cisneros would bring Chomsky’s candidacy anti-establishment edge and Hispanic votes, but she will primarily just use the campaign as a soapbox for her concerns.

\", \"candidate_score\": 0.0}}]"); campaignTrail_temp.running_mate_json = JSON.parse("[{\"model\": \"campaign_trail.running_mate\", \"pk\": 33, \"fields\": {\"candidate\": 23, \"running_mate\": 55}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 34, \"fields\": {\"candidate\": 23, \"running_mate\": 56}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 35, \"fields\": {\"candidate\": 23, \"running_mate\": 44}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 36, \"fields\": {\"candidate\": 23, \"running_mate\": 57}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 37, \"fields\": {\"candidate\": 24, \"running_mate\": 58}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 38, \"fields\": {\"candidate\": 24, \"running_mate\": 59}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 39, \"fields\": {\"candidate\": 24, \"running_mate\": 60}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 40, \"fields\": {\"candidate\": 24, \"running_mate\": 61}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 41, \"fields\": {\"candidate\": 25, \"running_mate\": 62}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 42, \"fields\": {\"candidate\": 25, \"running_mate\": 63}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 43, \"fields\": {\"candidate\": 25, \"running_mate\": 64}}]"); campaignTrail_temp.temp_election_list = [{"id": 4, "year": 1993, "is_premium": 0, "display_year": "1993PC"}]; document.getElementById("header").src = "https://jetsimon.com/cts-media/public/1993PC_init_13.png" nct_stuff.themes[nct_stuff.selectedTheme].coloring_title = "#010a1c" nct_stuff.themes[nct_stuff.selectedTheme].coloring_window = "#ddefff" document.getElementsByClassName("game_header")[0].style.backgroundColor = nct_stuff.themes[nct_stuff.selectedTheme].coloring_title $(".container")[0].style.backgroundColor = "#ac0e28" document.body.background = "https://upload.wikimedia.org/wikipedia/commons/4/4f/%D0%9A%D0%B0%D0%BC%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5_%D0%B4%D0%B6%D1%83%D0%BD%D0%B3%D0%BB%D0%B8.jpg" campaignTrail_temp.credits = '/u/Augenis'; nct_stuff.quotes=[`Who doesn’t regret the passing of the Union has no heart. Who wants it restored has no brain. - Nancy P. Pelosi`,`It has become clear to me that Americans will never understand democracy. - Eduard V. Savenko`,`The Union will produce more than the rest of the planet by 1980!`,`What is an exchange of opinions? When you enter your boss's office with your opinion and leave with his.`,`It has been proven Americans did not evolve from monkeys - no monkey could live without bananas.`,`No, here we don’t have any fish. The shop across the street is the one that has no meat.`,`My cat’s kittens were born communist, but then they opened their eyes.`,`You got ten years in prison for nothing? Liar, they give five years for nothing!`,`American business is stealing a box of whiskey and selling it to have money for a drink.`,`We will not live long enough to see communism, but our children... our poor children!`] quotnum = Math.floor((Math.random() * nct_stuff.quotes.length)) quote = nct_stuff.quotes[quotnum] corrr = `

CAMPAIGN TRAIL SHOWCASE

` + quote + `` next0 = function() { document.getElementById("screen0").style.display = "none" document.getElementById("screen1").style.display = "initial" } back0 = function() { document.getElementById("screen0").style.display = "initial" document.getElementById("screen1").style.display = "none" } 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: "Common", tracklist: [ { "name": "Russkaja - Change", "url": "https://audio.jukehost.co.uk/dUBw7obJuo3V0DowXZXWTZpudAEupRdY" }, { "name": "Žilvinas Žvagulis - My Son Returned From America", "url": "https://audio.jukehost.co.uk/92WKsSYCMWRvbgShluzg2AcaLdZOf4Lq" }, { "name": "InCulto - Eastern European Funk", "url": "https://audio.jukehost.co.uk/V7TxP1Q4MXT6Ss9fUKdf5eYhuqwOFOme" }, { "name": "Verka Serduchka - Dancing Lasha Tumbai", "url": "https://audio.jukehost.co.uk/MI5AaOlz7kA6ZdTdc6ciwaRHO66NuSVq" } ] } } // Set up new music player newMusicPlayer() } $("#game_start").click((event) => { event.preventDefault(); $("#election_id_button").click((event) => { musicMode() setInterval(changeFontColour, 200) }) })