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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-abc123..." crossorigin="anonymous" />
  10. <link rel="stylesheet" href="../css/app.css">
  11. <link rel="stylesheet" href="../css/animate.css">
  12. </head>
  13. <body>
  14. <section class="section animate__animated animate__fadeIn" style="max-height: 100vh;">
  15. <div class=""
  16. style="z-index: 3;background-color: #1F3F6D; min-height: 50px; display: flex; align-items: center;padding-left: 100px;">
  17. <h6 style="color: white;margin-right: 1em;" class=""><a style="color: white;" href="../index.html"><i
  18. class="fas fa-chevron-left"></i></a></h6>
  19. <h6 style="color: white;">Raub</h6>
  20. </div>
  21. <div class="text-center pt-5"
  22. style=" z-index: 2; position: relative;background-color: white; min-height: 50px; display: flex; justify-content: center; align-items: center; padding-left: 100px;">
  23. <button id="pembangun_btn" type="button" class="p-1"
  24. 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>
  25. <button id="pertanian_btn" type="button" class="p-1"
  26. 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>
  27. </div>
  28. <div class="text-center pt-1"
  29. style="min-height: 50px; display: flex; justify-content: center; align-items: center; padding-left: 400px;">
  30. <div class="pt-5 position-relative" style="width: 600px;height: 100px;margin-top: -200px;">
  31. <svg class="map-svg" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"
  32. xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="100 170 600 600"
  33. style="enable-background: new 0 0 1080 1080" xml:space="preserve">
  34. <g>
  35. <a href="#" data-area="jerantut">
  36. <path id="raub" class="pahang-barat"
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. 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
  43. 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
  44. 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
  45. 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
  46. 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
  47. 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" />
  48. </a>
  49. </g>
  50. </svg>
  51. <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>
  52. <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>
  53. </div>
  54. </div>
  55. <div id="pembangun_plot" class="position-relative content-div animate__animated animate__fadeIn" style="z-index: 3;background-color: rgb(0, 0, 0, 0);">
  56. <div class="text-center pt-5"style="display: flex; justify-content: left; align-items: left; padding-left: 100px;margin-top: 250px;">
  57. <h6>Pembangunan</h6><br>
  58. </div>
  59. <div class="text-center pt-2 text-nowrap flex-wrap"
  60. style="display: flex; justify-content: left; align-items: left; padding-left: 100px; margin-top: 0;gap: 10px;padding-right: 100px;">
  61. <a href="../details/detail_hsd11863.html" class="button-23 mb-2 mr-2"
  62. style="background-color: #1F9027; color: white; border: none;" role="button">HSD 11863</a>
  63. </div>
  64. </div>
  65. <div id="pertanian_plot" class="hidden position-relative content-div animate__animated animate__fadeIn" style="z-index: 3;background-color: rgb(0, 0, 0, 0);">
  66. <div class="text-center pt-5"style="display: flex; justify-content: left; align-items: left; padding-left: 100px;margin-top: 250px;">
  67. <h6>Pertanian</h6><br>
  68. </div>
  69. <div class="text-center pt-2 text-nowrap flex-wrap"style="display: flex; justify-content: left; align-items: left; padding-left: 100px; margin-top: 0;gap: 10px;padding-right: 100px;">
  70. <a href="../details/detail_hsd11991.html" class="button-23 mb-2 mr-2"
  71. style="background-color: #1F9027; color: white; border: none;" role="button">HSD 11991</a>
  72. </div>
  73. </div>
  74. </section>
  75. <script>
  76. document.getElementById('pembangun_btn').addEventListener('click', function () {
  77. showDiv('pembangun_plot');
  78. sessionStorage.setItem("prev-btn", 'pembangun_btn');
  79. showPoint('pembangunan-point');
  80. });
  81. document.getElementById('pertanian_btn').addEventListener('click', function () {
  82. showDiv('pertanian_plot');
  83. sessionStorage.setItem("prev-btn", 'pertanian_btn');
  84. showPoint('pertanian-point');
  85. });
  86. function showDiv(divId) {
  87. var divs = document.getElementsByClassName('content-div');
  88. for (var i = 0; i < divs.length; i++) {
  89. divs[i].classList.add('hidden');
  90. }
  91. document.getElementById(divId).classList.remove('hidden');
  92. }
  93. function showPoint(plotClass) {
  94. var divs = document.getElementsByClassName('plot');
  95. for (var i = 0; i < divs.length; i++) {
  96. divs[i].classList.add('hidden');
  97. }
  98. var plots = document.getElementsByClassName(plotClass);
  99. for (var i = 0; i < plots.length; i++) {
  100. plots[i].classList.remove('hidden');
  101. }
  102. }
  103. if(sessionStorage.getItem("prev-btn")){
  104. let prev_btn = sessionStorage.getItem("prev-btn");
  105. let targetButton = document.getElementById(prev_btn);
  106. targetButton.click();
  107. }
  108. </script>
  109. <script>
  110. let raub = document.querySelector("#raub");
  111. addLabelText(raub, "Raub");
  112. function addLabelText(bgPath, labelText) {
  113. let bbox = bgPath.getBBox();
  114. let x = bbox.x + bbox.width / 2;
  115. let y = bbox.y + bbox.height / 2;
  116. // Create a <text> element
  117. let textElem = document.createElementNS(bgPath.namespaceURI, "text");
  118. // X axis
  119. if (labelText == "Bentong") {
  120. textElem.setAttribute("x", 286);
  121. } else if (labelText == "Pekan") {
  122. textElem.setAttribute("x", 870);
  123. } else if (labelText == "Cameron") {
  124. textElem.setAttribute("x", 75);
  125. } else {
  126. textElem.setAttribute("x", x);
  127. }
  128. // Y axis
  129. if (labelText == "Rompin") {
  130. textElem.setAttribute("y", 935);
  131. } else if (labelText == "Pekan") {
  132. textElem.setAttribute("y", 650);
  133. } else if (labelText == "Kuantan") {
  134. textElem.setAttribute("y", 440);
  135. } else if (labelText == "Cameron") {
  136. textElem.setAttribute("y", 130);
  137. } else if (labelText == "Highland") {
  138. textElem.setAttribute("y", 155);
  139. } else {
  140. textElem.setAttribute("y", y);
  141. }
  142. // Centre text horizontally at x,y
  143. textElem.setAttribute("text-anchor", "middle");
  144. // Give it a class that will determine the text size, colour, etc
  145. if (labelText == "Cameron" || labelText == "Highland") {
  146. textElem.classList.add("label-text-cameron");
  147. } else {
  148. textElem.classList.add("label-text");
  149. }
  150. // Set the text
  151. textElem.textContent = labelText;
  152. // Add this text element directly after the label background path
  153. bgPath.after(textElem);
  154. }
  155. </script>
  156. </body>
  157. </html>