|
7 | 7 |
|
8 | 8 | <!-- Tailwind CSS --> |
9 | 9 | <script src="https://cdn.tailwindcss.com"></script> |
| 10 | + <!-- Note: Tailwind CDN is for development/prototyping only. --> |
10 | 11 |
|
11 | 12 | <!-- Google Fonts --> |
12 | 13 | <link rel="preconnect" href="https://fonts.googleapis.com" /> |
|
20 | 21 | <link |
21 | 22 | rel="stylesheet" |
22 | 23 | href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" |
| 24 | + integrity="sha384-wFjoQjtV1y5jVHbt0p35Ui8aV8GVpEZkyF99OXWqP/eNJDU93D3Ugxkoyh6Y2I4A" |
| 25 | + crossorigin="anonymous" |
23 | 26 | /> |
24 | 27 | <link |
25 | 28 | rel="stylesheet" |
26 | 29 | href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.css" |
| 30 | + integrity="sha384-nUkTNLI8COlMCRJ0FHIdX76If83145OTCLUx4gQyfnO0gGeO/sD9czGEUBxtkcUv" |
| 31 | + crossorigin="anonymous" |
27 | 32 | /> |
28 | 33 | <link |
29 | 34 | rel="stylesheet" |
30 | 35 | href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/toolbar/prism-toolbar.min.css" |
| 36 | + integrity="sha384-EUzJ34/1CCeefTGUKLgvA5Z/vYIwi+Jyu8aAaCfFDxfwZ3Xs3OfkkIeegsLRM11e" |
| 37 | + crossorigin="anonymous" |
31 | 38 | /> |
32 | 39 |
|
33 | 40 | <!-- React & ReactDOM --> |
34 | | - <script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script> |
35 | 41 | <script |
36 | | - crossorigin |
37 | | - src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" |
| 42 | + crossorigin="anonymous" |
| 43 | + src="https://unpkg.com/react@18/umd/react.production.min.js" |
| 44 | + integrity="sha384-DGyLxAyjq0f9SPpVevD6IgztCFlnMF6oW/XQGmfe+IsZ8TqEiDrcHkMLKI6fiB/Z" |
| 45 | + ></script> |
| 46 | + <script |
| 47 | + crossorigin="anonymous" |
| 48 | + src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js" |
| 49 | + integrity="sha384-gTGxhz21lVGYNMcdJOyq01Edg0jhn/c22nsx0kyqP0TxaV5WVdsSH1fSDUf5YJj1" |
38 | 50 | ></script> |
39 | 51 |
|
40 | 52 | <!-- Babel Standalone --> |
41 | | - <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> |
| 53 | + <script |
| 54 | + src="https://unpkg.com/@babel/standalone/babel.min.js" |
| 55 | + integrity="sha384-Fo0OdKhdnE7y2WmzjOMW4PYjHkkANeu1501pWTqKrzAPeJMFQb4ZTdAA9dtrVUJV" |
| 56 | + crossorigin="anonymous" |
| 57 | + ></script> |
| 58 | + <!-- Note: Runtime transpilation is for demos only. --> |
42 | 59 |
|
43 | 60 | <style> |
44 | 61 | html { |
@@ -321,7 +338,7 @@ <h3 class="text-xl font-semibold text-teal-800 mt-8 mb-3">最適化ポイント< |
321 | 338 | </h2> |
322 | 339 | <div class="mt-[20px] overflow-x-auto"> |
323 | 340 | <svg |
324 | | - viewBox="0 0 840 700" |
| 341 | + viewBox="0 0 840 620" |
325 | 342 | style="max-width: 100%; height: auto; color: #333" |
326 | 343 | role="img" |
327 | 344 | aria-label="Array Reduce Transformation flowchart" |
@@ -862,11 +879,31 @@ <h4 class="font-semibold text-purple-800 mb-3 text-lg">最適化のポイント< |
862 | 879 | </div> |
863 | 880 |
|
864 | 881 | <!-- Prism.js Scripts --> |
865 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script> |
866 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-typescript.min.js"></script> |
867 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.js"></script> |
868 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/toolbar/prism-toolbar.min.js"></script> |
869 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js"></script> |
| 882 | + <script |
| 883 | + src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js" |
| 884 | + integrity="sha384-06z5D//U/xpvxZHuUz92xBvq3DqBBFi7Up53HRrbV7Jlv7Yvh/MZ7oenfUe9iCEt" |
| 885 | + crossorigin="anonymous" |
| 886 | + ></script> |
| 887 | + <script |
| 888 | + src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-typescript.min.js" |
| 889 | + integrity="sha384-PeOqKNW/piETaCg8rqKFy+Pm6KEk7e36/5YZE5XO/OaFdO+/Aw3O8qZ9qDPKVUgx" |
| 890 | + crossorigin="anonymous" |
| 891 | + ></script> |
| 892 | + <script |
| 893 | + src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.js" |
| 894 | + integrity="sha384-nUkTNLI8COlMCRJ0FHIdX76If83145OTCLUx4gQyfnO0gGeO/sD9czGEUBxtkcUv" |
| 895 | + crossorigin="anonymous" |
| 896 | + ></script> |
| 897 | + <script |
| 898 | + src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/toolbar/prism-toolbar.min.js" |
| 899 | + integrity="sha384-EUzJ34/1CCeefTGUKLgvA5Z/vYIwi+Jyu8aAaCfFDxfwZ3Xs3OfkkIeegsLRM11e" |
| 900 | + crossorigin="anonymous" |
| 901 | + ></script> |
| 902 | + <script |
| 903 | + src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js" |
| 904 | + integrity="sha384-ZdEfx8sYX8i4IVXU1tUbqwOp4PBUCCmnpagpiHchnstXkEczkzPfUd9fvBrntM+F" |
| 905 | + crossorigin="anonymous" |
| 906 | + ></script> |
870 | 907 |
|
871 | 908 | <!-- React Component --> |
872 | 909 | <script type="text/babel"> |
@@ -1323,12 +1360,7 @@ <h4 class="font-semibold text-purple-800 mb-3 text-lg">最適化のポイント< |
1323 | 1360 | // 自動再生ロジック(v3.3) |
1324 | 1361 | useEffect(() => { |
1325 | 1362 | if (isPlaying) { |
1326 | | - if (activeStep > stepsData.length) { |
1327 | | - setIsPlaying(false); |
1328 | | - setActiveStep(1); |
1329 | | - return; |
1330 | | - } |
1331 | | - |
| 1363 | + // Note: activeStep > stepsData.length check is unreachable due to handlers constrains |
1332 | 1364 | timerRef.current = setTimeout(() => { |
1333 | 1365 | if (activeStep === stepsData.length) { |
1334 | 1366 | setActiveStep(1); |
@@ -1393,8 +1425,10 @@ <h3 className="mt-0 mb-4 text-teal-800 text-xl font-semibold"> |
1393 | 1425 | 'bg-white border-slate-200 hover:border-emerald-500 hover:translate-x-1', |
1394 | 1426 | isActive |
1395 | 1427 | ? 'bg-[linear-gradient(135deg,#d1fae5,#a7f3d0)] border-emerald-500 shadow-[0_4px_12px_rgba(16,185,129,0.20)]' |
1396 | | - : '', |
1397 | | - ].join(' ')} |
| 1428 | + : null, |
| 1429 | + ] |
| 1430 | + .filter(Boolean) |
| 1431 | + .join(' ')} |
1398 | 1432 | onClick={() => handleStepClick(step.step)} |
1399 | 1433 | aria-label={`ステップ${step.step}: ${step.title}`} |
1400 | 1434 | aria-current={isActive ? 'step' : undefined} |
|
0 commit comments