feat: screenshots only for selected device

This commit is contained in:
relikd
2024-02-29 23:36:28 +01:00
parent bcdbaaf399
commit 17a0014b58
3 changed files with 7 additions and 3 deletions

View File

@@ -71,7 +71,8 @@
<div>$IMG</div> <div>$IMG</div>
<p>$DESCRIPTION</p> <p>$DESCRIPTION</p>
</div> </div>
<a class="screenshot" href="$REF" target="_blank"><img src="$URL"></a> <a class="screenshot" href="$REF" target="_blank"><img src="$URL" crossorigin="anonymous"
referrerpolicy="no-referrer"></a>
<div class="randomAction"> <div class="randomAction">
Actions: Actions:
<button onclick="searchBundle($IDX, '&random=$IDX')">Show all versions</button> <button onclick="searchBundle($IDX, '&random=$IDX')">Show all versions</button>

View File

@@ -209,12 +209,13 @@ function randomIPA(specificId) {
const info = obj.results[0]; const info = obj.results[0];
const imgs1 = info.screenshotUrls; const imgs1 = info.screenshotUrls;
const imgs2 = info.ipadScreenshotUrls; const imgs2 = info.ipadScreenshotUrls;
const device = document.getElementById('device').value || 255;
var imgStr = ''; var imgStr = '';
if (imgs1 && imgs1.length > 0) { if (imgs1 && imgs1.length > 0 && device & 1) {
imgStr += '<p>iPhone Screenshots:</p>' + urlsToImgs(redirectUrl, imgs1); imgStr += '<p>iPhone Screenshots:</p>' + urlsToImgs(redirectUrl, imgs1);
} }
if (imgs2 && imgs2.length > 0) { if (imgs2 && imgs2.length > 0 && device & 2) {
imgStr += '<p>iPad Screenshots:</p>' + urlsToImgs(redirectUrl, imgs2); imgStr += '<p>iPad Screenshots:</p>' + urlsToImgs(redirectUrl, imgs2);
} }

View File

@@ -95,6 +95,8 @@ h4 {
.carousel img { .carousel img {
max-height: 330px; max-height: 330px;
margin: 8px; margin: 8px;
min-width: 100px;
min-height: 100px;
} }
.itunes p { .itunes p {
white-space: pre-wrap; white-space: pre-wrap;