-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathUnimplementedCards.php
58 lines (53 loc) · 2.92 KB
/
UnimplementedCards.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
include_once 'MenuBar.php';
include_once 'Header.php';
include_once 'GeneratedCode/GeneratedCardDictionaries.php';
?>
<style>
body {
background-size: cover;
background-position: center;
background-image: url('./Images/gamebg.jpg');
width: 100%;
min-height: 100vh;
margin: 0;
background-repeat: no-repeat;
background-attachment: fixed;
}
</style>
<div class="core-wrapper" style="height: auto; padding-bottom: 40px;">
<div class="game-browser-wrapper">
<div class="game-browser container bg-black" style="height: auto; margin-right: 20px;">
<div style="text-align: center; margin-top: 4px;">
<h2>Unimplemented Cards</h2>
<p style="margin-bottom: 20px;">Recently revealed cards (less than 2 days old) may not appear in this list yet as they need to be registered in our servers first</p>
</div>
<div class="container" style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px;">
<?php
$files = glob('./UnimplementedCards/*.{jpg,jpeg,png,gif,webp}', GLOB_BRACE);
foreach($files as $file) {
$filename = basename($file);
$cardId = pathinfo($filename, PATHINFO_FILENAME);
$cardName = CardTitle($cardId);
// Get image dimensions
list($width, $height) = getimagesize($file);
$isLandscape = $width > $height;
// Calculate styles for landscape images
$rotateStyle = $isLandscape ? 'transform: rotate(90deg);' : '';
$containerStyle = 'position: relative; padding-top: 140%;'; // Aspect ratio container
$imgWrapperStyle = 'position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;';
$imgStyle = $isLandscape ? 'max-width: 140%; max-height: 100%; border-radius: 4px;' : 'max-width: 100%; max-height: 100%; border-radius: 4px;';
echo "<div style='background: rgba(255,255,255,0.1); padding: 10px; border-radius: 8px; display: flex; flex-direction: column;'>";
echo "<div style='$containerStyle'>";
echo "<div style='$imgWrapperStyle'>";
echo "<img src='UnimplementedCards/$filename' alt='$cardName' style='$imgStyle $rotateStyle'>";
echo "</div>";
echo "</div>";
echo "<div style='margin-top: 10px; margin-bottom: 4px; text-align: center; font-size: 14px; font-weight: 500; color: #fff; display: flex; align-items: center; justify-content: center; flex: 1;'>$cardName</div>";
echo "</div>";
}
?>
</div>
</div>
</div>
</div>