You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

raub.html 9.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
  6. <!-- CSP is a PITA ;). Disabled, don't try this at home!-->
  7. <meta http-equiv="Content-Security-Policy" content="">
  8. <!-- include bulma css -->
  9. <link rel="stylesheet" href="bulma/css/bulma.min.css">
  10. <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
  11. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-abc123..." crossorigin="anonymous" />
  12. <link rel="stylesheet" href="../css/app.css">
  13. <link rel="stylesheet" href="../css/animate.css">
  14. </head>
  15. <body>
  16. <section class="section" style="max-height: 100vh;">
  17. <div class=""
  18. style="z-index: 3;background-color: #1F3F6D; min-height: 50px; display: flex; align-items: center;padding-left: 100px;">
  19. <h6 style="color: white;margin-right: 1em;" class=""><a style="color: white;" href="../index.html"><i
  20. class="fas fa-chevron-left"></i></a></h6>
  21. <h6 style="color: white;">Raub</h6>
  22. </div>
  23. <div class="text-center pt-5"
  24. style=" z-index: 2; position: relative;background-color: white; min-height: 50px; display: flex; justify-content: center; align-items: center; padding-left: 100px;">
  25. <button id="pembangun_btn" type="button" class="p-1"
  26. style="font-weight: 500; border-top: 4px solid #BF3030; border-right: none; border-bottom: none; border-left: none; margin: 0; background-color: transparent;">&emsp;&emsp;Pembangunan&emsp;&emsp;</button>
  27. <button id="pertanian_btn" type="button" class="p-1"
  28. style="font-weight: 500; border-top: 4px solid #E2E236; border-right: none; border-bottom: none; border-left: none; margin: 0; background-color: transparent;">&emsp;&emsp;Pertanian&emsp;&emsp;</button>
  29. </div>
  30. <div class="text-center pt-1"
  31. style="background-color: white; min-height: 50px; display: flex; justify-content: center; align-items: center; padding-left: 400px;">
  32. <div class="pt-5 position-relative" style="width: 600px;height: 100px;margin-top: -200px;">
  33. <svg class="map-svg" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"
  34. xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="100 170 600 600"
  35. style="enable-background: new 0 0 1080 1080" xml:space="preserve">
  36. <g>
  37. <a href="#" data-area="jerantut">
  38. <path id="raub" class="pahang-barat"
  39. d="M353.9,410.6c-3.2,7.6-9.2,19.1-4.7,22.8c8.4,7,4,13.7,5,20.6c2.6,16.3-7.4,32.1-16.7,37.8
  40. c-13.2,8.1-9.9,13.7-6.7,23.2c1,3,0.4,6.6,0.5,9.9c-9.6,6.5-16.9,13.6-9.6,26.4c1.1,1.9-0.8,5.5-1.2,8.3c-1.3,1.6-2.3,4.3-3.8,4.6
  41. c-15,3.1-27.4-6.8-28.5-22.9c-0.4-5.5,0.3-11-4.9-14.7c0,0,0,0,0,0c-0.9-4.7-4.1-7.8-8.6-7.9c-7.1-0.1-11.7-3.5-15.5-9
  42. c-2.1-3.1-4.8-6.8-9.2-4.6c-5.5,2.8-2.9,7.4-0.7,10.8c5.1,8.1,0.3,11.2-6.4,11.4c-9.4,0.3-14.3,6-18.9,12.7
  43. c-4.9-1.5-8.4-4.5-9.1-9.6c-1.9-13.1-10.6-21.7-19.5-30.2c-3.1-3-6.7-5.9-11.1-5.2c-19.1,2.7-31.5-6.8-40.7-21.8
  44. c-8.2-13.6-29.8-22.3-16.1-44.4c2-3.3,0.3-10.9-4.2-13.8c-9.1-5.9-8.5-14.5-8.8-23.4c-0.3-13,4.4-27-7.6-38
  45. c-3.1-2.9,0-7.3,2.2-10.4c3.4-4.8,7.1-9.4,10.6-14.1c13.4-4,26.3-3.6,40.2-0.6c12.2,2.6,27,4,35.2-11.1c0.5,0,0.9-0.1,1.4,0
  46. c4.3,6.5,9.4,11.3,17.5,11.4c4.9,0.1,6.7,3,5.9,7.6c-2,12.2,3.8,16.3,14.2,15.6h5.9c0.1,0,0.3,0,0.4,0c3.3,0,5.6-1.3,6.2-4.9
  47. c2.3-13.1,18.5-13.1,23.6-24.1c0.7-1.5,10.7-0.1,15.4,2.1c5,2.4,0.3,6.8-0.8,9.8c-3.6,9.1,0,16.8,4.8,23.8
  48. c5.5,7.9,3.1,12.4-4.8,15.4c-4.9,1.8-9.2,4.8-7.3,10c2.8,7.5,9.6,13.1,16.5,15.9c5.8,2.3,12.1-2.1,16-7.7c1.7-2.4,3-5.1,4.7-7.5
  49. c3.4-4.6,5.9-11.9,12.6-11c6.3,0.9,13,3.9,12.1,13.2c-0.2,2,4.9,4.2,5.1,6.6C345.4,400.8,358.4,400.9,353.9,410.6z" />
  50. </a>
  51. </g>
  52. </svg>
  53. <div class="plot animate__animated animate__bounceIn pembangunan-point position-absolute" style="background-color: #BF3030; width: 0.8rem; height: 0.8rem;border: 2px solid white;border-radius: 600px;top:340px;left:160px"></div>
  54. <div class="plot animate__animated animate__bounceIn pertanian-point position-absolute hidden" style="background-color: #E2E236; width: 0.8rem; height: 0.8rem;border: 2px solid white;border-radius: 600px;top:355px;left:145px"></div>
  55. </div>
  56. </div>
  57. <div id="pembangun_plot" class="content-div">
  58. <div class="text-center pt-5"
  59. style="background-color: white; display: flex; justify-content: left; align-items: left; padding-left: 100px;margin-top: 250px;">
  60. <h6>Pembangunan</h6><br>
  61. </div>
  62. <div class="text-center pt-2 text-nowrap flex-wrap"
  63. style="background-color: white; display: flex; justify-content: left; align-items: left; padding-left: 100px; margin-top: 0;gap: 10px;padding-right: 100px;">
  64. <a href="../details/detail_hsd11863.html" class="button-23 mb-2 mr-2"
  65. style="background-color: #1F9027; color: white; border: none;" role="button">HSD 11863</a>
  66. </div>
  67. </div>
  68. <div id="pertanian_plot" class="hidden content-div">
  69. <div class="text-center pt-5"
  70. style="background-color: white; display: flex; justify-content: left; align-items: left; padding-left: 100px;margin-top: 250px;">
  71. <h6>Pertanian</h6><br>
  72. </div>
  73. <div class="text-center pt-2 text-nowrap flex-wrap"
  74. style="background-color: white; display: flex; justify-content: left; align-items: left; padding-left: 100px; margin-top: 0;gap: 10px;padding-right: 100px;">
  75. <a href="../details/detail_hsd11991.html" class="button-23 mb-2 mr-2"
  76. style="background-color: #1F9027; color: white; border: none;" role="button">HSD 11991</a>
  77. </div>
  78. </div>
  79. </section>
  80. <script>
  81. document.getElementById('pembangun_btn').addEventListener('click', function () {
  82. showDiv('pembangun_plot');
  83. showPoint('pembangunan-point');
  84. });
  85. document.getElementById('pertanian_btn').addEventListener('click', function () {
  86. showDiv('pertanian_plot');
  87. showPoint('pertanian-point');
  88. });
  89. function showDiv(divId) {
  90. var divs = document.getElementsByClassName('content-div');
  91. for (var i = 0; i < divs.length; i++) {
  92. divs[i].classList.add('hidden');
  93. }
  94. document.getElementById(divId).classList.remove('hidden');
  95. }
  96. function showPoint(plotClass) {
  97. var divs = document.getElementsByClassName('plot');
  98. for (var i = 0; i < divs.length; i++) {
  99. divs[i].classList.add('hidden');
  100. }
  101. var plots = document.getElementsByClassName(plotClass);
  102. for (var i = 0; i < divs.length; i++) {
  103. plots[i].classList.remove('hidden');
  104. }
  105. }
  106. </script>
  107. <script>
  108. let raub = document.querySelector("#raub");
  109. addLabelText(raub, "Raub");
  110. function addLabelText(bgPath, labelText) {
  111. let bbox = bgPath.getBBox();
  112. let x = bbox.x + bbox.width / 2;
  113. let y = bbox.y + bbox.height / 2;
  114. // Create a <text> element
  115. let textElem = document.createElementNS(bgPath.namespaceURI, "text");
  116. // X axis
  117. if (labelText == "Bentong") {
  118. textElem.setAttribute("x", 286);
  119. } else if (labelText == "Pekan") {
  120. textElem.setAttribute("x", 870);
  121. } else if (labelText == "Cameron") {
  122. textElem.setAttribute("x", 75);
  123. } else {
  124. textElem.setAttribute("x", x);
  125. }
  126. // Y axis
  127. if (labelText == "Rompin") {
  128. textElem.setAttribute("y", 935);
  129. } else if (labelText == "Pekan") {
  130. textElem.setAttribute("y", 650);
  131. } else if (labelText == "Kuantan") {
  132. textElem.setAttribute("y", 440);
  133. } else if (labelText == "Cameron") {
  134. textElem.setAttribute("y", 130);
  135. } else if (labelText == "Highland") {
  136. textElem.setAttribute("y", 155);
  137. } else {
  138. textElem.setAttribute("y", y);
  139. }
  140. // Centre text horizontally at x,y
  141. textElem.setAttribute("text-anchor", "middle");
  142. // Give it a class that will determine the text size, colour, etc
  143. if (labelText == "Cameron" || labelText == "Highland") {
  144. textElem.classList.add("label-text-cameron");
  145. } else {
  146. textElem.classList.add("label-text");
  147. }
  148. // Set the text
  149. textElem.textContent = labelText;
  150. // Add this text element directly after the label background path
  151. bgPath.after(textElem);
  152. }
  153. </script>
  154. <script defer src="/ruta relativa a mi archivo .js"></script>
  155. </body>
  156. </html>