gacha_details.html 4.26 KB
Newer Older
ImmuState's avatar
ImmuState committed
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
<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400&display=swap">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css">
        <style>
            body {
                background-color: #f0f0f0;
            }
            p {
                font-weight:300;
            }
            a,a:hover {
                text-decoration:none !important;
                color:#626976;
            }
            .content {
                padding:3rem 0;
            }
            .container {
                color:#626976;
                position: relative;
            }

            h2 {
                font-size:20px;
            }
            h3 {
                font-size:16px;
            }
        </style>
        <title>Banner Details</title>
        <script type="text/javascript" src="/gacha/mappings"></script>
    </head>
    <body>
        <div class="content">
            <div class="container">
                <h2 class="mb-5">{{TITLE}}</h2>
41
                
ImmuState's avatar
ImmuState committed
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
                <h3 class="">{{AVAILABLE_FIVE_STARS}}</h3>
                <hr />
                <ul id="5-star-list">
                </ul>

                <h3 class="">{{AVAILABLE_FOUR_STARS}}</h3>
                <hr />
                <ul id="4-star-list">
                </ul>

                <h3 class="">{{AVAILABLE_THREE_STARS}}</h3>
                <hr />
                <ul id="3-star-list">
                </ul>
            </div>
        </div>
        <footer>
            <div class="copyright">
                <div class="container">
                    <div class="row">
                        <div class="col-md-6">
                            <span>
                                Template by BecodReyes. All rights reserved.
                            </span>
                        </div>
                        <div class="col-md-6">
                            <ul style="float:right">
                                <li class="list-inline-item">
                                    <a href="https://github.com/Grasscutters/Grasscutter">Github</a>
                                </li>
                                <li class="list-inline-item">·</li>
                                <li class="list-inline-item">
                                    <a href="https://github.com/Grasscutters/Grasscutter/blob/stable/LICENSE">License</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </footer>

        <script>
84
85
86
87
            var fiveStarItems = {{FIVE_STARS}};
            var fourStarItems = {{FOUR_STARS}};
            var threeStarItems = {{THREE_STARS}};
            var lang = "{{LANGUAGE}}";
ImmuState's avatar
ImmuState committed
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

            function getNameForId(itemId) {
                if (mappings[lang] != null && mappings[lang][itemId] != null) {
                    return mappings[lang][itemId][0];
                }
                else if (mappings["en-us"] != null && mappings["en-us"][itemId] != null) {
                    return mappings["en-us"][itemId][0];
                }
                
                return itemId.toString();
            }

            fiveStarList = document.getElementById("5-star-list");
            fourStarList = document.getElementById("4-star-list");
            threeStarList = document.getElementById("3-star-list");

            fiveStarItems.forEach(element => {
                var entry = document.createElement("li");
                entry.innerHTML = getNameForId(element);
                fiveStarList.appendChild(entry);
            });
            fourStarItems.forEach(element => {
                var entry = document.createElement("li");
                entry.innerHTML = getNameForId(element);
                fourStarList.appendChild(entry);
            });
            threeStarItems.forEach(element => {
                var entry = document.createElement("li");
                entry.innerHTML = getNameForId(element);
                threeStarList.appendChild(entry);
            });
        </script>
    </body>
</html>