Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
  5. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  6. <title>The Sinnoh Region</title>
  7. <style>
  8. * {
  9. color: #eee;
  10. -webkit-box-sizing: border-box;
  11. -khtml-box-sizing: border-box;
  12. -moz-box-sizing: border-box;
  13. -ms-box-sizing: border-box;
  14. -o-box-sizing: border-box;
  15. box-sizing: border-box;
  16. -webkit-transition: 0.05s ease-in;
  17. -khtml-transition: 0.05s ease-in;
  18. -moz-transition: 0.05s ease-in;
  19. -ms-transition: 0.05s ease-in;
  20. -o-transition: 0.05s ease-in;
  21. transition: 0.05s ease-in;
  22. font-family: courier;
  23. }
  24. #sinnoh {
  25. cursor: pointer;
  26. }
  27. div, img {
  28. margin: -2px;
  29. position: absolute;
  30. display: inline-block;
  31. }
  32. .nameplate {
  33. padding: 50px;
  34. text-align: center;
  35. background: transparent;
  36. color: transparent;
  37. font-size: 2em;
  38. }
  39. .nameplate:hover {
  40. background: rgba(160, 160, 200, .5);
  41. color: #eee;
  42. }
  43. </style>
  44. <script>
  45. $(document).ready(function() {
  46. var sinnoh = [
  47. {
  48. "name": "veritylakefront",
  49. "x": 0,
  50. "y": 8,
  51. "url": "http://i.imgur.com/2lnOcxb.png"
  52. },
  53. {
  54. "name": "route201",
  55. "x": 1,
  56. "y": 8,
  57. "url": "http://i.imgur.com/H0OXdNl.png"
  58. },
  59. {
  60. "name": "twinleaftown",
  61. "x": 1,
  62. "y": 9,
  63. "url": "http://i.imgur.com/Um4Dc1i.png"
  64. },
  65. {
  66. "name": "sandgemtown",
  67. "x": 3,
  68. "y": 8,
  69. "url": "http://i.imgur.com/Nyin8mI.png"
  70. },
  71. {
  72. "name": "jubilifecity",
  73. "x": 2,
  74. "y": 5,
  75. "url": "http://i.imgur.com/0SIqnfr.png"
  76. },
  77. {
  78. "name": "route202",
  79. "x": 3,
  80. "y": 7,
  81. "url": "http://i.imgur.com/RPFayaI.png"
  82. },
  83. {
  84. "name": "route219",
  85. "x": 3,
  86. "y": 9,
  87. "url": "http://i.imgur.com/Ec8IxTI.png"
  88. },
  89. {
  90. "name": "route220",
  91. "x": 3,
  92. "y": 10,
  93. "url": "http://i.imgur.com/5uBhjch.png"
  94. },
  95. {
  96. "name": "route204",
  97. "x": 3,
  98. "y": 3,
  99. "url": "http://i.imgur.com/evKGiip.png"
  100. },
  101. {
  102. "name": "route203",
  103. "x": 4,
  104. "y": 5,
  105. "url": "http://i.imgur.com/TVd8UO2.png"
  106. },
  107. {
  108. "name": "floaromatown",
  109. "x": 3,
  110. "y": 1,
  111. "url": "http://i.imgur.com/2s71Yat.png"
  112. },
  113. {
  114. "name": "route205",
  115. "x": 4,
  116. "y": 0,
  117. "url": "http://i.imgur.com/om4hwdM.png"
  118. },
  119. {
  120. "name": "oreburghcity",
  121. "x": 6,
  122. "y": 5,
  123. "url": "http://i.imgur.com/wY4g2D4.png"
  124. }
  125. ];
  126.  
  127. var sheet = $('#sinnoh');
  128. {
  129. var m,
  130. x,
  131. y,
  132. el,
  133. img,
  134. nameplate,
  135. map;
  136. for (var n = 0; n < sinnoh.length; n++) {
  137. map = sinnoh[n];
  138. m = map.name == 'floaromatown' ? 501.25 : 512;
  139. x = map.x * m;
  140. y = map.y * 512;
  141. el = $('<div>', {
  142. id: map.name
  143. }).css({
  144. top: y,
  145. left: x
  146. });
  147. img = $('<img>', {
  148. src: map.url,
  149. alt: map.name
  150. }).appendTo(el.appendTo(sheet));
  151.  
  152. img.load((function(par, map) {
  153. return function() {
  154. var self = $(this);
  155. par.append($('<div>', {
  156. html: map.name,
  157. class: 'nameplate'
  158. }).css({
  159. height: self.height(),
  160. width: self.width()
  161. }));
  162. };
  163. })(el, map));
  164.  
  165. }
  166. }
  167.  
  168. sheet.click(function() {
  169. document.location.href = 'http://www.pokecommunity.com/showthread.php?t=320333';
  170. });
  171. });
  172. </script>
  173. </head>
  174. <body>
  175. <span id="sinnoh"></span>
  176. </body>
  177. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement