html {background: url('fon.gif') repeat;}
html { background-image: url('fon1.gif'); background-repeat: repeat; } body { background-image: url('fon2.gif'); background-repeat: repeat; }
<?php include_once "generate_fon.php"; ?> <html> <title>10 PRINT CHR$(205.5+RND(1));: GOTO 10</title> <style type='text/css'> html, body { padding: 0px; margin: 0px; width: 100%; height: 100%; } html { background-image: url('fon1.png'); background-repeat: repeat; } body { background-image: url('fon2.png'); background-repeat: repeat; } #outer { height: 300px; line-height: 300px; text-align: center; } #inner { outline: solid #99c medium; padding: 50px; background: #336; color: #99c; font-weight: bold; font-size: 16pt; } </style> <body> <div id='outer'><span id='inner'>10 PRINT CHR$(205.5+RND(1));: GOTO 10</span></div> </body> </html>
<?php function create_background_image ($w, $h, $quadro, $is_chess, $numder) { //w, h - / //$quadro - " ", px //$is_chess - true/false, //$numder - ( 2) $img = imageCreate($w*$quadro, $h*$quadro);// , $color_transparent = imagecolorallocate ($img, 0, 0, 0);// $color_background = imagecolorallocate ($img, 51, 51, 102);// $color_line = imagecolorallocate ($img, 153, 153, 204);// imagesetthickness($img, 4);// "" // " " for ($i = 0; $i < $w; $i++) { for ($j = 0; $j < $h; $j++) { $sparseness = mt_rand(0, 8);//"" . 1 9- "" if ($sparseness) { // " " if (!($is_chess && ($i % 2 == $j % 2))) { // imagefilledrectangle ( $img, $i * $quadro, $j * $quadro, // ($i + 1) * $quadro, ($j + 1) * $quadro, // $color_background // ); //" ", "" $direction = mt_rand(0, 1); // ( : \ /) if ($direction) { imageline ( $img, $i * $quadro, $j * $quadro, // ... ($i + 1) * $quadro, ($j + 1) * $quadro, //... $color_line // ); } else { imageline ( $img, ($i + 1) * $quadro, $j * $quadro, // ... $i * $quadro, ($j + 1) * $quadro, //... $color_line // ); } } else { // imagefilledrectangle ( $img, $i * $quadro, $j * $quadro, // ($i + 1) * $quadro, ($j + 1) * $quadro, // $color_transparent // - ); } } else { // "" //"" , imagefilledrectangle ( $img, $i * $quadro, $j * $quadro, // ($i + 1) * $quadro, ($j + 1) * $quadro, // $color_background // ); } } } imagecolortransparent ($img, $color_transparent);// imagepng ($img, "fon$numder.png");// imageDestroy($img);// "" - } $w1 = 17; $h1 = 19;// $w2 = 23; $h2 = 13;// $wall = 30; // " ", px $img1 = create_background_image($w1, $h1, $wall, false, 1);// $img2 = create_background_image($w2, $h2, $wall, true, 2);// ?>
Source: https://habr.com/ru/post/161467/
All Articles