Skip to content

Commit

Permalink
styling home page, and navbar according to user
Browse files Browse the repository at this point in the history
  • Loading branch information
fichimura committed Mar 26, 2024
1 parent 0f5cef0 commit 4c8f0e3
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 33 deletions.
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ if (process.env.NODE_ENV !== 'production') {
require('dotenv').config();
}

console.log(process.env.SECRET);

const express = require('express');
const path = require('path');
Expand Down
22 changes: 22 additions & 0 deletions public/stylesheets/home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
body {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
url("https://source.unsplash.com/HTVUiryU9eo");
background-size: auto;
background-position: 50% 5%;
;
;
text-shadow: 0 0.05rem 0.1rem rgba(0, 0, 0, 0.5);
box-shadow: inset 0 0 5rem rgba(0, 0, 0, 0.5);
}

.home-text {
color: white
}

a {
text-decoration: none;
}

a:hover {
color: #2e86c1;
}
52 changes: 27 additions & 25 deletions views/home.ejs
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
<% layout('layouts/boilerplate') %>
<div class="d-flex flex-row justify-content-between">
<div>
<h2>Meerkat</h2>
<p>Meerkat is an app to test node, mongodb(Mongoose), express, ejs, and
other aspects of development. In this scenario, this application is developed to
enable the user to save its favorite Audiovisuals. This category gathers movies, series, documentaries
and others type of productions similar to these ones. Also the user can make reviews about these
audiovisuals in the application. </p>
<% if(currentUser){ %>
<% layout('layouts/boilerplate') %>
<%- include('./partials/home.ejs')%>
<%} else {%>
<p>
The app is the result of a course in Udemy, which is
taught by Colt Steele. The name of the course is <strong>The Web Developer Bootcamp 2024.</strong>
</p>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Meerkat</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
crossorigin="anonymous">
<link rel="stylesheet" href="/stylesheets/home.css">
</head>
<p>
The influence for the name of the app is from the animal found in souther Africa, which can be also
called suricate.
Moreover, the choose was because of Timon from The Lion King.
<a href="https://en.wikipedia.org/wiki/Meerkat"> More information of this animal in Wikipedia</a>
</p>
</div>

<div class="ms-3 my-5">
<img class="img-fluid" src="https://source.unsplash.com/HTVUiryU9eo">
</div>
</div>
<body>
<div class="flex-column">
<div class="home-text">
<%- include('./partials/home.ejs')%>
</div>
<div class="col-6 offset-3 d-inline-flex justify-content-around mt-3 mb-3">
<% if (!currentUser)%>
<a class="home-text lead" href="/signin">Sign in</a>
<a class="home-text lead" href="/signup">Sign up</a>
</div>
</div>
</body>
<% } %>
27 changes: 27 additions & 0 deletions views/partials/home.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<div class="d-flex flex-row justify-content-between col-6 offset-3 align-self-center">
<div class="mt-5">
<h3>Meerkat</h3>
<p class="lead">Meerkat is an app to test node, mongodb(Mongoose), express, ejs, and
other aspects of development. In this scenario, this application is developed to
enable the user to save its favorite Audiovisuals. This category gathers movies, series, documentaries
and others type of productions similar to these ones. Also the user can make reviews about these
audiovisuals in the application. </p>

<p class="lead">
The app is the result of a course in Udemy, which is
taught by Colt Steele. The name of the course is <strong>The Web Developer Bootcamp 2024.</strong>
</p>

<p class="lead">
The influence for the name of the app is from the animal found in souther Africa, which can be also
called suricate.
Moreover, the choose was because of Timon from The Lion King.
<a href="https://en.wikipedia.org/wiki/Meerkat"> More information of this animal in Wikipedia</a>
</p>
</div>
<%if(currentUser) {%>
<div class="ms-3 mt-5">
<img class="img-fluid" src="https://source.unsplash.com/HTVUiryU9eo">
</div>
<%}%>
</div>
27 changes: 20 additions & 7 deletions views/partials/navbar.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nav class="navbar navbar-expand-lg bg-body-tertiary mb-3" data-bs-theme="dark">
<nav id="navbar" class="navbar navbar-expand-lg bg-body-tertiary mb-3" data-bs-theme="dark">
<div class="container-fluid">
<a class="navbar-brand" href="/">Meerkat</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
Expand All @@ -13,11 +13,6 @@
<li class="nav-item">
<a class="nav-link" href="/audiovisuals">Audiovisuals</a>
</li>
<%if(currentUser){ %>
<li class="nav-item">
<a class="nav-link" href="/userReviews">User reviews</a>
</li>
<%}%>
</ul>
</div>
<div class="navbar-nav ml-auto">
Expand All @@ -26,7 +21,25 @@
<a class="nav-link" href="/signup">Sign up</a>
<% }else{ %>
<a class="nav-link" href="/signout">Sign out</a>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown"
aria-expanded="false">
<%= currentUser.username %>
</a>
<ul class="dropdown-menu dropdown-menu-lg-end">
<li class="nav-item">
<a class="dropdown-item" href="/userReviews">
<%=currentUser.username%> reviews
</a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li> <a class="nav-link" href="/signout">Sign out</a></li>
</ul>
</li>
<%} %>
</div>
</div>
Expand Down

0 comments on commit 4c8f0e3

Please sign in to comment.