-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbreadLabTest.html
More file actions
1205 lines (1046 loc) · 34.9 KB
/
Copy pathbreadLabTest.html
File metadata and controls
1205 lines (1046 loc) · 34.9 KB
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
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- 在<head>中添加 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<title>面包酶实验室</title>
<style>
/* 专业实验室样式 */
:root {
--primary-color: #FF9500;
--secondary-color: #34C759;
--danger-color: #FF3B30;
--bg-color: #F5F5F7;
--card-bg: rgba(255, 255, 255, 0.9);
--text-primary: #1D1D1F;
--text-secondary: #86868B;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}
body {
background: var(--bg-color);
color: var(--text-primary);
font-family: -apple-system, "SF Pro Display", system-ui;
line-height: 1.6;
}
header {
background-color: rgba(255, 255, 255, 0.8);
backdrop-filter: blur(20px);
position: fixed;
width: 100%;
z-index: 100;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}
header h1 {
font-size: 20px;
font-weight: 600;
}
/* 模式切换 */
.mode-switch {
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
display: flex;
gap: 8px;
}
.mode-btn {
padding: 6px 16px;
border-radius: 20px;
border: 1px solid #D1D1D6;
background: transparent;
font-size: 14px;
transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.mode-btn.active {
background: var(--primary-color);
border-color: var(--primary-color);
color: white;
}
.hero {
height: 100vh;
display: flex;
display: none;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
padding: 0 20px;
background: linear-gradient(180deg, #f5f5f7 0%, #fff 100%);
}
.hero h2 {
font-size: 56px;
font-weight: 700;
background: linear-gradient(90deg, #ff9500, #ff2d55);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 8px;
}
.hero p {
font-size: 24px;
font-weight: 400;
max-width: 600px;
margin-bottom: 40px;
color: #86868b;
}
.start-button {
background: linear-gradient(90deg, #ff9500, #ff2d55);
color: white;
border: none;
padding: 12px 30px;
font-size: 18px;
font-weight: 600;
border-radius: 30px;
cursor: pointer;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.start-button:hover {
transform: scale(1.05);
box-shadow: 0 10px 20px rgba(255, 45, 85, 0.2);
}
.lab-container {
/* display: none; */
min-height: 100vh;
padding-top: 48px;
}
.enzyme-controls {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
padding: 40px 20px;
}
.enzyme-card {
background: white;
width: 280px;
border-radius: 18px;
overflow: hidden;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
.enzyme-card:hover {
transform: translateY(-10px);
}
.enzyme-icon {
height: 140px;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(120deg, #ff9500, #ff3b30);
}
.enzyme-icon img {
width: 80px;
height: 80px;
}
.param-range {
font-size: 12px;
color: var(--text-secondary);
margin-top: 8px;
padding: 4px 8px;
background: rgba(134,134,139,0.1);
border-radius: 6px;
}
.enzyme-info {
padding: 20px;
}
.enzyme-info h3 {
font-size: 20px;
margin-bottom: 8px;
}
.enzyme-info p {
font-size: 14px;
color: #86868b;
margin-bottom: 16px;
height: 60px;
}
.slider-container {
margin-bottom: 10px;
}
.slider-container label {
display: block;
font-size: 14px;
margin-bottom: 8px;
display: flex;
justify-content: space-between;
}
.slider-container label span {
color: #ff3b30;
font-weight: 600;
}
.slider {
width: 100%;
-webkit-appearance: none;
height: 6px;
border-radius: 3px;
background: #e0e0e0;
outline: none;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 20px;
height: 20px;
border-radius: 50%;
background: #ff3b30;
cursor: pointer;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
/* 发酵控制面板 */
.fermentation-controls {
margin: 30px auto;
max-width: 800px;
}
.control-card {
background: var(--card-bg);
border-radius: 18px;
padding: 20px;
box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}
.param-group {
display: flex;
align-items: center;
margin: 15px 0;
}
.param-group label {
width: 120px;
font-size: 14px;
color: var(--text-secondary);
}
.param-group input {
flex: 1;
padding: 8px 12px;
border: 1px solid #E0E0E6;
border-radius: 10px;
background: rgba(255,255,255,0.8);
font-size: 16px;
}
/* 3D面包容器 */
.bread-container-3d {
width: 400px;
height: 400px;
margin: 0 auto;
perspective: 1000px;
}
#bread-3d {
width: 100%;
height: 100%;
transform-style: preserve-3d;
transition: transform 0.8s cubic-bezier(0.4,0,0.2,1);
}
/* 数据分析面板 */
.analytics-panel {
display: grid;
grid-template-columns: 1fr 300px;
gap: 30px;
max-width: 1200px;
margin: 40px auto;
padding: 0 20px;
}
#radar-chart {
background: var(--card-bg);
padding: 20px;
border-radius: 18px;
box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}
.reference-box {
background: var(--card-bg);
padding: 20px;
border-radius: 18px;
box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}
.reference-box h4 {
font-size: 18px;
margin-bottom: 15px;
color: var(--text-primary);
}
#reference-list {
font-size: 12px;
color: var(--text-secondary);
line-height: 1.8;
}
.bread-preview {
margin: 0 auto;
max-width: 1000px;
padding: 40px 20px;
display: flex;
flex-direction: column;
align-items: center;
}
.bread-container {
position: relative;
width: 400px;
height: 400px;
margin-bottom: 30px;
}
.bread-cross-section {
width: 400px;
height: 400px;
border-radius: 24px;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
transition: all 0.5s ease;
}
.bread-status {
background-color: white;
padding: 30px;
border-radius: 18px;
width: 100%;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
text-align: center;
}
.status-title {
font-size: 24px;
font-weight: 600;
margin-bottom: 16px;
}
.status-message {
font-size: 16px;
line-height: 1.5;
color: #86868b;
margin-bottom: 20px;
}
.status-effects {
display: flex;
justify-content: space-around;
margin-top: 20px;
}
.status-effect {
text-align: center;
width: 100px;
}
.effect-value {
font-size: 36px;
font-weight: 700;
background: linear-gradient(90deg, #ff9500, #ff2d55);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 8px;
}
.effect-label {
font-size: 14px;
color: #86868b;
}
.bake-button {
background: linear-gradient(90deg, #ff9500, #ff2d55);
color: white;
border: none;
padding: 15px 40px;
font-size: 18px;
font-weight: 600;
border-radius: 30px;
cursor: pointer;
margin-top: 30px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.bake-button:hover {
transform: scale(1.05);
box-shadow: 0 10px 20px rgba(255, 45, 85, 0.2);
}
.bake-button:disabled {
background: #e0e0e0;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
.knowledge-card {
background: white;
border-radius: 18px;
padding: 30px;
max-width: 800px;
margin: 40px auto;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.knowledge-card h3 {
font-size: 24px;
margin-bottom: 20px;
color: #1d1d1f;
}
.knowledge-card p {
font-size: 16px;
line-height: 1.6;
color: #86868b;
margin-bottom: 20px;
}
.microscope-view {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.85);
z-index: 200;
justify-content: center;
align-items: center;
flex-direction: column;
}
.microscope-container {
width: 70%;
max-width: 800px;
background-color: #f5f5f7;
border-radius: 24px;
overflow: hidden;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
position: relative;
}
.microscope-header {
background: linear-gradient(90deg, #ff9500, #ff2d55);
padding: 20px;
color: white;
text-align: center;
}
.microscope-header h3 {
font-size: 22px;
font-weight: 600;
}
.microscope-content {
padding: 30px;
display: flex;
flex-direction: column;
align-items: center;
}
.microscope-canvas {
width: 100%;
height: 300px;
background-color: #000;
border-radius: 12px;
margin-bottom: 20px;
position: relative;
overflow: hidden;
}
.microscope-particle {
position: absolute;
border-radius: 50%;
}
.close-microscope {
position: absolute;
top: 20px;
right: 20px;
background: none;
border: none;
color: white;
font-size: 30px;
cursor: pointer;
}
.microscope-info {
background-color: white;
padding: 20px;
border-radius: 12px;
width: 100%;
}
.microscope-info p {
font-size: 16px;
line-height: 1.6;
color: #1d1d1f;
}
.experiment-results {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 150;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
transition: opacity 0.5s ease;
pointer-events: none;
}
.results-container {
width: 90%;
max-width: 600px;
background-color: white;
border-radius: 24px;
overflow: hidden;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
transform: translateY(50px);
transition: transform 0.5s ease;
}
.results-header {
background: linear-gradient(90deg, #ff9500, #ff2d55);
padding: 20px;
color: white;
text-align: center;
}
.results-header h3 {
font-size: 24px;
font-weight: 700;
}
.results-content {
padding: 30px;
}
.results-summary {
margin-bottom: 30px;
}
.results-summary h4 {
font-size: 20px;
margin-bottom: 10px;
}
.results-summary p {
font-size: 16px;
line-height: 1.6;
color: #86868b;
}
.results-details {
margin-bottom: 30px;
}
.details-card {
background-color: #f5f5f7;
border-radius: 12px;
padding: 20px;
margin-bottom: 15px;
}
.details-card h5 {
font-size: 18px;
margin-bottom: 8px;
color: #1d1d1f;
}
.details-card p {
font-size: 14px;
color: #86868b;
line-height: 1.5;
}
.results-actions {
display: flex;
justify-content: center;
gap: 20px;
}
.results-button {
padding: 12px 24px;
border-radius: 30px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.retry-button {
background: linear-gradient(90deg, #ff9500, #ff2d55);
color: white;
border: none;
}
.retry-button:hover {
transform: scale(1.05);
box-shadow: 0 10px 20px rgba(255, 45, 85, 0.2);
}
.share-button {
background-color: transparent;
color: #ff3b30;
border: 2px solid #ff3b30;
}
.share-button:hover {
background-color: rgba(255, 59, 48, 0.1);
}
#lottie-loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 200px;
height: 200px;
z-index: 5;
display: none;
}
.show-experiment-results {
opacity: 1;
pointer-events: auto;
}
.show-experiment-results .results-container {
transform: translateY(0);
}
@media (max-width: 768px) {
.hero h2 {
font-size: 42px;
}
.hero p {
font-size: 18px;
}
.bread-container {
width: 300px;
height: 300px;
}
.bread-cross-section {
width: 300px;
height: 300px;
}
.microscope-container {
width: 90%;
}
}
</style>
</head>
<body>
<header>
<h1>面包酶实验室</h1>
<div class="mode-switch">
<button class="mode-btn active" id="basic-mode">基础模式</button>
<button class="mode-btn" id="pro-mode">专业模式</button>
</div>
</header>
<section class="hero">
<h2>探索酶的神奇世界</h2>
<p>亲手调配不同的酶,观察它们如何影响面包的质地、体积和口感</p>
<button class="start-button" id="start-experiment">开始实验</button>
</section>
<section class="lab-container" id="lab">
<div class="enzyme-controls">
<div class="enzyme-card">
<div class="enzyme-icon">
<img src="/api/placeholder/80/80" alt="淀粉酶图标">
</div>
<div class="enzyme-info">
<h3>淀粉酶</h3>
<p>分解淀粉产生糖分,影响面包发酵和体积</p>
<div class="slider-container">
<label>活性单位 (AU/kg):<span id="amylase-value">500</span></label>
<input type="range" min="300" max="800" value="500" class="slider" id="amylase-slider">
</div>
<div class="param-range">推荐范围:450-650 AU/kg</div>
</div>
</div>
<div class="enzyme-card">
<div class="enzyme-icon">
<img src="/api/placeholder/80/80" alt="脂肪酶图标">
</div>
<div class="enzyme-info">
<h3>脂肪酶</h3>
<p>改良面包组织结构,增加柔软度</p>
<div class="slider-container">
<label>用量 <span id="lipase-value">50%</span></label>
<input type="range" min="0" max="100" value="50" class="slider" id="lipase-slider">
</div>
</div>
</div>
<div class="enzyme-card">
<div class="enzyme-icon">
<img src="/api/placeholder/80/80" alt="葡萄糖氧化酶图标">
</div>
<div class="enzyme-info">
<h3>葡萄糖氧化酶</h3>
<p>强化面团,改善面团抗拉性</p>
<div class="slider-container">
<label>用量 <span id="glucose-oxidase-value">50%</span></label>
<input type="range" min="0" max="100" value="50" class="slider" id="glucose-oxidase-slider">
</div>
</div>
</div>
</div>
<div class="enzyme-card protease-card">
<div class="enzyme-icon protease">
<img src="protease.svg" alt="蛋白酶">
</div>
<div class="enzyme-info">
<h3>中性蛋白酶 <span class="enzyme-type">(真菌来源)</span></h3>
<div class="slider-container">
<label>活性单位 (PU/kg):<span id="protease-value">200</span></label>
<input type="range" min="100" max="400" value="200" class="slider" id="protease-slider">
</div>
<div class="param-range">推荐范围:180-260 PU/kg</div>
</div>
</div>
<div class="enzyme-card protease-card">
<div class="enzyme-icon protease">
<img src="protease.svg" alt="木聚糖酶">
</div>
<div class="enzyme-info">
<h3>木聚糖酶 <span class="enzyme-type">1</span></h3>
<div class="xylanase-container">
<label>活性单位 (PU/kg):<span id="protease-value">200</span></label>
<input type="range" min="100" max="400" value="200" class="slider" id="xylanase-slider">
</div>
<div class="param-range">推荐范围:180-260 PU/kg</div>
</div>
</div>
<!-- 新增发酵控制面板 -->
<div class="fermentation-controls">
<div class="control-card">
<h4>发酵参数</h4>
<div class="param-group">
<label>初发温度(℃):</label>
<input type="number" id="ferment-temp" value="28" min="20" max="35">
</div>
<div class="param-group">
<label>发酵时间(min):</label>
<input type="number" id="ferment-time" value="60" min="30" max="120">
</div>
</div>
</div>
<div class="bread-preview">
<div class="bread-container">
<div class="bread-cross-section" id="bread-visualization">
<!-- 面包可视化区域 -->
</div>
<div id="lottie-loading">
<!-- 面包烘焙动画区域 -->
</div>
</div>
<!-- 面包可视化容器保持不变但新增3D旋转控制 -->
<div class="bread-preview">
<div class="bread-container-3d" id="bread-3d">
</div>
</div>
<!-- 新增数据分析面板 -->
<div class="analytics-panel">
<canvas id="radar-chart"></canvas>
<div class="reference-box">
<h4>文献依据</h4>
<div id="reference-list"></div>
</div>
</div>
<div class="bread-status">
<div class="status-title">你的面包配方</div>
<div class="status-message">调整酶的用量,然后点击烘焙按钮查看结果</div>
<div class="status-effects">
<div class="status-effect">
<div class="effect-value" id="volume-value">--</div>
<div class="effect-label">体积</div>
</div>
<div class="status-effect">
<div class="effect-value" id="texture-value">--</div>
<div class="effect-label">质地</div>
</div>
<div class="status-effect">
<div class="effect-value" id="freshness-value">--</div>
<div class="effect-label">保鲜度</div>
</div>
</div>
<button class="bake-button" id="bake-button">开始烘焙</button>
</div>
</div>
<div class="knowledge-card">
<h3>酶的科学原理</h3>
<p>酶是生物催化剂,能加速特定的化学反应,但自身不改变。在面包制作中,不同种类的酶负责不同功能:淀粉酶分解淀粉产生糖分供酵母发酵;脂肪酶改良面包组织结构和柔软度;葡萄糖氧化酶增强面团筋力。</p>
<p>通过微调酶的用量,专业面包师能够精确控制面包的口感、体积和保质期。但用量不当会导致面包质量下降,比如面包发黏、质地粗糙或表皮烧焦等问题。</p>
<p>点击"分子视角"按钮,你可以看到酶在分子层面是如何工作的!</p>
<button class="bake-button" id="microscope-button">分子视角</button>
</div>
</section>
<div class="microscope-view" id="microscope-view">
<div class="microscope-container">
<button class="close-microscope" id="close-microscope">×</button>
<div class="microscope-header">
<h3>酶的分子作用</h3>
</div>
<div class="microscope-content">
<div class="microscope-canvas" id="microscope-canvas">
<!-- 分子动画区域 -->
</div>
<div class="microscope-info">
<p id="microscope-description">
在这个微观世界中,你可以看到酶分子(彩色小球)如何与底物(灰色大分子)结合并催化反应。淀粉酶正在切断淀粉长链,脂肪酶在分解脂肪,葡萄糖氧化酶则在促进蛋白质交联。</p>
</div>
</div>
</div>
</div>
<div class="experiment-results" id="experiment-results">
<div class="results-container">
<div class="results-header">
<h3>面包烘焙结果</h3>
</div>
<div class="results-content">
<div class="results-summary">
<h4 id="result-title">实验结果</h4>
<p id="result-description">根据你选择的酶配方,这里是你的面包烘焙结果。</p>
</div>
<div class="results-details">
<div class="details-card">
<h5>科学解释</h5>
<p id="science-explanation">这里将显示酶配方如何影响面包的科学解释。</p>
</div>
<div class="details-card">
<h5>专家提示</h5>
<p id="expert-tip">这里将显示如何改进配方的提示。</p>
</div>
</div>
<div class="results-actions">
<button class="results-button retry-button" id="try-again">再试一次</button>
<button class="results-button share-button" id="share-result">分享结果</button>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// 专业模式核心逻辑
class BreadLab {
constructor() {
// 酶活性基准参数(单位:AU/kg)
this.enzymeStandards = {
amylase: { optimal: 550, range: 150, weight: 0.3 },
lipase: { optimal: 200, range: 80, weight: 0.25 },
glucoseOxidase: { optimal: 350, range: 100, weight: 0.2 },
xylanase: { optimal: 120, range: 40, weight: 0.15 },
protease: { optimal: 180, range: 50, weight: 0.1 }
};
// 发酵阶段模型
this.fermentationModel = {
stages: [
{ phase: '初发', temp: 28, time: 40, impact: 0.4 },
{ phase: '主发', temp: 32, time: 60, impact: 0.5 },
{ phase: '终发', temp: 25, time: 30, impact: 0.1 }
],
tempEffect: (temp) => Math.min(1, temp/35),
timeEffect: (time) => Math.min(1, time/90)
};
this.initControls();
this.init3DVisualization();
}
initControls() {
// 绑定所有酶滑块
this.sliders = {
amylase: this.bindSlider('#amylase-slider', 300, 800),
lipase: this.bindSlider('#lipase-slider', 100, 400),
glucoseOxidase: this.bindSlider('#glucose-oxidase-slider', 200, 500),
xylanase: this.bindSlider('#xylanase-slider', 50, 200),
protease: this.bindSlider('#protease-slider', 100, 300)
};
// 绑定发酵参数
this.fermentTemp = document.querySelector('#ferment-temp');
this.fermentTime = document.querySelector('#ferment-time');
// 初始化图表
this.initRadarChart();
}
bindSlider(selector, min, max) {
const slider = document.querySelector(selector);
slider.min = min;
slider.max = max;
slider.addEventListener('input', () => this.onParamChange());
return slider;
}
// 核心评分算法
calculateScore() {
const enzymeValues = this.getCurrentValues();
let totalScore = 0;
let synergyMatrix = 1;
// 计算各酶得分
const enzymeScores = Object.entries(this.enzymeStandards).map(([key, std]) => {
const value = enzymeValues[key];
const deviation = Math.abs(value - std.optimal);
// 专业S型评分曲线
const score = 100 / (1 + Math.exp((deviation - std.range/2)/15));
const weighted = score * std.weight;
// 协同惩罚计算
if(deviation > std.range*0.8) {
synergyMatrix *= 0.95;
}
return { key, score: weighted, deviation };
});
// 发酵效率计算
const tempEffect = this.fermentationModel.tempEffect(this.fermentTemp.value);
const timeEffect = this.fermentationModel.timeEffect(this.fermentTime.value);
const fermentationEfficiency = tempEffect * timeEffect;
// 总得分计算
totalScore = enzymeScores.reduce((sum, item) => sum + item.score, 0);
totalScore = totalScore * synergyMatrix * fermentationEfficiency;
// 极端值检测
const hasExtreme = Object.values(enzymeValues).some(v =>
v < 50 || v > 750
);
return {
total: Math.min(100, totalScore),
details: enzymeScores,
status: this.getStatus(totalScore, hasExtreme),
efficiency: fermentationEfficiency
};
}
getStatus(score, hasExtreme) {
const statusLevels = [
{ threshold: 95, status: 'perfect', color: '#FFD700' },
{ threshold: 85, status: 'excellent', color: '#FF9500' },
{ threshold: 75, status: 'good', color: '#34C759' },
{ threshold: 60, status: 'acceptable', color: '#AF52DE' },
{ threshold: 0, status: 'failed', color: '#FF3B30' }
];
let result = statusLevels.find(l => score >= l.threshold);
if(hasExtreme) result = { status: 'imbalance', color: '#FF3B30' };
return result;
}
// 实时3D渲染更新
update3DVisualization(scores) {