Skip to content

Commit

Permalink
Merge pull request #41 from nhsprite/master
Browse files Browse the repository at this point in the history
Merge blog & calculator from nihao
  • Loading branch information
raytaylorlin committed Mar 20, 2014
2 parents d19587f + e9e52d3 commit f7dfc65
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 45 deletions.
58 changes: 47 additions & 11 deletions nihao/blog/blog.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
div#container{width:1300px}
div#header {background-color:#99bbbb;text-align: center;}
div#menu1 {background-color:#ffff99;height:200px;width:300px;float:left;}
div#content1 {background-color:#FFE66F;height:200px;width:1000px;float:left;}
div#menu2 {background-color:#ffff99;height:200px;width:300px;float:left;}
div#content2 {background-color:#FFE66F;height:200px;width:1000px;float:left;}
div#footer {background-color:#99bbbb;clear:both;text-align:center;}
h1 {margin-bottom:0;}
h2 {margin-bottom:1;font-size:18px;}
ul {margin:10;}
li {list-style:none;}
body {
height: 100%;
margin: 0;
padding: 0;
}
.container {
width:100%;
height:100%;
}
.header {
position: relative;
width: 100%;
height: 40px;
line-height: 20px;
top: 0px;
}

.content {
text-align: left;
height:100%;
width:100%;
float:left;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 20px;
background-color: #d93a49;
clear:both;
text-align:center;
}
h1 {
margin-left: 1cm;
margin-bottom:0;
}
h2 {
margin-left: 1cm;
margin-bottom:0;
font-size:18px;
}
ul {
margin:0;
}
li {
list-style:none;
}
57 changes: 23 additions & 34 deletions nihao/blog/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,36 @@
<meta charset="utf-8">
<html>
<head>
<link rel="stylesheet" type="text/css" href="blog.css"><title>倪浩的个人主页</title>
<link rel="stylesheet" type="text/css" href="blog.css">
<title>倪浩的个人主页</title>
</head>
<body>
<div id="container">
<div id="header">
<h1>
<marquee>倪浩的个人主页</marquee>

</h1>
</div>
<div id="menu1">
<h2>个人资料</h2>
<ul>
<li>姓名</li>
<li>性别</li>
<li>出生年月</li>
<li>EMAIL</li>
<li>家乡</li>
</ul>
<div class="container">
<div class="header">
<h1>倪浩的个人主页</h1>
</div>
<div id="content1">
<h2>&nbsp;</h2>
<u1>
<li>倪浩</li>
<li></li>
<li>1993.2</li>
<li><a href="mailto:1032274844@qq.com?subject=Hello%20again">1032274844@qq.com</a></li>
<li>湖北省荆州市</li>
</div>
<hr>
<div id="menu2">
<hr color="red";>
<div class="content">
<h2>个人资料</h2>
<ul>
<li>姓名:倪浩</li>
<li>性别:男</li>
<li>出生年月:1993.2.17</li>
<li>EMAIL:<a href="mailto:1032274844@qq.com?subject=Hello%20again">1032274844@qq.com</a></li>
<li>家乡:湖北省荆州市</li>
</ul>
<hr color="red";>
<h2>喜欢的电影</h2>
</div>
<div id="content2">
<h2>&nbsp;</h2>
<ul>
<li>钢铁侠系列</li>
<li>星级大战系列</li>
<li>星球大战系列</li>
<li>哈林波特系列</li>
<li>指环王系列</li>
</ul>
<hr color="red";>
</div>
<div id="footer">
<marquee>THANKS FOR COMING!</marquee>
<div class="footer" ;>
THANKS FOR COMING!
</div>

</body>
Expand Down
39 changes: 39 additions & 0 deletions nihao/calculator/cal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
body{
background-color: #ffffff;
}
.container{
margin-left: auto;
margin-right: auto;
width: 400px;
height: 430px;
line-height: 20px;
border-style: solid;
border-color: red;
}

#ButtonPercent{
height: 50px;
width: 150px;
margin-left: 10px;
margin-top: 20px;
}
#ButtonAC{
height: 50px;
width: 150px;
margin-left: 65px;
margin-top: 20px;
}

button{
height: 50px;
width: 80px;
margin-left: 10px;
margin-top: 20px;
outline-color: #EE4000;
background-color: #CDCD00;
}

h1{
text-align: center;
}

42 changes: 42 additions & 0 deletions nihao/calculator/cal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="cal.css">
<script src="cal.js"></script>
<title>calculator</title>
</head>
<body>
<form>
<h1>CALCULATOR</h1>
<hr color="red";>
<div class="container">
<input type="text" name="expr" style="width:396px; height:60px; background:#00FFFF" />
<button type="button" id="ButtonPercent" onclick="percent(this.form)">%</button>
<button id="ButtonAC" value="AC" onclick="form.reset()">AC</button>
<div>
<button type="button" value="7" onclick="enter(this.form,seven)">7</button>
<button type="button" value="8" onclick="enter(this.form,eight)">8</button>
<button type="button" value="9" onclick="enter(this.form,nine)">9</button>
<button type="button" value="/" onclick="enter(this.form,divide)">/</button>
</div>
<div>
<button type="button" value="4" onclick="enter(this.form,four)">4</button>
<button type="button" value="5" onclick="enter(this.form,five)">5</button>
<button type="button" value="6" onclick="enter(this.form,six)">6</button>
<button type="button" value="*" onclick="enter(this.form,multiply)">*</button>
</div>
<div>
<button type="button" value="1" onclick="enter(this.form,one)">1</button>
<button type="button" value="2" onclick="enter(this.form,two)">2</button>
<button type="button" value="3" onclick="enter(this.form,three)">3</button>
<button type="button" value="-" onclick="enter(this.form,minus)">-</button>
</div>
<div>
<button type="button" value="0" onclick="enter(this.form,zero)">0</button>
<button type="button" value="." onclick="enter(this.form,point)"><b>.</b></button>
<button type="button" value="=" onclick="compute(this.form)">=</button>
<button type="button" value="+" onclick="enter(this.form,plus)">+</button>
</div>
</form>
</body>
</html>
27 changes: 27 additions & 0 deletions nihao/calculator/cal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
var one = "1"
var two = '2'
var three = '3'
var four = '4'
var five = '5'
var six = '6'
var seven = '7'
var eight = '8'
var nine = '9'
var zero = '0'
var plus = '+'
var minus = '-'
var multiply = '*'
var divide = '/'
var point = '.'

function compute(obj){
obj.expr.value = eval(obj.expr.value)
}

function enter(obj,string){
obj.expr.value += string
}

function percent(obj){
obj.expr.value = eval(obj.expr.value+'/100')
}

0 comments on commit f7dfc65

Please sign in to comment.