Skip to content

Commit

Permalink
Merge pull request #16 from tatiananantes/UserExperience
Browse files Browse the repository at this point in the history
User experience
  • Loading branch information
willjshark authored Dec 16, 2021
2 parents 5057c94 + 51ece3d commit e574b77
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 14 deletions.
Binary file added app/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 43 additions & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ body {
font-family: "Source Sans Pro", sans-serif;
}

.navbar.bg-light {
.navbar {
position: fixed;
top: 0;
width: 100%;
background: white;
color: white;
box-shadow: 5px 0 5px -3px black;
}

.site-main-wrap {
Expand Down Expand Up @@ -77,3 +78,44 @@ body {
font-weight: 500;
}
}

#flash {
.flash.alert {
position: fixed;
bottom: 5%;
background: rgba(67,118,212, 0.8);
margin: 0 auto;
width: 40vw;
left: 30vw;
color: white;
text-align: center;
display: block;
padding: 20px;
animation-name: disappear;
opacity: 0;
animation-duration: 5s;
animation-iteration-count: 1;
}
}

.navbar-flex {
@media (min-width: 768px) {
display: flex;
width: 100%;
flex-direction: row;
align-items: center;
justify-content: space-between;
.inline-items {
.nav-link {
display: inline-block;
}
}
}
}


@keyframes disappear {
0% {opacity: 1;}
50% {opacity: 1;}
100% {opacity: 0;}
}
24 changes: 13 additions & 11 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@

<nav class="navbar navbar-expand-md navbar-light">
<div class="container-fluid">
<a class="navbar-brand" href="">ACEBOOK</a>
<a class="navbar-brand" href="/"><%= image_tag("logo.png", width: 100, :class=>"img-fluid") %></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<% if logged_in? %>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<ul class="navbar-nav navbar-flex">

<li class="nav-item">
<a class="nav-link active" aria-current="page" href="<%=logout_path%>">Logout</a>
<a class="nav-link" aria-current="page" href="<%=posts_path%>">PostFeed</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="<%=posts_path%>">PostFeed</a>
<li class="nav-item inline-items">
<span class="nav-link">Signed in as: <a href="/users/<%= current_user.id %>"><%= current_user.username %></a></span>
<a class="nav-link" aria-current="page" href="<%=logout_path%>">Logout</a>
</li>

</ul>

</div>
Expand All @@ -45,12 +46,13 @@
</div>
</nav>
<div class="site-main-wrap">
<div id="flash">
<% flash.each do |key, value| %>
<div class="flash <%= key %>"><%= value %></div>
<% end %>
</div>
<div class="container">
<div id="flash">
<% flash.each do |key, value| %>
<div class="flash <%= key %>"><%= value %></div>
<% end %>
</div>

<%= yield %>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sessions/login.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</div>
<% end %>
</div>
<p class="text-center soft-top" >Not yet a member? <a href="/">create an account</a> </p>
<p class="text-center soft-top" >Not yet a member? <a href="/">Create an account</a> </p>
</div>


2 changes: 1 addition & 1 deletion app/views/users/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</div>
<% end %>
</div>

<p class="text-center soft-top" >Already a member? <a href="/login">Login here</a> </p>
</div>
</div>

Binary file added storage/30/8e/308eev0uz96m0fc73xyll4p8yag4
Binary file not shown.
Binary file added storage/6p/gw/6pgw9e4g0dmkjwt2kcf8rygj322y
Binary file not shown.
Binary file added storage/b0/mk/b0mktgcempy5o46ryn68q7w9tjqg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit e574b77

Please sign in to comment.