Skip to content

Commit

Permalink
bad idea
Browse files Browse the repository at this point in the history
  • Loading branch information
kole1337 committed Mar 26, 2024
1 parent be88f80 commit e77fa22
Show file tree
Hide file tree
Showing 14 changed files with 486 additions and 0 deletions.
110 changes: 110 additions & 0 deletions govcalc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<!DOCTYPE html>
<html lang="bg">
<head>
<link rel="stylesheet" href="govcalcStyle.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <script src="govcalc.js"></script> -->

<title>GovCalc</title>
</head>
<body>
<div class="menu">
<h1>GovCalc</h1>
<nav class="main-menu">
<a href="govcalc.html">Главна страница</a> |
<a href="sglobka.html">Сглобканатор</a> |
<a href="segashna.html">Сегашна сглобка</a>
</nav>
</div>


<p>Zaglavna stranica</p>

<div class="view">

<div class="data-table">
<h1>Избори 2023</h1>
<p>Резултати от изборите през 2023</p>
<table>
<tr>
<td>Партия</td>
<td>Гласове</td>
<td>Процент (от общия)</td>
<td>Мандати</td>
</tr>
<tr>
<td>ГЕРБ</td>
<td>669 361</td>
<td>26.49%</td>
<td>69</td>
</tr>
<tr>
<td>ПП-ДБ</td>
<td>621 069</td>
<td>24.56%</td>
<td>64</td>
</tr>
<tr>
<td>Възраждане</td>
<td>358 174</td>
<td>14.16%</td>
<td>37</td>
</tr>
<tr>
<td>ДПС</td>
<td>347 700</td>
<td>13.75%</td>
<td>36</td>
</tr>
<tr>
<td>БСП</td>
<td>225 914</td>
<td>8.93%</td>
<td>23</td>
</tr>
<tr>
<td>ИТН</td>
<td>103 971</td>
<td>4.11%</td>
<td>11</td>
</tr>
</table>
</div>

<div class="select-parties">
<h1>Правителствен калкулатор</h1>
<p>Общо мандати: 240</p>
<button id="gerb" class="GERB" onclick="setGovName(this)">ГЕРБ: 69</button>
<button class="PP-DB" onclick="setGovName(this)">ПП-ДБ: 64</button>
<button class="Vyzrazhdane" onclick="setGovName(this)">Възраждане: 37</button>
<button class="DPS" onclick="setGovName(this)">ДПС: 36</button>
<button class="BSP" onclick="setGovName(this)">БСП: 23</button>
<button class="ITN" onclick="setGovName(this)">ИТН: 11</button>

<h2 id="gov">Правителство: </h2>
<h2 id ="seats">Мандати: ---/121</h2>
<div class="mandati">
<h2>Мандати:</h2></li>
<h2 id="numSeats">0</h2>
<h2>/121</h2>
</div>
<button class="clear-button" onclick="clearGovData()">Изчисти</button>
</div>

</div>

<div class="footer-section">
<footer>
<nav class="footer-menu">
<a href="https://github.com/kole1337/govcalc">GitHub</a> |
<a href="https://results.cik.bg">ЦИК данни</a> |
<a href="https://www.strazha.bg">Стража</a>
</nav>
</footer>
</div>

<script src="govcalc.js"></script>

</body>
</html>
Binary file removed govcalc.html.lnk
Binary file not shown.
62 changes: 62 additions & 0 deletions govcalc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
function setGovName(getButtonClass){



let buttonText = getButtonClass.textContent;

let govText = document.getElementById("gov").textContent;

const buttonArr = buttonText.split(": ");

var buttonClassText = buttonArr[0]+"-";

if(!govText.includes(buttonClassText)){

getButtonClass.style.border = "solid green";

document.getElementById("gov").append(buttonClassText);

setSeats( parseInt(buttonArr[1], 10) );



}else if(govText.includes(buttonClassText)) {

getButtonClass.style = null;


govText = govText.replace(buttonClassText,'');

document.getElementById("gov").innerHTML = govText;
removeSeats( parseInt(buttonArr[1] , 10) );
}


}


