-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
157 lines (137 loc) · 3.13 KB
/
index.html
File metadata and controls
157 lines (137 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
box-sizing: border-box;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a, .dropbtn {
display: inline-block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
li.dropdown {
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {background-color: #f1f1f1}
.dropdown:hover .dropdown-content {
display: block;
}
.main {
float:left;
width:70%;
height: 600px;
padding:0 20px;
}
.right {
background-color:rgb(120, 120, 120);
float:left;
width:30%;
padding:15px;
height: 600px;
margin-top:7px;
text-align:center;
}
@media only screen and (max-width:800px) {
/* For mobile phones: */
.main, .right {
width:100%;
}
}
</style>
</head>
<body style="font-family:Verdana;color:#aaaaaa;" onload="init();">
<div style="background-color:rgb(0, 255, 255);padding:45px;text-align:center;">
<h1>Richard website</h1>
</div>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="ph.html">photo</a></li>
<li class="dropdown">
<a href="javascript:void(0)" class="dropbtn">introduction</a>
<div class="dropdown-content">
<a href="family.html">family</a>
<a href="club.html">club</a>
<a href="motto.html">motto</a>
</div>
</li>
</ul>
<div class="main">
<h2>welcome to Richard website</h2>
<p>This is a first website about me.</p>
<br>
<p>This is a canvas</p>
<canvas id="myCanvas" width="500" height="300" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script language="JavaScript">
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.fillStyle = "red";
ctx.fillRect(0, 0, 500, 300);
var x=0,y=125;
var width=50;
function rect(){
ctx.fillRect(0, 0, 500, 300);
move();
ctx.clearRect(x,y,width,width);
if(x+width>500)
ctx.clearRect(0,y,width-500+x,width);
}
function move(){
if(x>500)
x=0;
else
x++;
}
function init(){
setInterval(rect,10);
}
</script>
</div>
<div class="right">
<h2>About Richard</h2>
<img src="photo/aries.jpg" alt="Cinque Terre" width="300" height="200">
<p>Brithday 03/26</p>
<img id="myImage" src="photo/middle.jpg" style="width:300px">
<br>
<button onclick="document.getElementById('myImage').src='photo/left.jpg'">Turn left</button>
<button onclick="document.getElementById('myImage').src='photo/middle.jpg'">middle</button>
<button onclick="document.getElementById('myImage').src='photo/right.jpg'">Turn right</button>
</div>
</div>
<div style="background-color:#e5e5e5;text-align:center;padding:20px;margin-top:10px;">
<hr>
© copyright</div>
</body>
</html>