|
1 | 1 | <!DOCTYPE html> |
2 | 2 | <html> |
3 | | - |
4 | 3 | <head> |
5 | 4 | <title>my home page</title> |
6 | 5 | <link href="style.css" rel="stylesheet" type="text/css"> |
7 | | -</head> |
| 6 | + <style> |
| 7 | + img { |
| 8 | + width: 204px; |
| 9 | + height: 128px; |
| 10 | + transition: width 5s; |
| 11 | + transition: height 4s; |
| 12 | + } |
| 13 | + |
| 14 | + img:active { |
| 15 | + width: 264px; |
| 16 | + height: 228px; |
| 17 | + } |
| 18 | + </style> |
8 | 19 |
|
| 20 | +</head> |
9 | 21 | <body> |
10 | 22 | <h1>My page</h1> |
11 | 23 | <h2>How to Cheat on Flappy Cube</h2> |
12 | 24 | <p>Just hold up</p> |
13 | 25 | <p></p> |
14 | | - <h2>Amazing links</h2><a HREF="https://en.m.wikipedia.org/wiki/Fish" > link to an amazing page</a> <a HREF="https://en.m.wikipedia.org/wiki/Fish"> link to a just as good page</a> |
| 26 | + <h2>Amazing links</h2><a HREF="https://en.m.wikipedia.org/wiki/Fish"> link to an amazing page</a> <a HREF="https://en.m.wikipedia.org/wiki/Fish"> link to a just as good page</a> |
15 | 27 | <h2>What hobbies am I interested in</h2> |
16 | 28 | <ul> |
17 | 29 | <li> |
18 | 30 | <a HREF="https://en.wikipedia.org/wiki/Wargaming"> Don't usually use wiki this much</a> |
19 | 31 | </li> |
20 | 32 | <li> |
21 | | - <a HREF="https://www.w3schools.com/html/html_lists.asp"> How to do what I do in index.html</a> |
| 33 | + <a HREF="http://www.w3schools.com/html/html_lists.asp"> How to do what I do in index.html</a> |
22 | 34 | </li> |
23 | 35 | <li>The above are the main ones</li> |
24 | 36 | </ul> |
25 | 37 | <h2>Good game</h2> |
26 | | - <img onclick="addFish()" src="fish.png" alt="good pic" style=";"> |
| 38 | + <img onclick="addFish()" src="fish.png" alt="good pic" height="128px"> |
27 | 39 | <p>You have <span id="fishQuantity">0</span> fish</p> |
28 | | - <h2> fish.com</h2> |
29 | | - <p onclick="buyapond">Pond: 15 fish<p> |
30 | | - <p onclick="buyafisherman"> Fisherman: 100 fish<p> |
31 | | - <p onclick="buyacoralreef">coral reef: 150<p> |
32 | | - <p onclick="buythegreatbarrierreef">coral the great barrier reef: 200<p> |
| 40 | + <h2> fish.com</h2> |
| 41 | + <p onclick="buy(20, 1)">Pond: 15 fish</p> |
| 42 | + <p onclick="buy(100, 10)"> Fisherman: 100 fish</p> |
| 43 | + <p onclick="buy(150, 20)">coral reef: 150</p> |
| 44 | + <p onclick="buy(200, 50)">coral the great barrier reef: 200</p> |
33 | 45 | <script> |
34 | 46 | var fish = 0; |
35 | | - var fps = 0; |
| 47 | + var fps = 0; |
| 48 | + |
36 | 49 | function addFish() { |
37 | 50 | fish = fish + 1; |
38 | | - |
| 51 | + |
39 | 52 | // Show them how many fish they have |
40 | 53 | displayFish(); |
41 | 54 | } |
42 | 55 |
|
43 | | - // Display fish |
44 | | - function displayFish() { |
45 | | - fishQuantity.innerHTML = fish; |
| 56 | + // Display fish |
| 57 | + function displayFish() { |
| 58 | + fishQuantity.innerHTML = fish; |
46 | 59 | } |
47 | | - function addfps(){ |
48 | | - fish = fish + fps |
49 | | - } |
50 | | - |
51 | | - |
52 | | - function buyapond() { |
53 | | - if(fish>19) |
54 | | - fish = fish - 20 |
55 | | - fps = fps + 1 |
56 | | - } |
57 | | - function buyafisherman() { |
58 | | - if(fish>99) |
59 | | - fish = fish - 100 |
60 | | - fps = fps + 10 |
61 | | - } |
62 | | - function buyacoralreef () { |
63 | | - if(fish>149) |
64 | | - fish = fish - 150 |
65 | | - fps = fps + 20 |
66 | | - } |
67 | | - function buythegreatbarrierreef () { |
68 | | - if(fish>199) |
69 | | - fish = fish - 200 |
70 | | - fps = fps + 50 |
71 | | - } |
72 | | - |
73 | | - setInterval(addfps, 1000); |
| 60 | + |
| 61 | + function addfps() { |
| 62 | + fish = fish + fps; |
| 63 | + displayFish(); |
| 64 | + } |
| 65 | + |
| 66 | + function buy(cost, fpsToAdd) { |
| 67 | + if (fish >= cost) { |
| 68 | + fish = fish - cost; |
| 69 | + displayFish(); |
| 70 | + fps = fps + fpsToAdd; |
| 71 | + } |
| 72 | + } |
| 73 | + |
| 74 | + setInterval(addfps, 1000); |
74 | 75 | </script> |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | | - |
80 | | - <h1> I am soooooooooooooooooooooooooooooooooo talented</h1> |
81 | | - |
| 76 | + <h1> I am soooooooooooooooooooooooooooooooooo talented</h1> |
| 77 | + |
82 | 78 | </body> |
83 | 79 | </html> |
0 commit comments