9 Janvier

This commit is contained in:
Adrian POURCHOT 2023-01-09 17:25:17 +01:00
parent 5ab50d58af
commit 22696c5ccf
13 changed files with 168 additions and 0 deletions

View File

@ -0,0 +1,86 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Calcul salaire</title>
</head>
<body onload="reset()">
<h1>Calcul salaire</h1>
<h3>Formule de calcul</h3>
<form method="POST" action="#">
<table>
<tr>
<td>Salaire brut</td>
<td><input name="salaire" type="text" id="sal"></td>
</tr>
<tr>
<td>impôt sur revenu</td>
<td><input name="impot" type="text" id="impot"></td>
</tr>
<tr>
<td>Assurance</td>
<td><input name="assur" type="text" id="assur"></td>
</tr>
<tr>
<td>Pension</td>
<td><input name="pension" type="text" id="pension"></td>
</tr>
<tr>
<td>Formation</td>
<td><input name="forma" type="checkbox" id="forma"></td>
</tr>
<tr>
<td>Trajet sup à 100 Km</td>
<td><input name="trajet" type="checkbox" id="trajet"></td>
</tr>
<tr>
<td>Salaire net</td>
<td><input type="text" id="salnet" name="salnet"></td>
</tr>
<tr>
<td><input name="butt" type="button" value="Calculer" id="calc" onclick="calculerSalaire()"></td>
<td><input name="butt" type="button" value="Effacer" id="rest" onclick="reset()"></td>
</tr>
</table>
</form>
<br /><br />
<script>
function calculerSalaire() {
//document.write("<h1>Salaire net</h1>");
var sal = document.getElementById("sal").value;
//alert(sal);
console.log(sal);
var impot = sal * 0.18;
document.getElementById("impot").value = impot.toFixed(2);
var assur = sal * 0.07;
document.getElementById("assur").value = assur.toFixed(2);
var pension = sal * 0.05;
document.getElementById("pension").value = pension.toFixed(2);
var forma = document.getElementById("forma").value;
var total = sal - impot - assur + pension;
if (document.getElementById("forma").checked) {
total += 150;
}
document.getElementById("salnet").value = total.toFixed(2);
}
function reset() {
document.getElementById("sal").value = 0;
document.getElementById("impot").value = 0;
document.getElementById("assur").value = 0;
document.getElementById("pension").value = 0;
document.getElementById("salnet").value = 0;
}
</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,71 @@
<html>
<head>
<title>Diaporama d'images</title>
<style>
/* Mettre en forme le diaporama */
.slideshow {
display: flex;
}
.slideshow img {
width: 500px;
height: 500px;
}
</style>
</head>
<body>
<h1>Diaporama d'images</h1>
<div class="slideshow">
<img src="" id="image">
</div>
<button id="previous">Précédent</button>
<button id="next">Suivant</button>
<script>
// Tableau d'images
var images = [
'img/image1.jpg',
'img/image2.jpg',
'img/image3.jpg',
'img/image4.jpg',
'img/image5.jpg',
'img/image6.jpg',
'img/image7.jpg',
'img/image8.jpg',
'img/image9.jpg',
'img/image10.jpg'
];
// Éléments HTML
var imageElement = document.getElementById('image');
var previousButton = document.getElementById('previous');
var nextButton = document.getElementById('next');
// Index de l'image en cours
var currentIndex = 0;
// Afficher l'image en cours
imageElement.src = images[currentIndex];
// Fonction pour passer à l'image suivante
function next() {
currentIndex++;
if (currentIndex >= images.length) {
currentIndex = 0;
}
imageElement.src = images[currentIndex];
}
// Fonction pour passer à l'image précédente
function previous() {
currentIndex--;
if (currentIndex < 0) {
currentIndex = images.length - 1;
}
imageElement.src = images[currentIndex];
}
// Événements pour les boutons
previousButton.addEventListener('click', previous);
nextButton.addEventListener('click', next);
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB