Skip to content

Commit

Permalink
Deploying to gh-pages from @ 1b2c95e 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
fabnemEPFL committed May 31, 2024
1 parent 75f8c7d commit b3fb822
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
(() => {
const selector = document.querySelector('.js-filter-select');
selector.addEventListener('change', () => {
//console.log(`index_bytheme.html?lang=${lang}`);
document.location = selector.value === 'year' ? `index.html?lang=${lang}` : `index_bytheme.html?lang=${lang}`;
});
})();
Expand Down
2 changes: 0 additions & 2 deletions resources/process_index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions resources/process_results.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ function generateBlocPartyRecomm(voteInfo, lang) {
const cnName = { "en": "Parliament", "fr": "Parlement", "de": "Bundesversammlung" }[lang];

const cnPos = 1 + (voteInfo["ja-lager"] < voteInfo["nein-lager"]) + 8 * (voteInfo["forme"] == 5);
console.log(cnPos);

addInnerHTML(partyRecommBloc, `<div class="border-black flex py-4 items-center gap-6" title="${cfName}">
<img src="resources/party_logos/federal_council.png" class="m-auto w-20 h-10 object-contain" />
Expand Down Expand Up @@ -240,6 +239,7 @@ function writeResultsFederal(voteInfo, lang) {

//passed or not
addInnerHTML(globalResult, `<div class="text-3xl font-bold ${([1, 9].includes(voteInfo["annahme"])) ? "text-green-400" : "text-red-500"} pr-2">${[1, 9].includes(voteInfo["annahme"]) ? yes : no}</div>`);
addInnerHTML(globalResult, `<div class="text-2xl pt-2 font-bold ${(voteInfo["volkja-proz"] >= 50) ? "text-green-400" : "text-red-500"} pr-2">${{"en": "Popular vote", "fr": "Peuple", "de": "Volk"}[lang]}</div>`);

//popular vote
addInnerHTML(globalResult, '<div class="flex flex-row">');
Expand Down Expand Up @@ -286,7 +286,7 @@ function writeSimulatedResults(simResultedResults, lang) {
const cantonsTxt = {"en": "Cantons", "fr": "Cantons", "de": "Kantone"}[lang];
const votesCantons = (cantonsHalfYes[0]+cantonsHalfYes[1]/2);

addInnerHTML(globalResult, `<div class="text-2xl font-semibold ${((100 * voteInfo["kt-ja"]) / 23 >= 50) ? "text-green-400" : "text-red-500"}">${cantonsTxt}</div>`);
addInnerHTML(globalResult, `<div class="text-2xl font-semibold ${((100 * votesCantons) / 23 >= 50) ? "text-green-400" : "text-red-500"}">${cantonsTxt}</div>`);
addInnerHTML(globalResult, '<div class="flex flex-row">');
addInnerHTML(globalResult, ` <div class="flex-none basis-2/12 text-4xl font-bold text-green-400 pr-2">${cantonsHalfYes[0]} ${cantonsHalfYes[1]}/2</div>`);
addInnerHTML(globalResult, ` <div class="flex-initial basis-8/12 border-solid h-10 bg-red-500 rounded-full overflow-hidden border-4 border-black"><div class="bg-green-400 h-8" style="width: ${(100 * votesCantons) / 23}%;"></div></div>`);
Expand Down
2 changes: 0 additions & 2 deletions resources/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
const loader = document.querySelector('.js-search-loader');

const doQuery = debounce(async (query) => {
console.log('searching', query)
const results = await client.action(api.search.default, { query });

if (query !== search.value.trim()) return;
console.log(results)

let html = '';
for (const row of results) {
Expand Down

0 comments on commit b3fb822

Please sign in to comment.