diff --git a/assets/2021.css/sprite.css b/assets/2021.css/sprite.css index 5aab1ea..363e2db 100644 --- a/assets/2021.css/sprite.css +++ b/assets/2021.css/sprite.css @@ -2,15 +2,17 @@ background-image: url('/images/sprite.png'); width: 25px; height: 25px; - background-size: 400px 25px; + background-size: 450px 25px; } @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) { - .fmi { background-image: url('/images/sprite@2x.png'); background-size: 400px 25px; } + .fmi { background-image: url('/images/sprite@2x.png'); background-size: 450px 25px; } } -.fmi.fmi-email { background-position: 400px 0px; } -.fmi.fmi-flashii { background-position: 375px 0px; } -.fmi.fmi-github { background-position: 350px 0px; } -.fmi.fmi-lastfm { background-position: 325px 0px; } +.fmi.fmi-bluesky { background-position: 450px 0px; } +.fmi.fmi-email { background-position: 425px 0px; } +.fmi.fmi-flashii { background-position: 400px 0px; } +.fmi.fmi-github { background-position: 375px 0px; } +.fmi.fmi-lastfm { background-position: 350px 0px; } +.fmi.fmi-line { background-position: 325px 0px; } .fmi.fmi-music { background-position: 300px 0px; } .fmi.fmi-n3ds { background-position: 275px 0px; } .fmi.fmi-osu { background-position: 250px 0px; } diff --git a/private/sprite icons v2/bluesky.png b/private/sprite icons v2/bluesky.png new file mode 100644 index 0000000..b417820 Binary files /dev/null and b/private/sprite icons v2/bluesky.png differ diff --git a/private/sprite icons v2/email.png b/private/sprite icons v2/email.png new file mode 100644 index 0000000..75fb770 Binary files /dev/null and b/private/sprite icons v2/email.png differ diff --git a/private/sprite icons v2/flashii.png b/private/sprite icons v2/flashii.png new file mode 100644 index 0000000..5ba63c7 Binary files /dev/null and b/private/sprite icons v2/flashii.png differ diff --git a/private/sprite icons v2/github.png b/private/sprite icons v2/github.png new file mode 100644 index 0000000..52871dc Binary files /dev/null and b/private/sprite icons v2/github.png differ diff --git a/private/sprite icons v2/iconv2.psd b/private/sprite icons v2/iconv2.psd new file mode 100644 index 0000000..68183fb Binary files /dev/null and b/private/sprite icons v2/iconv2.psd differ diff --git a/private/sprite icons v2/lastfm.png b/private/sprite icons v2/lastfm.png new file mode 100644 index 0000000..10cd4ae Binary files /dev/null and b/private/sprite icons v2/lastfm.png differ diff --git a/private/sprite icons v2/line.png b/private/sprite icons v2/line.png new file mode 100644 index 0000000..c471e0b Binary files /dev/null and b/private/sprite icons v2/line.png differ diff --git a/private/sprite icons v2/mksprite.php b/private/sprite icons v2/mksprite.php new file mode 100644 index 0000000..435b5e8 --- /dev/null +++ b/private/sprite icons v2/mksprite.php @@ -0,0 +1,104 @@ +'); +define('HTML_WRAP', '
%1$s
%1$s
'); +$html = ''; + +$lWidth2x = 0; +$lWidth1x = 0; +$lHeight2x = 0; +$lHeight1x = 0; + +$width2x = 0; +$height2x = 0; + +$dropFiles = []; + +foreach($files as $file) { + $imgSize = getimagesize($file); + if($imgSize === false || $imgSize[2] !== IMAGETYPE_PNG) { + $dropFiles[] = $file; + continue; + } + + if($lWidth2x < $imgSize[0]) + $lWidth2x = $imgSize[0]; + if($lHeight2x < $imgSize[1]) + $lHeight2x = $imgSize[1]; + + $width2x += $imgSize[0]; + if($height2x < $imgSize[1]) + $height2x = $imgSize[1]; +} + +if($width2x < 1 || $height2x < 1) + die('did nothing' . PHP_EOL); + +$files = array_diff($files, $dropFiles); + +$lWidth1x = ceil($lWidth2x / 2); +$lHeight1x = ceil($lHeight2x / 2); +$width1x = ceil($width2x / 2); +$height1x = ceil($height2x / 2); + +$offset = 0; + +$sprite1x = new Imagick; +$sprite1x->newImage($width1x, $height1x, 'none'); +$sprite1x->setImageFormat('png'); +$sprite2x = new Imagick; +$sprite2x->newImage($width2x, $height2x, 'none'); +$sprite2x->setImageFormat('png'); + +foreach($files as $file) { + $fileName = pathinfo($file, PATHINFO_FILENAME); + $html .= sprintf(HTML_TPL, $fileName); + $css .= sprintf(CSS_TPL, $fileName, $width1x - ($offset * $lWidth1x), 0); + + $imagick = new Imagick($file); + + $sprite2x->compositeImage($imagick, Imagick::COMPOSITE_DEFAULT, $offset * $lWidth2x, 0); + + $imagick->resizeImage( + ceil($imagick->getImageWidth() / 2), + ceil($imagick->getImageHeight() / 2), + Imagick::FILTER_LANCZOS, 1 + ); + + $sprite1x->compositeImage($imagick, Imagick::COMPOSITE_DEFAULT, $offset * $lWidth1x, 0); + + $imagick->destroy(); + $offset++; +} + +$sprite1x->writeImage('sprite.png'); +$sprite1x->destroy(); +$sprite2x->writeImage('sprite@2x.png'); +$sprite2x->destroy(); + +file_put_contents('sprite.css', sprintf($css, $width1x, $height1x, $width2x, $height2x)); +file_put_contents('sprite.html', sprintf(HTML_WRAP, $html)); diff --git a/private/sprite icons v2/music.png b/private/sprite icons v2/music.png new file mode 100644 index 0000000..bef6b95 Binary files /dev/null and b/private/sprite icons v2/music.png differ diff --git a/private/sprite icons v2/n3ds.png b/private/sprite icons v2/n3ds.png new file mode 100644 index 0000000..eed1ffc Binary files /dev/null and b/private/sprite icons v2/n3ds.png differ diff --git a/private/sprite icons v2/osu.png b/private/sprite icons v2/osu.png new file mode 100644 index 0000000..5b9bd3a Binary files /dev/null and b/private/sprite icons v2/osu.png differ diff --git a/private/sprite icons v2/patreon.png b/private/sprite icons v2/patreon.png new file mode 100644 index 0000000..bce2a93 Binary files /dev/null and b/private/sprite icons v2/patreon.png differ diff --git a/private/sprite icons v2/paypal.png b/private/sprite icons v2/paypal.png new file mode 100644 index 0000000..e24da52 Binary files /dev/null and b/private/sprite icons v2/paypal.png differ diff --git a/private/sprite icons v2/steam.png b/private/sprite icons v2/steam.png new file mode 100644 index 0000000..9b654e6 Binary files /dev/null and b/private/sprite icons v2/steam.png differ diff --git a/private/sprite icons v2/switch.png b/private/sprite icons v2/switch.png new file mode 100644 index 0000000..c2fa208 Binary files /dev/null and b/private/sprite icons v2/switch.png differ diff --git a/private/sprite icons v2/tetrio.png b/private/sprite icons v2/tetrio.png new file mode 100644 index 0000000..54d4773 Binary files /dev/null and b/private/sprite icons v2/tetrio.png differ diff --git a/private/sprite icons v2/twitch.png b/private/sprite icons v2/twitch.png new file mode 100644 index 0000000..2194f74 Binary files /dev/null and b/private/sprite icons v2/twitch.png differ diff --git a/private/sprite icons v2/twitter.png b/private/sprite icons v2/twitter.png new file mode 100644 index 0000000..2458a04 Binary files /dev/null and b/private/sprite icons v2/twitter.png differ diff --git a/private/sprite icons v2/wiiu.png b/private/sprite icons v2/wiiu.png new file mode 100644 index 0000000..128ef8a Binary files /dev/null and b/private/sprite icons v2/wiiu.png differ diff --git a/private/sprite icons v2/youtube.png b/private/sprite icons v2/youtube.png new file mode 100644 index 0000000..a17f64a Binary files /dev/null and b/private/sprite icons v2/youtube.png differ diff --git a/private/sprite icons/email.png b/private/sprite icons/email.png index acd9f43..75fb770 100644 Binary files a/private/sprite icons/email.png and b/private/sprite icons/email.png differ diff --git a/private/sprite icons/flashii.png b/private/sprite icons/flashii.png index 1a48eb0..eae825f 100644 Binary files a/private/sprite icons/flashii.png and b/private/sprite icons/flashii.png differ diff --git a/private/sprite icons/github.png b/private/sprite icons/github.png index df6cf75..887d81f 100644 Binary files a/private/sprite icons/github.png and b/private/sprite icons/github.png differ diff --git a/private/sprite icons/lastfm.png b/private/sprite icons/lastfm.png index 7413af4..4b77966 100644 Binary files a/private/sprite icons/lastfm.png and b/private/sprite icons/lastfm.png differ diff --git a/private/sprite icons/ninswitch.png b/private/sprite icons/ninswitch.png index 3e9e1a2..74efced 100644 Binary files a/private/sprite icons/ninswitch.png and b/private/sprite icons/ninswitch.png differ diff --git a/private/sprite icons/paypal.png b/private/sprite icons/paypal.png index d9ad9eb..bdbd16f 100644 Binary files a/private/sprite icons/paypal.png and b/private/sprite icons/paypal.png differ diff --git a/private/sprite icons/s-code.png b/private/sprite icons/s-code.png index f59598e..eb46838 100644 Binary files a/private/sprite icons/s-code.png and b/private/sprite icons/s-code.png differ diff --git a/private/sprite icons/steam.png b/private/sprite icons/steam.png index e47955a..a0b3518 100644 Binary files a/private/sprite icons/steam.png and b/private/sprite icons/steam.png differ diff --git a/private/sprite icons/twitch.png b/private/sprite icons/twitch.png index 9c7afe3..7906396 100644 Binary files a/private/sprite icons/twitch.png and b/private/sprite icons/twitch.png differ diff --git a/private/sprite icons/twitter.png b/private/sprite icons/twitter.png index edf4036..e446c08 100644 Binary files a/private/sprite icons/twitter.png and b/private/sprite icons/twitter.png differ diff --git a/private/sprite icons/youtube.png b/private/sprite icons/youtube.png index 2acbef4..5e27509 100644 Binary files a/private/sprite icons/youtube.png and b/private/sprite icons/youtube.png differ diff --git a/public/images/sprite.png b/public/images/sprite.png index 72c0bcb..ed070de 100644 Binary files a/public/images/sprite.png and b/public/images/sprite.png differ diff --git a/public/images/sprite@2x.png b/public/images/sprite@2x.png index da23fb4..5aa72ab 100644 Binary files a/public/images/sprite@2x.png and b/public/images/sprite@2x.png differ diff --git a/tools/migrate b/tools/migrate index ec2670e..0d07d64 100755 --- a/tools/migrate +++ b/tools/migrate @@ -1,4 +1,4 @@ -#!/usr/bin/env php +#!/usr/bin/env php8.2