Skip to content

Commit b7f5bdb

Browse files
committed
Enhance tutorials and documentation: Add max-width to list items, improve descriptions, and include loading indicators for better user experience
1 parent ee3a125 commit b7f5bdb

File tree

5 files changed

+101
-42
lines changed

5 files changed

+101
-42
lines changed

FEAScript-website.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ ul {
2626
padding-left: 1.5em;
2727
}
2828

29+
/* Add max-width to list items to match paragraph constraints */
30+
li {
31+
max-width: 1000px;
32+
}
33+
2934
/* Headings */
3035
h1,
3136
h2,
@@ -192,6 +197,10 @@ mjx-container {
192197
.highlight-container {
193198
max-width: 90%;
194199
}
200+
201+
li {
202+
max-width: 90%;
203+
}
195204
}
196205

197206
/* Medium screens: 500px to 1000px */
@@ -234,6 +243,10 @@ mjx-container {
234243
.highlight-container {
235244
max-width: 80%;
236245
}
246+
247+
li {
248+
max-width: 900px;
249+
}
237250
}
238251

239252
/* Large screens: 1000px and above */
@@ -270,4 +283,8 @@ mjx-container {
270283
.highlight-container {
271284
max-width: 70%;
272285
}
286+
287+
li {
288+
max-width: 1000px;
289+
}
273290
}

index.html

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ <h1>A JavaScript Finite Element Simulation Library</h1>
7575
<li><a href="#features">Features</a></li>
7676
<li><a href="#documentation">Documentation</a></li>
7777
<li><a href="#tutorials">Tutorials</a></li>
78+
<li><a href="#platform">Platform</a></li>
7879
<li><a href="#licensing">Licensing</a></li>
7980
<li class="menu-separator">|</li>
8081
<li>
@@ -101,7 +102,7 @@ <h1>A JavaScript Finite Element Simulation Library</h1>
101102

102103
<div class="highlight-container">
103104
<p>
104-
FEAScript is a lightweight finite element simulation library developed in JavaScript. It allows users
105+
<strong>FEAScript is a lightweight finite element simulation library developed in JavaScript</strong>. It allows users
105106
to create and run client-side, browser-based simulations for physics and engineering problems without
106107
requiring additional installations. FEAScript serves as an excellent tool for building interactive web
107108
applications and facilitates hands-on learning of computational mechanics by providing a versatile
@@ -114,12 +115,17 @@ <h2 id="gettingstarted"><a name="Getting Started"></a>Getting Started</h2>
114115
<p>
115116
FEAScript requires only a simple HTML page to operate. All simulations are executed locally in your
116117
browser, without the need for any cloud services. The entire workflow is performed using JavaScript
117-
objects directly in the HTML file.
118-
<!-- Below is a live example demonstrating FEAScript in action: -->
119-
<!-- JSFiddle embed temporarily disabled as it is not working
120-
<script async src="//jsfiddle.net/nikoscham/prhezsgv/24/embed/js,html,result/"></script>
121-
-->
118+
objects directly in the HTML file.
122119
</p>
120+
<p>
121+
There are two ways to create simulations with FEAScript:
122+
</p>
123+
<ul>
124+
<li><b>JavaScript API:</b> For developers comfortable with coding, the JavaScript API provides full programmatic
125+
control, allowing direct integration into websites or web applications.</li>
126+
<li><b>Visual Editor:</b> The <a href="https://platform.feascript.com" target="_blank">FEAScript-platform</a>
127+
provides a no-code, block-based interface for creating simulations without writing any JavaScript code.</li>
128+
</ul>
123129

124130
<h2 id="features"><a name="Features"></a>Features</h2>
125131
<p>The following lists contain some, but not all, of the available features in FEAScript:</p>
@@ -185,7 +191,7 @@ <h2 id="features"><a name="Features"></a>Features</h2>
185191
</ul>
186192

187193
<p>
188-
FEAScript is currently under heavy development with new features being added regularly. Interested in
194+
🚧 <strong>FEAScript is currently under heavy development with new features being added regularly</strong>. Interested in
189195
contributing? Please check out our
190196
<a href="https://github.com/FEAScript/FEAScript-core/blob/main/CONTRIBUTING.md" target="_blank"
191197
>contribution guidelines</a
@@ -201,7 +207,11 @@ <h2 id="documentation"><a name="Documentation"></a>Documentation</h2>
201207
</p>
202208