function clearGovData(){
document.getElementById("gov").innerHTML = "Правителство:";
document.getElementById("numSeats").innerHTML = "0";

}

function setSeats(seats){
var currSeats = parseInt( document.getElementById("numSeats").textContent , 10);
currSeats = currSeats + seats;
document.getElementById("numSeats").innerHTML = currSeats;

}
function removeSeats(seats){
var currSeats = parseInt( document.getElementById("numSeats").textContent , 10);
currSeats = currSeats - seats;
document.getElementById("numSeats").innerHTML = currSeats;

}


function printText(){

}

printText();
Binary file removed govcalc.js.lnk
Binary file not shown.
96 changes: 96 additions & 0 deletions govcalcStyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
body{
background-color: bisque;
}

.main-menu{
text-align: center;

}
.main-menu > a{
margin: 5px;
padding: 5px;
background-color: gray;
border-style: solid;

}
.main-menu > a:hover{
background-color: lightgray;
}
.main-menu > a:link{
color: black;
text-decoration: none;
}
.main-menu > a:visited{
color: black;
text-decoration: none;
}


.view{
display: flex;
}

.view > div{
margin:1%;
}

.data-table{
width: 50%;

}
.select-parties{
background-color: lightgray;
width:50%;
margin: 10px;
padding: 10px;
}

.select-parties > button {
font-size:12px;
margin:10px;
padding:15px;
}

.select-parties > button:hover{
border: solid green;
}



.mandati{
display: flex;
flex: row;
/* list-style-type: none; */
margin: 0;
padding: 0;
}


table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}

td, th {
border: 2px solid black;
text-align: left;
padding: 8px;
}

tr:nth-child(even) {
background-color: #dddddd;
}
tr:nth-child(odd) {
background-color: white;
}
tr:hover{
background-color: lightslategray;
}

footer{
text-align: center;
background-color: lightslategray;
color: black;
font-size:20px;
}
Binary file removed govcalcStyle.css.lnk
Binary file not shown.
31 changes: 31 additions & 0 deletions segashna.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="segashnaStyle.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GovCalc</title>
</head>
<body>
<div class="menu">
<h1>GovCalc</h1>
<nav class="main-menu">
<a href="govcalc.html">Главна страница</a> |
<a href="sglobka.html">Сглобканатор</a> |
<a href="segashna.html">Сегашна сглобка</a>
</nav>
</div>

<p>Segashna sglobka overview</p>

<div>
<footer>
<nav>
<a href="https://github.com/kole1337/govcalc">GitHub</a> |
<a href="https://results.cik.bg">ЦИК данни</a> |
<a href="https://www.strazha.bg">Стража</a>
</nav>
</footer>
</div>
</body>
</html>
Binary file removed segashna.html.lnk
Binary file not shown.
78 changes: 78 additions & 0 deletions segashnaStyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
body{
background-color: bisque;
}

.main-menu{
text-align: center;
a{
margin: 5px;
padding: 5px;
background-color: gray;
border-style: solid;

}
a:hover{
background-color: lightgray;
}
}


.view{
display: flex;
}

.view > div{
margin:1%;
}

.data-table{
width: 50%;

}
.select-parties{
background-color: lightgray;
width:50%;
}

.select-parties > button {
font-size:10px;
margin:15px;
padding:15px;
}
.mandati{
display: flex;
flex: row;
list-style-type: none;
margin: 10px;
padding: 10px;
}

table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}

td, th {
border: 2px solid #dddddd;
text-align: left;
padding: 8px;
}

tr:nth-child(even) {
background-color: #dddddd;
}

/* .data-table > div{
background-color: #f1f1f1;
margin: 40px;
padding: 80px;
font-size: 120px;
} */

footer{
text-align: center;
background-color: lightslategray;
color: black;
font-size:20px;
}
Binary file removed segashnaStyle.css.lnk
Binary file not shown.
Loading

0 comments on commit e77fa22

Please sign in to comment.