Browse Source

fix flex

master
Muqriz 4 months ago
parent
commit
7f89164125
4 changed files with 61 additions and 9 deletions
  1. 14
    1
      industri.html
  2. 17
    4
      pembangunan.html
  3. 16
    3
      penternakan.html
  4. 14
    1
      pertanian.html

+ 14
- 1
industri.html View File

106
             var numberRegex = /\d/; // Regular expression to check for any digit
106
             var numberRegex = /\d/; // Regular expression to check for any digit
107
             var matchedFile;
107
             var matchedFile;
108
 
108
 
109
+            var keywordMapping = {
110
+                'industri': 'industri.html',
111
+                'pembangunan': 'pembangunan.html',
112
+                'penternakan': 'penternakan.html',
113
+                'pertanian': 'pertanian.html'
114
+            };
115
+
116
+            if (keywordMapping[fileInput]) {
117
+                // If the input matches one of the keywords, redirect to the corresponding file
118
+                window.location.href = keywordMapping[fileInput];
119
+                return;
120
+            }
121
+
109
             if (numberRegex.test(fileInput)) {
122
             if (numberRegex.test(fileInput)) {
110
                 // Hardcoded list of files containing numbers
123
                 // Hardcoded list of files containing numbers
111
                 var numberFiles = [
124
                 var numberFiles = [
177
                 // File found, redirect to it
190
                 // File found, redirect to it
178
                 window.location.href = matchedFile;
191
                 window.location.href = matchedFile;
179
             } else {
192
             } else {
180
-                alert('No file containing the input ' + fileInput + ' was found.');
193
+                // alert('No file containing the input ' + fileInput + ' was found.');
181
             }
194
             }
182
         });
195
         });
183
     </script>
196
     </script>

+ 17
- 4
pembangunan.html View File

68
             </div>
68
             </div>
69
         </div>
69
         </div>
70
 
70
 
71
-        <div class="text-left pt-1 container text-nowrap flex-wrap">
72
-            <div class="pt-4 flex-wrap" style="display: flex; flex-wrap: wrap;width: 100px;">
71
+        <div class="text-left pt-1 container text-nowrap flex-wrap" style="display: flex;">
72
+            <div class="pt-4 flex-wrap" style="display: flex; flex-wrap: wrap;gap: 10px;">
73
                 <h6 style="width: 100%;">Kuantan</h6>
73
                 <h6 style="width: 100%;">Kuantan</h6>
74
                 <a href="./details/detail_hsd62438.html" class="button-23 mb-2 mr-2" style="background-color: #1F9027; color: white; border: none;" role="button">HSD 62438</a>
74
                 <a href="./details/detail_hsd62438.html" class="button-23 mb-2 mr-2" style="background-color: #1F9027; color: white; border: none;" role="button">HSD 62438</a>
75
                 <a href="./details/detail_hsd62441.html" class="button-23 mb-2 mr-2" style="background-color: #1F9027; color: white; border: none;" role="button">HSD 62441</a>
75
                 <a href="./details/detail_hsd62441.html" class="button-23 mb-2 mr-2" style="background-color: #1F9027; color: white; border: none;" role="button">HSD 62441</a>
89
         
89
         
90
 
90
 
91
 
91
 
92
-        <div class="text-left pt-1 pb-5 container text-nowrap flex-wrap">
92
+        <div class="text-left pt-1 pb-5 container text-nowrap flex-wrap" style="display: flex;">
93
             <div class="pt-4 text-nowrap flex-wrap">
93
             <div class="pt-4 text-nowrap flex-wrap">
94
                 <h6>Rompin</h6>
94
                 <h6>Rompin</h6>
95
                 <a href="./details/detail_hsd5715.html" class="button-23 mb-2 mr-2"
95
                 <a href="./details/detail_hsd5715.html" class="button-23 mb-2 mr-2"
132
             var numberRegex = /\d/; // Regular expression to check for any digit
132
             var numberRegex = /\d/; // Regular expression to check for any digit
133
             var matchedFile;
133
             var matchedFile;
134
 
134
 
