1
Fork 0
mirror of https://github.com/Steffo99/unisteffo.git synced 2024-11-26 09:54:19 +00:00
This commit is contained in:
Steffo 2020-03-11 17:16:17 +01:00
commit 472ee8b3bb
7 changed files with 382 additions and 56 deletions

View file

@ -25,6 +25,8 @@
"css-loader": "^3.4.2", "css-loader": "^3.4.2",
"file-loader": "^5.0.2", "file-loader": "^5.0.2",
"history": "^4.10.1", "history": "^4.10.1",
"less": "^3.11.1",
"less-loader": "^5.0.0",
"preact": "^10.3.1", "preact": "^10.3.1",
"preact-render-to-string": "^5.1.4", "preact-render-to-string": "^5.1.4",
"preact-router": "^3.2.1", "preact-router": "^3.2.1",

View file

@ -1,55 +0,0 @@
* {
box-sizing: border-box;
}
body {
background-color: #0d193b;
color: #a0ccff;
font-family: sans-serif;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 4px;
margin-bottom: 4px;
color: #ffffff;
font-weight: normal;
}
h1, h2, h3 {
text-align: center;
}
h4, h5, h6 {
font-weight: bold;
}
a {
color: #00caca;
text-decoration: none;
}
a:hover {
color: #4affff;
}
a:active {
color: #ffffff;
}
img {
max-width: 100%;
}
code {
font-family: "Consolas", monospace;
}
blockquote {
border-left: 3px solid #a0ccff;
padding: 4px;
margin-left: 12px;
background-color: rgba(62.7%, 80%, 100%, 0.1);
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}

View file

@ -1,7 +1,7 @@
import { Component } from 'preact'; import { Component } from 'preact';
// noinspection ES6UnusedImports // noinspection ES6UnusedImports
import _style from './index.css'; import _style from './index.less';
// noinspection ES6UnusedImports // noinspection ES6UnusedImports
import _manifest from './meta/manifest.json'; import _manifest from './meta/manifest.json';
// noinspection ES6UnusedImports // noinspection ES6UnusedImports

136
src/index.less Normal file
View file

@ -0,0 +1,136 @@
@import "./styles/constants.less";
* {
box-sizing: border-box;
}
body {
background-color: @bg;
color: @fg;
font-family: @sans;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 4px;
margin-bottom: 4px;
color: @accent;
font-weight: normal;
text-align: center;
}
h1 {
font-size: xx-large;
}
a {
color: @link;
text-decoration: none;
&:hover {
color: #4affff;
}
&:active {
color: #ffffff;
}
}
img {
max-width: 100%;
max-height: 300px;
}
b {
color: @accent;
}
code {
font-family: @mono;
}
blockquote {
color: @fg;
border-left: 3px solid @fg;
background-color: fade(@fg, 10%);
padding: 4px 4px 4px 8px;
margin: 8px;
}
input[type="text"], input[type="password"] {
color: @fg;
background-color: @bg;
border: 1px solid @bg-lighter;
border-radius: 4px;
padding: 4px;
font-size: medium;
&:disabled {
color: grey;
background-color: #1f1f1f;
cursor: not-allowed;
}
}
button {
color: @fg;
background-color: @bg;
border: 1px solid @bg-lighter;
border-radius: 4px;
padding: 4px;
font-size: medium;
&:hover {
background-color: @bg-light;
border: 1px solid @fg;
}
&:active {
background-color: @bg-lighter;
border: 1px solid @fg;
}
&.disabled {
color: grey;
background-color: #1f1f1f;
cursor: not-allowed;
}
}
hr {
border: 1px solid @bg-light;
margin-top: 24px;
margin-bottom: 24px;
}
table {
border-spacing: 0;
border: 2px solid @bg-lighter;
background-color: @bg-light;
border-radius: 4px;
border-collapse: collapse;
thead, tbody {
th, td {
padding: 4px;
border: 1px solid @bg-lighter;
}
}
thead {
background-color: @bg-lighter;
color: @accent;
border-radius: 4px 4px 0 0;
}
}
.left {
text-align: left;
}
.center {
text-align: center;
}
.right {
text-align: right;
}

View file

