Skip to content

Commit

Permalink
Merge pull request #92 from JessamineCodes/stop-dashboard-squirrel-in…
Browse files Browse the repository at this point in the history
…ifnite-bounce

bounce in to squirrel on dashboard
  • Loading branch information
JessamineCodes authored Mar 16, 2023
2 parents d2a5ac8 + b16f36d commit f4bd9db
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 21 deletions.
44 changes: 26 additions & 18 deletions app/assets/stylesheets/pages/_dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,31 @@ object-fit: contain;

}

.squirrel-img{
width: 35%;
bottom: auto;
position: absolute;
left: 950px;
top: 30%;
animation: bounce 2s ease;

img {
width: 100%;
height: 510px;
object-fit: contain;
}

@keyframes bounce {
0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
40% {transform: translateY(-30px);}
60% {transform: translateY(-15px);}
};
.squirrel-img-dashboard {
width: 35%;
bottom: auto;
position: absolute;
left: 950px;
top: 30%;
animation: bounce-in-right 2s ease;

img {
width: 100%;
height: 510px;
object-fit: contain;
}

@keyframes bounce-in-right {
0% {
opacity: 0;
transform: translateX(2000px);
}
60% {
opacity: 1;
transform: translateX(-30px);
}
80% { transform: translateX(10px); }
100% { transform: translateX(0); }
}
}
8 changes: 7 additions & 1 deletion app/assets/stylesheets/pages/_graduation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@
animation-delay: -2.5s;
background-color: #f9c4ea;
}
.squirrel {
.squirrel-graduation {
z-index:10;
animation: bounce 1.5s infinite;

@keyframes bounce {
0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
40% {transform: translateY(-30px);}
60% {transform: translateY(-15px);}
};
}
2 changes: 1 addition & 1 deletion app/views/pages/dashboard.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</div>
</div>

<div class="squirrel-img">
<div class="squirrel-img-dashboard">
<% if current_user.level == 0 %>
<%= image_tag "Original Sammy.png", class:"squirrel" %>
<% elsif current_user.level== 1%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/graduation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div>
<h1>Congratulations, <%= current_user.first_name %>!</h1>
</div>
<%= link_to dashboard_path, class: "w-25 squirrel" do %>
<%= link_to dashboard_path, class: "w-25 squirrel-graduation" do %>
<%= image_tag "Sammy Chal 3.png" , class:"w-100" %>
<% end %>
<h2 class="mt-4">You've graduated spy school!</h2>
Expand Down

0 comments on commit f4bd9db

Please sign in to comment.