Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add design #24

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 196 additions & 7 deletions public/styles.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,204 @@
img {
max-height: 70vh;
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
:root{
--primary-color: rgb(47, 79, 79);
--secondary-color: rgb(222, 184, 135);
}
h1,
li,
span {
* {
margin: 0px;
padding: 0px;
}
html,
body {
overflow-x: hidden;
height: 100%;
}
body div {
font-family: 'Lobster', cursive;
}
#imagebox {
height: fit-content;
width: fit-content;
border-radius: 20px;
padding: 10px;
box-shadow:
rgba(0, 0, 0, 0.25) 0px 0.0625em 0.0625em,
rgba(0, 0, 0, 0.25) 0px 0.125em 0.5em,
rgba(255, 255, 255, 0.1) 0px 0px 0px 1px inset;
background-color: var(--primary-color);
}
#imagebox img {
outline: 2px solid rgba(0, 0, 0, 0.582);
border-radius: 20px;
width: 500px;
height: 500px;
}
#nav {
display: flex;
align-items: center;
justify-content: flex-start;
font-size: 1.5rem;
background-color: var(--primary-color);
color: var(--secondary-color);
padding: 15px 0px;
}
#nav img {
width: 50px;
height: 50px;
border-radius: 50%;
margin: 0px 10px 0px 25px;
}
#subhead {
padding: 15px 0px 15px 30px;
font-size: 1.2rem;
outline: solid 1px white;
box-shadow: inset 0px 3px 7px 1px rgba(0, 0, 0, 0.466);
background-color: var(--secondary-color);
color: var(--primary-color);
}
#mainbox {
margin: 50px 30px 50px 30px;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 40px;
}
#linksbox {
font-family: 'Poppins', sans-serif;
font-weight: 300;
font-style: normal;
color: #343a40;
padding: 20px;
box-shadow:
rgba(0, 0, 0, 0.25) 0px 0.0625em 0.0625em,
rgba(0, 0, 0, 0.25) 0px 0.125em 0.5em,
rgba(255, 255, 255, 0.1) 0px 0px 0px 1px inset;
border-radius: 8px;
width: 40%;
background-color: var(--secondary-color);
}
#linksbox ul {
list-style-type: none;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
gap: 13px;
margin-bottom: 30px;
}

#linksbox ul li {
background-color: #f1f1f1;
border-radius: 6px;
transition: all 0.3s ease;
width: 40%;
padding: 5px 10px 5px 15px;
}

#linksbox ul li:hover {
background-color: #e9ecef;
}

#linksbox input.form-control {
padding: 10px;
width: 90%;
margin: 10px 0;
border: 2px solid #007bff;
border-radius: 6px;
font-size: 16px;
color: #495057;
overflow-x: scroll;
}

#linksbox input.form-control:focus {
outline: none;
border-color: #0056b3;
}

#linksbox span {
font-size: 0.9rem;
color: #6c757d;
}

#linksbox a {
color: #007bff;
text-decoration: none;
}

#linksbox a:hover {
text-decoration: underline;
}

.footer {
position: relative;
left: 0;
background-color: var(--primary-color);
color: var(--secondary-color);
padding: 20px 0;
text-align: center;
font-family: 'Arial', sans-serif;
position:relative;
bottom: 0;
width: 100%;
box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.3);
}

.footer p {
margin: 0;
font-size: 1.1rem;
}

.footer a {
color: #1abc9c;
text-decoration: none;
font-weight: bold;
transition: color 0.3s ease;
}

.footer a:hover {
color: #16a085;
}

.footer::before {
content: '';
display: block;
width: 50px;
height: 3px;
background: #1abc9c;
margin: 0 auto 10px;
border-radius: 3px;
}
.errorbox {
align-items: center;
flex-direction: column;
gap:10px !important;
}
.errorbox #linksbox {
width: 90%;
}
h2{
text-align: center;
}
/* media quaries */
@media only screen and (max-width: 1060px) {
#imagebox img {
width: 400px;
height: 400px;
}
}
@media only screen and (max-width: 900px) {
#imagebox img {
width: 300px;
height: 300px;
}
#linksbox ul li {
width: 90%;
}
}
@media only screen and (max-width: 720px) {
#imagebox img {
width: 80vw;
}
#linksbox {
width: 90%;
}
#subhead{
font-size: 1rem;
}
}
99 changes: 58 additions & 41 deletions views/foodish.ejs
Original file line number Diff line number Diff line change
@@ -1,58 +1,75 @@
<!DOCTYPE html>
<html>

