Merge branch 'master' of patchii.net:flash/flash.moe
|
@ -2,15 +2,17 @@
|
||||||
background-image: url('/images/sprite.png');
|
background-image: url('/images/sprite.png');
|
||||||
width: 25px;
|
width: 25px;
|
||||||
height: 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) {
|
@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-bluesky { background-position: 450px 0px; }
|
||||||
.fmi.fmi-flashii { background-position: 375px 0px; }
|
.fmi.fmi-email { background-position: 425px 0px; }
|
||||||
.fmi.fmi-github { background-position: 350px 0px; }
|
.fmi.fmi-flashii { background-position: 400px 0px; }
|
||||||
.fmi.fmi-lastfm { background-position: 325px 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-music { background-position: 300px 0px; }
|
||||||
.fmi.fmi-n3ds { background-position: 275px 0px; }
|
.fmi.fmi-n3ds { background-position: 275px 0px; }
|
||||||
.fmi.fmi-osu { background-position: 250px 0px; }
|
.fmi.fmi-osu { background-position: 250px 0px; }
|
||||||
|
|
BIN
private/sprite icons v2/bluesky.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
private/sprite icons v2/email.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
private/sprite icons v2/flashii.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
private/sprite icons v2/github.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
private/sprite icons v2/iconv2.psd
Normal file
BIN
private/sprite icons v2/lastfm.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
private/sprite icons v2/line.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
104
private/sprite icons v2/mksprite.php
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
<?php
|
||||||
|
if(is_file('sprite.css'))
|
||||||
|
unlink('sprite.css');
|
||||||
|
if(is_file('sprite.html'))
|
||||||
|
unlink('sprite.html');
|
||||||
|
if(is_file('sprite.png'))
|
||||||
|
unlink('sprite.png');
|
||||||
|
if(is_file('sprite@2x.png'))
|
||||||
|
unlink('sprite@2x.png');
|
||||||
|
|
||||||
|
$files = glob('*.png');
|
||||||
|
|
||||||
|
define('CSS_TPL', '.fmi.fmi-%1$s { background-position: %2$dpx %3$dpx; }' . PHP_EOL);
|
||||||
|
$css = <<<CSS
|
||||||
|
.fmi {
|
||||||
|
background-image: url('sprite.png');
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
background-size: %1\$dpx %2\$dpx;
|
||||||
|
}
|
||||||
|
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) {
|
||||||
|
.fmi { background-image: url('sprite@2x.png'); background-size: %1\$dpx %2\$dpx; }
|
||||||
|
}
|
||||||
|
|
||||||
|
CSS;
|
||||||
|
|
||||||
|
define('HTML_TPL', '<div class="fmi fmi-%1$s" style="border: 1px solid #0f0; margin: 5px; display: inline-block;" title="%1$s"></div>');
|
||||||
|
define('HTML_WRAP', '<!doctype html><link href="sprite.css" type="text/css" rel="stylesheet"/><div style="background-color: #000;">%1$s</div><div style="background-color: #fff;">%1$s</div>');
|
||||||
|
$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));
|
BIN
private/sprite icons v2/music.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
private/sprite icons v2/n3ds.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
private/sprite icons v2/osu.png
Normal file
After Width: | Height: | Size: 5 KiB |
BIN
private/sprite icons v2/patreon.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
private/sprite icons v2/paypal.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
private/sprite icons v2/steam.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
private/sprite icons v2/switch.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
private/sprite icons v2/tetrio.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
private/sprite icons v2/twitch.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
private/sprite icons v2/twitter.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
private/sprite icons v2/wiiu.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
private/sprite icons v2/youtube.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env php
|
#!/usr/bin/env php8.2
|
||||||
<?php
|
<?php
|
||||||
use Index\Data\Migration\FsDbMigrationRepo;
|
use Index\Data\Migration\FsDbMigrationRepo;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env php
|
#!/usr/bin/env php8.2
|
||||||
<?php
|
<?php
|
||||||
use Index\Data\Migration\FsDbMigrationRepo;
|
use Index\Data\Migration\FsDbMigrationRepo;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env php
|
#!/usr/bin/env php8.2
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/../makai.php';
|
require_once __DIR__ . '/../makai.php';
|
||||||
|
|
||||||
|
|