@ -59,6 +59,111 @@ export default class OttimizzazioneLineare extends Component {
</Example> </Example>
</Panel> </Panel>
</Split> </Split>
<Split title={"La forma standard"}>
<Panel title={"Condizioni"}>
<p>
Un sistema è in <i>forma standard</i> quando ha:
</p>
<ul>
<li>Solo equazioni</li>
<li>Tutte le variabili maggiori di zero</li>
</ul>
</Panel>
<Panel title={"Slack"}>
<p>
Possiamo trasformare una disequazione in equazione introducendo variabili <i>slack</i>:
</p>
<p>
<Latex>{r`3x + 2y \leq 15 \implies 3x + 2y + s_1 = 15`}</Latex>
</p>
<p>
In seguito, possiamo riscrivere tutte le funzioni in termini delle variabili slack.
</p>
<Example>
Si ottiene qualcosa come <Latex>{r`z = -2 s_1 - 3 s_2 + 40`}</Latex>.
</Example>
</Panel>
<Panel title={"Tableu"}>
<p>
Un modo per rappresentare sistemi in forma standard.
</p>
<p>
<table class={"right"}>
<thead>
<tr>
<th/>
<th><Latex>x</Latex></th>
<th><Latex>y</Latex></th>
<th><Latex>s_1</Latex></th>
<th><Latex>s_2</Latex></th>
</tr>
</thead>
<tbody>
<tr>
<td>ob.</td>
<td><Latex>80</Latex></td>
<td><Latex>70</Latex></td>
<td><Latex>0</Latex></td>
<td><Latex>0</Latex></td>
</tr>
<tr>
<td/>
<td><Latex>3</Latex></td>
<td><Latex>2</Latex></td>
<td><Latex>1</Latex></td>
<td><Latex>0</Latex></td>
</tr>
<tr>
<td/>
<td><Latex>2</Latex></td>
<td><Latex>3</Latex></td>
<td><Latex>0</Latex></td>
<td><Latex>1</Latex></td>
</tr>
</tbody>
</table>
</p>
<p>
Riscrivendo in termini delle variabili slack, otteniamo:
</p>
<p>
<table class={"right"}>
<thead>
<tr>
<th/>
<th><Latex>x</Latex></th>
<th><Latex>y</Latex></th>
<th><Latex>s_1</Latex></th>
<th><Latex>s_2</Latex></th>
</tr>
</thead>
<tbody>
<tr>
<td>ob.</td>
<td><Latex>0</Latex></td>
<td><Latex>0</Latex></td>
<td><Latex>-20</Latex></td>
<td><Latex>-10</Latex></td>
</tr>
<tr>
<td/>
<td><Latex>1</Latex></td>
<td><Latex>0</Latex></td>
<td><Latex>{r`\frac{3}{5}`}</Latex></td>
<td><Latex>{r`-\frac{2}{5}`}</Latex></td>
</tr>
<tr>
<td/>
<td><Latex>0</Latex></td>
<td><Latex>1</Latex></td>
<td><Latex>{r`-\frac{2}{5}`}</Latex></td>
<td><Latex>{r`\frac{3}{5}`}</Latex></td>
</tr>
</tbody>
</table>
</p>
</Panel>
</Split>
</div> </div>
) )
} }

17
src/styles/constants.less Normal file
View file

@ -0,0 +1,17 @@
@bg: #0d193b;
@bg-light: #1c2b4f;
@bg-lighter: #2a3d62;
@fg: #a0ccff;
@accent: #ffffff;
@link: #00caca;
@red: #ff7d7d;
@orange: #ffbb7d;
@yellow: #ffff7d;
@lime: #7dff7d;
@cyan: #7dffff;
@blue: #7d7dff;
@magenta: #ff7dff;
@sans: sans-serif;
@mono: "Consolas", "SFMono-Regular", "Liberation Mono", "Menlo", monospace;

View file

@ -0,0 +1,121 @@
@import "./constants.less";
.CodeMirror {
font-family: "Consolas", monospace !important;
background-color: @bg !important;
color: @fg !important;
border-top: 0 !important;
border-bottom: 0 !important;
border-left: 1px solid @bg-lighter !important;
border-right: 1px solid @bg-lighter !important;
border-radius: 0 !important;
caret-color: white;
.cm-link {
color: @cyan !important;
}
.cm-url {
color: @link !important;
}
.cm-tag {
color: @magenta !important;
}
.cm-strong {
color: @yellow !important;
}
.cm-em {
color: @orange !important;
}
.cm-quote {
color: @lime !important;
}
.cm-comment {
color: lightgray !important;
}
.cm-header {
color: @accent !important;
}
.CodeMirror-cursor {
border-left: 1px solid @fg !important;
}
}
.editor-toolbar, .editor-statusbar {
background-color: @bg-light !important;
color: @fg !important;
opacity: 1 !important;
a {
color: @fg !important;
border: 0 !important;
&:hover {
background-color: @bg-lighter !important;
color: lighten(@fg, 25%) !important;
}
&.active {
background-color: fade(@fg, 30%) !important;
color: white !important;
&:hover {
background-color: @bg-lighter !important;
color: lighten(@fg, 25%) !important;
}
}
}
.fas, .far, .fab {
color: @fg !important;
&:hover {
color: @fg !important;
}
&:active {
color: white !important;
}
}
}
.editor-toolbar {
border-top: 1px solid @bg-lighter !important;
border-left: 1px solid @bg-lighter !important;
border-right: 1px solid @bg-lighter !important;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
button {
color: @fg;
&:hover {
background-color: @bg-lighter;
border: none;
}
&:active, &.active {
background-color: @bg-lighter;
border: none;
color: @accent;
}
}
i.separator {
border-color: @bg-lighter;
}
}
.editor-statusbar {
border-bottom: 1px solid @bg-lighter !important;
border-left: 1px solid @bg-lighter !important;
border-right: 1px solid @bg-lighter !important;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}