_input.scss 16 KB

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