Created
June 12, 2017 23:45
-
-
Save VladaHejda/343b55347efaaaee6397eb94cd57ff62 to your computer and use it in GitHub Desktop.
učíme se s Hello Kitty :-D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL & ~E_NOTICE); | |
$jmeno = htmlspecialchars($_GET['jmeno']); | |
if (!$jmeno) { | |
$jmeno = 'Kitty'; | |
} | |
$r = rand(0, 255); | |
$g = rand(0, 255); | |
$b = rand(0, 255); | |
?> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script> | |
<style> | |
h1 { | |
color: blue; | |
} | |
.cat { | |
color: rgb(<?php echo "$r, $g, $b"; ?>); | |
position: relative; | |
} | |
</style> | |
<script> | |
$(function () { | |
var cat = $('.cat'); | |
var step1 = function () { | |
cat.animate({top: -5}, 200, step2); | |
}; | |
var step2 = function () { | |
cat.animate({top: 0}, 200, step1); | |
}; | |
step1(); | |
}); | |
</script> | |
<title>Hello <?php echo $jmeno; ?>!</title> | |
</head> | |
<body> | |
<h1>Hello <?php echo $jmeno; ?></h1> | |
<p>Ahoj, já jsem kočička <?php echo $jmeno; ?> <span class="cat">🐱</span> | |
</p> | |
<form> | |
<label>Pojmenuj mě: <input name="jmeno" value="<?php echo $jmeno; ?>"></label> | |
<input type="submit" value="přejmenovat"> | |
</form> | |
<p> | |
<a href="code.php">KÓD</a> | |
</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment