123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516 |
- $color-primary: #FFC907;
- $color-secondary: #29335C;
- $color-warning: #ff8f07;
- $color-danger: #ff073d;
- $color-success: #C2F9BB;
- $tablet: 768px;
- $mobile: 420px;
- .rule-app {
- padding: 2rem;
- position: relative;
- * {
- box-sizing: border-box;
- }
- @media screen and (max-width: $tablet) {
- padding: 2rem .5rem;
- }
- }
- .btn {
- border-radius: 4px;
- padding: .2em 1em;
- background-color: transparent;
- border: 1px solid $color-secondary;
- &.has-icon {
- padding-left: .25em;
- display: flex;
- align-items: center;
- img {
- margin-right: .25em
- }
- }
- &.is-large {
- font-size: 1.2em;
- }
- &.is-loading img {
- animation: rotation 2s infinite linear;
- }
- @keyframes rotation {
- from {
- transform: rotate(0deg);
- }
- to {
- transform: rotate(-359deg);
- }
- }
- &:hover {
- cursor: pointer;
- color: $color-secondary;
- border-color: black;
- background-color: lightgray;
- }
- &.primary {
- background-color: $color-primary;
- color:darken($color-primary, 80%);
- border: 1px solid darken($color-primary, 10%);
- &:hover {
- cursor: pointer;
- background-color: darken($color-primary, 10%);
- }
- }
- &.warn {
- background-color: $color-warning;
- color:darken($color-warning, 80%);
- border: 1px solid darken($color-warning, 10%);
- &:hover {
- cursor: pointer;
- background-color: darken($color-warning, 10%);
- }
- }
- &.danger {
- background-color: $color-danger;
- color:darken($color-danger, 80%);
- border: 1px solid darken($color-danger, 10%);
- &:hover {
- cursor: pointer;
- background-color: darken($color-danger, 10%);
- }
- }
- &.success {
- background-color: $color-success;
- color:darken($color-success, 80%);
- border: 1px solid darken($color-success, 10%);
- &:hover {
- cursor: pointer;
- background-color: darken($color-success, 10%);
- }
- }
- }
- .btn-group {
- display: flex;
- flex-wrap: wrap;
- gap: 1rem;
- margin: 1rem 0;
- }
- .btn {
- position: relative;
- .btn-cover {
- position: absolute;
- font-size: 0.6em;
- background-color: $color-warning;
- width: 110%;
- top: 30%;
- left: -10px;
- box-shadow: 1px 1px 3px #0003;
- transform: rotate(0deg) scale(.01);
- transition: all 0.3s ease;
- }
- &:hover .btn-cover {
- transform: rotate(5deg) scale(1);
- }
- }
- h1 .icon img {
- width: 50px;
- }
- h2 .icon img {
- width: 40px;
- }
- .label {
- display: block;
- flex: 1 1 auto;
- &>span {
- display: block;
- }
- input[type='text'],
- textarea {
- font-size: 1rem;
- font-family: monospace;
- margin: .5rem 0 1rem;
- padding: .25rem;
- width: 100%;
- }
- textarea {
- max-width: 65ch;
- }
- input.input-stack {
- margin-bottom: 0;
- }
- small {
- color: #aaa;
- }
- }
- .label-group {
- display: flex;
- gap: 1rem;
- @media screen and (max-width: $tablet) {
- &:not(.is-mobile){
- gap: 0;
- flex-direction: column;
- }
- }
- @media screen and (max-width: $mobile) {
- gap: 0;
- flex-direction: column;
- }
- }
- .dropdown {
- $dropdown-border-radius: 4px;
- cursor: pointer;
- flex-direction: column;
- background-color: #fff;
- padding: 2px;
- border-radius: $dropdown-border-radius;
- input[type='radio'] {
- display: none;
- }
- label {
- cursor: pointer;
- }
- label div {
- display: inline-flex;
- padding: 2px;
- }
- input[type='radio']:checked ~ div {
- background-color: $color-primary;
- border-radius: $dropdown-border-radius;
- }
- @media screen and (max-width: $tablet) {
- display: grid;
- grid-template-columns: repeat( auto-fit, minmax(50px, 1fr) );
-
- label.default {
- display: none;
- }
- }
- @media screen and (min-width: $tablet) {
- position: absolute;
- label:not(.selected) {
- display: none;
- }
- &:hover {
- border: 1px solid #ddd;
- box-shadow: 1px 1px 5px #0003;
- display: grid;
- grid-template-columns: 1fr 1fr 1fr;
- label {
- display: block;
- &:hover:not(.selected) div {
- background-color: #ddd;
- border-radius: $dropdown-border-radius;
- }
- }
- }
- &:hover label.default,
- label.selected ~ label.default {
- display: none;
- }
- label.default {
- display: block;
- }
- }
- }
- .editor .details {
- .label .dropdown {
- margin-top: calc(.5rem - 2px);
- img {
- width: 30px;
- }
- @media screen and (min-width: $tablet) {
- &:hover {
- grid-template-columns: repeat(4, 1fr);
- z-index: 100;
- }
- }
- }
- }
- .rule__modules {
- border: 4px dashed $color-primary;
- margin: 1rem 0;
- position: relative;
- @media screen and (max-width: $tablet) {
- margin: 1rem -0.75rem;
- }
- &.target {
- background-color: $color-primary;
- }
- .modules__dropzone {
- padding: 1.25rem 1rem 1rem;
- .module.drag-over {
- background-color: $color-primary;
- border-style: dashed;
- }
- }
- label {
- position: absolute;
- top: -1rem;
- left: 1rem;
- background: $color-primary;
- padding: 0.25rem .5rem;
- border-radius: 3px;
- font-size: 0.8rem;
- font-weight: bold;
- display: flex;
- align-items: center;
- gap: 0.5rem;
- }
- }
- .module-editor__wrapper {
- background-color: #fff;
- border: 1px solid #ccc;
- border-radius: 3px;
- box-shadow: 0 0 5px #0002;
- margin: 2rem 0 1rem;
- padding: 1rem;
- position: relative;
- .module-editor {
- display: flex;
- flex-direction: row-reverse;
- justify-content: space-between;
- padding-top: .5rem;
- .module-editor__right {
- position: absolute;
- top: -1.2rem;
- right: 1rem;
- }
- .module-editor__fields {
- flex: 1 1 auto;
- }
- .label {
- font-size: 0.8em;
- input,
- textarea {
- font-size: 1rem;
- margin-top: 0;
- }
- }
- }
-
- .module-editor__label {
- position: absolute;
- top: -1rem;
- left: 1rem;
- background: #fff;
- }
- }
- .module {
- align-items: center;
- display: inline-flex;
- gap: 0.5rem;
- margin: 0;
- padding: .25rem;
- flex-wrap: wrap;
- &.in-editor {
- background-color: $color-primary;
- }
- .submodules {
- display: flex;
- gap: 0.5rem;
- flex-wrap: wrap;
- }
- .module__grain {
- display: none;
- opacity: .3;
- cursor: grab;
- }
- &.mouse-over > .module__icon-wrapper {
- & > .module__grain {
- display: block;
- opacity: 1;
- }
- & > .module__icon {
- display: none;
- }
- }
- &.module--edit {
- font-family: monospace;
- padding: 0;
- input {
- width: fit-content;
- margin: 0;
- padding: 0.25rem
- }
- }
- }
- .modules__grid {
- display: flex;
- flex-wrap: wrap;
- gap: 0.5rem;
- }
- .modules {
- .modules__type {
- margin-bottom: 1rem;
- }
- h2 {
- margin-bottom: 0;
- &::first-letter {
- text-transform: capitalize;
- }
- }
- .modules__header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- a {
- cursor: pointer;
- }
- }
- }
- .rule {
- .rule__creator {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 1rem;
- border-top: 1px solid #ccc;
- margin-top: 2rem;
- padding-top: 2rem;
- }
- }
- .tabs {
- display: flex;
- flex-wrap: wrap;
- gap: 1rem;
- .tab__control {
- cursor: pointer;
- border: 1px solid #ccc;
- border-bottom: none;
- background-color: #ccc;
- padding: .5rem 1rem;
- text-align: center;
- flex: 1 1 auto;
- img {
- margin-right: .25em;
- }
- &.active {
- background-color: #fff;
- margin-bottom: -1px;
- }
- }
- @media screen and (max-width: $tablet) {
- gap:.5rem;
- font-size: 0.8rem;
- .tab__control img {
- display: block;
- margin: 0 auto;
- }
- }
- @media screen and (max-width: 550px) {
- gap: 0;
- }
- }
- .tab__pane {
- border: 1px solid #ccc;
- padding: 1rem;
- margin-bottom: 2rem;
- }
- .app-wrapper.is-preview {
- max-width: 65ch;
- margin: 0 auto;
- }
- .editor,
- .rule {
- border: 1px solid #ccc;
- border-radius: 3px;
- background-color: #fff;
- margin: 0 auto;
- padding: 2rem;
- position: relative;
- .controls {
- position: absolute;
- top: -1rem;
- right: 2rem;
- }
- @media screen and (max-width: $tablet) {
- padding: 1.5rem 1rem 1rem;
- }
- @media screen and (max-width: $mobile) {
- font-size: 90%;
- }
- }
- .editor {
- }
- .rule {
- .modules__grid {
- padding: 1rem 0;
- }
- .module-list {
- margin-bottom: 1rem;
- &, & ul { margin-left: 30px; }
- .submodules { margin-bottom: 1rem;}
- .module-list-item {
- list-style: none;
- position: relative;
- .module__icon {
- position: absolute;
- left:-30px;
- top:-3px;
- }
- }
- }
- }
- .json {
- white-space: pre-wrap;
- }
- .legacy {
- .module {
- img,
- a {
- display: none;
- }
- }
- }
|