diff --git a/bun.lockb b/bun.lockb index 23a36c5..74a5a27 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/index.html b/index.html index 8996609..88d22a1 100644 --- a/index.html +++ b/index.html @@ -4,9 +4,22 @@ + + + + + + + + + + - Ricerca Operativa / Programmazione Lineare + Algoritmo del Simplesso | PL | Ricerca Operativa diff --git a/package.json b/package.json index 2f9ce6a..251f3d1 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,8 @@ "typescript": "^5.0.0" }, "dependencies": { + "@fontsource-variable/jetbrains-mono": "^5.1.2", + "@fontsource-variable/open-sans": "^5.1.1", "katex": "^0.16.20", "preact": "^10.25.4" } diff --git a/public/about.txt b/public/about.txt new file mode 100644 index 0000000..3720f4a --- /dev/null +++ b/public/about.txt @@ -0,0 +1,6 @@ +This favicon was generated using the following font: + +- Font Title: Open Sans +- Font Author: undefined +- Font Source: https://fonts.gstatic.com/s/opensans/v40/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4nY1M2xLER.ttf +- Font License: undefined) diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png new file mode 100644 index 0000000..a38854d Binary files /dev/null and b/public/android-chrome-192x192.png differ diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png new file mode 100644 index 0000000..a2c7eb0 Binary files /dev/null and b/public/android-chrome-512x512.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..126f3bd Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png new file mode 100644 index 0000000..694c194 Binary files /dev/null and b/public/favicon-16x16.png differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png new file mode 100644 index 0000000..903a97d Binary files /dev/null and b/public/favicon-32x32.png differ diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..c011f74 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/favicon_io.zip b/public/favicon_io.zip new file mode 100644 index 0000000..4d5812f Binary files /dev/null and b/public/favicon_io.zip differ diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100644 index 0000000..45dc8a2 --- /dev/null +++ b/public/site.webmanifest @@ -0,0 +1 @@ +{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file diff --git a/src/Primal.tsx b/src/Primal.tsx index a3636a1..7e3583f 100644 --- a/src/Primal.tsx +++ b/src/Primal.tsx @@ -1,3 +1,4 @@ +import { useEffect, useState } from 'preact/hooks' import { MobileScrollable } from './components' import { Katex } from './Katex' import { fillDot, drawSemiplane, drawSimpleArrow, strokeInfiniteLine } from './lib-v2/canvas' @@ -83,42 +84,54 @@ const PrimalStep = ({ } export const Primal = ({ input }: { input: ProblemInput }) => { - // const steps: Step[] = [{ B: input.B }] - - const timerStart = performance.now() - - const problemOutput = computePrimalSimplexSteps({ - A: input.A, - b: input.b, - c: input.c, - B: input.B, - maxIterations: 10, - }) - - const timerDelta = performance.now() - timerStart + const [problemOutput, setProblemOutput] = useState | null>(null) + const [timerDelta, setTimerDelta] = useState(null) + + useEffect(() => { + const timerStart = performance.now() + const output = computePrimalSimplexSteps({ + A: input.A, + b: input.b, + c: input.c, + B: input.B, + maxIterations: 10, + }) + const elapsedTime = performance.now() - timerStart + + setProblemOutput(output) + setTimerDelta(elapsedTime) + }, [input]) return (
-
-

Svolgimento

-
- {problemOutput.steps.map((step, iter) => ( - - ))} + {problemOutput ? ( + <> +
+

Svolgimento

+
+ {problemOutput.steps.map((step, iter) => ( + + ))} + + ) : ( +
+

Loading...

+
+ )}
) } diff --git a/src/main.tsx b/src/main.tsx index 17840bb..688f844 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,3 +1,6 @@ +import '@fontsource-variable/jetbrains-mono/index.css' +import '@fontsource-variable/open-sans/index.css' + import { render } from 'preact' import { useState } from 'preact/hooks' import { parseSafeProblemInput } from './parser-problem' @@ -58,20 +61,17 @@ const App = () => { return ( <>

- Ricerca Operativa / Programmazione Lineare + Ricerca Operativa / PL / Algoritmo del Simplesso {' '} - by @aziis98 + by @aziis98

Questo sito è un progetto per il{' '} corso di Ricerca Operativa{' '} dell'Università di Pisa per visualizzare automaticamente tutti i passaggi dell' - - algoritmo del simplesso primale e duale - - . + algoritmo del simplesso primale.

Visualizzazione

I dati del problema vanno inseriti nel seguente campo di testo nel formato:

diff --git a/src/style.css b/src/style.css index 6d2d043..62c8338 100644 --- a/src/style.css +++ b/src/style.css @@ -30,9 +30,9 @@ h2, h3, h4 { - font-weight: 600; + font-weight: 300; margin: 0; - color: #444; + color: #222; line-height: 1.25; } @@ -50,7 +50,7 @@ font-size: 16px; background: #fff; - border: 1px solid #888; + border: 1px solid #ccc; min-height: 1.75rem; padding: 0 0.25rem; border-radius: 0.25rem; @@ -63,21 +63,24 @@ padding: 0.5rem; - font-family: 'JetBrains Mono', monospace; + font-family: 'JetBrains Mono Variable', monospace; font-weight: 400; color: #333; } button, select { - font-family: 'Open Sans', sans-serif; - font-size: 16px; - font-weight: 400; - color: #333; + font-family: 'Open Sans Variable', sans-serif; + font-size: 14px; + font-weight: 600; + color: #444; + + display: grid; + place-content: center; box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.1); background: #f0f0f0; - border: 1px solid #888; + border: 1px solid #bbb; padding: 0 0.5rem; border-radius: 0.25rem; min-height: 1.75rem; @@ -89,20 +92,24 @@ } } + button { + padding: 0 1rem; + } + p { line-height: 1.75; } pre, code { - font-family: 'JetBrains Mono', monospace; + font-family: 'JetBrains Mono Variable', monospace; font-weight: 400; color: #333; } strong { - font-weight: 700; - color: #444; + font-weight: 600; + color: #000; } small { @@ -113,7 +120,7 @@ @layer components { body { - font-family: 'Open Sans', sans-serif; + font-family: 'Open Sans Variable', sans-serif; font-size: 16px; line-height: 1.75;