203209
<h2 id="tutorials"><a name="Tutorials"></a>Tutorials</h2>
204-
<p>Below you can explore tutorials which serve as a step-by-step introduction to FEAScript:</p>
210+
<p>
211+
Below you can explore tutorials which serve as a step-by-step introduction to FEAScript. These tutorials
212+
demonstrate how to use FEAScript's JavaScript API directly, allowing you to integrate finite element
213+
simulations into your own websites and applications.
214+
</p>
205215
<ul>
206216
<li>
207217
Heat conduction through wall
@@ -212,9 +222,14 @@ <h2 id="tutorials"><a name="Tutorials"></a>Tutorials</h2>
212222
>
213223
</li>
214224
<li>
215-
Heat conduction in a two-dimensional fin:
216-
<a href="https://feascript.com/tutorials/HeatConduction2DFin.html" target="_blank">Standard version</a> |
217-
<a href="https://feascript.com/tutorials/HeatConduction2DFinWorker.html" target="_blank">Web Worker version</a>
225+
Heat conduction in a two-dimensional fin:
226+
<a href="https://feascript.com/tutorials/HeatConduction2DFin.html" target="_blank"
227+
>Standard version</a
228+
>
229+
|
230+
<a href="https://feascript.com/tutorials/HeatConduction2DFinWorker.html" target="_blank"
231+
>Web Worker version</a
232+
>
218233
</li>
219234
</ul>
220235
<p>
@@ -223,6 +238,29 @@ <h2 id="tutorials"><a name="Tutorials"></a>Tutorials</h2>
223238
<a href="https://github.com/FEAScript/FEAScript-core/issues" target="_blank">issues</a>.
224239
</p>
225240

241+
<h2 id="platform"><a name="Platform"></a>Platform</h2>
242+
<p>
243+
For a visual approach to creating simulations, we are developing the
244+
<a href="https://platform.feascript.com" target="_blank">FEAScript-platform</a> - a browser-based visual
245+
editor built on the
246+
<a href="https://developers.google.com/blockly/" target="_blank"
247+
>Blockly
248+
<img
249+
src="https://upload.wikimedia.org/wikipedia/commons/4/44/Icon_External_Link.svg"
250+
alt="External Link Icon"
251+
style="width: 16px; height: 16px; vertical-align: middle; margin-left: 2px; margin-bottom: 4px"
252+
/></a>
253+
library. This no-code interface allows users to build and run finite element simulations directly in
254+
their browser by connecting visual blocks. While FEAScript's JavaScript API offers full programmatic
255+
control for advanced customization, the Platform provides an accessible entry point for users without
256+
coding experience. FEAScript-platform also provides the ability to save and load projects in XML format,
257+
enabling easy sharing and reuse of simulation configurations. You can find example tutorials (as XML
258+
files) in the
259+
<a href="https://github.com/FEAScript/FEAScript-platform/tree/main/examples" target="_blank"
260+
>examples repository</a
261+
>.
262+
</p>
263+
226264
<h2 id="licensing"><a name="Licensing"></a>Licensing</h2>
227265
<p>
228266
The core library of FEAScript is distributed under the terms of the

tutorials/HeatConduction1DWall.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,7 @@ <h2 id="results"><a name="Results"></a>Results</h2>
198198

199199
<script type="module">
200200
//Import FEAScript library from GitHub
201-
import {
202-
FEAScriptModel,
203-
plotSolution,
204-
printVersion,
205-
} from "https://core.feascript.com/src/index.js";
201+
import { FEAScriptModel, plotSolution, printVersion } from "https://core.feascript.com/src/index.js";
206202
//Import FEAScript library from a local directory
207203
//import { FEAScriptModel, plotSolution, printVersion } from "../../FEAScript-core/src/index.js";
208204

tutorials/HeatConduction2DFin.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
1818
<meta
1919
name="description"
20-
content="FEAScript is a lightweight JavaScript library for browser-based finite element simulations in physics, engineering, and computational mechanics."
20+
content="This example demonstrates solving a steady-state heat transfer problem in a 2D rectangular domain using the FEAScript library. The problem represents a typical cooling fin scenario, where the objective is to model heat conduction and understand temperature distribution under specific boundary conditions."
2121
/>
2222
<meta
2323
name="keywords"
@@ -229,7 +229,10 @@ <h2 id="results"><a name="Results"></a>Results</h2>
229229
<!-- Link to worker-based implementation -->
230230
<div class="highlight-container">
231231
<p>
232-
See also the <a href="HeatConduction2DFinWorker.html">Heat Conduction in a Two-Dimensional Fin (Web Worker version)</a>
232+
See also the
233+
<a href="HeatConduction2DFinWorker.html"
234+
>Heat Conduction in a Two-Dimensional Fin (Web Worker version)</a
235+
>
233236
for an example using FEAScript in a separate thread for improved responsiveness.
234237
</p>
235238
</div>
@@ -242,11 +245,7 @@ <h2 id="results"><a name="Results"></a>Results</h2>
242245

243246
<script type="module">
244247
//Import FEAScript library from GitHub
245-
import {
246-
FEAScriptModel,
247-
plotSolution,
248-
printVersion,
249-
} from "https://core.feascript.com/src/index.js";
248+
import { FEAScriptModel, plotSolution, printVersion } from "https://core.feascript.com/src/index.js";
250249
//Import FEAScript library from a local directory
251250
//import { FEAScriptModel, plotSolution, printVersion } from "../../FEAScript-core/src/index.js";
252251

