-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry2.html
More file actions
594 lines (510 loc) · 21.6 KB
/
Copy pathtry2.html
File metadata and controls
594 lines (510 loc) · 21.6 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>面包酶实验室</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}
body {
background-color: #f2f2f7;
color: #1d1d1f;
padding: 20px;
max-width: 1200px;
margin: 0 auto;
}
.container {
display: flex;
flex-direction: column;
min-height: 100vh;
}
header {
text-align: center;
padding: 20px 0;
margin-bottom: 20px;
}
h1 {
font-size: 32px;
font-weight: 700;
margin-bottom: 8px;
background: linear-gradient(135deg, #ff9500, #ff2d55);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
h2 {
font-size: 24px;
margin-bottom: 16px;
color: #1d1d1f;
}
p {
margin-bottom: 16px;
line-height: 1.5;
}
.experiment-area {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-bottom: 40px;
}
.controls {
flex: 1;
min-width: 300px;
background-color: white;
border-radius: 16px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
.result {
flex: 2;
min-width: 300px;
background-color: white;
border-radius: 16px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
display: flex;
flex-direction: column;
}
.bread-view {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.bread-container {
width: 280px;
height: 210px;
position: relative;
transition: all 0.5s ease;
}
.bread {
width: 100%;
height: 100%;
background-color: #f5d7a3;
border-radius: 50% 50% 5px 5px / 20px 20px 5px 5px;
position: relative;
transition: all 0.5s ease;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.bread-crust {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 15%;
background-color: #e3ae65;
border-radius: 50% 50% 0 0 / 20px 20px 0 0;
transition: all 0.5s ease;
}
.bread-bubbles {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.2;
transition: all 0.5s ease;
}
.bubble {
position: absolute;
background-color: white;
border-radius: 50%;
transition: all 0.5s ease;
}
.slider-container {
margin-bottom: 20px;
}
.slider-label {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
}
.slider {
width: 100%;
-webkit-appearance: none;
height: 6px;
border-radius: 3px;
background: #e0e0e0;
outline: none;
margin-bottom: 8px;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: #007aff;
cursor: pointer;
}
.bake-button {
display: block;
width: 100%;
padding: 12px;
background-color: #007aff;
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s;
margin-top: 20px;
}
.bake-button:hover {
background-color: #0067d6;
}
.result-text {
padding: 20px;
background-color: #f2f2f7;
border-radius: 12px;
margin-top: 20px;
font-size: 16px;
line-height: 1.6;
}
.info-panel {
background-color: white;
border-radius: 16px;
padding: 20px;
margin-top: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
.tabs {
display: flex;
margin-bottom: 20px;
border-bottom: 1px solid #e0e0e0;
}
.tab {
padding: 10px 20px;
cursor: pointer;
font-weight: 500;
color: #6e6e73;
border-bottom: 2px solid transparent;
transition: all 0.2s;
}
.tab.active {
color: #007aff;
border-bottom: 2px solid #007aff;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
.enzyme-info {
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 1px solid #e0e0e0;
}
.enzyme-info:last-child {
border-bottom: none;
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>面包酶实验室</h1>
<p>探索不同酶对面包的神奇影响!调整酶的用量,亲眼见证面包的变化</p>
</header>
<div class="experiment-area">
<div class="controls">
<h2>添加酶</h2>
<p>调整各种酶的用量,然后点击"开始烘焙"按钮查看结果!</p>
<div class="slider-container">
<div class="slider-label">
<span>淀粉酶</span>
<span id="amylase-value">0</span>
</div>
<input type="range" min="0" max="10" value="0" class="slider" id="amylase-slider">
</div>
<div class="slider-container">
<div class="slider-label">
<span>脂肪酶</span>
<span id="lipase-value">0</span>
</div>
<input type="range" min="0" max="10" value="0" class="slider" id="lipase-slider">
</div>
<div class="slider-container">
<div class="slider-label">
<span>木聚糖酶</span>
<span id="xylanase-value">0</span>
</div>
<input type="range" min="0" max="10" value="0" class="slider" id="xylanase-slider">
</div>
<div class="slider-container">
<div class="slider-label">
<span>葡萄糖氧化酶</span>
<span id="glucoseOxidase-value">0</span>
</div>
<input type="range" min="0" max="10" value="0" class="slider" id="glucoseOxidase-slider">
</div>
<div class="slider-container">
<div class="slider-label">
<span>蛋白酶</span>
<span id="protease-value">0</span>
</div>
<input type="range" min="0" max="10" value="0" class="slider" id="protease-slider">
</div>
<button class="bake-button" id="bake-button">开始烘焙</button>
</div>
<div class="result">
<h2>烘焙结果</h2>
<div class="bread-view">
<div class="bread-container">
<div class="bread">
<div class="bread-crust"></div>
<div class="bread-bubbles" id="bubbles"></div>
</div>
</div>
</div>
<div class="result-text" id="result-text">
调整左侧的酶用量,然后点击"开始烘焙"按钮查看结果!
</div>
</div>
</div>
<div class="info-panel">
<div class="tabs">
<div class="tab active" data-tab="about">关于面包酶</div>
<div class="tab" data-tab="tips">实验提示</div>
</div>
<div class="tab-content active" id="about-content">
<h2>酶对面包的影响</h2>
<div class="enzyme-info">
<h3>淀粉酶</h3>
<p>淀粉酶能分解淀粉为糖,为酵母提供发酵所需的养分,帮助面包体积增大,延缓老化。</p>
</div>
<div class="enzyme-info">
<h3>脂肪酶</h3>
<p>脂肪酶能分解面粉中的脂质,改良面包的内部组织结构和柔软度。</p>
</div>
<div class="enzyme-info">
<h3>木聚糖酶</h3>
<p>木聚糖酶能分解面粉中的木聚糖,提高面团持气性,使面包体积更大,结构更均匀。</p>
</div>
<div class="enzyme-info">
<h3>葡萄糖氧化酶</h3>
<p>葡萄糖氧化酶能催化葡萄糖氧化,有助于面筋网络形成,增强面团筋力。</p>
</div>
<div class="enzyme-info">
<h3>蛋白酶</h3>
<p>蛋白酶能降解面筋蛋白,让面团更有弹性,面包更松软。但过量会使面筋网络崩溃。</p>
</div>
</div>
<div class="tab-content" id="tips-content">
<h2>实验技巧</h2>
<p>1. 尝试不同酶的组合,观察它们之间的协同作用。</p>
<p>2. 注意用量控制!过多或过少都会影响面包品质。</p>
<p>3. 淀粉酶和木聚糖酶配合使用,效果往往更好。</p>
<p>4. 面包有不同问题时,可以有针对性地添加相应的酶。</p>
<p>5. 实验记录下最佳配方,下次可以重复尝试!</p>
</div>
</div>
</div>
<script>
// 创建气泡
function createBubbles() {
const bubblesContainer = document.getElementById('bubbles');
for (let i = 0; i < 50; i++) {
const bubble = document.createElement('div');
bubble.className = 'bubble';
const size = Math.random() * 10 + 2;
bubble.style.width = `${size}px`;
bubble.style.height = `${size}px`;
bubble.style.left = `${Math.random() * 100}%`;
bubble.style.top = `${Math.random() * 100}%`;
bubblesContainer.appendChild(bubble);
}
}
// 初始化气泡
createBubbles();
// 获取所有滑块并添加事件监听器
const sliders = document.querySelectorAll('.slider');
sliders.forEach(slider => {
const valueSpan = document.getElementById(`${slider.id.split('-')[0]}-value`);
valueSpan.textContent = slider.value;
slider.addEventListener('input', function() {
valueSpan.textContent = this.value;
});
});
// 标签切换功能
const tabs = document.querySelectorAll('.tab');
tabs.forEach(tab => {
tab.addEventListener('click', () => {
// 移除所有活动状态
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
// 添加当前活动状态
tab.classList.add('active');
document.getElementById(`${tab.dataset.tab}-content`).classList.add('active');
});
});
// 烘焙按钮功能
document.getElementById('bake-button').addEventListener('click', function() {
const amylaseValue = parseInt(document.getElementById('amylase-slider').value);
const lipaseValue = parseInt(document.getElementById('lipase-slider').value);
const xylanaseValue = parseInt(document.getElementById('xylanase-slider').value);
const glucoseOxidaseValue = parseInt(document.getElementById('glucoseOxidase-slider').value);
const proteaseValue = parseInt(document.getElementById('protease-slider').value);
// 更新面包外观
updateBreadAppearance(amylaseValue, lipaseValue, xylanaseValue, glucoseOxidaseValue, proteaseValue);
// 更新结果文本
updateResultText(amylaseValue, lipaseValue, xylanaseValue, glucoseOxidaseValue, proteaseValue);
});
function updateBreadAppearance(amylase, lipase, xylanase, glucoseOxidase, protease) {
const bread = document.querySelector('.bread');
const crust = document.querySelector('.bread-crust');
const bubbles = document.querySelectorAll('.bubble');
const container = document.querySelector('.bread-container');
// 基础值
let height = 170;
let width = 280;
let lightness = 83; // 控制面包颜色深浅
let crustColor = '#e3ae65';
let bubblesOpacity = 0.2;
let bubblesSize = 1;
// 调整体积 (淀粉酶和木聚糖酶影响)
if (amylase >= 4 && amylase <= 7) height += 20;
else if (amylase > 7) height -= 15;
else if (amylase < 4) height -= 10;
if (xylanase >= 4 && xylanase <= 7) width += 20;
else if (xylanase > 7) width -= 20;
else if (xylanase < 4) width -= 5;
// 调整颜色 (淀粉酶影响)
if (amylase > 7) {
lightness -= 15; // 更深的颜色,表示烤糊了
crustColor = '#9e5e11'; // 更深的酥皮颜色
} else if (amylase >= 4) {
lightness += 2; // 稍微更亮的颜色
crustColor = '#cc9343'; // 金黄色酥皮
} else {
lightness -= 5; // 较暗的颜色,表示发酵不足
crustColor = '#c9a675'; // 较浅的酥皮颜色
}
// 调整内部结构 (通过气泡)
if (protease > 7) {
bubblesOpacity = 0.8; // 过多蛋白酶导致结构松散
bubblesSize = 2;
} else if (protease >= 4 && protease <= 7) {
bubblesOpacity = 0.6; // 适量蛋白酶,气泡清晰
bubblesSize = 1.4;
} else {
bubblesOpacity = 0.3; // 蛋白酶不足,气泡不明显
bubblesSize = 0.8;
}
// 脂肪酶影响松软度
if (lipase > 7) {
// 过多脂肪酶使面包变干硬
width -= 10;
height -= 10;
} else if (lipase >= 4 && lipase <= 7) {
// 适量脂肪酶增加松软度
width += 10;
height += 5;
}
// 葡萄糖氧化酶影响面筋结构
if (glucoseOxidase > 7) {
// 过多导致面团干硬
width -= 15;
height -= 5;
} else if (glucoseOxidase >= 4 && glucoseOxidase <= 7) {
// 适量帮助面筋网络形成
width += 5;
height += 10;
} else {
// 不足导致面团筋力不够
width += 15; // 松散,横向扩展
height -= 15; // 塌陷,高度减少
}
// 应用变化
container.style.width = `${width}px`;
container.style.height = `${height + 40}px`; // 添加一些额外高度给顶部
bread.style.backgroundColor = `hsl(39, 70%, ${lightness}%)`;
crust.style.backgroundColor = crustColor;
document.querySelector('.bread-bubbles').style.opacity = bubblesOpacity;
bubbles.forEach(bubble => {
const originalSize = parseFloat(bubble.style.width);
// bubble.style.width = `${originalSize * bubblesSize}px`;
// bubble.style.height = `${originalSize * bubblesSize}px`;
bubble.style.transform = `scale(${bubblesSize})`;
});
}
function updateResultText(amylase, lipase, xylanase, glucoseOxidase, protease) {
const resultText = document.getElementById('result-text');
// 初始描述
let description = "你的面包结果:";
let problems = [];
let positives = [];
// 检查淀粉酶
if (amylase > 7) {
problems.push("淀粉酶过多,面包内部发黏,表皮上色过深!");
} else if (amylase < 4) {
problems.push("淀粉酶不足,面包体积偏小,发酵不充分。");
} else {
positives.push("适量的淀粉酶促使面包体积增大,老化速度减慢。");
}
// 检查脂肪酶
if (lipase > 7) {
problems.push("脂肪酶过多,面团变干变硬,甚至产生异味。");
} else if (lipase < 4) {
problems.push("脂肪酶不足,面包柔软度不够。");
} else {
positives.push("适量的脂肪酶让面包组织更柔软细腻。");
}
// 检查木聚糖酶
if (xylanase > 7) {
problems.push("木聚糖酶过多,面团发黏难以操作。");
} else if (xylanase < 4) {
problems.push("木聚糖酶不足,面团持气性不足,面包体积小。");
} else {
positives.push("适量的木聚糖酶让面包体积更大,结构更均匀。");
}
// 检查葡萄糖氧化酶
if (glucoseOxidase > 7) {
problems.push("葡萄糖氧化酶过多,面团干硬,口感变差。");
} else if (glucoseOxidase < 4) {
problems.push("葡萄糖氧化酶不足,面团筋力不够,结构松散。");
} else {
positives.push("适量的葡萄糖氧化酶增强了面筋网络,提高了面包结构。");
}
// 检查蛋白酶
if (protease > 7) {
problems.push("蛋白酶过多,面团筋度过低,无法保持气体。");
} else if (protease < 4) {
problems.push("蛋白酶不足,面团筋度高,面包口感较硬。");
} else {
positives.push("适量的蛋白酶让面团更有弹性,面包更松软。");
}
// 合并结果
if (problems.length === 0) {
description += "<br><br>👏 恭喜!你的面包完美无缺!<br><br>";
description += positives.join("<br>");
} else {
description += "<br><br>⚠️ 存在的问题:<br>";
description += problems.join("<br>");
if (positives.length > 0) {
description += "<br><br>✅ 正面效果:<br>";
description += positives.join("<br>");
}
description += "<br><br>📝 尝试调整酶的用量,再次烘焙!";
}
// 特殊情况:完美配方
if (amylase >= 4 && amylase <= 7 &&
lipase >= 4 && lipase <= 7 &&
xylanase >= 4 && xylanase <= 7 &&
glucoseOxidase >= 4 && glucoseOxidase <= 7 &&
protease >= 4 && protease <= 7) {
description = "🌟 恭喜你找到了完美配方! 🌟<br><br>这个面包松软可口,体积适中,表皮金黄诱人,内部组织细腻均匀。酶的作用相互协调,创造出理想的面包品质。<br><br>这个酶的组合让淀粉充分水解、面筋网络结构合理、发酵充分,同时保持了良好的保水性。<br><br>这将是一个令人难忘的面包!";
}
resultText.innerHTML = description;
}
</script>
</body>
</html>