-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
113 lines (100 loc) · 6.08 KB
/
Copy pathindex.html
File metadata and controls
113 lines (100 loc) · 6.08 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cloth Simulation</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/src/style.css" />
</head>
<body>
<div id="app">
<canvas id="webgl-canvas"></canvas>
<div id="ui-top-actions" class="ui-top-actions hidden">
<a href="https://shinnei.github.io/" target="_blank" rel="noopener noreferrer" class="ui-icon-btn ui-github-btn" title="GitHub Repository">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
<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"/>
</svg>
</a>
<button id="ui-toggle-btn" class="ui-hamburger-btn" title="Open Settings">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
</div>
<div id="ui-panel" class="ui-window">
<div class="ui-header">
<span class="ui-title">Cloth Simulation 3D</span>
<div class="ui-header-right">
<span id="ui-fps" class="ui-fps-badge">60.0 FPS</span>
<a href="https://shinnei.github.io/" target="_blank" rel="noopener noreferrer" class="ui-header-github-btn" title="GitHub Repository">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
<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"/>
</svg>
</a>
<button id="ui-close-btn" class="ui-close-btn" title="Collapse Window">✕</button>
</div>
</div>
<div class="ui-content">
<div class="ui-group">
<div class="ui-group-title">Controls</div>
<div class="ui-btn-row">
<button id="btn-pause" class="ui-btn">Pause</button>
<button id="btn-reset" class="ui-btn ui-btn-accent">Reset Cloth</button>
</div>
</div>
<div class="ui-group">
<div class="ui-group-title">Pinning</div>
<div class="ui-row">
<label class="ui-label">Pin Mode:</label>
<select id="sel-pin-mode" class="ui-select">
<option value="top-2-corners" selected>Top 2 Corners</option>
<option value="top-edge">Top Edge</option>
<option value="top-4-corners">4 Corners</option>
<option value="none">Free Hanging</option>
</select>
</div>
</div>
<div class="ui-group">
<div class="ui-group-title">Appearance</div>
<div class="ui-row">
<label class="ui-label">Render Mode:</label>
<select id="sel-render-mode" class="ui-select">
<option value="solid" selected>Solid Fabric</option>
<option value="wireframe">Wireframe Mesh</option>
</select>
</div>
<div class="ui-row ui-checkbox-row">
<input type="checkbox" id="chk-shadows" checked class="ui-checkbox" />
<label for="chk-shadows" class="ui-label">Enable Shadows</label>
</div>
</div>
<div class="ui-group">
<div class="ui-group-title">Physics Parameters</div>
<div class="ui-row">
<label for="sld-gravity" class="ui-label">Gravity Y: <span id="val-gravity">-9.8</span></label>
<input type="range" id="sld-gravity" min="-25" max="5" step="0.5" value="-9.8" class="ui-slider" />
</div>
<div class="ui-row">
<label for="sld-damping" class="ui-label">Air Damping: <span id="val-damping">0.98</span></label>
<input type="range" id="sld-damping" min="0.90" max="0.999" step="0.005" value="0.98" class="ui-slider" />
</div>
<div class="ui-row">
<label for="sld-stiffness" class="ui-label">Solver Iterations: <span id="val-stiffness">12</span></label>
<input type="range" id="sld-stiffness" min="1" max="30" step="1" value="12" class="ui-slider" />
</div>
</div>
<div class="ui-footer-tip">
💡 <strong>Left Mouse:</strong> Rotate camera / Drag sphere<br>
💡 <strong>Right Mouse Drag:</strong> Add wind
</div>
</div>
</div>
</div>
<script type="module" src="/src/main.js"></script>
</body>
</html>