<head>
<title>Foodish</title>
<!-- Logo -->
<link rel="shortcut icon" href="/assets/logo.ico">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Lobster&display=swap" rel="stylesheet">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<title>Foodish</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Logo -->
<link rel="shortcut icon" href="/assets/logo.ico">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Lobster&display=swap" rel="stylesheet">
<!-- CSS -->
<link rel="stylesheet" href="/assets/styles.css">
</head>

<body>
<div class="container">
<h1><img src="/assets/logo.png" alt="logo" title="Samosa" height="60"/> Foodish</h1>
<p class="lead">&#x1F372; Random pictures of food dishes. &#x1F35B;</p>
<div class="row align-items-center">
<div class="col">
<div>
<div id="nav">
surhud004 marked this conversation as resolved.
Show resolved Hide resolved
<img src="/assets/logo.png" alt="logo" title="Samosa" height="60" /> Foodish
<br>
</div>
<p id="subhead">&#x1F372; Random pictures of food dishes. &#x1F35B;</p>
<div id="mainbox">
<div id="imagebox">
<% if (food.image) { %>
<img src="/images/<%= food.image %>" alt="foodish"/>
<% } %>
<img src="/images/<%= food.image %>" alt="foodish" />
<% } %>
</div>
<div class="col">
<div id="linksbox">
<% if (food.foodDB) { %>
<ul>
<% food.foodDB.forEach((dish) => { %>
<% if (dish.title === 'Total Foodishes') { %>
<li><%= dish.title %> : <%= dish.count %></li>
<% } else { %>
<li><a href="https://foodish-api.com/images/<%= dish.title %>/"><%= dish.title %></a> : <%= dish.count %></li>
<% } %>
<% }) %>
<% food.foodDB.forEach((dish)=> { %>
<% if (dish.title==='Total Foodishes' ) { %>
<li>
<%= dish.title %> : <%= dish.count %>
</li>
<% } else { %>
<li><a href="https://foodish-api.com/images/<%= dish.title %>/">
<%= dish.title %>
</a> : <%= dish.count %>
</li>
<% } %>
<% }) %>
</ul>
<% } %>
<% if (food.image) { %>
<span>Share this foodish : </span>
<input type="text" class="form-control" value="https://foodish-api.com/images/<%= food.image %>"/>
<% } %>
<br>
<span>API available at : <a href="https://foodish-api.com/api/">https://foodish-api.com/api/</a></span>
<br>
<span>Read the Documentation at : <a href="https://github.com/surhud004/Foodish#readme">Foodish</a></span>
<br>
<br>
<span>Try a Random Burger : <a href="https://foodish-api.com/images/burger/">https://foodish-api.com/images/burger/</a></span>
<br>
<span>Try an Unknown Foodish : <a href="https://foodish-api.com/images/somefoodish/">https://foodish-api.com/images/somefoodish/</a></span>
</div>
<% } %>
<% if (food.image) { %>
<span>Share this foodish : </span>
<input type="text" class="form-control"
value="https://foodish-api.com/images/<%= food.image %>" />
<% } %>
<br>
<span>API available at : <a
href="https://foodish-api.com/api/">https://foodish-api.com/api/</a></span>
<br>
<span>Read the Documentation at : <a
href="https://github.com/surhud004/Foodish#readme">Foodish</a></span>
<br>
<br>
<span>Try a Random Burger : <a
href="https://foodish-api.com/images/burger/">https://foodish-api.com/images/burger/</a></span>
<br>
<span>Try an Unknown Foodish : <a
href="https://foodish-api.com/images/somefoodish/">https://foodish-api.com/images/somefoodish/</a></span>
</div>
</div>
<footer class="footer">
<p class="lead">Designed and Coded by : <a href="https://github.com/surhud004">surhud004</a> &copy; 2020 - <%= new Date().getFullYear(); %></p>
<!-- Build date : 10th October 2020 -->
</footer>
</div>
</div>
<footer class="footer">
<p class="lead">Designed and Coded by : <a href="https://github.com/surhud004">surhud004</a> &copy; 2020 - <%=
new Date().getFullYear(); %>
</p>
<!-- Build date : 10th October 2020 -->
</footer>
</body>

</html>
Loading