Skip to content

Commit 34809a8

Browse files
committed
Add additional info to store item page
1 parent 87b3212 commit 34809a8

File tree

1 file changed

+90
-5
lines changed

1 file changed

+90
-5
lines changed

store-item.html

Lines changed: 90 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,46 @@
141141
.dropdown-item:hover {
142142
background-color: #f5f5f5;
143143
}
144+
145+
.store-item-details {
146+
margin-top: 20px;
147+
}
148+
149+
.info-tile {
150+
margin-top: 20px;
151+
margin-bottom: 20px;
152+
padding: 15px;
153+
background-color: #fff;
154+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
155+
border-radius: 0.75rem;
156+
border: 1px solid #e5e7eb;
157+
display: flex;
158+
justify-content: space-around;
159+
align-items: center;
160+
}
161+
162+
.info-item {
163+
display: flex;
164+
align-items: center;
165+
gap: 10px; /* Adds spacing between the icon and the text content */
166+
}
167+
168+
.info-item div {
169+
display: flex;
170+
flex-direction: column;
171+
justify-content: center;
172+
gap: 4px; /* Adds spacing between label and value */
173+
}
174+
175+
.info-item strong {
176+
font-weight: bold;
177+
font-size: 14px;
178+
}
179+
180+
.info-item span {
181+
font-size: 12px;
182+
color: #555; /* Adjust to your desired color */
183+
}
144184
</style>
145185
</head>
146186
<body>
@@ -253,8 +293,8 @@
253293
<div class="container">
254294
<div class="header">
255295
<div>
256-
<h1 id="item-title">Item Title</h1>
257-
<p class="author" id="item-author">by Author Name</p>
296+
<h1 id="item-title"></h1>
297+
<p class="author" id="item-author"></p>
258298
</div>
259299
<div class="download-button">
260300
<div class="download-main" id="download-main">
@@ -297,9 +337,10 @@ <h1 id="item-title">Item Title</h1>
297337
</div>
298338
</div>
299339
<div class="description" id="item-description">
300-
<p>
301-
Item description goes here. It will be replaced dynamically.
302-
</p>
340+
<p></p>
341+
</div>
342+
<div class="store-item-details">
343+
<div class="info-tile" id="infoTile"></div>
303344
</div>
304345
<div class="screenshot-container">
305346
<img
@@ -343,6 +384,50 @@ <h2>More patches</h2>
343384
"thumbnails/webp/" + item.StoreThumb + ".webp";
344385
document.getElementById("item-thumb").alt = item.Title;
345386

387+
const infoTile = document.getElementById("infoTile");
388+
389+
// Build content dynamically based on available data
390+
let tileContent = "";
391+
if (item["Release date"]) {
392+
tileContent += `
393+
<div class="info-item">
394+
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
395+
<path d="M15.25 13.5h-4a.75.75 0 0 1-.75-.75v-6a.75.75 0 0 1 1.5 0V12h3.25a.75.75 0 0 1 0 1.5ZM12 2C6.478 2 2 6.478 2 12s4.478 10 10 10 10-4.478 10-10S17.522 2 12 2Z" fill="#212121"/>
396+
</svg>
397+
<div>
398+
<strong>Release Date</strong>
399+
<span>${item["Release date"]}</span>
400+
</div>
401+
</div>`;
402+
}
403+
if (item.Size) {
404+
tileContent += `
405+
<div class="info-item">
406+
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
407+
<path d="M5 7h14a3 3 0 0 1 2.995 2.824L22 10v4a3 3 0 0 1-2.824 2.995L19 17H5a3 3 0 0 1-2.995-2.824L2 14v-4a3 3 0 0 1 2.824-2.995L5 7h14H5Zm13 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm-4 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" fill="#212121"/>
408+
</svg>
409+
<div>
410+
<strong>Size</strong>
411+
<span>${item.Size}</span>
412+
</div>
413+
</div>`;
414+
}
415+
if (item.Price) {
416+
tileContent += `
417+
<div class="info-item">
418+
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
419+
<path d="M2 6.75C2 5.784 2.784 5 3.75 5h13.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 17.25 17H3.75A1.75 1.75 0 0 1 2 15.25v-8.5Zm3-.5v1a.75.75 0 0 1-.75.75h-1v1.5h1A2.25 2.25 0 0 0 6.5 7.25v-1H5Zm5.5 7.25a2.25 2.25 0 1 0 0-4.5 2.25 2.25 0 0 0 0 4.5Zm-7.25.5h1a.75.75 0 0 1 .75.75v1h1.5v-1a2.25 2.25 0 0 0-2.25-2.25h-1V14Zm12.75.75a.75.75 0 0 1 .75-.75h1v-1.5h-1a2.25 2.25 0 0 0-2.25 2.25v1H16v-1Zm0-7.5v-1h-1.5v1a2.25 2.25 0 0 0 2.25 2.25h1V8h-1a.75.75 0 0 1-.75-.75Z" fill="#212121"/>
420+
<path d="M4.401 18.5A2.999 2.999 0 0 0 7 20h10.25A4.75 4.75 0 0 0 22 15.25V10c0-1.11-.603-2.08-1.5-2.599v7.849a3.25 3.25 0 0 1-3.25 3.25H4.401Z" fill="#212121"/>
421+
</svg>
422+
<div>
423+
<strong>Price</strong>
424+
<span>${item.Price}</span>
425+
</div>
426+
</div>`;
427+
}
428+
429+
infoTile.innerHTML = tileContent;
430+
346431
let downloadButton =
347432
document.getElementById("download-main");
348433
const toggleButton =

0 commit comments

Comments
 (0)