tutorials/HeatConduction2DFinWorker.html

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
1818
<meta
1919
name="description"
20-
content="FEAScript is a lightweight finite element simulation library built in JavaScript for creating client-side, browser-based simulations for physics and engineering problems."
20+
content="This example demonstrates solving a steady-state heat transfer problem in a 2D rectangular domain using the FEAScript library. The problem represents a typical cooling fin scenario, where the objective is to model heat conduction and understand temperature distribution under specific boundary conditions."
2121
/>
2222
<meta
2323
name="keywords"
@@ -87,14 +87,23 @@ <h1>Heat Conduction in a Two-Dimensional Fin (Web Worker)</h1>
8787

8888
<div class="highlight-container">
8989
<p>
90-
This page demonstrates solving the 2D heat conduction fin problem using FEAScript in a Web Worker for improved browser responsiveness.
91-
For the mathematical formulation and theory, see the <a href="HeatConduction2DFin.html">main (standard) tutorial</a>.
90+
This page demonstrates solving the 2D heat conduction fin problem using FEAScript in a Web Worker for
91+
improved browser responsiveness. For the mathematical formulation and theory, see the
92+
<a href="HeatConduction2DFin.html">main (standard) tutorial</a>.
93+
</p>
94+
95+
<p>
96+
<strong>⚠️ Important:</strong> Due to security restrictions, this example requires launching the
97+
browser with reduced security settings, e.g.:
98+
</p>
99+
<pre style="background-color: #f8f9fa; padding: 8px; border-radius: 4px; overflow-x: auto">
100+
start chrome --disable-web-security --user-data-dir="C:\tmp\chrome-cors" --disable-site-isolation-trials</pre
101+
>
102+
<p>
103+
These flags disable CORS restrictions which are normally required when working with Web Workers in a
104+
local environment. For production applications, proper CORS headers should be configured on your
105+
server.
92106
</p>
93-
94-
<p><strong>⚠️ Important:</strong> Due to security restrictions, this example requires launching the browser with reduced security settings, e.g.:</p>
95-
<pre style="background-color: #f8f9fa; padding: 8px; border-radius: 4px; overflow-x: auto;">
96-
start chrome --disable-web-security --user-data-dir="C:\tmp\chrome-cors" --disable-site-isolation-trials</pre>
97-
<p>These flags disable CORS restrictions which are normally required when working with Web Workers in a local environment. For production applications, proper CORS headers should be configured on your server.</p>
98107
</div>
99108

100109
<h2>Web Worker Implementation</h2>
@@ -158,14 +167,18 @@ <h2>Web Worker Implementation</h2>
158167

159168
<h2>Results</h2>
160169
<div id="orientation-message">
161-
Cannot draw the results. Please turn your phone to horizontal position to see the results. You can find a minimal example of this tutorial in the
170+
Cannot draw the results. Please turn your phone to horizontal position to see the results. You can find
171+
a minimal example of this tutorial in the
162172
<a
163173
href="https://github.com/FEAScript/FEAScript-core/tree/main/examples/solidHeatTransferScript/HeatConduction2DFin"
164174
target="_blank"
165175
>example directory</a
166176
>.
167177
</div>
168-
<div id="loading"><div class="spinner"></div>Solving...</div>
178+
<div id="loading">
179+
<div class="spinner"></div>
180+
Solving...
181+
</div>
169182
<div id="solutionPlot"></div>
170183

171184
<ul id="menu">
@@ -176,11 +189,7 @@ <h2>Results</h2>
176189

177190
<script type="module">
178191
//Import FEAScript library from GitHub
179-
import {
180-
FEAScriptWorker,
181-
plotSolution,
182-
printVersion,
183-
} from "https://core.feascript.com/src/index.js";
192+
import { FEAScriptWorker, plotSolution, printVersion } from "https://core.feascript.com/src/index.js";
184193
//Import FEAScript library from a local directory
185194
//import { FEAScriptWorker, plotSolution, printVersion } from "../../FEAScript-core/src/index.js";
186195
window.addEventListener("DOMContentLoaded", async () => {
@@ -191,7 +200,7 @@ <h2>Results</h2>
191200
} else {
192201
document.getElementById("orientation-message").style.display = "none";
193202
document.getElementById("solutionPlot").style.display = "block";
194-
203+
195204
// Show loading indicator
196205
document.getElementById("loading").style.display = "block";
197206

@@ -228,7 +237,7 @@ <h2>Results</h2>
228237

229238
// Solve the problem and get the solution
230239
const { solutionVector, nodesCoordinates } = await model.solve();
231-
240+
232241
// Hide loading indicator
233242
document.getElementById("loading").style.display = "none";
234243

@@ -255,7 +264,7 @@ <h2>Results</h2>
255264
} else {
256265
document.getElementById("orientation-message").style.display = "none";
257266
document.getElementById("solutionPlot").style.display = "block";
258-
267+
259268
// Show loading indicator
260269
document.getElementById("loading").style.display = "block";
261270

@@ -292,7 +301,7 @@ <h2>Results</h2>
292301

293302
// Solve the problem and get the solution
294303
const { solutionVector, nodesCoordinates } = await model.solve();
295-
304+
296305
// Hide loading indicator
297306
document.getElementById("loading").style.display = "none";
298307

0 commit comments

Comments
 (0)