-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
137 lines (128 loc) · 5.73 KB
/
index.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
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
84
85
86
87
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
define('access', 'index');
define('config', include_once("Class/Config.class.php"));
$lang = isset($_GET['lang']) ? $_GET['lang'] : 'zh_CN';
function getDirContent($path)
{
if (!is_dir($path)) {
return "error";
}
$arr = array();
$data = scandir($path);
foreach ($data as $value) {
if ($value != '.' && $value != '..') {
$arr[] = $value;
}
}
return $arr;
}
$data = getDirContent("Lang/");
include("Class/Lang.class.php");
?>
<html>
<head>
<title><?php echo $_LANG['title']; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kognise/water.css@latest/dist/light.min.css" />
<style>
a {
color: #000000;
}
a:hover {
color: #03a9f4;
text-decoration: none;
}
.a-select {
color: #03a9f4;
}
.text-decoration {
padding-bottom: 5px;
border-bottom: 1px solid #000;
}
.text-decoration:hover {
color: #03a9f4;
border-bottom: 1px solid #03a9f4;
}
</style>
</head>
<body>
<h3><?php echo $_LANG['info.1']; ?></h3>
<p><?php echo $_LANG['info.2']; ?></p>
<p style="text-decoration: line-through"><?php echo $_LANG['info.3']; ?></p>
<p><?php echo $_LANG['info.4']; ?></p>
<h3><?php echo $_LANG['info.5']; ?></h3>
<h5><?php echo $_LANG['info.6']; ?></h5><code><?php echo config['web']['url'] ?>/get/@:name</code>
<h5><?php echo $_LANG['info.7']; ?></h5><code><img src="<?php echo config['web']['url'] ?>/get/@:name" alt=":name" /></code>
<h5><?php echo $_LANG['info.8']; ?></h5><code></code>
<h3>eg:<img src="<?php echo config['web']['url'] ?>/get/@index" alt="Moe Count!" /></h3>
<i><?php echo $_LANG['info.9']; ?></i>
<details>
<summary style="display: inline-block;">
<h3 style="display: inline-block; cursor: pointer;" class="text-decoration"><?php echo $_LANG['info.10']; ?></h3>
</summary>
<p style="margin: 0;"><?php echo $_LANG['info.11']; ?></p>
<h5>minecraft<sup style="color: red;">NEW</sup></h5>
<img src="<?php echo config['web']['url'] ?>/get/@demo?theme=minecraft" alt="Minecraft" />
<h5>asoul</h5>
<img src="<?php echo config['web']['url'] ?>/get/@demo?theme=asoul" alt="Asoul" />
<h5>moebooru</h5>
<img src="<?php echo config['web']['url'] ?>/get/@demo?theme=moebooru" alt="Moebooru" />
<h5>moebooru-h</h5>
<img src="<?php echo config['web']['url'] ?>/get/@demo?theme=moebooru-h" alt="Moebooru-Hentai" />
<h5>rule34</h5>
<img src="<?php echo config['web']['url'] ?>/get/@demo?theme=rule34" alt="Rule34" />
<h5>gelbooru</h5>
<img src="<?php echo config['web']['url'] ?>/get/@demo?theme=gelbooru" alt="Gelbooru" />
<h5>gelbooru-h</h5>
<img src="<?php echo config['web']['url'] ?>/get/@demo?theme=gelbooru-h" alt="Gelbooru-Hentai" />
<h5>Tohoku-Kiritan</h5>
<img src="<?php echo config['web']['url'] ?>/get/@demo?theme=Tohoku-Kiritan" alt="Tohoku-Kiritan" />
</details>
<details>
<summary style="display: inline-block;">
<h3 style="display: inline-block; cursor: pointer;" class="text-decoration"><?php echo $_LANG['html.lang']; ?></h3>
</summary>
<?php
foreach ($data as $key => $value) {
$json_string = json_decode(file_get_contents('Lang/' . $value), true);
if ($lang === $json_string['region']) {
$Html_Class = "a-select";
} else {
$Html_Class = "a-noselect";
}
echo $key = '<p><a href="?lang=' . pathinfo($value, PATHINFO_FILENAME) . '" class="' . $Html_Class . '">' . $json_string['language'] . '</a></p>';
}
?>
</details>
<p>
<h3>Tool</h3>
</p>
<div class="tool"><code>https://count.kjchmc.cn/get/@</code><input id="name" type="text" placeholder=":name" style="display: inline-block; width: 80px; height: 1.4em; line-height: 1.4em; margin: 0 4px; vertical-align: middle;"><code>?theme=</code><select id="theme" style="display: inline-block; height: 1.6em; line-height: 1.6em; font-size: 14px; margin: 0 4px; padding: 0 4px; vertical-align: middle;">
<option value="minecraft">minecraft</option>
<option value="asoul">asoul</option>
<option value="moebooru">moebooru</option>
<option value="moebooru-h">moebooru-h</option>
<option value="rule34">rule34</option>
<option value="gelbooru">gelbooru</option>
<option value="gelbooru-h">gelbooru-h</option>
<option value="Tohoku-Kiritan">Tohoku-Kiritan</option>
</select><button id="get" style="margin: 10px 0;" onclick="_evt_push("click", "normal", "get_counter")">Get</button><img id="result" style="display: block;">
<script>
var btn = document.getElementById('get'),
img = document.getElementById('result')
btn.addEventListener('click', function() {
var name = document.getElementById('name'),
themeEl = document.getElementById('theme')
var text = name.value ? name.value.trim() : ''
var theme = themeEl.value || 'moebooru'
if (!text) {
alert('Please input counter name.')
return
}
img.src = 'https://count.kjchmc.cn/get/@' + text + '?theme=' + theme
})
</script>
</div>
</body>
</html>