forked from hamer1818/socket-numpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.htm
678 lines (564 loc) · 26.5 KB
/
index.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
<!DOCTYPE html>
<html lang="tr">
<head>
<title>2x2 Matris</title>
<!-- Bootstrap CDN CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://code.jquery.com/jquery-3.7.0.js" integrity="sha256-JlqSTELeR4TLqP0OG9dxM7yDPqX1ox/HfgiSLBj8+kM=" crossorigin="anonymous"></script>
</head>
<body>
<!-- Nav tabs -->
<ul class="container nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" href="#home">Matrix Determinant</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#menu1">Random Number Generator</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><i id="activeTheme" class="fa-solid fa-sun"></i> Seçili Tema</a>
<ul class="dropdown-menu">
<li class="dropdown-item" id="lightTheme"><i class="fa-solid fa-sun"></i> Açık Tema</li>
<li class="dropdown-item" id="darkTheme"><i class="fa-solid fa-moon"></i> Koyu Tema</li>
</ul>
</li>
</ul>
<!-- Matris Calculators -->
<div class="tab-content">
<div class="tab-pane container active" id="home">
<div class="container row">
<!-- Matris -1 -->
<form class="col-6 d-flex flex-column align-items-center justify-content-between mt-4 needs-validation" style="height: 50vh;" novalidate>
<h2 class="fw-medium text-dark text-center">2x2 Matris</h2>
<!-- Row-1 -->
<div class="px-5 d-flex gap-3">
<!-- Matris 1 -->
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris 1" name="2x2matrix1" id="2x2matrix1" required>
<label for="2x2matrix1">1. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris 2" name="2x2matrix2" id="2x2matrix2" required>
<label for="2x2matrix2">2. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
</div>
<!-- Row-1 End -->
<!-- Row-2 -->
<div class="px-5 d-flex gap-3">
<!-- Matris 3 -->
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris 3" name="2x2matrix3" id="2x2matrix3" required>
<label for="2x2matrix3">3. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<!-- Matris 4 -->
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris 4" name="2x2matrix4" id="2x2matrix4" required>
<label for="2x2matrix4">4. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
</div>
<!-- Row-2 End -->
<button id="2x2determinantBtn" class="btn btn-lg w-75 btn-success px-5 mt-2">Determinantı Hesapla</button>
<p class="text-secondary">Sonuç: <b class="det-results text-dark" id="2x2det"></b></p>
</form>
<!-- Matris -1 End -->
<!-- Matris -2 -->
<form class="needs-validation col-6 d-flex flex-column align-items-center justify-content-between mt-4" style="height: 50vh;" novalidate>
<h2 class="fw-medium text-dark text-center">3x3 Matris</h2>
<!-- Row-1 -->
<div class="px-5 d-flex gap-3">
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="3x3matrix1" id="3x3matrix1" required>
<label for="3x3matrix1">1. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="3x3matrix2" id="3x3matrix2" required>
<label for="3x3matrix2">2. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris"
name="3x3matrix3" id="3x3matrix3" required>
<label for="3x3matrix3">3. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
</div>
<!-- Row-1 End -->
<!-- Row-2 -->
<div class="px-5 d-flex gap-3">
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="3x3matrix4" id="3x3matrix4" required>
<label for="3x3matrix4">4. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="3x3matrix5" id="3x3matrix5" required>
<label for="3x3matrix5">5. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris"
name="3x3matrix6" id="3x3matrix6" required>
<label for="3x3matrix6">6. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
</div>
<!-- Row-2 End -->
<!-- Row-3 -->
<div class="px-5 d-flex gap-3">
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="3x3matrix7" id="3x3matrix7" required>
<label for="3x3matrix7">7. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="3x3matrix8" id="3x3matrix8" required>
<label for="3x3matrix8">8. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="3x3matrix9" id="3x3matrix9" required>
<label for="3x3matrix9">9. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
</div>
<!-- Row-3 End -->
<button id="3x3determinantBtn" class="btn btn-lg btn-success col-5 px-5 w-75 mt-2">Determinantı Hesapla</button>
<p class="text-secondary">Sonuç : <b class="det-results text-dark" id="3x3det"></b></p>
</form>
<!-- Matris -2 End -->
</div>
<div class="container row text-center">
<!-- Matris -3 -->
<form class="needs-validation col-12 d-flex flex-column align-items-center justify-content-between mt-5" style="height: 60vh;">
<h2 class="fw-medium text-dark text-center">4x4 Matris</h2>
<!-- Row-1 -->
<div class="px-5 d-flex gap-3">
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix1" id="4x4matrix1" required>
<label for="4x4matrix1">1. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix2" id="4x4matrix2" required>
<label for="4x4matrix2">2. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix3" id="4x4matrix3" required>
<label for="4x4matrix3">3. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix4" id="4x4matrix4" required>
<label for="4x4matrix4">4. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
</div>
<!-- Row-1 End -->
<!-- Row-2 -->
<div class="px-5 d-flex gap-3">
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix5" id="4x4matrix5" required>
<label for="4x4matrix5">5. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix6" id="4x4matrix6" required>
<label for="4x4matrix6">6. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix7" id="4x4matrix7" required>
<label for="4x4matrix7">7. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix8" id="4x4matrix8" required>
<label for="4x4matrix8">8. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
</div>
<!-- Row-2 End -->
<!-- Row-3 -->
<div class="px-5 d-flex gap-3">
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix9" id="4x4matrix9" required>
<label for="4x4matrix9">9. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix10" id="4x4matrix10" required>
<label for="4x4matrix10">10. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix11" id="4x4matrix11" required>
<label for="4x4matrix11">11. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix12" id="4x4matrix12" required>
<label for="4x4matrix12">12. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
</div>
<!-- Row-3 End -->
<!-- Row-4 -->
<div class="px-5 d-flex gap-3">
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix13" id="4x4matrix13" required>
<label for="4x4matrix13">13. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix14" id="4x4matrix14" required>
<label for="4x4matrix14">14. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix15" id="4x4matrix15" required>
<label for="4x4matrix15">15. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
<div class="form-floating mb-3">
<input type="number" class="form-control" placeholder="matris" name="4x4matrix16" id="4x4matrix16" required>
<label for="4x4matrix16">16. Elemanı Giriniz</label>
<div class="valid-feedback">
Başarılı!
</div>
<div class="invalid-feedback">
Girdi Boş Olamaz!
</div>
</div>
</div>
<!-- Row-4 End -->
<button id="4x4determinantBtn" class="btn btn-lg btn-success px-5 w-50 mt-2">Determinantı Hesapla</button>
<p class="text-secondary">Sonuç : <b class="det-results text-dark" id="4x4det"></b></p>
</form>
<!-- Matris -3 End -->
</div>
</div>
</div>
<!-- Matris Calculators End -->
<!-- Random Number -->
<div class="tab-pane container fade w-100 m-auto" id="menu1">
<main class="m-auto col-6">
<h2 class="h3 mb-3 fw-normal mt-5">Rastgele Sayı Oluşturucu</h2>
<div class="form-floating">
<input type="number" class="form-control" id="randomText" placeholder="1-x arasında bir sayı girin" required>
<label for="randomText">Oluşturulacak Maksimum Sayıyı Girin</label>
<p class="fw-light text-secondary">Girdiğiniz sayı 1'den büyük olmalıdır.</p>
</div>
<button type="button" class="btn btn-success w-100 my-2" id="random">Sayıyı Oluştur</button>
</main>
<!-- Random Number Result -->
<div class="container mt-4 px-5 col-3">
<p class="text-secondary fw-medium mb-0">Sonuç Burada Gözükecek</p>
<div class="border border-secondary border-1 rounded fw-medium text-dark d-flex align-items-center justify-content-center" id="randomSonuc" style="min-height: 5vh;"></div>
</div>
<!-- Random Number Result End -->
</div>
<!-- Random Number End -->
<!-- Bootstrap CDN JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
</body>
<script src="https://cdn.socket.io/3.1.3/socket.io.min.js" integrity="sha384-cPwlPLvBTa3sKAgddT6krw0cJat7egBga3DJepJyrLl4Q9/5WLra3rrnMcyTyOnh" crossorigin="anonymous"></script>
<script >
$( document ).ready(function() {
console.log( "ready!" );
const socket = io("http://localhost:8081",{transports: ["websocket", "polling", "flashsocket"] ,path:"/ws/socket.io"});
// "+" butonuna basıldığında para değişkenini 1 arttıran kodu dinler
socket.on("2x2determinant",data=> {
console.log(data);
$("#2x2det").html(data);
});
socket.on("3x3determinant",data=> {
console.log(data);
$("#3x3det").html(data);
});
socket.on("4x4determinant",data=> {
console.log(data);
$("#4x4det").html(data);
});
socket.on("random",data=> {
console.log(data);
$("#randomSonuc").html(data);
})
// "+" butonuna basıldığında para değişkenini pythona gönderen kod
$("#2x2determinantBtn").on("click",function(e){
e.preventDefault()
let sayi1 = $("#2x2matrix1").val();
let sayi2 = $("#2x2matrix2").val();
let sayi3 = $("#2x2matrix3").val();
let sayi4 = $("#2x2matrix4").val();
sayi1 = parseInt(sayi1);
sayi2 = parseInt(sayi2);
sayi3 = parseInt(sayi3);
sayi4 = parseInt(sayi4);
socket.emit("2x2determinant", [[sayi1,sayi2],[sayi3,sayi4]]);
})
$("#3x3determinantBtn").on("click",function(e){
e.preventDefault()
let sayi1 = $("#3x3matrix1").val();
let sayi2 = $("#3x3matrix2").val();
let sayi3 = $("#3x3matrix3").val();
let sayi4 = $("#3x3matrix4").val();
let sayi5 = $("#3x3matrix5").val();
let sayi6 = $("#3x3matrix6").val();
let sayi7 = $("#3x3matrix7").val();
let sayi8 = $("#3x3matrix8").val();
let sayi9 = $("#3x3matrix9").val();
sayi1 = parseInt(sayi1);
sayi2 = parseInt(sayi2);
sayi3 = parseInt(sayi3);
sayi4 = parseInt(sayi4);
sayi5 = parseInt(sayi5);
sayi6 = parseInt(sayi6);
sayi7 = parseInt(sayi7);
sayi8 = parseInt(sayi8);
sayi9 = parseInt(sayi9);
socket.emit("3x3determinant", [[sayi1,sayi2,sayi3],[sayi4,sayi5,sayi6],[sayi7,sayi8,sayi9]]);
})
$("#4x4determinantBtn").on("click",function(e){
e.preventDefault()
let sayi1 = $("#4x4matrix1").val();
let sayi2 = $("#4x4matrix2").val();
let sayi3 = $("#4x4matrix3").val();
let sayi4 = $("#4x4matrix4").val();
let sayi5 = $("#4x4matrix5").val();
let sayi6 = $("#4x4matrix6").val();
let sayi7 = $("#4x4matrix7").val();
let sayi8 = $("#4x4matrix8").val();
let sayi9 = $("#4x4matrix9").val();
let sayi10 = $("#4x4matrix10").val();
let sayi11 = $("#4x4matrix11").val();
let sayi12 = $("#4x4matrix12").val();
let sayi13 = $("#4x4matrix13").val();
let sayi14 = $("#4x4matrix14").val();
let sayi15 = $("#4x4matrix15").val();
let sayi16 = $("#4x4matrix16").val();
sayi1 = parseInt(sayi1);
sayi2 = parseInt(sayi2);
sayi3 = parseInt(sayi3);
sayi4 = parseInt(sayi4);
sayi5 = parseInt(sayi5);
sayi6 = parseInt(sayi6);
sayi7 = parseInt(sayi7);
sayi8 = parseInt(sayi8);
sayi9 = parseInt(sayi9);
sayi10 = parseInt(sayi10);
sayi11 = parseInt(sayi11);
sayi12 = parseInt(sayi12);
sayi13 = parseInt(sayi13);
sayi14 = parseInt(sayi14);
sayi15 = parseInt(sayi15);
sayi16 = parseInt(sayi16);
socket.emit("4x4determinant", [[sayi1,sayi2,sayi3,sayi4],[sayi5,sayi6,sayi7,sayi8],[sayi9,sayi10,sayi11,sayi12],[sayi13,sayi14,sayi15,sayi16]]);
})
$("#random").on("click",function(){
randomSayi = $("#randomText").val();
randomSayi = parseInt(randomSayi);
socket.emit("random", randomSayi);
})
});
</script>
<!-- Dark & Light Theme -->
<script>
$('#darkTheme').on('click', () => {
// Change Body Color & Headings
$('body').addClass('bg-dark');
$('h2').addClass('text-white');
// Change Active Theme
$('#activeTheme').addClass('fa-moon');
$('#activeTheme').removeClass('fa-sun');
// Change Dropdown Menu
$('.dropdown-menu').addClass('dropdown-menu-dark');
// Change Result Text
$('#randomSonuc').removeClass('text-dark');
$('#randomSonuc').addClass('text-light');
// Change Result Text
$('.det-results').removeClass('text-dark');
$('.det-results').addClass('text-light');
})
$('#lightTheme').on('click', () => {
// Change Body Color & Headings
$('body').removeClass('bg-dark');
$('h2').removeClass('text-white');
// Change Active Theme
$('#activeTheme').addClass('fa-sun');
$('#activeTheme').removeClass('fa-moon');
// Change Dropdown Menu
$('.dropdown-menu').removeClass('dropdown-menu-dark');
// Change Result Text
$('#randomSonuc').removeClass('text-light');
// Change Result Text
$('.det-results').removeClass('text-light');
})
</script>
<!-- Bootstrap Form Validation -->
<script>
// Example starter JavaScript for disabling form submissions if there are invalid fields
(() => {
'use strict'
// Fetch all the forms we want to apply custom Bootstrap validation styles to
const forms = document.querySelectorAll('.needs-validation')
// Loop over them and prevent submission
Array.from(forms).forEach(form => {
form.addEventListener('click', event => {
if (!form.checkValidity()) {
event.preventDefault()
event.stopPropagation()
}
form.classList.add('was-validated')
}, false)
})
})()
</script>
</html>