Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sahithi000 committed May 15, 2024
2 parents d2aabc6 + 5863d9a commit d44cbc9
Show file tree
Hide file tree
Showing 9 changed files with 207 additions and 7 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
./DS_Store
node_modules/
26 changes: 24 additions & 2 deletions Public/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ body {
}
}
.cta-card__img {
width: 9.4rem;
height: 9.4rem;
/* width: 9.4rem;
height: 9.4rem; */
border: 0.8rem solid #fff;
border-radius: 50%;
box-shadow: 0 1.4rem 2.5rem -1.5rem rgba(82, 113, 224, 0.5);
Expand All @@ -188,12 +188,34 @@ body {
font-size: 5rem;
font-family: "Mulish", sans-serif;
margin:0.05rem;
position:relative;
}

.circle:hover{
filter: grayscale(1);
transition: filter 0.3s ease;
}
.tooltip {
visibility: hidden;
width: 200px;
background-color: rgb(52, 52, 52);
color: white;
border-radius: 6px;
padding: 10px;
position: absolute;
z-index: 1;
bottom: 120%;
left: 50%;
transform: translateX(-50%);
opacity: 0;
transition: opacity 0.3s;
font-size: 15px;
}

.circle:hover .tooltip {
visibility: visible;
opacity: 1;
}

.rect{
display: flex;
Expand Down
32 changes: 31 additions & 1 deletion Public/styles/result.css
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,34 @@ body {
/* change the direction of the change here */
color: #fff;
text-decoration: none;
}
}

.recommended-resources {
background-color: rgb(255, 255, 255);
border-radius: 5px;
padding: 1rem;
margin-top: 2rem;
}

.recommended-resources h2 {
text-align: center; /* Center align the text inside the header */
font-weight: bold; /* Make the text bold */
margin-bottom: 1rem; /* Add space below the header */
}

.resource-card {
display: inline-block; /* Make cards appear side-by-side */
width: calc(20% - 1rem); /* Set width to 20% of available space with 1rem margin */
margin: 0.5rem; /* Add some margin between cards */
padding: 1rem; /* Add padding inside cards */
border: 1px solid #ddd; /* Add a thin border */
border-radius: 5px; /* Add rounded corners to cards */
background-color: #fff; /* Set card background color (white) */
text-align: center; /* Center align content within cards */
}






15 changes: 14 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ const express = require("express")
const bodyParser = require("body-parser")
const axios = require("axios")
const sgMail = require("@sendgrid/mail")
<<<<<<< HEAD
<<<<<<< Updated upstream
=======
const path=require("path")
const bcrypt=require("bcrypt")
const collection=require("./config.js")
const ExpressError=require("./utils/ExpressError.js")
>>>>>>> Stashed changes
=======
const ExpressError=require("./utils/ExpressError.js")
>>>>>>> 5863d9a63eacb84b10eca3dc7563444fd15206a4

require("dotenv").config()

Expand Down Expand Up @@ -91,4 +95,13 @@ app.post("/result",async (req,res)=>{

app.listen(process.env.PORT || 3000,function(){
console.log("Server Started Sucessfully")
})
})

app.all("*",(req,res,next)=>{
next(new ExpressError(404,"Page not found!"));
});

app.use((err,req,res,next)=>{
let {statusCode=500,message="Something Went Wrong"}=err;
res.render("customError.ejs",{message});
});
7 changes: 7 additions & 0 deletions utils/ExpressError.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports=class ExpressError extends Error{
constructor(statusCode,message){
super();
this.statusCode=statusCode;
this.message=message;
}
}
12 changes: 12 additions & 0 deletions views/customError.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Invalid</title>
</head>
<body>
<h3 style="font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; color: red;"><%= message %></h3>
<a href="/"><button>Home</button></a>
</body>
</html>
15 changes: 13 additions & 2 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>

<body
style="background-image: url(images/vector-purple-light-blue-gradient-260nw-1941567055.jpg);background-repeat: no-repeat;background-position: center;background-size: cover;">
<body style="background-image: radial-gradient(circle, rgb(34, 34, 210), rgb(95, 4, 200))">
<!-- style="background-image: url(images/vector-purple-light-blue-gradient-260nw-1941567055.jpg);background-repeat: no-repeat;background-position: center;background-size: cover;"> -->

<nav>
<h1><a href="/">Euphoria-Check</a></h1>
<ul>
Expand Down Expand Up @@ -64,18 +65,28 @@
alt="User" /> -->
<div class="circle" id="P">
<b>P</b>
<br>
<div class="tooltip" style="font-size: small;text-align: center;"><b>Positive Emotions</b>: Experiencing positive feelings such as joy, hope, inspiration and love</div>
</div>
<div class="circle" id="E">
<b>E</b>
<br>
<div class="tooltip" style="font-size: small;text-align: center;"><b>Engagement</b> : Being fully involved and absorbed in activities</div>
</div>
<div class="circle" id="R">
<b>R</b>
<br>
<div class="tooltip" style="font-size: small;text-align: center;"><b>Relationships</b> : Connections we have with others, including family, friends, colleagues, and the broader community </div>
</div>
<div class="circle" id="M">
<b>M</b>
<br>
<div class="tooltip" style="font-size: small;text-align: center;"><b>Meaning</b> : Having a sense of purpose and direction in life </div>
</div>
<div class="circle" id="A">
<b>A</b>
<br>
<div class="tooltip" style="font-size: small;text-align: center;"><b>Achievement</b> : Setting and pursuing goals that are personally meaningful and important</div>
</div>
</div>
</div>
Expand Down
106 changes: 105 additions & 1 deletion views/result.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,111 @@

</article>
<button class="btn-grad" onclick = "window.location.href='/';"">Try Again!!</button>
</main>
</div>
<section class="recommended-resources">
<h2>Recommended Resources</h2>
<div class="resource-list">
<% if (pos < 5) { %>
<article class="resource-card">
<h3>Boosting Positivity</h3>
<p>Feeling down? Check out these tips for increasing positive emotions.</p>
<a href="https://greatergood.berkeley.edu/article/science/what/happiness/how-increase-your-happiness" target="_blank">Visit Resource</a>
</article>
<% } else if (pos >= 5 && pos <= 7) { %>
<article class="resource-card">
<h3>Maintaining Positivity</h3>
<p>Strategies to keep your positive emotions thriving.</p>
<a href="https://www.psychologytoday.com/us/blog/the-athletes-way/201701/9-ways-cultivate-and-maintain-positive-emotions" target="_blank">Visit Resource</a>
</article>
<% } else { %>
<article class="resource-card">
<h3>Enhancing Positivity</h3>
<p>Take your positive emotions to the next level with these practices.</p>
<a href="https://www.headspace.com/science/happiness" target="_blank">Visit Resource</a>
</article>
<% } %>
<% if (eng < 5) { %>
<article class="resource-card">
<h3>Spark Engagement</h3>
<p>Feeling disengaged? Explore these tips to find activities that light you up.</p>
<a href="https://www.helpguide.org/articles/mental-health/finding-purpose-and-meaning-in-life.htm" target="_blank">Visit Resource</a>
</article>
<% } else if (eng >= 5 && eng <= 7) { %>
<article class="resource-card">
<h3>Deepen Engagement</h3>
<p>Take your engagement to the next level with these strategies.</p>
<a href="https://positivepsychology.com/engagement-activities/" target="_blank">Visit Resource</a>
</article>
<% } else { %>
<article class="resource-card">
<h3>Supercharge Engagement</h3>
<p>Learn how to maximize your flow and motivation.</p>
<a href="https://www.ted.com/talks/mihaly_csikszentmihalyi_on_flow_the_secret_to_happiness" target="_blank">Visit Resource</a>
</article>
<% } %>
<% if (rel < 5) { %>
<article class="resource-card">
<h3>Strengthen Relationships</h3>
<p>Build stronger connections with these tips for fostering healthy relationships.</p>
<a href="https://www.gottman.com/blog/the-four-horsemen-communication-apocalypse/" target="_blank">Visit Resource</a>
</article>
<% } else if (rel >= 5 && rel <= 7) { %>
<article class="resource-card">
<h3>Nurture Relationships</h3>
<p>Learn how to nurture and deepen your existing connections.</p>
<a href="https://www.psychologytoday.com/us/blog/the-athletes-way/201801/6-ways-nurture-your-relationships" target="_blank">Visit Resource</a>
</article>
<% } else { %>
<article class="resource-card">
<h3>Thriving Relationships</h3>
<p>Explore advanced strategies for building strong and fulfilling relationships.</p>
<a href="https://www.gottman.com/blog/what-makes-love-last-2/" target="_blank">Visit Resource</a>
</article>
<% } %>
<% if (mea < 5) { %>
<article class="resource-card">
<h3>Discover Meaning</h3>
<p>Feeling lost? Explore resources to help you find your purpose in life.</p>
<a href="https://www.verywellmind.com/how-to-find-meaning-in-life-4160866" target="_blank">Visit Resource</a>
</article>
<% } else if (mea >= 5 && mea <= 7) { %>
<article class="resource-card">
<h3>Live a Meaningful Life</h3>
<p>Learn how to integrate meaning into your daily life.</p>
<a href="https://www.berkeley.edu/greatergood/science/purpose/what-gives-life-meaning" target="_blank">Visit Resource</a>
</article>
<% } else { %>
<article class="resource-card">
<h3>Expand Your Purpose</h3>
<p>Explore ways to broaden your sense of purpose and make a bigger impact.</p>
<a href="https://greatergood.berkeley.edu/article/science/well-being/how-find-your-lifes-purpose" target="_blank">Visit Resource</a>
</article>
<% } %>
<% if (acc < 5) { %>
<article class="resource-card">
<h3>Boost Accomplishment</h3>
<p>Feeling stuck? Discover strategies to set and achieve goals effectively.</p>
<a href="https://jamesclear.com/articles/goal-setting/" target="_blank">Visit Resource</a>
</article>
<% } else if (acc >= 5 && acc <= 7) { %>
<article class="resource-card">
<h3>Maximize Accomplishment</h3>
<p>Take your goal-setting skills to the next level with advanced strategies.</p>
<a href="https://www.forbes.com/sites/forbescoachescouncil/2019/01/14/10-powerful-goal-setting-tips-for-maximum-achievement/" target="_blank">Visit Resource</a>
</article>
<% } else { %>
<article class="resource-card">
<h3>Breakthrough Accomplishment</h3>
<p>Explore strategies for tackling ambitious goals and achieving peak performance.</p>
<a href="https://www.entrepreneur.com/article/273150" target="_blank">Visit Resource</a>
</article>
<% } %>
</div>
</section>
</body>
</html>

0 comments on commit d44cbc9

Please sign in to comment.