Skip to content
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
48 changes: 46 additions & 2 deletions app/assets/stylesheets/components/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,52 @@
padding: 0px 16px 16px 16px;
}

.cards img {
height: 300px;
// .cards img {
// height: 300px;
// width: 100%;
// }

.drum-card {
width: 200px;
height: 200px;
img {
display: block;
width: 100%;
height: auto;
object-fit: cover;
}
}

.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .5s ease;
background-color: rgba(0,0,0,0.3);
}

.drum-card:hover .overlay {
opacity: 1;
}

.text {
color: white;
font-size: small;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
text-align: center;
width: 150px;
.item-name {
font-size: medium;
font-weight: bold;
}
}
26 changes: 26 additions & 0 deletions app/assets/stylesheets/components/_footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.footer {
background: #F4F4F4;
display: flex;
align-items: center;
justify-content: flex-end;
height: 100px;
padding: 0px 50px;
color: rgba(0,0,0,0.3);
}

.footer-links {
display: flex;
align-items: center;
}

.footer-links a {
color: black;
opacity: 0.15;
text-decoration: none;
font-size: 24px;
padding: 0px 10px;
}

.footer-links a:hover {
opacity: 1;
}
1 change: 1 addition & 0 deletions app/assets/stylesheets/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
@import "navtab";
@import "carousel";
@import "description";
@import "footer";
10 changes: 10 additions & 0 deletions app/assets/stylesheets/pages/_global.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
body {
background-color: white;
}

.flex-wrapper {
display: flex;
min-height: 100vh;
flex-direction: column;
justify-content: space-between
}
3 changes: 0 additions & 3 deletions app/assets/stylesheets/pages/global.scss

This file was deleted.

11 changes: 0 additions & 11 deletions app/views/items/_cymbals.html.erb

This file was deleted.

11 changes: 0 additions & 11 deletions app/views/items/_hardwares.html.erb

This file was deleted.

28 changes: 18 additions & 10 deletions app/views/items/_items.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<div class="container my-5">
<div class="cards">
<% @items.each do |item| %>
<% item.photos.each_with_index do |photo, index| %>
<% if index == 0 %>
<%= link_to (cl_image_tag photo.key, width: 400, height: 300, crop: :fit), item_path(item) %>
<% end %>
<% end %>
<% item.photos.each_with_index do |photo, index| %>
<% if index == 0 %>
<%= link_to item_path(item) do%>
<div class="drum-card container">
<%= cl_image_tag photo.key, width: 400, height: 300, crop: :fit %>
<div class="overlay">
<div class="text">
<p>
<span class="item-name"><%= item.name %></span><br>
from <%= item.brand %><br>
$<%= item.price %>
</p>
</div>
</div>
</div>
<% end %>
</div>
</div>
<% end %>
<% end %>

12 changes: 0 additions & 12 deletions app/views/items/_kits.html.erb

This file was deleted.

11 changes: 0 additions & 11 deletions app/views/items/_misc.html.erb

This file was deleted.

11 changes: 0 additions & 11 deletions app/views/items/_snares.html.erb

This file was deleted.

60 changes: 54 additions & 6 deletions app/views/items/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,60 @@
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab"><%= render 'items' %></div>
<div class="tab-pane fade" id="kits" role="tabpanel" aria-labelledby="kits-tab"><%= render 'kits' %></div>
<div class="tab-pane fade" id="snares" role="tabpanel" aria-labelledby="snares-tab"><%= render 'snares' %></div>
<div class="tab-pane fade" id="cymbals" role="tabpanel" aria-labelledby="cymbals-tab"><%= render 'cymbals' %></div>
<div class="tab-pane fade" id="hardware" role="tabpanel" aria-labelledby="hardware-tab"><%= render 'hardwares' %></div>
<div class="tab-pane fade" id="misc" role="tabpanel" aria-labelledby="misc-tab"><%= render 'misc' %></div>
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
<div class="container my-5">
<div class="cards">
<% @items.each do |item| %>
<%= render partial: 'items', locals: { item: item } %>
<% end %>
</div>
</div>
</div>
<div class="tab-pane fade" id="kits" role="tabpanel" aria-labelledby="kits-tab">
<div class="container my-5">
<div class="cards">
<% @items.where(category: 'Kit').each do |item| %>
<%= render partial: 'items', locals: { item: item } %>
<% end %>
</div>
</div>
</div>
<div class="tab-pane fade" id="snares" role="tabpanel" aria-labelledby="snares-tab">
<div class="container my-5">
<div class="cards">
<% @items.where(category: 'Snare').each do |item| %>
<%= render partial: 'items', locals: { item: item } %>
<% end %>
</div>
</div>
</div>
<div class="tab-pane fade" id="cymbals" role="tabpanel" aria-labelledby="cymbals-tab">
<div class="container my-5">
<div class="cards">
<% @items.where(category: 'Cymbal').each do |item| %>
<%= render partial: 'items', locals: { item: item } %>
<% end %>
</div>
</div>
</div>
<div class="tab-pane fade" id="hardware" role="tabpanel" aria-labelledby="hardware-tab">
<div class="container my-5">
<div class="cards">
<% @items.where(category: 'Hardware').each do |item| %>
<%= render partial: 'items', locals: { item: item } %>
<% end %>
</div>
</div>
</div>
<div class="tab-pane fade" id="misc" role="tabpanel" aria-labelledby="misc-tab">
<div class="container my-5">
<div class="cards">
<% @items.where(category: 'Misc').each do |item| %>
<%= render partial: 'items', locals: { item: item } %>
<% end %>
</div>
</div>
</div>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/items/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<h1><span class="half_background"><%= @item.name %></span></h1>
<p>from <%= @item.brand %></p>
<p class="drum-details"><%= @item.details %></p>
<p class="drum-price"><%= @item.price %></p>
<p class="drum-price">$<%= @item.price %></p>
<p><span>Condition:</span> <%= @item.condition %></p>

<%= link_to 'Contact us', "#", class: 'btn btn-dark'%>
Expand Down
9 changes: 8 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@

<body>
<%= render 'shared/flashes' %>
<%= yield %>
<div class="flex-wrapper">
<div>
<%= yield %>
</div>
<div>
<%= render 'shared/footer' %>
</div>
</div>
</body>
</html>
7 changes: 7 additions & 0 deletions app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="footer">
<div class="footer-links">
<a href="/">DrumFX</a>
<a href="#">Contact us</a>
<a href="#"><i class="fab fa-facebook"></i></a>
</div>
</div>