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) {