Skip to content

Commit

Permalink
Init js and css
Browse files Browse the repository at this point in the history
  • Loading branch information
Romainmivi authored Dec 7, 2023
1 parent f2630ea commit 9acd391
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
41 changes: 41 additions & 0 deletions theme/java.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
var $pred;
var $perso;
let ThemesPred = ["DARK", "Base", "Enfant", "XMAS"];




$(document).ready(function() {
$pred = $("#Pre");
$perso = $("#Perso");
themepred();

$pred.css("display","none");
$perso.css("display","none");
$('input[type="radio"]').on('click', function() {
var valeurSelectionnee = $('input[name="options"]:checked').val();
// console.log("Bouton cliqué : " + valeurSelectionnee);
if(valeurSelectionnee=="Pre"){
$perso.css("display","none");
$pred.css("display","block");
}else if (valeurSelectionnee == "Perso") {
$pred.css("display","none");
$perso.css("display","block");
}
});
});

function themepred(){
for (var i = 0; i<ThemesPred.length; i++) {
var radioElement = $("<input>").attr({
type: "radio",
id: "radio"+i,
name: "Thème",
value: ThemesPred[i]
});
var labelElement = $("<label>").attr("for", "radio" + i).text(ThemesPred[i]);
$pred.append(radioElement, labelElement, "<br>");
}
}


11 changes: 11 additions & 0 deletions theme/t.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#Pre, #Perso{
border: 3px solid black;
border-radius: 10px;
margin: 10px;
padding: 10px;
padding-top: 0;
}

#Pre h3, #Perso h3{
margin: 5px;
}

0 comments on commit 9acd391

Please sign in to comment.