aboutsummaryrefslogtreecommitdiff
path: root/index.php
blob: 17202a27b3715ecad48560126f0ac6ad61e9860f (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
<?php $title = null; require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/gui/header.php"; global $general; ?>

<div id="hero">
    <img src="/assets/img/icon.png" id="hero-img" alt="">
    <h1><?= $general["name"] ?></h1>
    <h4><?= $general["description"] ?></h4>
    <b>Current Fronter·s:</b> <?php

        $config = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/data/pluralkit.json"), true);
        $data = json_decode(file_get_contents("https://api.pluralkit.me/v2/systems/$config[system]/fronters"), true);

        foreach ($data["members"] as $index => $fronter) {
            if (is_string($fronter["display_name"]) && trim($fronter["display_name"]) !== "") {
                $dn = $fronter["display_name"];
            } else if (is_string($fronter["name"]) && trim($fronter["name"]) !== "") {
                $dn = $fronter["name"];
            } else {
                $dn = "(Unnamed)";
            }

            if ($index + 1 === count($data["members"])) {
                echo("<a href='/members/read/?m=$fronter[uuid]' class='text-white'>" . $dn . "</a>");
            } else if ($index + 2 === count($data["members"])) {
                echo("<a href='/members/read/?m=$fronter[uuid]' class='text-white'>" . $dn . "</a> and ");
            } else {
                echo("<a href='/members/read/?m=$fronter[uuid]' class='text-white'>" . $dn . "</a>, ");
            }
        }

        ?>
</div>
<br>

<div class="container">
    <div class="row">
        <?php foreach (json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/data/projects.json"), true) as $project): if ($project["showcase"]): ?>
        <div class="col-lg-4">
            <div class="card stylized-card">
                <div class="card-body">
                    <img class="stylized-card-icon" src="<?= $project["icon"] ?>" alt="">
                    <h4 class="card-title"><?= $project["name"] ?></h4>
                    <p class="card-text"><?= $project["description"] ?></p>
                    <a href="<?= $project["source"] ?>" target="_blank" class="btn btn-outline-light">View Project</a>
                </div>
            </div>
        </div>
        <?php endif; endforeach; ?>
    </div>
</div>

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