|
13 | 13 | <div id="app"> |
14 | 14 | <canvas id="webgl-canvas"></canvas> |
15 | 15 |
|
16 | | - <button id="ui-toggle-btn" class="ui-hamburger-btn hidden" title="Open Settings"> |
17 | | - <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
18 | | - <line x1="3" y1="6" x2="21" y2="6"></line> |
19 | | - <line x1="3" y1="12" x2="21" y2="12"></line> |
20 | | - <line x1="3" y1="18" x2="21" y2="18"></line> |
21 | | - </svg> |
22 | | - </button> |
| 16 | + <div id="ui-top-actions" class="ui-top-actions hidden"> |
| 17 | + <a href="https://shinnei.github.io/" target="_blank" rel="noopener noreferrer" class="ui-icon-btn ui-github-btn" title="GitHub Repository"> |
| 18 | + <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"> |
| 19 | + <path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.53 1.032 1.53 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"/> |
| 20 | + </svg> |
| 21 | + </a> |
| 22 | + <button id="ui-toggle-btn" class="ui-hamburger-btn" title="Open Settings"> |
| 23 | + <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
| 24 | + <line x1="3" y1="6" x2="21" y2="6"></line> |
| 25 | + <line x1="3" y1="12" x2="21" y2="12"></line> |
| 26 | + <line x1="3" y1="18" x2="21" y2="18"></line> |
| 27 | + </svg> |
| 28 | + </button> |
| 29 | + </div> |
23 | 30 |
|
24 | 31 | <div id="ui-panel" class="ui-window"> |
25 | 32 | <div class="ui-header"> |
26 | 33 | <span class="ui-title">Cloth Simulation 3D</span> |
27 | 34 | <div class="ui-header-right"> |
28 | 35 | <span id="ui-fps" class="ui-fps-badge">60.0 FPS</span> |
| 36 | + <a href="https://shinnei.github.io/" target="_blank" rel="noopener noreferrer" class="ui-header-github-btn" title="GitHub Repository"> |
| 37 | + <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"> |
| 38 | + <path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.53 1.032 1.53 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"/> |
| 39 | + </svg> |
| 40 | + </a> |
29 | 41 | <button id="ui-close-btn" class="ui-close-btn" title="Collapse Window">✕</button> |
30 | 42 | </div> |
31 | 43 | </div> |
|
53 | 65 | </div> |
54 | 66 |
|
55 | 67 | <div class="ui-group"> |
56 | | - <div class="ui-group-title">Physics Parameters</div> |
| 68 | + <div class="ui-group-title">Appearance</div> |
57 | 69 |
|
58 | 70 | <div class="ui-row"> |
59 | | - <label for="sld-gravity" class="ui-label">Gravity Y: <span id="val-gravity">-9.8</span></label> |
60 | | - <input type="range" id="sld-gravity" min="-25" max="5" step="0.5" value="-9.8" class="ui-slider" /> |
61 | | - </div> |
62 | | - |
63 | | - <div class="ui-row"> |
64 | | - <label for="sld-damping" class="ui-label">Air Damping: <span id="val-damping">0.98</span></label> |
65 | | - <input type="range" id="sld-damping" min="0.90" max="0.999" step="0.005" value="0.98" class="ui-slider" /> |
| 71 | + <label class="ui-label">Render Mode:</label> |
| 72 | + <select id="sel-render-mode" class="ui-select"> |
| 73 | + <option value="solid" selected>Solid Fabric</option> |
| 74 | + <option value="wireframe">Wireframe Mesh</option> |
| 75 | + </select> |
66 | 76 | </div> |
67 | 77 |
|
68 | | - <div class="ui-row"> |
69 | | - <label for="sld-stiffness" class="ui-label">Solver Iterations: <span id="val-stiffness">12</span></label> |
70 | | - <input type="range" id="sld-stiffness" min="1" max="30" step="1" value="12" class="ui-slider" /> |
| 78 | + <div class="ui-row ui-checkbox-row"> |
| 79 | + <input type="checkbox" id="chk-shadows" checked class="ui-checkbox" /> |
| 80 | + <label for="chk-shadows" class="ui-label">Enable Shadows</label> |
71 | 81 | </div> |
72 | 82 | </div> |
73 | 83 |
|
74 | 84 | <div class="ui-group"> |
75 | | - <div class="ui-group-title">Wind Simulation</div> |
| 85 | + <div class="ui-group-title">Physics Parameters</div> |
76 | 86 |
|
77 | | - <div class="ui-row ui-checkbox-row"> |
78 | | - <input type="checkbox" id="chk-wind-enable" class="ui-checkbox" /> |
79 | | - <label for="chk-wind-enable" class="ui-label">Enable Wind Force</label> |
80 | | - </div> |
81 | | - |
82 | 87 | <div class="ui-row"> |
83 | | - <label for="sld-wind-strength" class="ui-label">Wind Strength: <span id="val-wind-strength">12.0</span></label> |
84 | | - <input type="range" id="sld-wind-strength" min="0" max="50" step="1" value="12" class="ui-slider" /> |
| 88 | + <label for="sld-gravity" class="ui-label">Gravity Y: <span id="val-gravity">-9.8</span></label> |
| 89 | + <input type="range" id="sld-gravity" min="-25" max="5" step="0.5" value="-9.8" class="ui-slider" /> |
85 | 90 | </div> |
86 | 91 |
|
87 | 92 | <div class="ui-row"> |
88 | | - <label for="sld-wind-angle" class="ui-label">Wind Angle: <span id="val-wind-angle">45°</span></label> |
89 | | - <input type="range" id="sld-wind-angle" min="0" max="360" step="5" value="45" class="ui-slider" /> |
90 | | - </div> |
91 | | - |
92 | | - <div class="ui-row ui-checkbox-row"> |
93 | | - <input type="checkbox" id="chk-wind-turbulence" checked class="ui-checkbox" /> |
94 | | - <label for="chk-wind-turbulence" class="ui-label">Turbulence / Gusts</label> |
| 93 | + <label for="sld-damping" class="ui-label">Air Damping: <span id="val-damping">0.98</span></label> |
| 94 | + <input type="range" id="sld-damping" min="0.90" max="0.999" step="0.005" value="0.98" class="ui-slider" /> |
95 | 95 | </div> |
96 | | - </div> |
97 | 96 |
|
98 | | - <div class="ui-group"> |
99 | | - <div class="ui-group-title">Appearance</div> |
100 | | - |
101 | 97 | <div class="ui-row"> |
102 | | - <label class="ui-label">Render Mode:</label> |
103 | | - <select id="sel-render-mode" class="ui-select"> |
104 | | - <option value="solid" selected>Solid Fabric</option> |
105 | | - <option value="wireframe">Wireframe Mesh</option> |
106 | | - </select> |
107 | | - </div> |
108 | | - |
109 | | - <div class="ui-row ui-checkbox-row"> |
110 | | - <input type="checkbox" id="chk-shadows" checked class="ui-checkbox" /> |
111 | | - <label for="chk-shadows" class="ui-label">Enable Shadows</label> |
| 98 | + <label for="sld-stiffness" class="ui-label">Solver Iterations: <span id="val-stiffness">12</span></label> |
| 99 | + <input type="range" id="sld-stiffness" min="1" max="30" step="1" value="12" class="ui-slider" /> |
112 | 100 | </div> |
113 | 101 | </div> |
114 | 102 |
|
115 | 103 | <div class="ui-footer-tip"> |
116 | | - 💡 <strong>Left Mouse:</strong> Rotate camera angle / Drag sphere.<br> |
117 | | - 💡 <strong>Right Mouse Drag:</strong> Rotate & adjust wind vector arrow! |
| 104 | + 💡 <strong>Left Mouse:</strong> Rotate camera / Drag sphere<br> |
| 105 | + 💡 <strong>Right Mouse Drag:</strong> Add wind |
118 | 106 | </div> |
119 | 107 | </div> |
120 | 108 | </div> |
|
0 commit comments