From 8607c11f946fee6771343c1e7b9667b07a9d840f Mon Sep 17 00:00:00 2001 From: Shuqi Date: Mon, 29 Apr 2024 17:29:20 +0800 Subject: [PATCH] Added dedicated pages for each icon, and monkey icons --- php/icon.php | 164 +++++++++++++++++++++++++++++++++++ php/index.php | 25 ++++-- {src => public}/icons.json | 97 +++++++++++---------- public/icons/monkey-love.svg | 13 +++ public/icons/monkey-walk.svg | 9 ++ public/icons/monkey.svg | 11 +++ src/App.jsx | 11 ++- src/IconList.jsx | 11 +-- src/index.css | 126 +++++++++++++++++++++++++-- 9 files changed, 400 insertions(+), 67 deletions(-) create mode 100644 php/icon.php rename {src => public}/icons.json (76%) create mode 100644 public/icons/monkey-love.svg create mode 100644 public/icons/monkey-walk.svg create mode 100644 public/icons/monkey.svg diff --git a/php/icon.php b/php/icon.php new file mode 100644 index 0000000..b03759e --- /dev/null +++ b/php/icon.php @@ -0,0 +1,164 @@ +setBackgroundColor(new ImagickPixel('#ffffff')); + $image->readImageBlob(file_get_contents($icon_path)); + $image->setImageFormat("png24"); + $image->setImageInterpolateMethod('Integer'); + $image->resizeImage(180, 180, Imagick::FILTER_POINT, 1); + $image->borderImage('#ffffff', 510, 225); + $image->writeImage($preview_path); +} + +// generate color palette +$palette = array(); +$svg = file_get_contents($icon_path); +preg_match_all("/#([0-9a-fA-F]{6})/", $svg, $matches); +$palette = array_unique($matches[0]); +$palette = array_map('strtoupper', $palette); + +// get tags +$icon_json = json_decode(file_get_contents(__DIR__ . "/icons.json"), true); +$tags = $icon_json[$icon_name . ".svg"]; + +?> + + + + + + + + + + <?= $icon_name ?> - Pixel Icons + + + + + + + + +
+
+

+ +
+ + +
+ +
+
+
+
+ +
+ + +
+
+ Colour Palette: +
    + +
  • +
    +
    +
  • + +
+
+
+ Colour code copied! +
+ +
+ Tags: + +
+
+ +
+ + + + \ No newline at end of file diff --git a/php/index.php b/php/index.php index 590e983..54e328c 100644 --- a/php/index.php +++ b/php/index.php @@ -6,6 +6,9 @@ $files = scandir($icons_path); $files = array_filter($files, function ($file) { return (substr($file, -4, 4) == ".svg"); }); +$files = array_map(function ($file) { + return str_replace(".svg", "", $file); +}, $files); ?> @@ -16,9 +19,9 @@ $files = array_filter($files, function ($file) { - + Pixel Icons - + @@ -57,23 +60,28 @@ $files = array_filter($files, function ($file) {