Skip to content

Commit

Permalink
Merge pull request #1 from kamalsritha/Alert-box
Browse files Browse the repository at this point in the history
ADD: Alert box for error
  • Loading branch information
kamalsritha authored Jan 31, 2024
2 parents a014f09 + 9932436 commit 2eee218
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
4 changes: 1 addition & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,7 @@ app.post("/tips",function(req,res){
res.render("accomplishments")
}
else{
res.render('error', {
errorMessage: "We're just a few steps away! Please complete all questions to unveil your PERMA Score."
});
res.render("error",{ errorMessage: "Please answer all the questions to calculate PERMA Score!"})
}
})

Expand Down
29 changes: 2 additions & 27 deletions views/error.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Invalid</title>
<style>
.custom-alert {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border: 1px solid #8c87fc;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
z-index: 1000;
}
.custom-alert button {
background-color: #8c87fc;
color: #fff;
border: none;
padding: 10px 20px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="custom-alert" id="customAlert">
<% if(errorMessage) { %>
<p><%= errorMessage %></p>
<button onclick="document.getElementById('customAlert').style.display='none'">Close</button>
<% } %>
</div>
<h3 style="font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; color: red;"> <%= errorMessage %></h3>
</body>
</html>
</html>

0 comments on commit 2eee218

Please sign in to comment.