From 98dd31fab4da78bdae8f7b4fad014a837d52750e Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Sun, 2 May 2021 19:50:41 +0200 Subject: [PATCH 01/19] Updated work time --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index fbc6cd5..4ce78af 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,12 @@ Note: _The order of this list might not match the order these features will be a ## Versions log +#### v1.3 + +_Release date: ???????????????????????_ + +_Work Time: 2h_ + #### v1.2 _Release date: April 25, 2021_ From 35706b0b816ec7596f51d19d5aea6e4ee399ce4d Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Wed, 5 May 2021 20:02:53 +0200 Subject: [PATCH 02/19] Updated 1.3 work time --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ce78af..35c5de9 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 2h_ +_Work Time: 2h + 0.5h_ #### v1.2 From 950f1f1ef112e9084154ba7df9d3f941c1ae5482 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Fri, 7 May 2021 19:53:44 +0200 Subject: [PATCH 03/19] Updated 1.3 work time --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 35c5de9..22527bc 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 2h + 0.5h_ +_Work Time: 2h + 0.5h + 0.5h_ #### v1.2 From 6671e68c3cc7711dc69dd75949fe9a0abb30bba8 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Wed, 12 May 2021 19:31:54 +0200 Subject: [PATCH 04/19] Updated Media section --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 22527bc..46f480a 100644 --- a/README.md +++ b/README.md @@ -98,4 +98,5 @@ First release composed by an index page and 13 standard shapes to choose. Tables #### Media -- Favicon made by [Vitaliy Gorbachev](https://www.flaticon.com/authors/vitaly-gorbachev) from [www.flaticon.com](www.flaticon.com) +- Favicon made by [Vitaliy Gorbachev](https://www.flaticon.com/authors/vitaly-gorbachev) from [www.flaticon.com](https://www.flaticon.com/) +- Icons made by [Freepik](https://www.freepik.com) [www.flaticon.com](https://www.flaticon.com/) From 8ad2995b59567454dba26a9e858d497527b23b67 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Wed, 12 May 2021 20:01:43 +0200 Subject: [PATCH 05/19] Updated 1.3 work time --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 46f480a..50f7ddc 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 2h + 0.5h + 0.5h_ +_Work Time: 4h_ #### v1.2 From acedb12892b3292811ce3137a1999d641c696eef Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Sun, 23 May 2021 19:51:58 +0200 Subject: [PATCH 06/19] Updated 1.3 work time --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 50f7ddc..c89ea99 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 4h_ +_Work Time: 5h 20m_ #### v1.2 From 8060694b105a27fd7fb1379975db97161b086fc8 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Wed, 16 Jun 2021 20:12:31 +0200 Subject: [PATCH 07/19] Updated 1.3 work time --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c89ea99..9a7704e 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 5h 20m_ +_Work Time: 5h 50m_ #### v1.2 From 0da70163d9f3c989663861854cb7df69cf112a52 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Fri, 18 Jun 2021 20:13:44 +0200 Subject: [PATCH 08/19] Generation from JSON database --- assets/db/equations.json | 393 ++++++++++++++++++++++++++++++++++ assets/ico/exit-top-right.svg | 46 ++++ pages/equations.css | 124 +++++++++++ pages/equations.html | 36 ++++ pages/equations.js | 73 +++++++ style.css | 22 -- 6 files changed, 672 insertions(+), 22 deletions(-) create mode 100644 assets/db/equations.json create mode 100644 assets/ico/exit-top-right.svg create mode 100644 pages/equations.css create mode 100644 pages/equations.html create mode 100644 pages/equations.js diff --git a/assets/db/equations.json b/assets/db/equations.json new file mode 100644 index 0000000..a3f6133 --- /dev/null +++ b/assets/db/equations.json @@ -0,0 +1,393 @@ +{ + "Cylinder": { + "title": "Cylinder", + "legend": [ + "D : diameter", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[P = D /cdot /pi/]", + "/[A = /pi r^{2}/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I = /frac{/pi /cdot D^{4}}{64}/]", + "/[W = /frac{/pi /cdot D^{3}}{32}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "Hollow Cylinder": { + "title": "Hollow Cylinder", + "legend": [ + "D : diameter", + "d : internal diameter", + "t : thickness", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[d = D - 2t/]", + "/[P = D /cdot /pi + d /cdot /pi = /pi (D + d)/]", + "/[A = /pi r^{2} - /pi (r - t)^{2} = /pi t (D - t)/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I = /frac{/pi /cdot (D^{4} - d^{4})}{64}/]", + "/[W = /frac{/pi /cdot (D^{3} - d^{3})}{32}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "Rectangle Bar": { + "title": "Rectangle Bar", + "legend": [ + "B : base length", + "H : height", + "R : corner radius", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[P = 2 (B + H - 4R) + 2 /pi R/]", + "/[A = B (H - 2R) + 2R (H - 2R) + /pi R^{2}/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I /approx /frac{B H^{3}}{12}/]", + "/[W /approx /frac{B H^{2}}{6}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "Rectangular Tube": { + "title": "Rectangle Tube", + "legend": [ + "B : base length", + "H : height", + "R : outer radius", + "r : inner radius", + "t : thickness", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[r = max /left /{ 0 ; R - t /right /} /]", + "/[P_{inner} = 2 (B + H - 4t - 4r) + 2 /pi r/]", + "/[A_{inner} = (B - 2t)(H - 2t - 2r) + 2r (B - 2t - 2r) - /pi r^{2}/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I /approx /frac{B H^{3} - (B - 2t)(H - 2t)^{3}}{12}/]", + "/[W /approx /frac{B H^{3} - (B - 2t)(H - 2t)^{3}}{6 H}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "Triangle Prism": { + "title": "Triangular Prism", + "legend": [ + "B : base length", + "H : height", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[P = B + 2 /sqrt{/frac{B^2}{4} + H^2}/]", + "/[A = /frac{B H}{2}/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I = /frac{B H^3}{36}/]", + "/[W = /frac{B H^2}{24}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "Trapezius Prism": { + "title": "Trapezius Prism", + "legend": [ + "B : major base length", + "b : minor base length", + "H : height", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[P = B + b + 2 /sqrt{/frac{(B - b)^{2}}{4} + H^2}/]", + "/[A = /frac{H (B + b)}{2}/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I = /frac{H^3 (b^3 + 4Bb + B^2)}{36 (B + b)}/]", + "/[W = /frac{H^2 (b^2 + 4Bb + B^2)}{12 (B + 2b)}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "Hexagon Prism": { + "title": "Hexagonal Prism", + "legend": [ + "H : height (side to side)", + "e : edge length", + "s : circumscribed diameter", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[e = /frac{H}{2 sin/frac{/pi}{3}}/]", + "/[s = 2e/]", + "/[P = 6e/]", + "/[A = /frac{P /cdot H}{4}/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I = /frac{5 /sqrt{3}}{16} /cdot e^4/]", + "/[W_{A} = /frac{2 I}{H}/]", + "/[W_{B} = /frac{2 I}{s}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "Octagonal Prism": { + "title": "Octagonal Prism", + "legend": [ + "H : side to side dimension", + "e : edge length", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[e = H /sqrt{2} - H = /frac{H}{1 + /sqrt{2}}/]", + "/[P = 8e/]", + "/[A = 2 (/sqrt{2} - 1) /cdot H^2/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I = /frac{/sqrt{2} - 1}{6} /cdot H^4/]", + "/[W = /frac{2 I}{H} = /frac{/sqrt{2} - 1}{3} /cdot H^3/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "Elliptic Bar": { + "title": "Elliptic Bar", + "legend": [ + "A : horizontal diameter", + "B : vertical diameter", + "a : horizontal radius", + "b : vertical radius", + "h : circularity factor", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[a = /frac{A}{2} /; , /; b = /frac{B}{2}/]", + "/[h = /frac{(a - b)^2}{(a + b)^2}/]", + "/[P /approx /pi (a + b) /left(1 + /frac{3h}{10 + /sqrt{4 - 3h}} /right)/]", + "/[A = /pi /frac{A /cdot B}{4}/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I = /frac{/pi A B^3}{64}/]", + "/[W = /frac{2 I}{B} = /frac{/pi A B^2}{32}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "Hollow Ellipse Bar": { + "title": "Elliptic Tube", + "legend": [ + "A : horizontal diameter", + "B : vertical diameter", + "a : horizontal external radius", + "b : vertical external radius", + "t : thickness", + "h : circularity factor", + "hi : internal circularity factor", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[a = /frac{A}{2} /; , /; b = /frac{B}{2}/]", + "/[h = /frac{(a - b)^2}{(a + b)^2} /; , /; h_i = /frac{(a - b)^2}{(a + b)^2}/]", + "/[P /approx /pi /left[ (a + b) /left(1 + /frac{3h}{10 + /sqrt{4 - 3h}} /right) + (a + b - 2t) /left(1 + /frac{3h_i}{10 + /sqrt{4 - 3h_i}} /right) /right]/]", + "/[A /simeq /frac{/pi}{4} /left [A B - (A - 2t)(B- 2t) /right ]/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I /simeq /frac{/pi}{64} /left [A B^3 - (A - 2t)(B- 2t)^3 /right ]/]", + "/[W = /frac{2 I}{B} /simeq /frac{/pi}{32 /cdot B} /left [A B^3 - (A - 2t)(B- 2t)^3 /right ]/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "H Profile": { + "title": "H Profile", + "legend": [ + "B : base length", + "H : height", + "t : central thickness", + "h : wings inner height", + "L : length", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[P = 2 (2B + H - t)/]", + "/[A = B (H - h) + ht/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I_{A} = /frac{B H^3 - (B-t) h^3}{12}/]", + "/[W_{A} = /frac{2 I_{A}}{H} = /frac{B H^3 - (B-t) h^3}{6H}/]", + "/[I_{B} = /frac{(H - h) B^3 - h t^3}{12}/]", + "/[W_{B} = /frac{2 I_{B}}{B} = /frac{(H - h) B^3 - h t^3}{6B}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "C / U Profile": { + "title": "C Profile", + "legend": [ + "B : base length", + "H : height", + "b : inner base", + "h : wings inner height", + "L : length", + "v1 : barycenter height", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[P = 2 (B + H + b)/]", + "/[A = B H - b h/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[I_{A} = /frac{B H^3 - b h^3}{12}/]", + "/[W_{A} = /frac{2 I_{A}}{H} = /frac{B H^3 - b h^3}{6H}/]", + "/[v_1B = /frac{1}{2} /cdot /frac{(H - h) B^2 + h (B - b)^2}{(H - h) B + h (B - b)}/]", + "/[I_{B} = /frac{H {v_1B}^3 - h (v_1B - B + b)^3 + (H - h)(B - v_1B)^3}{3}/]", + "/[W_{B} = /frac{I_{B}}{B - v_1B}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + }, + "T Profile": { + "title": "T Profile", + "legend": [ + "B : base length", + "H : height", + "t : central thickness", + "h : central height", + "L : length", + "v1 : barycenter height", + "Rm : braking/ultimate strength", + "ReH : yeld strength", + "I : moment of inertia relative to horixontal axis", + "W : strength modulus on vertical load", + "Fmax : max traction load" + ], + "geo": [ + "/[P = 2 (B + H)/]", + "/[A = B (H - h) - h t/]", + "/[V = A /cdot L/]", + "/[if (L = 0) /Rightarrow S = A/]", + "/[if (L /neq 0) /Rightarrow S = 2A + P /cdot L/]" + ], + "phi": [ + "/[m = V /cdot /rho/]", + "/[v_1A = /frac{1}{2} /cdot /frac{t H^2 + (B - t) (H - h)^2}{t H + (B - t) (H - h)}/]", + "/[I_{A} = /frac{B {v_1A}^3 - (B - t) (v_1A - H + h)^3 + t(H - v_1A)^3}{3}/]", + "/[W_{A} = /frac{I_{A}}{H - v_1A}/]", + "/[I_{B} = /frac{(H - h) B^3 - h t^3}{12}/]", + "/[W_{B} = /frac{2 I_{B}}{B} = /frac{(H - h) B^3 - h t^3}{6B}/]", + "/[if (R_{s} /neq 0) /Rightarrow F_{max} = /frac{R_{s}}{3} /cdot A/]", + "/[else /Rightarrow F_{max} = /frac{R_{m}}{4} /cdot A/]" + ] + } +} \ No newline at end of file diff --git a/assets/ico/exit-top-right.svg b/assets/ico/exit-top-right.svg new file mode 100644 index 0000000..a585663 --- /dev/null +++ b/assets/ico/exit-top-right.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pages/equations.css b/pages/equations.css new file mode 100644 index 0000000..a5fe5e2 --- /dev/null +++ b/pages/equations.css @@ -0,0 +1,124 @@ +.main-container { + display: flex; + position: relative; +} + +#list { + padding: 0.5em 1em; + display: flex; + flex-direction: column; +} + +#list div { + height: 2.5em; + display: flex; + align-items: center; +} + +label { + color: var(--color-2); + padding: 0.5em 1em; + margin: 0.3em; + position: relative; + font-size: 1em; + font-weight: bold; + width: 100%; +} + +label:hover { + color: var(--color-4); +} + +input[name=select]:checked ~ label { + background-color: var(--color-5); + color: var(--main-bg); + border-radius: 100vh; +} + +input[name=select]:checked ~ label::before, input[name=select]:checked ~ label::after { + content: ''; + position: absolute; + width: 1em; + height: 1em; + background: white; + right: -2em; + z-index: -1; +} + +input[name=select]:checked ~ label::before { + transform: skewX(45deg); + top: 50%; +} + +input[name=select]:checked ~ label::after { + transform: skewX(-45deg); + bottom: 50%; +} + +input[name=select] { + display: none; +} + +#board { + flex-grow: 1; + background-color: white; + border-radius: 1em; + width: 100px; + overflow: hidden; +} + +.math { + --marg: 2%; + width: calc(100% - 2 * var(--marg)); + height: auto; + margin: var(--marg); +} + +.math h4 { + color: var(--color-1); + text-align: center; +} + +.math > div { + display: grid; + grid-template: auto auto / 1fr 1fr; + gap: .5em; +} + +.math img { + margin: auto; + height: 12rem; +} + +.card { + border-top: solid 1px var(--color-1); + border-left: solid 1px var(--color-1); + border-radius: 16px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2); +} + +.card > div { + display: flex; + flex-direction: column; + flex-wrap: wrap; +} + +h5 { + color: black; + text-align: center; + font-size: 1em; + margin-block-start: 0.5em; + margin-block-end: 1em; +} + +.card p { + display: inline-block; + text-align: center; + color: black; + width: auto; + margin: .15em; +} + +mjx-container[jax="CHTML"][display="true"] { + margin: .5em 0 !important; +} \ No newline at end of file diff --git a/pages/equations.html b/pages/equations.html new file mode 100644 index 0000000..7b01d3b --- /dev/null +++ b/pages/equations.html @@ -0,0 +1,36 @@ + + + + + Equations + + + + + + + + + +
+

