Skip to content
Draft
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
121 changes: 121 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,127 @@ input[type="email"]:focus, input[type="password"]:focus, input[type="text"]:focu
}
}

.shop-directory-table-wrapper {
overflow-x: auto;
}

.shop-directory-table {
width: 100%;
border-spacing: 0;
}

.shop-directory__item-content,
.shop-directory__owner-content {
display: flex;
align-items: center;
gap: 0.75rem;
}

.shop-directory__item-image {
width: 48px;
height: 48px;
border-radius: 8px;
object-fit: cover;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shop-directory__item-name {
font-weight: 600;
color: inherit;
}

.shop-directory__owner-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
object-fit: cover;
}

.shop-directory__owner-name {
font-weight: 600;
}

.shop-directory__location code {
word-break: break-word;
}

@media (max-width: 992px) {
.shop-directory__item-image {
width: 40px;
height: 40px;
}
}

@media (max-width: 768px) {
.shop-directory-table-wrapper {
overflow: visible;
}

.shop-directory-table thead {
display: none;
}

.shop-directory-table,
.shop-directory-table tbody,
.shop-directory-table tr,
.shop-directory-table td {
display: block;
width: 100%;
}

.shop-directory-table tbody {
display: flex;
flex-direction: column;
gap: 1.25rem;
}

.shop-directory-table tbody tr {
border: 1px solid rgba(47, 80, 140, 0.2);
border-radius: 16px;
padding: 1.25rem;
background: rgba(255, 255, 255, 0.95);
box-shadow: 0 16px 32px rgba(15, 23, 42, 0.06);
}

.shop-directory-table tbody tr td {
padding: 0.35rem 0;
font-size: 0.95rem;
}

.shop-directory-table tbody tr td:not(:last-child) {
border-bottom: 1px solid rgba(111, 139, 164, 0.15);
}

.shop-directory-table tbody tr td::before {
content: attr(data-label);
display: block;
font-size: 0.75rem;
letter-spacing: 0.06em;
font-weight: 700;
text-transform: uppercase;
color: #6f8ba4;
margin-bottom: 0.2rem;
}

.shop-directory__item-content,
.shop-directory__owner-content {
gap: 0.5rem;
}

.shop-directory__item-name,
.shop-directory__owner-name {
font-size: 1rem;
}

.shop-directory-table code {
font-size: 1rem;
background: rgba(47, 80, 140, 0.08);
border-radius: 8px;
padding: 0.35rem 0.5rem;
display: inline-block;
}
}

.overly-2 {
position: relative;
}
Expand Down
64 changes: 41 additions & 23 deletions views/shopdirectory.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,44 @@

<section class="section">
<div class="container">
<table id="shopTable" class="display">
<thead>
<tr>
<th>Item</th>
<th>Shop Owner</th>
<th>Amount</th>
<th>Price</th>
<th>Stock</th>
<th>Location</th>
</tr>
</thead>
<tbody>
<% shopApiData.data.forEach(shop => { %>
<div class="shop-directory-table-wrapper">
<table id="shopTable" class="display shop-directory-table">
<thead>
<tr>
<td><img src="<%= shop.itemData.image %>" alt="<%= shop.itemData.displayName %>"> <%= shop.itemData.displayName %></td>
<td><img src="<%= shop.userData.profilePicture %>" alt="<%= shop.userData.username %>" height="20px"> <a href="/profile/<%= shop.userData.username %>"><%= shop.userData.username %></a></td>
<td><code><%= shop.amount %></code></td>
<td><code><%= shop.price %></code></td>
<td><code><%= shop.stock %></code></td>
<td><code><%= shop.x %>, <%= shop.y %>, <%= shop.z %></code></td>
<th>Item</th>
<th>Shop Owner</th>
<th>Amount</th>
<th>Price</th>
<th>Stock</th>
<th>Location</th>
</tr>
<% }) %>
</tbody>
</table>
</thead>
<tbody>
<% shopApiData.data.forEach(shop => { %>
<tr>
<td data-label="Item" class="shop-directory__item">
<div class="shop-directory__item-content">
<img src="<%= shop.itemData.image %>" alt="<%= shop.itemData.displayName %>" class="shop-directory__item-image" loading="lazy">
<span class="shop-directory__item-name"><%= shop.itemData.displayName %></span>
</div>
</td>
<td data-label="Shop Owner" class="shop-directory__owner">
<div class="shop-directory__owner-content">
<img src="<%= shop.userData.profilePicture %>" alt="<%= shop.userData.username %>" class="shop-directory__owner-avatar" loading="lazy">
<a href="/profile/<%= shop.userData.username %>" class="shop-directory__owner-name"><%= shop.userData.username %></a>
</div>
</td>
<td data-label="Amount"><code><%= shop.amount %></code></td>
<td data-label="Price"><code><%= shop.price %></code></td>
<td data-label="Stock"><code><%= shop.stock %></code></td>
<td data-label="Location" class="shop-directory__location">
<code><%= shop.x %>, <%= shop.y %>, <%= shop.z %></code>
</td>
</tr>
<% }) %>
</tbody>
</table>
</div>
</div>

<script>
Expand All @@ -44,7 +58,11 @@
"paging": true,
"searching": true,
"ordering": true,
"info": true
"info": true,
"pageLength": 25,
"lengthChange": false,
"deferRender": true,
"responsive": true
});
});
</script>
Expand Down