RecReading=true e = campaignTrail_temp; campaignTrail_temp.election_json = JSON.parse("[{\"model\": \"campaign_trail.election\", \"pk\": 10, \"fields\": {\"year\": 2000, \"summary\": \"The tenth presidential and vice presidential election of the Republic of China will be held on March 18, 2000 (R.O.C. 89) in the free areas of the Republic of China.In the 1990s, an atmosphere of seeking political reform pervaded Taiwanese society, and the Kuomintang (KMT), which had been in power for more than half a century, was challenged by the Democratic Progressive Party (DPP) in major elections.Nine-term President Lee Teng-hui, who could have been re-elected under the ROC Constitution and its additions, which stipulate that the term of office of the president and vice president shall be four years, and they may be re-elected for a second term, eventually announced that he would give up his bid for a second term.The KMT nominated Lien Chan to run in the election, the DPP nominated Chen Shui-bian to run in the election, and James Soong, the former governor of Taiwan Province, left the party to run in the election.The former chairman of the Democratic Progressive Party (DPP), Hsu Hsin-liang, who was not in agreement with Chen Shui-bian, and the writer Li Ao, who was known for criticizing the KMT, also followed suit.

\", \"image_url\": \"https://i.ibb.co/6JGnLy7/7936936bd8f834571448f31ce4521d72.jpg\", \"winning_electoral_vote_number\":25, \"advisor_url\": \"https://i.imgur.com/xX70GMQ.jpeg\", \"recommended_reading\": \"

Thank you for playing 2000 ROC!


.

Gwangju News, 2003, The May 16 Military Coup: How It Came About

The Korea Times, 2010, Gen. Park Chung-hee’s May 16 coup and rise of military regime

The University of Edinburgh, 2023, Yun Posun



No Words,sir

\", \"has_visits\":1, \"no_electoral_majority_image\": \"https://i.ibb.co/RP64RDH/DCzSbAr.jpg\"}}]"); campaignTrail_temp.candidate_json = JSON.parse("[{\"model\": \"campaign_trail.candidate\", \"pk\": 91, \"fields\": {\"first_name\": \"\", \"last_name\": \"Chen Shui-Bian\", \"election\": 10, \"party\": \"Democratic Progressive Party (DPP)\", \"state\": \"Tainan\", \"priority\": 1, \"description\": \"After his defeat in the 1998 Taipei mayoral election, at the end of the same year, he entered the presidential palace to meet with President Lee Teng-hui (then chairman of the Kuomintang), who publicly recommended an article entitled From Moses to Joshua to CHEN Shui-bian, triggering a wide-ranging public discussion on who is Lee Teng-hui's Joshua .In 1999, Chen Shui-bian visited foreign countries on a study tour and published his autobiography Son of Taiwan to pave the way for his candidacy in the 2000 presidential election. However, at that time, the DPP had the so-called four-year rule, which stipulated that comrades within the party could not run for different public offices within four years, which was set up by the DPP in order to maintain a fair distribution of the limited political resources and to avoid the speculative mentality of riding on a donkey in search of a horse, Because Chen Shui-bian had previously chosen to run for mayor of Taipei, he was theoretically unable to participate in the party primaries for the presidential election. However, because Chen Shui-bian has a high degree of public opinion and is no longer in office, some DPP members are interested in amending the four-year clause for Chen Shui-bian. Chen Shui-bian himself publicly appealed to his comrades in the DPP not to customize the rules for him, and also verbally expressed his support for Hsu Hsin-liang's candidacy. However, in the end, with the strong support of powerful people such as Huang Hsin-suke, the DPP was able to modify the four-year terms to allow Chen Shui-bian to run in the election. In July of the same year, Chen Shui-bian won the DPP primary election over Hsu Hsin-liang and was nominated by the Democratic Progressive Party (DPP) as its presidential candidate.\", \"color_hex\": \"#1B9431\", \"secondary_color_hex\": \"#1B9431\", \"is_active\": 1, \"image_url\": \"https://i.ibb.co/RP64RDH/DCzSbAr.jpg\", \"electoral_victory_message\": \"\", \"electoral_loss_message\": \"\", \"no_electoral_majority_message\": \"\", \"description_as_running_mate\": \"wwww\", \"candidate_score\": 1.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 92, \"fields\": {\"first_name\": \"\", \"last_name\": \"Song Chu-yu\", \"election\": 10, \"party\": \"Independent\", \"state\": \"Hunan\", \"priority\": 2, \"description\": \"Born on April 30, 1942 (16th day of the third month of the lunar calendar 1942), James Soong came to Taiwan with his father in 1949, his grandmother was Mrs. Wen, and his father, Soong Tat, was a general officer in the Republic of China National Army. In 1966, he went to the United States for further study and received a master's degree in international relations from the University of California, Berkeley, in 1967; a master's degree from the Department of Library Science at the Catholic University of America in 1971 and a Ph.D. from the Department of Political Science at Georgetown University in Washington, D.C in 1974.In 1994, he was re-elected as the first elected governor of Taiwan, and in 1998, due to the restructuring of the Taiwan Provincial Government's functional operations and organization, there were no more gubernatorial elections, and James Soong became the only elected governor, and in 1999, he was expelled from the Kuomintang (KMT) because of his unsuccessful attempt to win the KMT's nomination for the presidency, and because of his breakup with Lee Teng-hui and Lien Chan. Soong set up the New Taiwanese Service Team on his own, without party membership, and ran for the 2000 presidential election with Chang Gung University of Medicine President Chang Chiu-hsiung.\", \"color_hex\": \"#FF6310\", \"secondary_color_hex\": \"#FF6310\", \"is_active\": 1, \"image_url\": \"https://i.ibb.co/Qpd1zkY/K3SfbAr.jpg\", \"electoral_victory_message\": \"\", \"electoral_loss_message\": \"\", \"no_electoral_majority_message\": \"\", \"description_as_running_mate\": \"''\", \"candidate_score\": 1.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 93, \"fields\": {\"first_name\": \"\", \"last_name\": \"Lien Chan\", \"election\": 10, \"party\": \"Kuomingtang\", \"state\": \"Tainan(Born in Xi'an)\", \"priority\": 3, \"description\": \"Since the re-election of President Lee Teng-hui, the competition for succession among the young and middle-aged in the KMT has become increasingly fierce. Since Lien Chan had already been elected vice president, he should have resigned from his post as chief executive. However, considering the number of seats in the Legislative Yuan and the competition among the middle-aged generation, the then President Lee decided to let Lien continue to serve as the Chief Executive. of course, there were rumors that a very representative heavyweight of the middle-aged generation agreed to this, and some said that it was James Soong. in 1997, after the National Congress of the Kuomintang (KMT), Hsiao Wan-chang took over the post of the Chief Executive. Although Lien Chan had stepped down, the KMT lost the subsequent county and city mayoral elections due to a provincial freeze fiasco and internal party infighting. The Democratic Progressive Party (DPP) gained a number of counties and cities that it had never ruled before. The KMT did not hold party primaries. The then KMT Chairman Lee Teng-hui insisted that the then Vice President and KMT Vice Chairman Lien Chan be the presidential candidate, which was strongly resented by former Taiwan governor James Soong, who eventually publicly announced his resignation from the party to run for the presidency. On the delegate side, the KMT hierarchy unanimously supported Hsiao Wan-chang as the vice presidential candidate to run alongside Lien Chan, and the two were eventually nominated by the KMT.\", \"color_hex\": \"#1e1ec9\", \"secondary_color_hex\": \"#1e1ec9\", \"is_active\": 1, \"image_url\": \"https://i.ibb.co/S3VXWyH/fNfP3lr.jpg\", \"electoral_victory_message\": \"''\", \"electoral_loss_message\": \"''\", \"no_electoral_majority_message\": \"''\", \"description_as_running_mate\": \"''\", \"candidate_score\": 1.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 94, \"fields\": {\"first_name\": \"\", \"last_name\": \"Hsu Hsin-liang\", \"election\": 10, \"party\": \"Independent\", \"state\": \"Taoyuan\", \"priority\": 4, \"description\": \"''\", \"color_hex\": \"#99E64D\", \"secondary_color_hex\": \"#99E64D\", \"is_active\": 0, \"image_url\": \"https://i.ibb.co/N30ZTJg/0518-190518-0008.jpg\", \"electoral_victory_message\": \"''\", \"electoral_loss_message\": \"''\", \"no_electoral_majority_message\": \"''\", \"description_as_running_mate\": \"''\", \"candidate_score\": 1.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 95, \"fields\": {\"first_name\": \"Lu\", \"last_name\": \"Hsiu-Lien\", \"election\": 10, \"party\": \"Democratic Progressive Party\", \"state\": \"Taoyuan\", \"priority\": 5, \"description\": \"'In November 1996, due to the shooting deaths of the family of Liu Bangyou, the then KMT governor of Taoyuan, the DPP recruited Lu Hsiu-lien to return to her hometown to run for the election, and she defeated the KMT nominee, the then mayor of Jhongli, Mr. Fang Li-shu, in the March 1997 by-election. Nine months later, in the official election, she even defeated Chen Gende, the then Speaker of Taoyuan County, and became the only DPP governor of Taoyuan County to serve two consecutive terms. During her tenure as governor of Taoyuan, the main axes of her administration were building the Gold Coast, developing Taoyuan's Silicon Valley, and managing the earthly landscape. 2000, Lu Hsiu-lien was paired with Chen Shui-bian in the presidential election on behalf of the Democratic Progressive Party.'\", \"color_hex\": \"#0000FF\", \"secondary_color_hex\": \"#90C0FF\", \"is_active\": 0, \"image_url\": \"https://i.ibb.co/b6hSjTV/image.jpg\", \"electoral_victory_message\": \"''\", \"electoral_loss_message\": \"''\", \"no_electoral_majority_message\": \"''\", \"description_as_running_mate\": \"In November 1996, due to the shooting deaths of the family of Liu Bangyou, the then KMT governor of Taoyuan, the DPP recruited Lu Hsiu-lien to return to her hometown to run for the election, and she defeated the KMT nominee, the then mayor of Jhongli, Mr. Fang Li-shu, in the March 1997 by-election. Nine months later, in the official election, she even defeated Chen Gende, the then Speaker of Taoyuan County, and became the only DPP governor of Taoyuan County to serve two consecutive terms. During her tenure as governor of Taoyuan, the main axes of her administration were building the Gold Coast, developing Taoyuan's Silicon Valley, and managing the earthly landscape. However, she took office as vice president on May 20, 2000, and her tenure as governor was too short, failing to lay the groundwork for the acting Hsu Ying-shen to step down at the end of 2001, and the Democratic Progressive Party (DPP) failed to gain power for thirteen years in three consecutive terms. After Taoyuan was elevated to the status of a municipality, it was not until Zheng Wen-Chan won the first Taoyuan Municipal Municipal Governor Election in 2014 by less than 30,000 votes that the green returned to power in Taoyuan. 2000, Lu Hsiu-lien was paired with Chen Shui-bian in the presidential election on behalf of the Democratic Progressive Party (DPP).\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 96, \"fields\": {\"first_name\": \"\", \"last_name\": \"Chang Chau-Hsiung\", \"election\": 10, \"party\": \"Independent\", \"state\": \"Kaohsiung\", \"priority\": 6, \"description\": \"''\", \"color_hex\": \"#0000FF\", \"secondary_color_hex\": \"#90C0FF\", \"is_active\": 0, \"image_url\": \"https://i.ibb.co/JmQ6CYx/1284.jpg\", \"electoral_victory_message\": \"''\", \"electoral_loss_message\": \"''\", \"no_electoral_majority_message\": \"''\", \"description_as_running_mate\": \"Chang Chau-hsiung (February 3, 1942-), born in Kaohsiung City, Kaohsiung Prefecture, Taiwan during the Japanese rule, is a Taiwanese medical figure and political figure, a native of Kaohsiung. He graduated from Taiwan Provincial Kaohsiung High School (now Kaohsiung City Kaohsiung High School) and the Department of Medicine of National Taiwan University School of Medicine. He served as chief of cardiac surgery and dean of Chang Gung Memorial Hospital and president of Chang Gung University. He was a partner of James Soong in the 2000 Republic of China presidential election.\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 103, \"fields\": {\"first_name\": \"\", \"last_name\": \"Siew Wan-chang\", \"election\": 10, \"party\": \"Kuomingtang\", \"state\": \"Chiayi County\", \"priority\": 13, \"description\": \"wwww\", \"color_hex\": \"#00C100\", \"secondary_color_hex\": \"#A1FFA1\", \"is_active\": 0, \"image_url\": \"https://i.ibb.co/1K7gxMN/image.jpg\", \"electoral_victory_message\": \"''\", \"electoral_loss_message\": \"''\", \"no_electoral_majority_message\": \"''\", \"description_as_running_mate\": \"Born in Beishewei, Chiayi City, Tainan State, Taiwan (located in present-day West District of Chiayi City) attended kindergarten during the Japanese rule period, and after the war attended Beiyuan National Elementary School until he transferred to a fourth-grade school; he graduated from Tatung National Elementary School in Chiayi City in 1951, and then enrolled in the Chiayi Commercial Vocational School, Chiayi Industrial Vocational School, and Chiayi Junior High School (today's Chiayi High School.) He graduated from the senior high school section of Chiayi Junior High School in 1957, and then attended the Department of Foreign Affairs and the Department of Foreign Affairs, National Chengchi University, from 1957 to 1965. National Chengchi University, Department of Foreign Affairs and Institute.In the middle of 1997, due to the Justice Conference of the Judicial Yuan, which explained that Lien Chan's appointment as chief executive officer in addition to his vice-presidency had constitutional misgivings and might affect Lien's career, Lee Teng-hui notified then legislator Hsiao Wan-chang of his appointment to the Cabinet on August 21st and the nomination was approved by the KMT's Provisional Central Standing Committee on August 28th, which made Hsiao Wan-chang the Republic of China's first Taiwanese chief executive officer.At the end of 1999, Lien Chan was nominated by the Kuomintang to run for president, and Hsiao was the vice presidential candidate's partner in the campaign.\", \"candidate_score\": 0.0}}, {\"model\": \"campaign_trail.candidate\", \"pk\": 104, \"fields\": {\"first_name\": \"...\", \"last_name\": \"Other\", \"election\": 10, \"party\": \"Independent\", \"state\": \"Alaska\", \"priority\": 14, \"description\": \"''\", \"color_hex\": \"#FFFF00\", \"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\": 0.0}}]"); campaignTrail_temp.running_mate_json = JSON.parse("[{\"model\": \"campaign_trail.running_mate\", \"pk\": 66, \"fields\": {\"candidate\": 93, \"running_mate\": 103}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 67, \"fields\": {\"candidate\": 94, \"running_mate\": 104}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 58, \"fields\": {\"candidate\": 91, \"running_mate\": 95}}, {\"model\": \"campaign_trail.running_mate\", \"pk\": 59, \"fields\": {\"candidate\": 92, \"running_mate\": 96}}]"); campaignTrail_temp.opponents_default_json = JSON.parse("[{\"election\": 10, \"candidates\": [93, 94, 91, 92]}]"); campaignTrail_temp.opponents_weighted_json = JSON.parse("[{\"election\": 10, \"candidates\": [91, 92, 93, 94]}]"); campaignTrail_temp.difficulty_level_json = JSON.parse("[{\"model\": \"campaign_trail.difficulty_level\", \"pk\": 1, \"fields\": {\"name\": \"Very Easy\", \"multiplier\":1.5}}, {\"model\": \"campaign_trail.difficulty_level\", \"pk\": 2, \"fields\": {\"name\": \"Easy\", \"multiplier\": 1.25}}, {\"model\": \"campaign_trail.difficulty_level\", \"pk\": 3, \"fields\": {\"name\": \"Minor Easy\", \"multiplier\": 1.05}}, {\"model\": \"campaign_trail.difficulty_level\", \"pk\": 4, \"fields\": {\"name\": \"Normal\", \"multiplier\": 0.97}}, {\"model\": \"campaign_trail.difficulty_level\", \"pk\": 5, \"fields\": {\"name\": \"A little difficult\", \"multiplier\": 0.9}}, {\"model\": \"campaign_trail.difficulty_level\", \"pk\": 6, \"fields\": {\"name\": \"Harder\", \"multiplier\": 0.85}}, {\"model\": \"campaign_trail.difficulty_level\", \"pk\": 7, \"fields\": {\"name\": \"Struggle\", \"multiplier\": 0.8}}, {\"model\": \"campaign_trail.difficulty_level\", \"pk\": 8, \"fields\": {\"name\": \"Hard\", \"multiplier\": 0.75}}, {\"model\": \"campaign_trail.difficulty_level\", \"pk\": 9, \"fields\": {\"name\": \"Hell\", \"multiplier\": 0.72}}]"); campaignTrail_temp.global_parameter_json = JSON.parse("[{\"model\": \"campaign_trail.global_parameter\", \"pk\": 1, \"fields\": {\"vote_variable\": 1.125, \"max_swing\": 0.12, \"start_point\": 0.94, \"candidate_issue_weight\": 10.0, \"running_mate_issue_weight\": 3.0, \"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.candidate_dropout_json = JSON.parse("[{\"model\": \"campaign_trail.candidate_dropout\", \"pk\": 1, \"fields\": {\"candidate\": 36, \"affected_candidate\": 18, \"probability\": 1.0}}]"); function updateRunningMateForm() { try { const form = document.querySelector("#running_mate_form form"); const heading = form.querySelector("h3"); heading.textContent = "Please select your party:"; } catch {} } window.setInterval(updateRunningMateForm,200) function modifyForm() { try { const form = document.querySelector('form[name="game_type_selection"]'); const select = form.querySelector('select[name="game_type_id"]'); const option = select.querySelector('option[value="1"]'); option.textContent = 'Default (Plurality Voting)'; select.querySelector('option[value="2"]').remove(); const h3 = form.querySelector('h3'); h3.textContent = 'How would you like the winner to be decided?'; } catch {} } window.setInterval(modifyForm,200) function changeOpponentSelectionDescription() { try { const opponentSelectionDescription = document.getElementById("opponent_selection_description_window"); opponentSelectionDescription.innerHTML = `

Use the default method of deciding the winner in the ROC presidential election.

In the ROC presidential election, the candidate who receives votes more than any other opponents is elected president. Regardless of the majority, you just need to have the most to win. For example, in the historical result of this election, Chen shui-bian won 39.3 percent of the vote, beating Song chu-yu, who won only 36.84 percent of the vote.

`; } catch {} } window.setInterval(changeOpponentSelectionDescription,200) campaignTrail_temp.temp_election_list = [{"id": 10, "year": 2000, "is_premium": 0, "display_year": "2000ROC"}]; campaignTrail_temp.show_premium = true; campaignTrail_temp.premier_ab_test_version = -1; campaignTrail_temp.credits = "Phone_Tall, "; credits = function() { credits = [""] text = "CODE CREDITS:\n1963 Korea\\n1964 Draft Lodge (Color Setting Codes)\n2000N (Soundtrack Code)\n2025 Netherlands (Several Codes)\n\nHAVE FUN!" for (i in credits) { text += credits[i] } alert(text) } nct_stuff.themes[nct_stuff.selectedTheme].coloring_title = "#002864"; nct_stuff.themes[nct_stuff.selectedTheme].coloring_window = "#ffffff"; 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 = "#df0024"; bannerlist=["https://jetsimon.com/cts-media/public/2000ROC_init_0.png", "https://jetsimon.com/cts-media/public/2000ROC_init_1.png"] document.getElementById("header").src = "https://i.imgur.com/i5Zekxl.jpeg"; document.body.background = "https://i.imgur.com/pE2Msoh.jpeg"; $(".footer a").css({"color":"#ffffff"}); nct_stuff.themes[nct_stuff.selectedTheme].text_col = "#000000" let style = document.createElement('style'); style.type = 'text/css'; style.id = 'dynamic-style'; style.innerHTML = ` .campaign_trail_start_emphasis { background-color: #ffffff; } a:-webkit-any-link { color: #ffffff; } `; document.head.appendChild(style); quotes = ["","Stand in the water and see if you're in a hurry. -Song Chu-yu,On Heavy Rainfall in Central Taiwan in 1998","The country has been stolen, the crime of theft! To be more frank, the country was stolen! Stolen by thieves! -Lien Chan","A-Bian does not rule out the possibility of unification in the future, and will also seek an opportunity for Taiwan to become independent.-Chen Shuibian","The ruling of the DPP is to break the one-party dictatorship of the Kuomintang. -Chen Shuibian","Is A-Bian Wrong? -Chen Shuibian","I'm lucky I'm president now. Or what? -Chen Shuibian"] customquote = quotes[Math.floor((Math.random() * quotes.length))] corrr=`\n

CAMPAIGN TRAIL SHOWCASE

`+customquote+`` 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: "ROC 2000 Eletion Music", tracklist: [ { "name": "Happy to the Future -Chen Shuibian 2000", "url": "https://audio.jukehost.co.uk/AzjmGWjR7Zlwp1PrwevXhbb0lBoCqCWd" }, { "name": "You And Me Song Chu-yu 2000", "url": "https://audio.jukehost.co.uk/8llwphKP8rtx36uz1EzOlFNlRndwMFcM" }, { "name": "March of Taiwan Lien Chan 2000", "url": "https://audio.jukehost.co.uk/uuGhNtxun5XTn5QMZLHg9OmcwvjsdCTt" }, { "name": "ROC Flag Anthem-Saving Our Flag! -Lien Chan 2000 AD", "url": "https://audio.jukehost.co.uk/wPZS5s3sm7xwt5du3CG0O6mMXQ8HBw3B" }, { "name": "Youth of Taiwan Chen Shui-bian,2000", "url": "https://audio.jukehost.co.uk/Evr7yCnGQauHre5MKL4dA1gnzgavTfnR" }, { "name": "Happy to the Future Rap -Chen Shuibian 2000", "url": "https://audio.jukehost.co.uk/BGF61FlWo3Rl6NLCM13bwokuf9VfJg5J" } ] }, } // Set up new music player newMusicPlayer() } $("#game_start").click((event) => { event.preventDefault(); $("#election_id_button").click((event) => { musicMode() setInterval(changeFontColour, 200) }) }) HistHexcolour=["#1B9431","#FF6310","#1e1ec9","#99E64D","#FFDB00"]; HistName=[" Chen Shui-bian","Song Chu-yuu","Lien Chan","Hu Hsing-Liang" ,"Li Ao"]; HistEV=[10,15,0,0,0]; HistPV=["4,977,697","4,664,972","2,925,513","79,429","16,782"]; HistPVP=["39.3%","36.84%","23.1%","0.63%","0.13%"];