_rule-app.scss 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. $color-primary: #FFC907;
  2. $color-secondary: #29335C;
  3. $color-warning: #ff8f07;
  4. $color-danger: #ff073d;
  5. $color-success: #C2F9BB;
  6. .rule-app {
  7. padding: 2rem;
  8. position: relative;
  9. }
  10. .btn {
  11. border-radius: 4px;
  12. padding: .2em 1em;
  13. background-color: transparent;
  14. border: 1px solid $color-secondary;
  15. &.has-icon {
  16. padding-left: .25em;
  17. }
  18. &.is-large {
  19. font-size: 1.2em;
  20. }
  21. &.is-loading img {
  22. animation: rotation 2s infinite linear;
  23. }
  24. @keyframes rotation {
  25. from {
  26. transform: rotate(0deg);
  27. }
  28. to {
  29. transform: rotate(-359deg);
  30. }
  31. }
  32. &:hover {
  33. cursor: pointer;
  34. color: $color-secondary;
  35. border-color: black;
  36. }
  37. &.primary {
  38. background-color: $color-primary;
  39. color:darken($color-primary, 80%);
  40. border: 1px solid darken($color-primary, 10%);
  41. &:hover {
  42. cursor: pointer;
  43. background-color: darken($color-primary, 10%);
  44. }
  45. }
  46. &.warn {
  47. background-color: $color-warning;
  48. color:darken($color-warning, 80%);
  49. border: 1px solid darken($color-warning, 10%);
  50. &:hover {
  51. cursor: pointer;
  52. background-color: darken($color-warning, 10%);
  53. }
  54. }
  55. &.danger {
  56. background-color: $color-danger;
  57. color:darken($color-danger, 80%);
  58. border: 1px solid darken($color-danger, 10%);
  59. &:hover {
  60. cursor: pointer;
  61. background-color: darken($color-danger, 10%);
  62. }
  63. }
  64. &.success {
  65. background-color: $color-success;
  66. color:darken($color-success, 80%);
  67. border: 1px solid darken($color-success, 10%);
  68. &:hover {
  69. cursor: pointer;
  70. background-color: darken($color-success, 10%);
  71. }
  72. }
  73. }
  74. .btn-group {
  75. display: flex;
  76. flex-wrap: wrap;
  77. gap: 1rem;
  78. margin: 1rem 0;
  79. }
  80. .btn {
  81. position: relative;
  82. .btn-cover {
  83. position: absolute;
  84. font-size: 0.6em;
  85. background-color: $color-warning;
  86. width: 110%;
  87. top: 30%;
  88. left: -10px;
  89. box-shadow: 1px 1px 3px #0003;
  90. transform: rotate(0deg) scale(.01);
  91. transition: all 0.3s ease;
  92. }
  93. &:hover .btn-cover {
  94. transform: rotate(5deg) scale(1);
  95. }
  96. }
  97. h1 .icon img {
  98. width: 50px;
  99. }
  100. h2 .icon img {
  101. width: 40px;
  102. }
  103. .label {
  104. display: block;
  105. flex: 1 1 auto;
  106. &>span {
  107. display: block;
  108. }
  109. input[type='text'],
  110. textarea {
  111. font-size: 1.2rem;
  112. font-family: monospace;
  113. margin: .5rem 0 1rem;
  114. padding: .25rem;
  115. width: 100%;
  116. }
  117. textarea {
  118. max-width: 65ch;
  119. }
  120. .dropdown {
  121. $dropdown-border-radius: 4px;
  122. cursor: pointer;
  123. flex-direction: column;
  124. position: absolute;
  125. background-color: #fff;
  126. padding: 2px;
  127. border-radius: $dropdown-border-radius;
  128. label:not(.selected) {
  129. display: none;
  130. }
  131. &:hover {
  132. border: 1px solid #ddd;
  133. box-shadow: 1px 1px 5px #0003;
  134. display: grid;
  135. grid-template-columns: 1fr 1fr 1fr;
  136. label {
  137. display: block;
  138. &:hover:not(.selected) div {
  139. background-color: #ddd;
  140. border-radius: $dropdown-border-radius;
  141. }
  142. }
  143. }
  144. input[type='radio'] {
  145. display: none;
  146. }
  147. label {
  148. cursor: pointer;
  149. }
  150. label div {
  151. display: inline-flex;
  152. padding: 2px;
  153. }
  154. &:hover label.default,
  155. label.selected ~ label.default {
  156. display: none;
  157. }
  158. label.default {
  159. display: block;
  160. }
  161. input[type='radio']:checked ~ div {
  162. background-color: $color-primary;
  163. border-radius: $dropdown-border-radius;
  164. }
  165. }
  166. input.input-stack {
  167. margin-bottom: 0;
  168. }
  169. small {
  170. color: #aaa;
  171. }
  172. }
  173. .label-group {
  174. display: flex;
  175. gap: 1rem;
  176. }
  177. .editor .details {
  178. .label .dropdown {
  179. margin-top: calc(.5rem - 2px);
  180. img {
  181. width: 30px;
  182. }
  183. &:hover {
  184. grid-template-columns: repeat(4, 1fr);
  185. z-index: 100;
  186. }
  187. }
  188. }
  189. .rule__modules {
  190. border: 4px dashed $color-primary;
  191. margin: 1rem 0;
  192. position: relative;
  193. &.target {
  194. background-color: $color-primary;
  195. }
  196. .modules__dropzone {
  197. padding: 1.25rem 1rem 1rem;
  198. .module.drag-over {
  199. background-color: $color-primary;
  200. border-style: dashed;
  201. }
  202. }
  203. label {
  204. position: absolute;
  205. top: -1rem;
  206. left: 1rem;
  207. background: $color-primary;
  208. padding: 0.25rem .5rem;
  209. border-radius: 3px;
  210. font-size: 0.8rem;
  211. font-weight: bold;
  212. display: flex;
  213. align-items: center;
  214. gap: 0.5rem;
  215. }
  216. }
  217. .module-editor__wrapper {
  218. background-color: #fff;
  219. border: 1px solid #ccc;
  220. border-radius: 3px;
  221. box-shadow: 0 0 5px #0002;
  222. margin: 2rem 0 1rem;
  223. padding: 1rem;
  224. position: relative;
  225. .module-editor {
  226. display: flex;
  227. flex-direction: row-reverse;
  228. justify-content: space-between;
  229. padding-top: .5rem;
  230. .module-editor__fields {
  231. flex: 1 0 auto;
  232. }
  233. .label {
  234. font-size: 0.8em;
  235. input,
  236. textarea {
  237. font-size: 1rem;
  238. margin-top: 0;
  239. }
  240. }
  241. }
  242. .module-editor__label {
  243. position: absolute;
  244. top: -1rem;
  245. left: 1rem;
  246. background: #fff;
  247. }
  248. }
  249. .module {
  250. align-items: center;
  251. display: inline-flex;
  252. gap: 0.5rem;
  253. margin: 0;
  254. padding: .25rem;
  255. &.in-editor {
  256. background-color: $color-primary;
  257. }
  258. .submodules {
  259. display: flex;
  260. gap: 0.5rem;
  261. }
  262. .module__grain {
  263. display: none;
  264. opacity: .3;
  265. cursor: grab;
  266. }
  267. &.mouse-over > .module__icon-wrapper {
  268. & > .module__grain {
  269. display: block;
  270. opacity: 1;
  271. }
  272. & > .module__icon {
  273. display: none;
  274. }
  275. }
  276. &.module--edit {
  277. font-family: monospace;
  278. padding: 0;
  279. input {
  280. width: fit-content;
  281. margin: 0;
  282. padding: 0.25rem
  283. }
  284. }
  285. }
  286. .modules__grid {
  287. display: flex;
  288. flex-wrap: wrap;
  289. gap: 0.5rem;
  290. }
  291. .modules {
  292. .modules__type {
  293. margin-bottom: 1rem;
  294. }
  295. h2 {
  296. margin-bottom: 0;
  297. &::first-letter {
  298. text-transform: capitalize;
  299. }
  300. }
  301. .modules__header {
  302. display: flex;
  303. justify-content: space-between;
  304. align-items: center;
  305. a {
  306. cursor: pointer;
  307. }
  308. }
  309. }
  310. .rule {
  311. .rule__creator {
  312. display: flex;
  313. align-items: center;
  314. justify-content: center;
  315. gap: 1rem;
  316. border-top: 1px solid #ccc;
  317. margin-top: 2rem;
  318. padding-top: 2rem;
  319. }
  320. }
  321. .tabs {
  322. display: flex;
  323. gap: 1rem;
  324. .tab__control {
  325. cursor: pointer;
  326. border: 1px solid #ccc;
  327. border-bottom: none;
  328. background-color: #ccc;
  329. padding: .5rem 1rem;
  330. text-align: center;
  331. flex: 1 1 auto;
  332. &.active {
  333. background-color: #fff;
  334. margin-bottom: -1px;
  335. }
  336. }
  337. }
  338. .tab__pane {
  339. border: 1px solid #ccc;
  340. padding: 1rem;
  341. margin-bottom: 2rem;
  342. }
  343. .app-wrapper.is-preview {
  344. max-width: 65ch;
  345. margin: 0 auto;
  346. }
  347. .editor,
  348. .rule {
  349. border: 1px solid #ccc;
  350. border-radius: 3px;
  351. background-color: #fff;
  352. margin: 0 auto;
  353. padding: 2rem;
  354. position: relative;
  355. .controls {
  356. position: absolute;
  357. top: -1rem;
  358. right: 2rem;
  359. }
  360. }
  361. .editor {
  362. }
  363. .rule {
  364. .modules__grid {
  365. padding: 1rem 0;
  366. }
  367. .module-list {
  368. margin-bottom: 1rem;
  369. &, & ul { margin-left: 30px; }
  370. .submodules { margin-bottom: 1rem;}
  371. .module-list-item {
  372. list-style: none;
  373. position: relative;
  374. .module__icon {
  375. position: absolute;
  376. left:-30px;
  377. top:-3px;
  378. }
  379. }
  380. }
  381. }
  382. .json {
  383. white-space: pre-wrap;
  384. }
  385. .legacy {
  386. .module {
  387. img,
  388. a {
  389. display: none;
  390. }
  391. }
  392. }