This commit is contained in:
Shuqi 2023-11-14 02:57:29 +08:00
parent 8fc5f8dd35
commit 91491d2e8d
4 changed files with 46 additions and 0 deletions

View File

@ -5,7 +5,27 @@ if (empty($_GET['icon']) || !preg_match("/^\w+(\.svg)?$/", $_GET['icon'])) exit;
$request = $_GET['icon'];
$icons_path = __DIR__."/icons";
function get_ip() {
//whether ip is from the share internet
if(!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
}
//whether ip is from the proxy
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
//whether ip is from the remote address
else{
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
$time = date("Y-m-d H:i:s");
$ip = get_ip();
if ($request == 'all') {
file_put_contents('download_log', "$time - $ip - download all".PHP_EOL , FILE_APPEND | LOCK_EX);
$mtime = filemtime(__DIR__.'/assets/index.js');
$zip_filename = "pixel-icons-$mtime.zip";
$zip_path = __DIR__."/zipped/$zip_filename";
@ -46,6 +66,8 @@ if ($request == 'all') {
}
} else {
file_put_contents('download_log', "$time - $ip - $request".PHP_EOL , FILE_APPEND | LOCK_EX);
$file = $icons_path . "/$request";
if (!is_file($file)) exit;

14
public/icons/cat.svg Normal file
View File

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9" class="pixelicon-pencil">
<polygon fill="#EBEAF7" points="3,5 3,4 2,4 2,5 1,5 1,6 4,6 4,5"/>
<polygon fill="#EBEAF7" points="6,6 6,4 5,4 5,7 7,7 7,8 8,8 8,6"/>
<rect fill="#EBEAF7" x="2" y="7" width="1" height="1"/>
<rect fill="#EBEAF7" x="4" y="7" width="1" height="1"/>
<polygon fill="#FFB100" points="4,2 4,3 2,3 2,4 4,4 4,6 5,6 5,2"/>
<rect fill="#FFB100" x="0" y="5" width="1" height="1"/>
<polygon fill="#D38100" points="2,3 1,3 1,2 0,2 0,5 1,5 1,4 2,4"/>
<rect fill="#D38100" x="2" y="6" width="3" height="1"/>
<polygon fill="#D38100" points="7,5 7,4 6,4 6,6 8,6 8,5"/>
<rect fill="#D38100" x="8" y="3" width="1" height="2"/>
<rect fill="#343341" x="1" y="4" width="1" height="1"/>
<rect fill="#343341" x="3" y="4" width="1" height="1"/>
</svg>

After

Width:  |  Height:  |  Size: 821 B

8
public/icons/pencil.svg Normal file
View File

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9" class="pixelicon-pencil">
<rect fill="#F92F3C" x="3" y="1" width="3" height="1"/>
<rect fill="#4435FF" x="3" y="2" width="1" height="4"/>
<rect fill="#4435FF" x="5" y="2" width="1" height="4"/>
<rect fill="#FFE800" x="4" y="2" width="1" height="4"/>
<rect fill="#FFB100" x="3" y="6" width="3" height="1"/>
<rect fill="#343341" x="4" y="7" width="1" height="1"/>
</svg>

After

Width:  |  Height:  |  Size: 432 B

View File

@ -35,6 +35,7 @@
"caret-right.svg": [ "caret-right", "ui-icon", "blue" ],
"caret-up.svg": [ "caret-up", "ui-icon", "blue" ],
"cart.svg": [ "cart", "ui-icon", "yellow" ],
"cat.svg": [ "cat", "full-body", "animal", "orange", "white" ],
"cat-black.svg": [ "cat-black", "animal", "black" ],
"cat-calico.svg": [ "cat-calico", "animal", "orange", "white" ],
"cat-grey.svg": [ "cat-grey", "animal", "grey-gray" ],
@ -76,6 +77,7 @@
"paper-bag.svg": [ "paper-bag", "ui-icon", "pink" ],
"paste.svg": [ "paste", "ui-icon", "cut", "copy" ],
"pear.svg": [ "pear", "fruit", "food", "green" ],
"pencil.svg": [ "pencil", "ui-icon", "yellow", "blue", "edit" ],
"phone.svg": [ "phone", "ui-icon", "red" ],
"photo.svg": [ "photo", "ui-icon", "blue" ],
"picture.svg": [ "picture", "ui-icon", "blue" ],