Equations

+ + +

Back to index

+
+
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/pages/equations.js b/pages/equations.js new file mode 100644 index 0000000..940c7f9 --- /dev/null +++ b/pages/equations.js @@ -0,0 +1,73 @@ +var list; +var radio; +var profiles; +var database; + +function preload() { + list = document.getElementById('list'); + radio = document.getElementById('radio'); + profiles = loadTable("../assets/db/profiles.csv", "csv", "header"); + database = loadJSON("../assets/db/equations.json"); +} + +function setup() { + noCanvas(); + + // sidebar list generation + for (let i = 0; i < profiles.rows.length; i++) { + let div = document.createElement('div'); + let num = i + 1; + let id = "radio" + num; + let btn = document.createElement('input'); + btn.setAttribute('type', 'radio'); + btn.setAttribute('name', 'select'); + btn.setAttribute('value', num); + btn.setAttribute('id', id); + if (i == 0) { btn.checked = true } + let label = document.createElement('label'); + label.setAttribute('for', id); + label.innerText = profiles.rows[i].obj["Name"]; + div.append(btn, label, document.createElement('br')); + list.append(div); + } + + // content generation + for (let elt of profiles.rows) { + let math = document.createElement('div'); + math.classList.add('math'); + document.getElementById('board').append(math); + let title = document.createElement('h4'); + title.innerHTML = database[elt.obj["Name"]].title; + let main = document.createElement('div'); + math.append(title, main); + let pic = document.createElement('img'); + pic.src = '../assets/img/' + elt.obj["MediaName"] + '.png'; + main.append(pic); + let cards = new Array(3); + let titles = ["Legend", "Geometry equations", "Phisical equations"]; + let indices = ["legend", "geo", "phi"]; + for (let i = 0; i < cards.length; i++) { + cards[i] = document.createElement('div'); + cards[i].classList.add('card'); + main.append(cards[i]); + let title = document.createElement('h5'); + title.innerHTML = titles[i]; + let innerContainer = document.createElement('div'); + let strings = database[elt.obj["Name"]][indices[i]]; + for (let j = 0; j < strings.length; j++) { + let p = document.createElement('p'); + p.innerHTML = strings[j]; + if (i != 0) p.innerHTML = strings[j].replaceAll("/", "\\"); + innerContainer.append(p); + } + cards[i].append(title, innerContainer); + } + } +} + +// load MathJax after all +let mathjax = document.createElement('script'); +mathjax.id = "MathJax-script"; +mathjax.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'; +mathjaxsetAttribute('async', ''); +document.head.appendChild(mathjax); \ No newline at end of file diff --git a/style.css b/style.css index c34d3d1..2921d67 100644 --- a/style.css +++ b/style.css @@ -224,26 +224,4 @@ input, select { border: none; font-family: Rockwell; font-size: 14px; -} - -h4 { - text-align: center; - color: var(--color-2); -} - -.math { - /*display: inline-block;*/ - /*margin: var(--side-margin);*/ - /*background-color: var(--color-4);*/ - float: left; - width: 256px; - height: 270px; - margin-bottom: 30px; - color: var(--color-4); -} - -.list { - text-align: left; - color: var(--color-4); - margin-left: 16px; } \ No newline at end of file From 021765e36141355229b681ba8d43e1b94ec63fc1 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Fri, 18 Jun 2021 20:15:50 +0200 Subject: [PATCH 09/19] Updated 1.3 work time --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a7704e..507ae5b 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 5h 50m_ +_Work Time: 6h 50m_ #### v1.2 From c7e69fce5bc1581ad0f5dcac87f498575c6833c2 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Tue, 22 Jun 2021 19:49:05 +0200 Subject: [PATCH 10/19] Fixed Mathjax script run before p5 loads elements --- pages/equations.html | 1 + pages/equations.js | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pages/equations.html b/pages/equations.html index 7b01d3b..69d8b24 100644 --- a/pages/equations.html +++ b/pages/equations.html @@ -9,6 +9,7 @@ + diff --git a/pages/equations.js b/pages/equations.js index 940c7f9..60b1b6d 100644 --- a/pages/equations.js +++ b/pages/equations.js @@ -63,11 +63,11 @@ function setup() { cards[i].append(title, innerContainer); } } -} -// load MathJax after all -let mathjax = document.createElement('script'); -mathjax.id = "MathJax-script"; -mathjax.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'; -mathjaxsetAttribute('async', ''); -document.head.appendChild(mathjax); \ No newline at end of file + // load MathJax after all + let mathjax = document.createElement('script'); + mathjax.id = "MathJax-script"; + mathjax.src = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"; + mathjax.defer = true; + document.head.appendChild(mathjax); +} \ No newline at end of file From 21f0875f86dc1b6f53d8c7f40fae73086a5b6e51 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:15:09 +0200 Subject: [PATCH 11/19] Limited #board panel height --- pages/equations.css | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/equations.css b/pages/equations.css index a5fe5e2..51d00a1 100644 --- a/pages/equations.css +++ b/pages/equations.css @@ -65,6 +65,7 @@ input[name=select] { border-radius: 1em; width: 100px; overflow: hidden; + max-height: calc(100vh - 129px - 1em); } .math { From 48595129afb7afb5d1feb49d51d89baae9b3b4d2 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Thu, 24 Jun 2021 18:29:20 +0200 Subject: [PATCH 12/19] Updated 1.3 work time --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 507ae5b..6eb40e6 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 6h 50m_ +_Work Time: 7h 30m_ #### v1.2 From f3831462eda12e4d4914430120844a86994c4f49 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Thu, 24 Jun 2021 19:48:13 +0200 Subject: [PATCH 13/19] Updated 1.3 work time --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6eb40e6..4c669da 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 7h 30m_ +_Work Time: 8h 00m_ #### v1.2 From 66fa6fac25b8d5b369445aca60f177b5aaaebcba Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Thu, 24 Jun 2021 19:50:31 +0200 Subject: [PATCH 14/19] Added scrolling and shape selection with labels --- pages/equations.css | 8 +++++++- pages/equations.js | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pages/equations.css b/pages/equations.css index 51d00a1..4631486 100644 --- a/pages/equations.css +++ b/pages/equations.css @@ -55,6 +55,12 @@ input[name=select]:checked ~ label::after { bottom: 50%; } +label a { + position: absolute; + inset: 0; + border-radius: inherit; +} + input[name=select] { display: none; } @@ -64,7 +70,7 @@ input[name=select] { background-color: white; border-radius: 1em; width: 100px; - overflow: hidden; + overflow: scroll; max-height: calc(100vh - 129px - 1em); } diff --git a/pages/equations.js b/pages/equations.js index 60b1b6d..bf0171b 100644 --- a/pages/equations.js +++ b/pages/equations.js @@ -27,6 +27,10 @@ function setup() { let label = document.createElement('label'); label.setAttribute('for', id); label.innerText = profiles.rows[i].obj["Name"]; + let link = document.createElement('a'); + link.href = "#" + database[profiles.rows[i].obj["Name"]].title.replace(" ", ""); + link.setAttribute('onclick', 'checkMe(' + (i + 1) + ')'); + label.append(link); div.append(btn, label, document.createElement('br')); list.append(div); } @@ -38,6 +42,7 @@ function setup() { document.getElementById('board').append(math); let title = document.createElement('h4'); title.innerHTML = database[elt.obj["Name"]].title; + title.id = title.innerHTML.replace(" ", ""); let main = document.createElement('div'); math.append(title, main); let pic = document.createElement('img'); @@ -70,4 +75,8 @@ function setup() { mathjax.src = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"; mathjax.defer = true; document.head.appendChild(mathjax); +} + +function checkMe(index) { + document.getElementById('radio' + index).checked = true; } \ No newline at end of file From a1a504b920f1a8f6668e7cb07129941e59c53da5 Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Wed, 7 Jul 2021 19:49:56 +0200 Subject: [PATCH 15/19] Table look for legend paragraphs --- README.md | 2 +- pages/equations.css | 23 ++++++++++++++++++++++- pages/equations.js | 19 ++++++++++++++++--- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4c669da..d4c9972 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 8h 00m_ +_Work Time: 8h 40m_ #### v1.2 diff --git a/pages/equations.css b/pages/equations.css index 4631486..1d17a28 100644 --- a/pages/equations.css +++ b/pages/equations.css @@ -104,7 +104,7 @@ input[name=select] { box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2); } -.card > div { +.card:not(:first-of-type) > div { display: flex; flex-direction: column; flex-wrap: wrap; @@ -126,6 +126,27 @@ h5 { margin: .15em; } +.card:first-of-type p { + text-align: left; +} + +.card p > span { + display: inline-block; + margin-left: 1em; +} + +.card p > span:nth-child(1) { + display: none; +} + +.card p > span:nth-child(2) { + width: 6ch; +} + +.card p > span:nth-child(3) { + width: max-content; +} + mjx-container[jax="CHTML"][display="true"] { margin: .5em 0 !important; } \ No newline at end of file diff --git a/pages/equations.js b/pages/equations.js index bf0171b..7c13c7a 100644 --- a/pages/equations.js +++ b/pages/equations.js @@ -33,6 +33,7 @@ function setup() { label.append(link); div.append(btn, label, document.createElement('br')); list.append(div); + //reverse highlighting labels on scroll//////////////////////////////////////////////////// } // content generation @@ -61,9 +62,21 @@ function setup() { let strings = database[elt.obj["Name"]][indices[i]]; for (let j = 0; j < strings.length; j++) { let p = document.createElement('p'); - p.innerHTML = strings[j]; - if (i != 0) p.innerHTML = strings[j].replaceAll("/", "\\"); - innerContainer.append(p); + if (i != 0) { + p.innerHTML = strings[j]; + p.innerHTML = strings[j].replaceAll("/", "\\"); + innerContainer.append(p); + } else { + let re = /(.+)\s?:\s?(.+)/; + let spans = re.exec(strings[j]); + for (let str of spans) { + let s = document.createElement('span'); + s.innerHTML = str; + p.append(s); + } + let br = document.createElement('br'); + innerContainer.append(p, br); + } } cards[i].append(title, innerContainer); } From 026bd27c492358bc4c431f91c7fca1345395448a Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Thu, 22 Jul 2021 19:37:50 +0200 Subject: [PATCH 16/19] Changed grid display for cards Math page completed --- README.md | 2 +- assets/db/equations.json | 26 +++++++++++++------------- pages/equations.css | 24 +++++++++++++++++++----- pages/equations.js | 1 - 4 files changed, 33 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d4c9972..afd0689 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 8h 40m_ +_Work Time: 9h 10m_ #### v1.2 diff --git a/assets/db/equations.json b/assets/db/equations.json index a3f6133..1a89603 100644 --- a/assets/db/equations.json +++ b/assets/db/equations.json @@ -6,7 +6,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -34,7 +34,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -63,7 +63,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -93,7 +93,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -121,7 +121,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -149,7 +149,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -177,7 +177,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -207,7 +207,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -238,7 +238,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -272,7 +272,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -303,7 +303,7 @@ "L : length", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -335,7 +335,7 @@ "v1 : barycenter height", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], @@ -368,7 +368,7 @@ "v1 : barycenter height", "Rm : braking/ultimate strength", "ReH : yeld strength", - "I : moment of inertia relative to horixontal axis", + "I : moment of inertia on horiz. axis", "W : strength modulus on vertical load", "Fmax : max traction load" ], diff --git a/pages/equations.css b/pages/equations.css index 1d17a28..ac440f8 100644 --- a/pages/equations.css +++ b/pages/equations.css @@ -32,7 +32,7 @@ label:hover { input[name=select]:checked ~ label { background-color: var(--color-5); color: var(--main-bg); - border-radius: 100vh; + border-radius: 0.5em; } input[name=select]:checked ~ label::before, input[name=select]:checked ~ label::after { @@ -70,14 +70,14 @@ input[name=select] { background-color: white; border-radius: 1em; width: 100px; - overflow: scroll; + overflow: hidden; max-height: calc(100vh - 129px - 1em); } .math { --marg: 2%; width: calc(100% - 2 * var(--marg)); - height: auto; + height: calc(100% - 2 * var(--marg)); margin: var(--marg); } @@ -88,7 +88,7 @@ input[name=select] { .math > div { display: grid; - grid-template: auto auto / 1fr 1fr; + grid-template: auto 1fr / repeat(3, 1fr); gap: .5em; } @@ -102,6 +102,7 @@ input[name=select] { border-left: solid 1px var(--color-1); border-radius: 16px; box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2); + padding: 0.5em; } .card:not(:first-of-type) > div { @@ -114,7 +115,7 @@ h5 { color: black; text-align: center; font-size: 1em; - margin-block-start: 0.5em; + margin-block-start: 0; margin-block-end: 1em; } @@ -124,6 +125,7 @@ h5 { color: black; width: auto; margin: .15em; + font-size: 80%; } .card:first-of-type p { @@ -147,6 +149,18 @@ h5 { width: max-content; } +.card:nth-child(2) { /*LEGEND*/ + grid-row: 2; +} + +.card:nth-child(3) { /*GEO*/ + grid-row: 1 / span 2; +} + +.card:nth-child(4) { /*PHI*/ + grid-row: 1 / span 2; +} + mjx-container[jax="CHTML"][display="true"] { margin: .5em 0 !important; } \ No newline at end of file diff --git a/pages/equations.js b/pages/equations.js index 7c13c7a..392b6a4 100644 --- a/pages/equations.js +++ b/pages/equations.js @@ -33,7 +33,6 @@ function setup() { label.append(link); div.append(btn, label, document.createElement('br')); list.append(div); - //reverse highlighting labels on scroll//////////////////////////////////////////////////// } // content generation From 3b1f97f207824674d902d7353f5fde3ac8342abc Mon Sep 17 00:00:00 2001 From: Nazzareno Pasqual <79537141+TerribleCoding@users.noreply.github.com> Date: Fri, 23 Jul 2021 19:54:27 +0200 Subject: [PATCH 17/19] Added side bar menu --- README.md | 2 +- index.html | 18 ++++++++++++------ style.css | 45 +++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index afd0689..f9375fa 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Note: _The order of this list might not match the order these features will be a _Release date: ???????????????????????_ -_Work Time: 9h 10m_ +_Work Time: 10h_ #### v1.2 diff --git a/index.html b/index.html index 1cbc975..0fcc913 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,7 @@ + @@ -16,13 +17,18 @@

Select a profile shape

-
- + - -