_input.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. .ui-input {
  2. display: inline-flex;
  3. align-items: center;
  4. --base-border-color: rgba(255, 255, 255, 0.2);
  5. --colors-content-color: #fff;
  6. &.error {
  7. position: relative;
  8. --colors-primary-base: #FA3F48;
  9. --base-border-color: #FA3F48;
  10. .error-msg {
  11. top: 100%;
  12. position: absolute;
  13. color: var(--colors-primary-base);
  14. margin-top: 5px;
  15. }
  16. }
  17. &.require {
  18. position: relative;
  19. &::before {
  20. content: '*';
  21. position: absolute;
  22. top: 50%;
  23. transform: translateY(-50%);
  24. right: 100%;
  25. margin-right: 4px;
  26. color: #FA3F48;
  27. line-height: 1.5em;
  28. }
  29. }
  30. .input {
  31. position: relative;
  32. align-items: center;
  33. display: inline-flex;
  34. .input-div,
  35. textarea,
  36. input {
  37. width: 100%;
  38. height: 100%;
  39. outline: none;
  40. border: none;
  41. font-size: 14px;
  42. color: var(--colors-content-color);
  43. padding-left: 4px;
  44. resize: none;
  45. &+.replace {
  46. position: absolute;
  47. z-index: 1;
  48. }
  49. &.replace-input {
  50. opacity: 0;
  51. cursor: pointer;
  52. }
  53. }
  54. .pre-icon {
  55. position: absolute;
  56. z-index: 1;
  57. }
  58. }
  59. .label {
  60. cursor: pointer;
  61. margin-left: 7px;
  62. }
  63. .radio,
  64. .checkbox {
  65. width: 16px;
  66. height: 16px;
  67. input {
  68. &+.replace {
  69. color: var(--colors-color);
  70. border: 1px solid currentColor;
  71. background-color: var(--colors-normal-back);
  72. left: 0;
  73. top: 0;
  74. right: 0;
  75. bottom: 0;
  76. pointer-events: none;
  77. transition: all .1s linear;
  78. }
  79. &:focus+.replace {
  80. border-color: var(--colors-primary-base);;
  81. }
  82. &:checked+.replace {
  83. color: var(--colors-primary-base);
  84. }
  85. }
  86. }
  87. .checkbox input {
  88. &+.replace {
  89. border-radius: 4px;
  90. .icon {
  91. position: absolute;
  92. left: 50%;
  93. top: 50%;
  94. transform: translate(-50%, -50%) scale(0);
  95. opacity: 0;
  96. transition: all .1s linear;
  97. }
  98. }
  99. &:checked+.replace {
  100. .icon{
  101. opacity: 1;
  102. transform: translate(-50%, -50%) scale(1);
  103. }
  104. }
  105. }
  106. .radio input {
  107. &+.replace {
  108. border-radius: 50%;
  109. &::after {
  110. content: '';
  111. border-radius: 50%;
  112. position: absolute;
  113. left: 50%;
  114. top: 50%;
  115. transform: translate(-50%, -50%) scale(0);
  116. transition: all .1s linear;
  117. width: 60%;
  118. height: 60%;
  119. background-color: currentColor;
  120. }
  121. }
  122. &:checked+.replace::after{
  123. transform: translate(-50%, -50%) scale(1);
  124. }
  125. }
  126. .text {
  127. width: 100%;
  128. height: 100%;
  129. border-radius: 4px;
  130. input {
  131. background: var(--colors-normal-back);
  132. height: 100%;
  133. padding: 8px 10px;
  134. border-radius: 4px;
  135. border: 1px solid var(--base-border-color);
  136. transition: border .3s ease;
  137. &:focus {
  138. border-color: var(--colors-primary-base);
  139. }
  140. &::placeholder {
  141. color: var(--colors-color);
  142. }
  143. }
  144. &.pre-suffix {
  145. input {
  146. padding-left: 30px;
  147. }
  148. .pre-icon {
  149. left: 10px;
  150. top: 50%;
  151. transform: translateY(-50%);
  152. }
  153. }
  154. &.right input {
  155. text-align: right;
  156. }
  157. &.suffix {
  158. input {
  159. padding-right: 30px;
  160. }
  161. .retouch {
  162. position: absolute;
  163. right: 10px;
  164. top: 50%;
  165. transform: translateY(-50%);
  166. }
  167. .len {
  168. font-size: var(--small-size);
  169. color: rgba(var(--colors-primary-fill), 1);
  170. span {
  171. color: var(--colors-primary-base);;
  172. }
  173. }
  174. }
  175. &.ready {
  176. .retouch,
  177. input {
  178. transition: all .1s linear;
  179. }
  180. }
  181. }
  182. .textarea {
  183. width: 100%;
  184. height: 100%;
  185. min-height: 50px;
  186. > .replace {
  187. border-radius: 4px;
  188. left: 0;
  189. top: 0;
  190. right: 0;
  191. bottom: 0;
  192. pointer-events: none;
  193. background: var(--colors-normal-back);
  194. border: 1px solid var(--base-border-color);
  195. transition: border .3s ease;
  196. }
  197. .input-div {
  198. overflow-y: auto;
  199. a {
  200. color: var(--color-main-normal);
  201. }
  202. }
  203. .input-div,
  204. textarea {
  205. height: 100%;
  206. width: 100%;
  207. padding: 10px;
  208. &:focus + .replace {
  209. border-color: var(--colors-primary-base);
  210. }
  211. &::placeholder {
  212. color: var(--colors-color);
  213. }
  214. }
  215. &.right .input-div,
  216. &.right textarea {
  217. text-align: right;
  218. }
  219. &.suffix {
  220. --bar-height: 30px;
  221. .input-div,
  222. textarea {
  223. margin-bottom: var(--bar-height);
  224. height: calc(100% - var(--bar-height));
  225. }
  226. > .retouch {
  227. position: absolute;
  228. right: 0;
  229. left: 0;
  230. bottom: 0;
  231. background-color: rgba(var(--colors-primary-fill), 0.1);
  232. height: var(--bar-height);
  233. display: flex;
  234. padding: 0 10px;
  235. align-items: center;
  236. justify-content: end;
  237. }
  238. .len {
  239. justify-self: end;
  240. font-size: var(--small-size);
  241. color: rgba(var(--colors-primary-fill), 1);
  242. span {
  243. color: var(--colors-primary-base);;
  244. }
  245. }
  246. }
  247. }
  248. .number {
  249. input {
  250. -moz-appearance:textfield;
  251. }
  252. input::-webkit-inner-spin-button,
  253. input::-webkit-outer-spin-button {
  254. -webkit-appearance: none;
  255. margin: 0;
  256. }
  257. .ctrls {
  258. position: absolute;
  259. inset: 2px 0;
  260. width: 8px;
  261. .icon {
  262. position: absolute;
  263. right: 0;
  264. &.up {
  265. bottom: 0;
  266. }
  267. &.down {
  268. top: 0;
  269. }
  270. }
  271. }
  272. &.ctrl.suffix input {
  273. padding-right: 20px;
  274. }
  275. }
  276. .select {
  277. input {
  278. cursor: pointer;
  279. }
  280. &.focus {
  281. input {
  282. border-color: var(--colors-primary-base);
  283. }
  284. .retouch {
  285. transform: translateY(-50%) rotateZ(180deg);
  286. }
  287. }
  288. }
  289. .range {
  290. width: 100%;
  291. display: flex;
  292. --height: 6px;
  293. --slideSize: calc(var(--height) + 8px);
  294. .range-content {
  295. flex: 1;
  296. background-color: var(--colors-normal-back);
  297. position: relative;
  298. cursor: pointer;
  299. }
  300. .range-content::before,
  301. .range-content {
  302. height: var(--height);
  303. border-radius: calc(var(--height) / 2);
  304. }
  305. .range-content::before,
  306. .range-content .range-slide{
  307. content: '';
  308. position: absolute;
  309. }
  310. .range-content::before {
  311. pointer-events: none;
  312. left: 0;
  313. top: 0;
  314. width: var(--percentage);
  315. background-color: var(--colors-primary-base);;
  316. }
  317. .range-locus {
  318. width: calc(100% - var(--slideSize));
  319. height: var(--height);
  320. position: relative;
  321. .range-slide {
  322. cursor: pointer;
  323. height: var(--slideSize);
  324. width: var(--slideSize);
  325. top: 50%;
  326. left: var(--percentage);
  327. transform: translateY(-50%);
  328. background-color: var(--colors-content-color);
  329. border-radius: 50%;
  330. }
  331. }
  332. .range-text {
  333. margin-left: 20px;
  334. width: 60px;
  335. }
  336. .animation {
  337. &.range-content::before,
  338. .range-slide {
  339. transition: all .1s linear;
  340. }
  341. }
  342. }
  343. .switch {
  344. --height: 24px;
  345. width: 50px;
  346. height: var(--height);
  347. .replace {
  348. background-color: rgba(255, 255, 255, 0.3);;
  349. left: 0;
  350. top: 0;
  351. right: 0;
  352. bottom: 0;
  353. border-radius: calc(var(--height) / 2);
  354. pointer-events: none;
  355. position: relative;
  356. transition: background-color .3s ease;
  357. &::after {
  358. content: '';
  359. --padding: 3px;
  360. --size: calc(var(--height) - var(--padding) * 2);
  361. position: absolute;
  362. width: var(--size);
  363. height: var(--size);
  364. top: var(--padding);
  365. background: var(--colors-content-color);
  366. border-radius: 50%;
  367. left: var(--padding);
  368. transition: left .3s ease;
  369. }
  370. }
  371. input:checked + .replace {
  372. background-color: var(--colors-primary-base);
  373. &::after {
  374. left: calc(100% - var(--size) - var(--padding));
  375. }
  376. }
  377. }
  378. .file {
  379. width: 100%;
  380. height: 100%;
  381. input {
  382. cursor: pointer;
  383. opacity: 0;
  384. }
  385. .use-replace {
  386. position: absolute;
  387. }
  388. .use-replace,
  389. .replace {
  390. left: 0;
  391. right: 0;
  392. display: flex;
  393. align-items: center;
  394. justify-content: center;
  395. pointer-events: none;
  396. }
  397. &:not(.valuable) {
  398. .replace {
  399. top: 0;
  400. bottom: 0;
  401. background: rgba(var(--colors-primary-fill), 0.1);
  402. border-radius: 4px;
  403. border: 1px solid rgba(var(--colors-primary-fill), 0.2);
  404. // position: relative;
  405. .placeholder {
  406. text-align: center;
  407. max-width: 80%;
  408. p:not(:last-child){
  409. margin-bottom: 10px;
  410. }
  411. .bottom {
  412. font-size: 12px;
  413. color: rgba(255,255,255,.3);
  414. width: 90%;
  415. position: absolute;
  416. bottom: 10px;
  417. left: 50%;
  418. transform: translateX(-50%);
  419. text-align: left;
  420. }
  421. }
  422. }
  423. input {
  424. width: 100%;
  425. height: 100%;
  426. &:focus + .replace {
  427. border-color: var(--colors-primary-base);
  428. }
  429. }
  430. }
  431. &.valuable {
  432. background: rgba(var(--colors-primary-fill), 0.1);
  433. border-radius: 4px;
  434. border: 1px solid rgba(var(--colors-primary-fill), 0.2);
  435. input,
  436. .replace {
  437. position: absolute;
  438. bottom: 0;
  439. background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0,0,0,0.5) 100%);
  440. height: 32px;
  441. line-height: 32px;
  442. .tj {
  443. right: 10px;
  444. top: 0;
  445. bottom: 0;
  446. display: flex;
  447. align-items: center;
  448. font-size: 10px;
  449. &::after {
  450. content: ')';
  451. }
  452. &::before {
  453. content: '(';
  454. }
  455. > span {
  456. color: var(--colors-primary-base);;
  457. margin-right: 4px;
  458. }
  459. }
  460. }
  461. .icons {
  462. position: absolute;
  463. right: 10px;
  464. top: 0;
  465. span {
  466. width: 24px;
  467. height: 24px;
  468. border-radius: 50%;
  469. background: rgba(0, 0, 0, 0.3);
  470. font-size: 12px;
  471. color: rgba(255,255,255,.6);
  472. display: flex;
  473. align-items: center;
  474. justify-content: center;
  475. margin-top: 10px
  476. }
  477. }
  478. }
  479. }
  480. .search{
  481. .retouch{
  482. transform: translateY(-50%) !important;
  483. .clear {
  484. // background-color: rgba(255,255,255,.3);
  485. font-size: 16px;
  486. display: flex;
  487. align-items: center;
  488. justify-content: center;
  489. color: rgba(255,255,255,.6);
  490. border-radius: 50%;
  491. cursor: pointer;
  492. }
  493. }
  494. }
  495. .color {
  496. &.default {
  497. input {
  498. opacity: 1;
  499. border: inherit;
  500. outline: inherit;
  501. }
  502. }
  503. .replace {
  504. pointer-events: none;
  505. }
  506. }
  507. }
  508. .select-float {
  509. transition: transform .3s ease,
  510. opacity .3s ease;
  511. &:not(.show) {
  512. opacity: 0;
  513. pointer-events: none;
  514. }
  515. &.show {
  516. opacity: 1;
  517. }
  518. &.dire-bottom {
  519. transform-origin: center top;
  520. &:not(.show) {
  521. transform: scale(1, 0);
  522. }
  523. &.show {
  524. transform: scale(1, 1);
  525. }
  526. }
  527. &.dire-top {
  528. transform-origin: center bottom;
  529. &:not(.show) {
  530. transform: translateY(-100%) scale(1, 0);
  531. }
  532. &.show {
  533. transform: translateY(-100%) scale(1, 1);
  534. }
  535. }
  536. }
  537. .select-replace{
  538. --colors-content-color: #fff;
  539. list-style: none;
  540. max-height: 288px;
  541. background: rgba(26, 26, 26, 0.8);
  542. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.3),
  543. inset 0 0 1px rgb(255 255 255 / 90%);
  544. backdrop-filter: blur(4px);
  545. border-radius: 4px;
  546. overflow-y: auto;
  547. color: var(--colors-content-color);
  548. .un-data {
  549. padding: 20px 15px;
  550. color: rgba(255, 255, 255, 0.3);
  551. pointer-events: none;
  552. font-size: 14px;
  553. }
  554. .select-options-atom {
  555. padding: 10px 10px;
  556. font-size: 14px;
  557. &.active {
  558. background: var(--colors-normal-back);
  559. color: var(--colors-primary-base);;
  560. }
  561. &:not(.active):hover {
  562. cursor: pointer;
  563. background-color: var(--colors-primary-base);
  564. }
  565. }
  566. }
  567. .is-hidden {
  568. position: absolute;
  569. left: -10000px;
  570. top: -10000px;
  571. }
  572. .multiple {
  573. .multiple-option {
  574. display: flex;
  575. align-items: center;
  576. p {
  577. margin-left: 10px;
  578. }
  579. }
  580. .select-options-atom {
  581. background: none !important;
  582. }
  583. }