summaryrefslogtreecommitdiff
path: root/pages/relations.php
blob: 54fc4ec3d2863f5da33ac3b5af23794a43adb8a4 (plain)
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
59
60
61
62
63
64
65
66
<?php $title = "Relations"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; ?>

<br>
<div class="container">
    <div id="page-content">
        <h2>Relations</h2>
        <?php foreach (scoreOrderGlobal() as $member): if (count($member["_metadata"]["marefriends"]) > 0 || count($member["_metadata"]["sisters"]) > 0): ?>
        <div class="relation" style="background-color:rgba(255, 255, 255, .1);margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr 2fr;">
            <a class="relation-intro" style="background-color:rgba(255, 255, 255, .05);border-right:1px solid rgba(255, 255, 255, .1);margin:-10px;padding:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;color: white;text-decoration: none;" href="/<?= $member["_system"] === "gdapd" ? "raindrops" : "cloudburst" ?>/<?= $member["name"] ?>">
                <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member['name'] . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
            </a>

            <div class="relation-item relation-item-marefriends" style="margin-left:10px;padding:0 20px;">
                <b style="padding-right:5px;">Marefriends:</b><span class="list-separator-mobile"><br></span>
                <?php if (count($member["_metadata"]["marefriends"]) === 0): ?>
                    <span class="text-muted">None</span>
                <?php else: ?>
                    <?php $index = 0; foreach ($member["_metadata"]["marefriends"] as $id): $mfSystem = explode("/", $id)[0]; $marefriend = getSystemMember(explode("/", $id)[0], explode("/", $id)[1]); ?>
                        <a class="member-link" href="/<?= $mfSystem === "gdapd" ? "raindrops" : "cloudburst" ?>/<?= $marefriend["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $marefriend['name'] . ".png") ? "-" . $marefriend['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($marefriend["display_name"] ?? $marefriend["name"]) ?></a><?php if ($index + 2 <= count($member["_metadata"]["marefriends"])) echo('<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>'); $index++; ?>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>

            <div class="relation-item relation-item-sisters" style="padding:0 20px;">
                <b style="padding-right:5px;">Sisters:</b><span class="list-separator-mobile"><br></span>
                <?php if (count($member["_metadata"]["sisters"]) === 0): ?>
                    <span class="text-muted">None</span>
                <?php else: ?>
                    <?php $index = 0; foreach ($member["_metadata"]["sisters"] as $id): $mfSystem = explode("/", $id)[0]; $marefriend = getSystemMember(explode("/", $id)[0], explode("/", $id)[1]); ?>
                    <a class="member-link" href="/<?= $mfSystem === "gdapd" ? "raindrops" : "cloudburst" ?>/<?= $marefriend["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $marefriend['name'] . ".png") ? "-" . $marefriend['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($marefriend["display_name"] ?? $marefriend["name"]) ?></a><?php if ($index + 2 <= count($member["_metadata"]["sisters"])) echo('<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>'); $index++; ?>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>
        </div>
        <?php endif; endforeach; ?>
    </div>

    <style>
        @media (max-width: 991px) {
            .relation {
                grid-template-columns: 1fr !important;
            }

            .relation-intro {
                text-align: center;
                border-bottom-left-radius: 0 !important;
                border-top-right-radius: 10px;
                border-right: none !important;
                border-bottom: 1px solid rgba(255, 255, 255, .1);
            }

            .relation-item-marefriends {
                margin-top: 20px !important;
            }

            .relation-item {
                margin-top: 10px;
                margin-left: 0 !important;
                padding: 10px 0 !important;
                text-align: center;
            }
        }
    </style>
</div>

<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>