<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/js" href="js-style.js">
<title>Текст</title>
<style>
#cmd {
font-family: courier;
font-size: 14px;
background: black;
color: #21f838;
padding: 5px;
overflow: hidden;
}
#cmd span {
float: left;
padding-left: 3px;
white-space: pre;
}
#cursor {
float: left;
width: 5px;
height: 14px;
background: #21f838;
}
input {
width: 0;
height: 0;
opacity: 0;
}
</style>
<script type="text/javascript">
$(function() {
var cursor;
$('#cmd').click(function() {
$('input').focus();
cursor = window.setInterval(function() {
if ($('#cursor').css('visibility') === 'visible') {
$('#cursor').css({ visibility: 'hidden' });
} else {
$('#cursor').css({ visibility: 'visible' });
}
}, 500);
});
$('input').keyup(function() {
$('#cmd span').text($(this).val());
});
$('input').blur(function() {
clearInterval(cursor);
$('#cursor').css({ visibility: 'visible' });
});
});
</script>
</head>
<body>
<section>
<div class="header-tex">
<div class="logo"><p style="color: #21f838; padding:0px; margin: 0px;">Привествую! Пожалуйста ввидите ваше имя в поле ввода.</p><svg id='svg'>
<line x1="0" y1="20" x2="470" y2="20" style="stroke: #21f838; stroke-opacity: 1;
stroke-dasharray: 1, 1, 1;
">
</svg></div>
</div>
<div class="mainpart">
<form action="index.php" method="POST" name='forma'>
<div id="cmd">
<p style="color: #21f838; padding:0px; margin: 0px;">Нажмите на курсор, введите ваше имя и нажмите Enter: </p>
<span></span>
<div id="cursor"></div>
<button type="submit" name="submit1" style="margin-left:360px;border: 1px dotted #21f838; background: #000; color: #21f838; position: fixed;" id="button-submit1">Enter</button>
</div>
<input type="text" name="username">
</form>
<?php
$connect = mysqli_connect("localhost", "", "") or die('Не удалось подключиться');
mysqli_select_db($connect, "");
$name = $_POST['username'];
if (isset($_POST['submit1'])) {
if ($name != '') {
echo "<div style='color:#21f838; font-family: courier;
font-size: 14px;'>"."Очень рад посещению,".$name.", текст"."</div>"."<form action='index.php' method='POST' name='forma'>
<div id='cmd'><span></span><div id='cursor'></div><button type='submit' name='submit2' style='margin-left:360px;border: 1px dotted #21f838; background: #000; color: #21f838; position: fixed;' id='button-submit1'>Enter</button></div><input type='text' name='answer'></form>";
if (condition) {
# code...
}
}else{
echo "<div style='color:#f80000; font-family: courier;
font-size: 14px;'>"."Введите имя!"."</div>";
}
}
?>
</div>
</section>
</body>
</html>