- Код: Выделить всё • Развернуть
<?php
///////////////////////////////////////////////////////////
// +---------------------------------------------------+ //
// | Генератор случайного фона на PHP | 2009 by Zver | //
// +---------------------------------------------------+ //
///////////////////////////////////////////////////////////
/* НАСТРОЙКИ */
$bg_height = 100; // Кол - во генерируемых DIV'ов
$max_width = 20; // Максимальная высота DIV'а
$min_width = 10; // Минимальная высота DIV'а
/* НАСТРОЙКИ */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Поднималка настроения | 2009 by Zver</title>
<style type="text/css">
body {
padding:0px;
margin:0px;
}
#content {
position:fixed;
padding:30px;
border:10px double #999;
background:#CCC;
margin-left:20%;
margin-right:20%;
width:60%;
margin-top:30%;
font-size:24px;
display:block;
text-align:center;
font-family: Verdana, Geneva, sans-serif;
text-transform:capitalize;
}
</style>
</head>
<div id="content">Всё будет чики - пуки! ;)</div>
<?php
for($i=0; $i<$bg_height; $i++){
$div_width = rand($min_width, $max_width);
$div_color_1 = rand(0, 9);
$div_color_2 = rand(0, 9);
$div_color_3 = rand(0, 9);
echo "<div style='height:".$div_width."px; background:#".$div_color_1.$div_color_2.$div_color_3."'></div>
";
}
?>
<body>
</body>
</html>
ЗЫ: Ща пишу скрипт генерации градиента, с полными настройки - от начального цвета до финального