File: /www/wwwroot/cece.umchkw.com/index.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>计算弧的半径长度</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style type="text/css" media="all">
body{
background-color:midnightblue
}
*{
margin: 0;
padding: 0;
}
form {
width: 100%;
max-width: 640px;
margin: 0 auto;
/* height: 460px; */
background-color: rgba(255,245,245,0.3);
/* border-radius: 10px; */
/* border: 1px solid rgba(255,0,0,0.4); */
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
padding: 40px;
box-sizing: border-box;
}
form .content {
border-radius: 20px;
background-color: rgba(255,245,245,0.5);
}
form .content .top h3{
line-height: 60px;
text-align: center;
border-bottom: 1px solid rgb(94 91 152);
}
form .content .center .line {
line-height: 50px;
}
form .content .center {
border-bottom: 1px solid rgb(94 91 152);
text-align: center;
}
form .content .center label {
display: inline-block;
width: 100%;
text-align: center;
}
form .content .center .line:not(.not) label{
letter-spacing: 6px;
font-size: 20px;
}
form .content .center .not label{
padding-right: 16px;
box-sizing: border-box;
}
form .content .center input {
text-indent: 8px;
width: 90%;
/* margin: 0 40px; */
line-height: 50px;
border-radius: 6px;
outline: none;
border: 1px solid rgb(94 91 152);
font-size: 25px;
}
form .content .center input:focus{
border: 1px solid lawngreen;
}
form .content .center input:visited{
border: 1px solid green;
}
form .content .center input:valid+span{
visibility: hidden;
}
form .content .center input:invalid+span{
visibility: visible;
}
form .content .center span{
display: inline-block;
width: 200px;
text-align: left;
}
form .content .bottom {
line-height: 80px;
text-align: center;
}
form .content .bottom input {
width: 80%;
height: 50px;
background-color: rgb(8 23 221 / 30%);
border: none;
outline: none;
border-radius: 10px;
font-size: 22px;
font-weight: 700;
color: #fff;
}
form .content .bottom input:hover{
background-color: #E149AF;
box-shadow: 0 2px 0 1px rgba(225,73,175,0.5);
}
form .content .bottom input:active{
box-shadow: 0 1px 0 1px rgba(12,135,162,1);
}
</style>
</head>
<body>
<?php
if($_POST){
$zhixiang=$_POST['zhixiang'];
$gonggao=$_POST['gonggao'];
}
?>
<form action="" method="post">
<div class="content">
<div class="top">
<h3 style="font-size: 25px;
font-weight: 700;">计算弧的半径长度</h3>
</div>
<div class="center">
<div class="line">
<label>弧两边点的直线长度</label>
<input type="" name="zhixiang" autocomplete="off" value="<?php echo $zhixiang;?>" required="required">
</div>
<div class="line">
<label>拱高</label>
<input type="" name="gonggao" autocomplete="off" value="<?php echo $gonggao;?>" required="required">
</div>
<br>
</div>
<div class="bottom">
<input type="submit" value="开始计算">
</div>
<div class="center">
<div class="line not">
<?php
if($_POST){
$zhixiang=$_POST['zhixiang'];
$gonggao=$_POST['gonggao'];
$banjing=(($zhixiang/2)*($zhixiang/2)+($gonggao*$gonggao))/(2*$gonggao);
echo '
<label style="letter-spacing: 10px;">结果:弧的半径长度</label>
<input type="" name="" id="" value="'.$banjing.'" style=" text-align: center;">
';
}?>
</div>
<br>
</div>
</div>
</form>
</body>
</html>