chore: some stylistic updates

main
Antonio De Lucreziis 2 years ago
parent 65256888f7
commit 388008f8a3

Binary file not shown.

@ -4,9 +4,22 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<meta property="og:site_name" content="Ricerca Operativa / PL / Algoritmo del Simplesso" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Ricerca Operativa / PL / Algoritmo del Simplesso" />
<meta
property="og:description"
content="Visualizzazione dell'algoritmo del simplesso per la programmazione lineare"
/>
<link rel="stylesheet" href="./src/style.css" /> <link rel="stylesheet" href="./src/style.css" />
<title>Ricerca Operativa / Programmazione Lineare</title> <title>Algoritmo del Simplesso | PL | Ricerca Operativa</title>
</head> </head>
<body> <body>
<script type="module" src="./src/main.tsx"></script> <script type="module" src="./src/main.tsx"></script>

@ -16,6 +16,8 @@
"typescript": "^5.0.0" "typescript": "^5.0.0"
}, },
"dependencies": { "dependencies": {
"@fontsource-variable/jetbrains-mono": "^5.1.2",
"@fontsource-variable/open-sans": "^5.1.1",
"katex": "^0.16.20", "katex": "^0.16.20",
"preact": "^10.25.4" "preact": "^10.25.4"
} }

@ -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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

@ -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"}

@ -1,3 +1,4 @@
import { useEffect, useState } from 'preact/hooks'
import { MobileScrollable } from './components' import { MobileScrollable } from './components'
import { Katex } from './Katex' import { Katex } from './Katex'
import { fillDot, drawSemiplane, drawSimpleArrow, strokeInfiniteLine } from './lib-v2/canvas' import { fillDot, drawSemiplane, drawSimpleArrow, strokeInfiniteLine } from './lib-v2/canvas'
@ -83,42 +84,54 @@ const PrimalStep = ({
} }
export const Primal = ({ input }: { input: ProblemInput }) => { export const Primal = ({ input }: { input: ProblemInput }) => {
// const steps: Step[] = [{ B: input.B }] const [problemOutput, setProblemOutput] = useState<ReturnType<typeof computePrimalSimplexSteps> | null>(null)
const [timerDelta, setTimerDelta] = useState<number | null>(null)
const timerStart = performance.now()
useEffect(() => {
const problemOutput = computePrimalSimplexSteps({ const timerStart = performance.now()
A: input.A, const output = computePrimalSimplexSteps({
b: input.b, A: input.A,
c: input.c, b: input.b,
B: input.B, c: input.c,
maxIterations: 10, B: input.B,
}) maxIterations: 10,
})
const timerDelta = performance.now() - timerStart const elapsedTime = performance.now() - timerStart
setProblemOutput(output)
setTimerDelta(elapsedTime)
}, [input])
return ( return (
<div class="steps" title={`Calcolato in ${timerDelta}ms`}> <div class="steps" title={`Calcolato in ${timerDelta}ms`}>
<div class="title"> {problemOutput ? (
<h2>Svolgimento</h2> <>
</div> <div class="title">
{problemOutput.steps.map((step, iter) => ( <h2>Svolgimento</h2>
<PrimalStep </div>
{...{ {problemOutput.steps.map((step, iter) => (
iter, <PrimalStep
{...{
A: input.A, iter,
b: input.b,
c: input.c, A: input.A,
b: input.b,
B: step.B, c: input.c,
x: step.x,
xi: step.xi, B: step.B,
x: step.x,
comments: step.comments, xi: step.xi,
}}
/> comments: step.comments,
))} }}
/>
))}
</>
) : (
<div class="title">
<h2>Loading...</h2>
</div>
)}
</div> </div>
) )
} }

@ -1,3 +1,6 @@
import '@fontsource-variable/jetbrains-mono/index.css'
import '@fontsource-variable/open-sans/index.css'
import { render } from 'preact' import { render } from 'preact'
import { useState } from 'preact/hooks' import { useState } from 'preact/hooks'
import { parseSafeProblemInput } from './parser-problem' import { parseSafeProblemInput } from './parser-problem'
@ -58,20 +61,17 @@ const App = () => {
return ( return (
<> <>
<h1> <h1>
Ricerca Operativa / Programmazione Lineare Ricerca Operativa / PL / Algoritmo del Simplesso
<small> <small>
{' '} {' '}
by <a href="aziis98.com">@aziis98</a> by <a href="https://poisson.phc.dm.unipi.it/~delucreziis/">@aziis98</a>
</small> </small>
</h1> </h1>
<p> <p>
Questo sito è un progetto per il{' '} Questo sito è un progetto per il{' '}
<a href="https://didawiki.cli.di.unipi.it/doku.php/matematica/ro/start">corso di Ricerca Operativa</a>{' '} <a href="https://didawiki.cli.di.unipi.it/doku.php/matematica/ro/start">corso di Ricerca Operativa</a>{' '}
dell'Università di Pisa per visualizzare automaticamente tutti i passaggi dell' dell'Università di Pisa per visualizzare automaticamente tutti i passaggi dell'
<a href="https://it.wikipedia.org/wiki/Algoritmo_del_simplesso"> <a href="https://it.wikipedia.org/wiki/Algoritmo_del_simplesso">algoritmo del simplesso primale</a>.
algoritmo del simplesso primale e duale
</a>
.
</p> </p>
<h2>Visualizzazione</h2> <h2>Visualizzazione</h2>
<p>I dati del problema vanno inseriti nel seguente campo di testo nel formato:</p> <p>I dati del problema vanno inseriti nel seguente campo di testo nel formato:</p>

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

Loading…
Cancel
Save