uccser/cs-field-guide

View on GitHub
csfieldguide/static/interactives/nfa-guesser/css/nfa-guesser.scss

Summary

Maintainability
Test Coverage
#interactive-nfa-guesser {
  margin: 2em;
  button {
      display: inline-block;
  }
}
#interactive-nfa-guesser-image {
  max-width: 40em;
}
.interactive-nfa-guesser-header {
  font-size: 1.5em;
  margin: 1rem 0;
}
#interactive-nfa-guesser-input-sequence-value {
  font-weight: bold;
}
#interactive-nfa-guesser-answer-options {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;

  .state-option {
    margin: 0 1rem;
    padding: 1rem;
    border-radius: 50%;
    border: 1px solid black;
    cursor: pointer;
    font-size: 1.5rem;
    font-family: monospace;
    user-select: none;
    color: black;
    background-color: #fff;
    $state-size: 3rem;
    height: $state-size;
    width: $state-size;
    // Center text node within circle
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
        background-color: #ddd;
    }
    &.selected {
        background-color: rgb(59, 59, 255);
        color: white;
    }
    &.valid {
        background-color: #4CAF50;
    }
  }
}

#interactive-nfa-guesser-result {
  font-size: 1.5em;
  margin: 0.5em;
  font-weight: bold;
  color: #F44336;
}
#interactive-nfa-guesser-result.valid {
  color: #4CAF50 !important;
}

.hidden {
    display: none !important;
}