-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerateSite.php
117 lines (112 loc) · 3.62 KB
/
generateSite.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
<?php
function signDirTpl(string $dir, string $tag, string $ratio): string {
$ret = "";
foreach(glob($dir . "/*") as $file) {
if (str_ends_with($file, ".loc")) continue;
if (str_ends_with($file, ".zip.png")) continue;
$ft = $file;
$isPaintable = "";
if (str_ends_with($file, ".zip")) {
$ft = $file.".png";
$isPaintable = '<span class="tag icon" title="Colorable"><i class="fa fa-paint-brush" aria-hidden="true"></i></span>';
}
$ret .= sprintf(<<<EOL
<div class="column is-3">
<div class="card">
<div class="card-image">
<figure class="image is-%s">
<img src="%s" />
<div class="tags sign-tags is-overlay">
<span class="tag icon copy" data-clipboard-text="https://misfitmaid.github.io/openplanet-plugin-signs/%s" title="Copy to clipboard">
<i class="fa fa-files-o" aria-hidden="true"></i>
</span>%s
</div>
</figure>
</div>
</div>
</div>\n
EOL, $ratio, $ft, $file, $isPaintable);
}
return $ret;
}
?><!DOCTYPE html>
<!-- DO NOT EDIT THIS FILE DIRECTLY. To make changes, run php generateSite.php > index.html -->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Openplanet Plugin Signs</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css" integrity="sha256-XoaMnoYC5TH6/+ihMEnospgm0J1PM/nioxbOUdnM8HY=" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
<style>
.sign-tags {
align-items: flex-end;
flex-wrap: nowrap;
overflow: clip;
opacity: .8;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
var clipboard = new ClipboardJS('.copy');
clipboard.on('success', function(e) {
console.info('Action:', e.action);
console.info('Text:', e.text);
console.info('Trigger:', e.trigger);
e.trigger.querySelector("i").classList.remove("fa-files-o");
e.trigger.querySelector("i").classList.add("fa-check");
e.trigger.classList.add("is-success");
setTimeout(() => {
e.trigger.querySelector("i").classList.remove("fa-check");
e.trigger.querySelector("i").classList.add("fa-files-o");
e.trigger.classList.remove("is-success");
}, 2000);
e.clearSelection();
});
});
</script>
</head>
<body>
<section class="section">
<div class="container">
<h1 class="title">
Openplanet Plugin Signs
</h1>
<p>Feel free to contribute your signs on <a href="https://github.com/MisfitMaid/openplanet-plugin-signs">GitHub</a>.</p>
</div>
</section>
<section class="section">
<div class="container">
<h3 class="title is-3">1x1 (12-3-1)</h3>
<div class="columns is-multiline is-centered">
<?php echo signDirTpl("1x1", "1x1 (12-3-1)", "1by1"); ?>
</div>
</div>
</section>
<section class="section">
<div class="container">
<h3 class="title is-3">1x2 (12-3-2)</h3>
<div class="columns is-multiline is-centered">
<?php echo signDirTpl("1x2", "1x2 (12-3-2)", "2by1"); ?>
</div>
</div>
</section>
<section class="section">
<div class="container">
<h3 class="title is-3">1x4 (12-3-3)</h3>
<div class="columns is-multiline is-centered">
<?php echo signDirTpl("1x4", "1x4 (12-3-3)", "4by1"); ?>
</div>
</div>
</section>
<section class="section">
<div class="container">
<h3 class="title is-3">2x3 (ItemFlag)</h3>
<div class="columns is-multiline is-centered">
<?php echo signDirTpl("2x3", "2x3 (ItemFlag)", "3by2"); ?>
</div>
</div>
</section>
</body>
</html>