Les jolis boutons !

This commit is contained in:
Samy Avrillon 2025-03-02 20:15:19 +01:00
parent 2c5f529e89
commit 15f747807b
Signed by: Mysaa
GPG Key ID: 0220AC4A3D6A328B
2 changed files with 82 additions and 29 deletions

View File

@ -1,19 +1,31 @@
/* Button box */
div.buttonbox {
display: flex;
flex-direction: column;
}
textarea.squared-input {
border-radius: 5px;
padding: 4px;
font-size: 1rem;
margin-bottom: 12px;
width: 400px;
min-height: 65px;
}
/* Common to all the answer buttons*/
button.squared-button {
border: 0;
border-radius: 5px;
color: #1F1A25;
font-family: "Muli", Arial, sans-serif;
font-family: Arial, sans-serif;
font-weight: 800;
text-transform: uppercase;
padding: 1rem 2rem;
padding: 4px;
font-size: 1rem;
background-color: #78E0DC;
box-shadow: 0 8px #2dc5bf;
margin-bottom: 12px;
width: 145px;
height: 65px;
width: 400px;
min-height: 65px;
}
button.squared-button:hover {
@ -24,13 +36,8 @@ button.squared-button:focus {
outline: none;
}
button.squared-button:hover, button.squared-button:focus {
background-color: #4fd6d1;
}
button.squared-button:active {
transform: translateY(4px);
box-shadow: 0 3px #2dc5bf;
}
/*@import url("https://fonts.googleapis.com/css?family=Muli:400,700,800&display=swap");
@ -43,3 +50,49 @@ body {
min-height: 100vh;
}
*/
/* Color 1 */
button.squared-button.bcol1 {
background-color: #78E0DC;
box-shadow: 0 8px #2dc5bf;
}
button.squared-button.bcol1:hover, button.squared-button.bcol1:focus {
background-color: #4fd6d1;
}
button.squared-button.bcol1:active {
box-shadow: 0 3px #2dc5bf;
}
/* Color 2 */
button.squared-button.bcol2 {
background-color: #FDE74C;
box-shadow: 0 8px #d7bd02;
}
button.squared-button.bcol2:hover, button.squared-button.bcol2:focus {
background-color: #fcde0d;
}
button.squared-button.bcol2:active {
box-shadow: 0 3px #d7bd02;
}
/* Color 3 */
button.squared-button.bcol3 {
background-color: #B8B3E9;
box-shadow: 0 8px #867ec8;
}
button.squared-button.bcol3:hover, button.squared-button.bcol3:focus {
background-color: #b0acd9;
}
button.squared-button.bcol3:active {
box-shadow: 0 3px #867ec8;
}
/* Color 4 */
button.squared-button.bcol4 {
background-color: #4fd337;
box-shadow: 0 8px #339721;
}
button.squared-button.bcol4:hover, button.squared-button.bcol4:focus {
background-color: #40be29;
}
button.squared-button.bcol4:active {
box-shadow: 0 3px #339721;
}

View File

@ -12,28 +12,28 @@
<span id="question-text"></span>
<span id="question-counter">0/0</span>
<div id="answers">
<div id="answer-select">
<button class="squared-button" id="answer-select-duo">Duo</button>
<button class="squared-button" id="answer-select-carre">Carré</button>
<button class="squared-button" id="answer-select-cache">Cache</button>
<div class="buttonbox" id="answer-select">
<button class="squared-button bcol1" id="answer-select-duo">Duo</button>
<button class="squared-button bcol2" id="answer-select-carre">Carré</button>
<button class="squared-button bcol3" id="answer-select-cache">Cache</button>
</div>
<div id="answer-cache">
<input id="answer-cache-input" type="text"/>
<button class="squared-button" id="answer-cache-button">Envoyer la réponse</button>
<div class="buttonbox" id="answer-cache">
<textarea class="squared-input" id="answer-cache-input" type="text"></textarea>
<button class="squared-button bcol4" id="answer-cache-button">Envoyer la réponse</button>
</div>
<div id="answer-duo">
<button class="squared-button" id="answer-duo-button-1"></button>
<button class="squared-button" id="answer-duo-button-2"></button>
<div class="buttonbox" id="answer-duo">
<button class="squared-button bcol1" id="answer-duo-button-1"></button>
<button class="squared-button bcol2" id="answer-duo-button-2"></button>
</div>
<div id="answer-carre">
<button class="squared-button" id="answer-carre-button-1"></button>
<button class="squared-button" id="answer-carre-button-2"></button>
<button class="squared-button" id="answer-carre-button-3"></button>
<button class="squared-button" id="answer-carre-button-4"></button>
<div class="buttonbox" id="answer-carre">
<button class="squared-button bcol1" id="answer-carre-button-1"></button>
<button class="squared-button bcol2" id="answer-carre-button-2"></button>
<button class="squared-button bcol3" id="answer-carre-button-3"></button>
<button class="squared-button bcol4" id="answer-carre-button-4"></button>
</div>
</div>
<span id="error-textbox" style="color: red"></span>
<button class="squared-button" id="question-button">Poser la question</button>
<button id="question-button">Poser la question</button>
<script th:inline="javascript">
/*<![CDATA[*/
var qid = /*[[${formid}]]*/ -1;
@ -155,7 +155,7 @@
$("#answer-select-duo").on('click',() => answer1(2))
$("#answer-select-carre").on('click',() => answer1(4))
$("#answer-select-cache").on('click',() => answer1(0))
$("#answer-cache-button").on('click',() => answer2($("#answer-cache-input").text()))
$("#answer-cache-button").on('click',() => answer2($("#answer-cache-input").val()))
$("#answer-duo-button-1").on('click',() => answer2(awrs[0]))
$("#answer-duo-button-2").on('click',() => answer2(awrs[1]))
$("#answer-carre-button-1").on('click',() => answer2(awrs[0]))