<?php
/**
 * Project:        M.VuiZ.Net
 * Author:         nampt.me <admin@vuiz.net>
 * Copyright:      © 2025 vuiz.net All rights reserved.
 */
header('Content-Type: image/png');
header('Content-disposition: attachment;filename="logo.png"');
//gia tri
$size= 40;
$size2 = 15;
$angel= 0;
$text1 = empty($_GET['text1']) ? 'VuiZ.Net' : $_GET['text1'];
$text2 = empty($_GET['text2']) ? 'Tạo logo wap Online' : $_GET['text2'];
$text = $text1.''.$text2;
$font= __DIR__.'/StoryBrush.otf';
$cao= 78;
$bbox= imagettfbbox($size,$angel,$font,$text);
$bbox1= imagettfbbox($size,$angel,$font,$text1);
$bbox2= imagettfbbox($size2,$angel,$font,$text2);
if ($bbox1[2] >= $bbox2[2]){
$rong= $bbox1[2] + 125;
$vt1 = 110;
$vt2  = ($rong - 125 - $bbox2[2])/2 +110;
} else {
$rong= $bbox2[2] + 125;
$vt1 = ($rong - 125 - $bbox1[2])/2 +110;
$vt2 = 110;
}
//tao anh moi
$im = imagecreatetruecolor($rong,$cao);
$icon = imagecreatefrompng('icon.png');
//dinh dang mau sac
$xanh = imagecolorallocate($im,0,150,136);
$den = imagecolorallocate($im,0,0,0);
$green = imagecolorallocate($im,76,175,80);
//transparen
 imagesavealpha($im, true);
    //setting completely transparent color
    $transparent = imagecolorallocatealpha($im, 0, 0, 0, 127);
    //filling created image with transparent color
    imagefill($im, 0, 0, $transparent);

imagecopy($im,$icon,0,0,0,0,imagesx($icon),imagesy($icon));

// the shadow 
imagefttext($im, $size, 0, $vt1+2, 45, $den, $font,$text1);
imagefttext($im, $size, 0, $vt1, 47, $xanh, $font,$text1);
imagefttext($im, $size2, 0, $vt2-1, 70, $den, $font,$text2);
imagefttext($im, $size2, 0, $vt2, 68, $green, $font,$text2);



imagepng($im);
imagedestroy($im);

?>