135
+            var keywordMapping = {
136
+                'industri': 'industri.html',
137
+                'pembangunan': 'pembangunan.html',
138
+                'penternakan': 'penternakan.html',
139
+                'pertanian': 'pertanian.html'
140
+            };
141
+
142
+            if (keywordMapping[fileInput]) {
143
+                // If the input matches one of the keywords, redirect to the corresponding file
144
+                window.location.href = keywordMapping[fileInput];
145
+                return;
146
+            }
147
+            
135
             if (numberRegex.test(fileInput)) {
148
             if (numberRegex.test(fileInput)) {
136
                 // Hardcoded list of files containing numbers
149
                 // Hardcoded list of files containing numbers
137
                 var numberFiles = [
150
                 var numberFiles = [
203
                 // File found, redirect to it
216
                 // File found, redirect to it
204
                 window.location.href = matchedFile;
217
                 window.location.href = matchedFile;
205
             } else {
218
             } else {
206
-                alert('No file containing the input ' + fileInput + ' was found.');
219
+                // alert('No file containing the input ' + fileInput + ' was found.');
207
             }
220
             }
208
         });
221
         });
209
     </script>
222
     </script>

+ 16
- 3
penternakan.html View File

128
             </div>
128
             </div>
129
         </div>
129
         </div>
130
 
130
 
131
-        <div class="text-left pt-1 pb-5 container">
132
-            <div class="pt-4 text-nowrap flex-wrap">
131
+        <div class="text-left pt-1 pb-5 container" style="display: flex;">
132
+            <div class="pt-4 text-nowrap flex-wrap" style="gap: 10px;">
133
                 <h6>Rompin</h6>
133
                 <h6>Rompin</h6>
134
                 <a href="./details/detail_hsd4638.html" class="button-23 mb-2 mr-2"
134
                 <a href="./details/detail_hsd4638.html" class="button-23 mb-2 mr-2"
135
                     style="background-color: #1F9027; color: white; border: none;" role="button">HSD 4638</a>
135
                     style="background-color: #1F9027; color: white; border: none;" role="button">HSD 4638</a>
183
             var numberRegex = /\d/; // Regular expression to check for any digit
183
             var numberRegex = /\d/; // Regular expression to check for any digit
184
             var matchedFile;
184
             var matchedFile;
185
 
185
 
186
+            var keywordMapping = {
187
+                'industri': 'industri.html',
188
+                'pembangunan': 'pembangunan.html',
189
+                'penternakan': 'penternakan.html',
190
+                'pertanian': 'pertanian.html'
191
+            };
192
+
193
+            if (keywordMapping[fileInput]) {
194
+                // If the input matches one of the keywords, redirect to the corresponding file
195
+                window.location.href = keywordMapping[fileInput];
196
+                return;
197
+            }
198
+
186
             if (numberRegex.test(fileInput)) {
199
             if (numberRegex.test(fileInput)) {
187
                 // Hardcoded list of files containing numbers
200
                 // Hardcoded list of files containing numbers
188
                 var numberFiles = [
201
                 var numberFiles = [
254
                 // File found, redirect to it
267
                 // File found, redirect to it
255
                 window.location.href = matchedFile;
268
                 window.location.href = matchedFile;
256
             } else {
269
             } else {
257
-                alert('No file containing the input ' + fileInput + ' was found.');
270
+                // alert('No file containing the input ' + fileInput + ' was found.');
258
             }
271
             }
259
         });
272
         });
260
     </script>
273
     </script>

+ 14
- 1
pertanian.html View File

81
             var numberRegex = /\d/; // Regular expression to check for any digit
81
             var numberRegex = /\d/; // Regular expression to check for any digit
82
             var matchedFile;
82
             var matchedFile;
83
 
83
 
84
+            var keywordMapping = {
85
+                'industri': 'industri.html',
86
+                'pembangunan': 'pembangunan.html',
87
+                'penternakan': 'penternakan.html',
88
+                'pertanian': 'pertanian.html'
89
+            };
90
+
91
+            if (keywordMapping[fileInput]) {
92
+                // If the input matches one of the keywords, redirect to the corresponding file
93
+                window.location.href = keywordMapping[fileInput];
94
+                return;
95
+            }
96
+
84
             if (numberRegex.test(fileInput)) {
97
             if (numberRegex.test(fileInput)) {
85
                 // Hardcoded list of files containing numbers
98
                 // Hardcoded list of files containing numbers
86
                 var numberFiles = [
99
                 var numberFiles = [
152
                 // File found, redirect to it
165
                 // File found, redirect to it
153
                 window.location.href = matchedFile;
166
                 window.location.href = matchedFile;
154
             } else {
167
             } else {
155
-                alert('No file containing the input ' + fileInput + ' was found.');
168
+                // alert('No file containing the input ' + fileInput + ' was found.');
156
             }
169
             }
157
         });
170
         });
158
     </script>
171
     </script>

Loading…
Cancel
Save