Skip to content

Commit

Permalink
Merge pull request #241 from Arquisoft/develop
Browse files Browse the repository at this point in the history
Fix post presentation fixes
  • Loading branch information
Pelayori authored May 6, 2024
2 parents b85ac56 + 63efda0 commit ca147da
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 11 deletions.
7 changes: 0 additions & 7 deletions docs/src/10_quality_requirements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ ifndef::imagesdir[:imagesdir: ../images]
|The ability of a system to handle increasing workload or growing demands by adapting or expanding its capacity without compromising performance.
|SC7

|Interoperability
|The system must have the ability of seamlessly communicate, exchange data, and work together effectively with different systems, applications, or components, even if they use different technologies.
|SC8


|===

Expand Down Expand Up @@ -69,7 +65,4 @@ ifndef::imagesdir[:imagesdir: ../images]
| SC7
| As user demand grows, the deployment does not grow dynamically. However a system can be put in place to deploy more instances of the application to handle the increased workload, trough a load balancer, for example.

| SC8
| The application seamlessly integrates with other systems, allowing for the exchange of data and functionality without compatibility issues, enhancing its overall interoperability.

|===
3 changes: 3 additions & 0 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ navbar.admin.zone=Zona de administración
# -------------------Statements for the footer.html file---------------------
footer.copyright=© ASW - Grupo 04 B
footer.nav=Menú de navegación
footer.toggle.on=
footer.toggle.off=No
footer.animation=Animación de fondo

# -------------------Statements for the error.html file---------------------
error.page.title=Error!
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ navbar.admin.zone=Admin Zone
# -------------------Statements for the footer.html file---------------------
footer.copyright=© ASW - Group 04 B
footer.nav=Navigation
footer.toggle.on=On
footer.toggle.off=Off
footer.animation=Background animation

# -------------------Statements for the error.html file---------------------
error.page.title=Error!
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ navbar.admin.zone=Zona de administración
# -------------------Statements for the footer.html file---------------------
footer.copyright=© ASW - Grupo 04 B
footer.nav=Menú de navegación
footer.toggle.on=
footer.toggle.off=No
footer.animation=Animación de fondo

# -------------------Statements for the error.html file---------------------
error.page.title=Error!
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ navbar.admin.zone=Espace administrateur
# -------------------Statements for the footer.html file---------------------
footer.copyright=© ASW - Groupe 04 B
footer.nav=Menu de navigation
footer.toggle.on=Oui
footer.toggle.off=Non
footer.animation=Animation de la page

# -------------------Statements for the error.html file---------------------
error.page.title=Erreur !
Expand Down
19 changes: 19 additions & 0 deletions src/main/resources/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,23 @@ html {
}
body {
margin-bottom: 60px; /* Margin bottom by footer height */
}

div div .btn-danger {
color: #fff;
background-color: #dc3545 !important;
border-color: #dc3545 !important;
}

div div .btn-success {
color: #fff;
background-color: #218838 !important;
border-color: #1e7e34 !important;
}

div div .toggle-handle {
border-width: 0 1px;
background-color: #fff !important;
color: #212529;
border-color: #f8f9fa;
}
24 changes: 23 additions & 1 deletion src/main/resources/static/script/background.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
// modified version of random-normal
function getCookie(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for(let i = 0; i <ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}

function normalPool(o){var r=0;do{var a=Math.round(normal({mean:o.mean,dev:o.dev}));if(a<o.pool.length&&a>=0)return o.pool[a];r++}while(r<100)}function randomNormal(o){if(o=Object.assign({mean:0,dev:1,pool:[]},o),Array.isArray(o.pool)&&o.pool.length>0)return normalPool(o);var r,a,n,e,l=o.mean,t=o.dev;do{r=(a=2*Math.random()-1)*a+(n=2*Math.random()-1)*n}while(r>=1);return e=a*Math.sqrt(-2*Math.log(r)/r),t*e+l}

const NUM_PARTICLES = 350;
Expand Down Expand Up @@ -51,8 +67,13 @@ function drawParticle(particle, canvas, ctx) {
ctx.fillText("?", particle.x * canvas.width, particle.y * vh + (canvas.height / 2));
}


let init = false;
function draw(time, canvas, ctx) {
if (init && getCookie("backgroundAnimation") === "false") {
requestAnimationFrame((time) => draw(time, canvas, ctx));
return;
}

// Move particles
particles.forEach((particle, index) => {
particles[index] = moveParticle(particle, canvas, time);
Expand All @@ -66,6 +87,7 @@ function draw(time, canvas, ctx) {
drawParticle(particle, canvas, ctx);
})

init = true;
// Schedule next frame
requestAnimationFrame((time) => draw(time, canvas, ctx));
}
Expand Down
54 changes: 52 additions & 2 deletions src/main/resources/templates/fragments/footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!-- footer.html -->
<footer class="footer bg-primary mt-auto">
<div class="container">
<!-- Navigation Menu to the left -->
Expand All @@ -13,9 +12,60 @@
<div class="col-md-4 text-center">
<span class="text-white" th:text="#{footer.copyright}"></span>
</div>
<div class="col-md-4"></div>

<div class="col-md-4" style="padding-left: 10px">
<div class="form-check form-check-inline" style="padding-left: 10px">
<label class="checkbox-inline" style="padding-left: 10px">
<input id="backgroundToggleCheckbox" type="checkbox" checked data-toggle="toggle" data-onstyle="success" data-offstyle="danger" style="padding-left: 10px" th:text="#{footer.animation}">
</label>
</div>
</div>
</div>
</div>
<script>
function setCookie(cname, cvalue, exdays) {
const d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
let expires = "expires="+ d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for(let i = 0; i <ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}

/*<![CDATA[*/
$(function() {
let onText = "[[#{footer.toggle.on}]]";
let offText = "[[#{footer.toggle.off}]]";
$(".toggle-on").text(onText);
$(".toggle-off").text(offText);
$('#backgroundToggleCheckbox').change(function() {
if ($(this).prop('checked')) {
setCookie("backgroundAnimation", "true", 365);
} else {
setCookie("backgroundAnimation", "false", 365);
}
});

let backgroundAnimation = getCookie("backgroundAnimation");
if (backgroundAnimation === "false") {
$('#backgroundToggleCheckbox').bootstrapToggle('off');
}
});
/*]]>*/
</script>
</footer>


4 changes: 3 additions & 1 deletion src/main/resources/templates/fragments/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@
<link rel="stylesheet" href="/css/nav.css" />
<link rel="stylesheet" href="/css/footer.css" />
<link rel="stylesheet" href="/css/style.css" />
<script src="/script/languages.js"> </script>
<script src="/script/languages.js"> </script>
<link href="https://cdn.jsdelivr.net/gh/gitbrent/[email protected]/css/bootstrap4-toggle.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected]/js/bootstrap4-toggle.min.js"></script>
</head>

0 comments on commit ca147da

Please sign in to comment.