Add Portfolio project

This commit is contained in:
2025-10-25 19:09:18 +02:00
parent 50e97e8a51
commit bd757d5ceb
30 changed files with 560 additions and 17 deletions

28
Portfolio/script.js Normal file
View File

@@ -0,0 +1,28 @@
function addRecommendation() {
// Get the message of the new recommendation
let recommendation = document.getElementById("new_recommendation");
// If the user has left a recommendation, display a pop-up
if (recommendation.value != null && recommendation.value.trim() != "") {
console.log("New recommendation added");
//Call showPopup here
showPopup(true);
// Create a new 'recommendation' element and set it's value to the user's message
var element = document.createElement("div");
element.setAttribute("class","recommendation");
element.innerHTML = "\<span\>&#8220;\</span\>" + recommendation.value + "\<span\>&#8221;\</span\>";
// Add this element to the end of the list of recommendations
document.getElementById("all_recommendations").appendChild(element);
// Reset the value of the textarea
recommendation.value = "";
}
}
function showPopup(bool) {
if (bool) {
document.getElementById('popup').style.visibility = 'visible'
} else {
document.getElementById('popup').style.visibility = 'hidden'
}
}