Files
finite-state-automaton/src/style.css

310 lines
5.0 KiB
CSS

:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
margin: 0;
min-height: 100vh;
}
h1 {
font-size: 3.2em;
line-height: 1.1;
}
#app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
#app[hidden] {
display: none;
}
.input {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 0.5em;
}
#current-word {
padding-top: 2rem;
text-align: center;
}
input {
padding: 0.3em 0.5em;
font-size: 1.1em;
width: 6em;
background-color: transparent;
transition: border-color 0.25s;
}
button, .button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
text-decoration: none;
color: inherit;
}
button:hover, .button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
#light {
width: 2.5em;
height: 2.5em;
border-radius: 50%;
background-color: #1a1a1a;
margin-left: .75em;
}
#light.is-valid {
background-color: #46fd46;
}
#light.is-invalid {
background-color: #fd3838;
}
#automaton-selector {
width: 100%;
max-width: 600px;
margin: 0 auto;
}
#automaton-collection {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: 2em 0;
}
.card {
display: flex;
flex-direction: column;
align-items: center;
padding: 1.5em;
margin: 1em;
border-radius: 8px;
background-color: #1a1a1a;
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.2);
cursor: pointer;
}
.card:hover, .card:focus {
background-color: #2a2a2a;
}
.card:active {
background-color: #3a3a3a;
}
.blurred {
filter: blur(32px);
pointer-events: none;
}
.player {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
#state-graph {
flex-grow: 1;
display: flex;
flex-direction: column;
}
graph-editor {
flex-grow: 1;
display: flex;
flex-direction: column;
touch-action: none;
}
graph-editor svg {
flex-grow: 1;
}
#display-graph {
position: absolute;
align-self: center;
}
.link {
stroke: orange;
stroke-width: 4px;
fill: none;
}
.link.draggable {
stroke: orangered;
stroke-dasharray: 8px 2px;
pointer-events: none;
}
.link.hidden {
stroke-width: 0;
}
.arrow {
fill: orange;
}
.arrow.draggable {
fill: orangered;
}
.node {
fill: #007aff;
stroke: none;
cursor: pointer;
}
.node.active {
fill: #a31dfd;
}
.node.accepting.active {
fill: green;
}
.start-arrow {
fill: #007aff;
stroke: none;
}
.start-arrow.active {
fill: #a31dfd;
}
.node.accepting {
outline: 5px solid #007aff;
outline-offset: 4px;
border-radius: 50%;
}
.node.accepting.active {
outline: 5px solid green;
}
.clickbox {
stroke: rgba(0, 0, 0, 0);
stroke-width: 16px;
fill: none;
cursor: pointer;
}
.context-menu {
position: absolute;
background: #313131;
border: 1px solid #222;
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
min-width: 150px;
}
.context-menu ul {
padding: 0;
margin: 0;
cursor: pointer;
list-style-type: none;
}
.context-menu li {
padding: 4px 8px;
}
.context-menu li:hover, .context-menu li:focus {
background-color: #2a2a2a;
}
.context-menu li:active {
background-color: #1a1a1a;
}
.context-menu .checked:after {
content: "✓";
float: right;
}
table {
width: 100%;
}
th, td {
border-bottom: thin solid hsla(0, 0%, 100%, .12);
height: 48px;
padding: 0 16px;
}
.actions {
position: absolute;
top: 16px;
left: 16px;
}
#sidebar-toggle::after {
content: "🡒";
}
.has-sidebar #sidebar-toggle::after {
content: "🡐";
}
#sidebar {
margin-left: -600px;
padding-left: .5rem;
transition: all .3s;
position: absolute;
pointer-events: none;
}
.has-sidebar #sidebar {
margin: -.2rem 0 0 0;
}
.has-sidebar #sidebar-toggle {
margin-left: 7rem;
transition: all .3s;
}
#controls {
display: flex;
justify-content: space-between;
margin-top: 1em;
flex-grow: 1;
}
@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
.card {
background-color: #f0f0f0;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.2);
}
.card:hover, .card:focus {
background-color: #e0e0e0;
}
.card:active {
background-color: #d0d0d0;
}
button, .button {
background-color: #e9e9e9;
}
.context-menu {
background: white;
border: 1px solid #ccc;
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
.context-menu li:hover, .context-menu li:focus {
background-color: #f0f0f0;
}
.context-menu li:active {
background-color: #e0e0e0;
}
th, td {
border-bottom: thin solid hsla(0, 0%, 0%, .12);
}
.sidebar-content {
background-color: #f0f0f0;
}
}