fileinput.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  1. /*!
  2. * bootstrap-fileinput v5.2.9
  3. * http://plugins.krajee.com/file-input
  4. *
  5. * Krajee default styling for bootstrap-fileinput.
  6. *
  7. * Author: Kartik Visweswaran
  8. * Copyright: 2014 - 2022, Kartik Visweswaran, Krajee.com
  9. *
  10. * Licensed under the BSD-3-Clause
  11. * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
  12. */
  13. //colors
  14. $mountain-mist: #999 !default;
  15. $apple-blossom: #a94442 !default;
  16. $vanilla-ice: #f2dede !default;
  17. $oyster-pink: #ebccd1 !default;
  18. $gallery: #eee !default;
  19. $alto: #ddd !default;
  20. $celeste: #ccc !default;
  21. $green: #008000 !default;
  22. $mine-shaft: #333 !default;
  23. $boston-blue: #428bca !default;
  24. $pelorous: #17a2b8 !default;
  25. $tapa: #777 !default;
  26. $black: #000 !default;
  27. $white: #fff !default;
  28. $black-20: rgba(0, 0, 0, 0.2) !default;
  29. $black-30: rgba(0, 0, 0, 0.3) !default;
  30. $black-40: rgba(0, 0, 0, 0.4) !default;
  31. $mystic: #e1edf7 !default;
  32. $perano: #a1abff !default;
  33. $silver-chalice: #aaa !default;
  34. $viking: #5acde2 !default;
  35. $curious-blue: #1c94c4 !default;
  36. $link-water: #d9edf7 !default;
  37. $gray-1: #6c757d !default;
  38. //fonts
  39. $font-0: Impact !default;
  40. $font-1: Charcoal !default;
  41. $font-2: sans-serif !default;
  42. $font-3: Menlo !default;
  43. $font-4: Monaco !default;
  44. $font-5: Consolas !default;
  45. $font-6: "Courier New" !default;
  46. $font-7: monospace !default;
  47. //urls
  48. $url-0: url(../img/loading.gif) !default;
  49. $url-1: url(../img/loading-sm.gif) !default;
  50. //standard measures
  51. $radius: 4px !default;
  52. $pad: 5px !default;
  53. $border: 1px !default;
  54. //operations
  55. @function multiply($pixels, $multiplier) {
  56. @return $pixels * $multiplier;
  57. }
  58. //@extend-elements
  59. %set-invisible {
  60. width: 0;
  61. height: 0;
  62. }
  63. %set-hidden {
  64. display: none;
  65. }
  66. %set-absolute {
  67. position: absolute;
  68. }
  69. %set-relative {
  70. position: relative;
  71. }
  72. %set-text-left {
  73. text-align: left;
  74. }
  75. %set-error {
  76. @extend %set-text-left;
  77. margin: 0;
  78. }
  79. %set-indicator {
  80. float: left;
  81. margin-top: multiply($pad, 2);
  82. width: multiply($pad, 3.2);
  83. height: multiply($pad, 3.2);
  84. }
  85. %set-progress {
  86. height: multiply($pad, 2.2);
  87. font-size: multiply($pad, 1.8);
  88. }
  89. %set-caption {
  90. display: block;
  91. white-space: nowrap;
  92. overflow: hidden;
  93. text-overflow: ellipsis;
  94. width: multiply($pad, 32);
  95. height: multiply($pad, 3);
  96. margin: auto;
  97. }
  98. %set-object {
  99. max-width: 100%;
  100. max-height: 100%;
  101. width: auto;
  102. }
  103. %set-object-video {
  104. @extend %set-object;
  105. height: 100%;
  106. }
  107. %set-object-default {
  108. width: 100%;
  109. }
  110. .kv-hidden {
  111. @extend %set-hidden;
  112. }
  113. .hide-content .kv-file-content {
  114. @extend %set-hidden;
  115. }
  116. .file-input {
  117. @extend %set-relative;
  118. }
  119. .file-no-browse {
  120. @extend %set-absolute;
  121. left: 50%;
  122. bottom: 20%;
  123. width: 1px;
  124. height: 1px;
  125. font-size: 0;
  126. opacity: 0;
  127. border: none;
  128. background: none;
  129. outline: none;
  130. box-shadow: none;
  131. }
  132. .file-loading {
  133. input[type=file] {
  134. @extend %set-invisible;
  135. }
  136. &:before {
  137. @extend %set-relative;
  138. content: " Loading...";
  139. display: inline-block;
  140. padding-left: multiply($pad, 4);
  141. line-height: multiply($pad, 3.2);
  142. font-size: multiply($pad, 2.6);
  143. font-variant: small-caps;
  144. color: $mountain-mist;
  145. background: transparent $url-0 top left no-repeat;
  146. }
  147. }
  148. input[type=file].file-loading {
  149. @extend %set-invisible;
  150. }
  151. .file-object {
  152. margin: 0 0 (-$pad) 0;
  153. padding: 0;
  154. }
  155. .btn-file {
  156. @extend %set-relative;
  157. overflow: hidden;
  158. input[type=file] {
  159. @extend %set-absolute;
  160. top: 0;
  161. left: 0;
  162. min-width: 100%;
  163. min-height: 100%;
  164. text-align: right;
  165. opacity: 0;
  166. background: none repeat scroll 0 0 transparent;
  167. cursor: inherit;
  168. display: block;
  169. }
  170. ::-ms-browse {
  171. font-size: multiply($pad, 2000);
  172. width: 100%;
  173. height: 100%;
  174. }
  175. }
  176. .file-caption {
  177. @extend %set-relative;
  178. .input-group {
  179. align-items: center;
  180. }
  181. .file-caption-name {
  182. width: 100%;
  183. margin: 0;
  184. padding: 0;
  185. box-shadow: none;
  186. border: none;
  187. background: none;
  188. outline: none;
  189. }
  190. &.icon-visible {
  191. .file-caption-icon {
  192. display: inline-block;
  193. }
  194. .file-caption-name {
  195. padding-left: 1.875rem;
  196. }
  197. > .input-group-lg .file-caption-name {
  198. padding-left: 2.1rem;
  199. }
  200. > .input-group-sm .file-caption-name {
  201. padding-left: 1.5rem;
  202. }
  203. }
  204. }
  205. .file-caption-icon {
  206. @extend %set-hidden;
  207. @extend %set-absolute;
  208. left: multiply($pad, 1.6);
  209. padding: 0.5rem;
  210. }
  211. .input-group-lg .file-caption-icon {
  212. font-size: 1.25rem;
  213. }
  214. .input-group-sm .file-caption-icon {
  215. font-size: 0.875rem;
  216. padding: 0.25rem;
  217. }
  218. .file-error-message {
  219. color: $apple-blossom;
  220. background-color: $vanilla-ice;
  221. margin: $pad;
  222. border: $border solid $oyster-pink;
  223. border-radius: $radius;
  224. padding: multiply($pad, 3);
  225. pre {
  226. @extend %set-error;
  227. margin: $pad 0;
  228. }
  229. ul {
  230. @extend %set-error;
  231. }
  232. }
  233. .file-caption-disabled {
  234. background-color: $gallery;
  235. cursor: not-allowed;
  236. opacity: 1;
  237. }
  238. .file-preview {
  239. @extend %set-relative;
  240. border-radius: multiply($radius, 1.25);
  241. border: $border solid $alto;
  242. padding: multiply($pad, 1.6);
  243. width: 100%;
  244. margin-bottom: $pad;
  245. .btn-xs {
  246. padding: multiply($pad, 0.2) $pad;
  247. font-size: multiply($pad, 2.4);
  248. line-height: 1.5;
  249. border-radius: multiply($radius, 0.75);
  250. }
  251. .fileinput-remove {
  252. @extend %set-absolute;
  253. top: multiply($pad, 0.2);
  254. right: multiply($pad, 0.2);
  255. line-height: multiply($pad, 2);
  256. }
  257. .clickable {
  258. cursor: pointer;
  259. }
  260. .kv-zoom-cache {
  261. display: none;
  262. }
  263. }
  264. .file-preview-image {
  265. font: multiply($pad, 8) $font-0, $font-1, $font-2;
  266. color: $green;
  267. width: auto;
  268. height: auto;
  269. max-width: 100%;
  270. max-height: 100%;
  271. }
  272. .krajee-default {
  273. &.file-preview-frame {
  274. @extend %set-relative;
  275. margin: multiply($pad, 1.6);
  276. border: $border solid $black-20;
  277. box-shadow: 0 0 multiply($pad, 2) 0 $black-20;
  278. padding: multiply($pad, 1.2);
  279. float: left;
  280. text-align: center;
  281. .kv-file-content {
  282. width: multiply($pad, 42.6);
  283. height: multiply($pad, 32);
  284. &.kv-pdf-rendered {
  285. width: 400px;
  286. }
  287. }
  288. .file-thumbnail-footer {
  289. height: multiply($pad, 14);
  290. }
  291. &:not(.file-preview-error):hover {
  292. border: $border solid $black-30;
  293. box-shadow: 0 0 multiply($pad, 2) 0 $black-40;
  294. }
  295. &[data-template="audio"] .kv-file-content {
  296. width: 240px;
  297. height: 55px;
  298. }
  299. }
  300. .file-preview-text {
  301. display: block;
  302. color: $boston-blue;
  303. border: $border solid $alto;
  304. font-family: $font-3, $font-4, $font-5, $font-6, $font-7;
  305. outline: none;
  306. padding: multiply($pad, 1.6);
  307. resize: none;
  308. }
  309. .file-preview-html {
  310. border: $border solid $alto;
  311. padding: multiply($pad, 1.6);
  312. overflow: auto;
  313. }
  314. .file-actions {
  315. @extend %set-text-left;
  316. }
  317. .file-other-error {
  318. @extend %set-text-left;
  319. }
  320. .file-other-icon {
  321. font-size: 6em;
  322. line-height: 1;
  323. }
  324. .file-footer-buttons {
  325. float: right;
  326. }
  327. .file-footer-caption {
  328. display: block;
  329. text-align: center;
  330. padding-top: multiply($pad, 0.8);
  331. font-size: multiply($pad, 2.2);
  332. color: $tapa;
  333. margin-bottom: multiply($pad, 3);
  334. }
  335. .file-preview-error {
  336. opacity: 0.65;
  337. box-shadow: none;
  338. }
  339. .file-drag-handle {
  340. @extend %set-indicator;
  341. }
  342. .file-upload-indicator {
  343. @extend %set-indicator;
  344. }
  345. .file-thumb-progress {
  346. @extend %set-absolute;
  347. height: multiply($pad, 2.2);
  348. top: multiply($pad, 7.4);
  349. left: 0;
  350. right: 0;
  351. .progress {
  352. @extend %set-progress;
  353. color: $celeste;
  354. }
  355. .progress-bar {
  356. @extend %set-progress;
  357. font-family: Verdana, Helvetica, sans-serif;
  358. }
  359. }
  360. .file-thumbnail-footer {
  361. @extend %set-relative;
  362. }
  363. .file-caption-info {
  364. @extend %set-caption;
  365. }
  366. .file-size-info {
  367. @extend %set-caption;
  368. }
  369. &.kvsortable-ghost {
  370. background: $mystic;
  371. border: multiply($border, 2) solid $perano;
  372. }
  373. .file-preview-other:hover {
  374. opacity: 0.8;
  375. }
  376. .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover {
  377. color: $black;
  378. }
  379. }
  380. .file-upload-stats {
  381. font-size: 9px;
  382. text-align: center;
  383. width: 100%;
  384. }
  385. .kv-upload-progress {
  386. .progress {
  387. height: multiply($pad, 4);
  388. line-height: multiply($pad, 4);
  389. margin: multiply($pad, 2) 0;
  390. overflow: hidden;
  391. color: $celeste;
  392. }
  393. .progress-bar {
  394. height: multiply($pad, 4);
  395. font-family: Verdana, Helvetica, sans-serif;
  396. }
  397. .file-upload-stats {
  398. font-size: 11px;
  399. margin: -10px 0 5px;
  400. }
  401. }
  402. .file-thumb-progress {
  403. .progress {
  404. background-color: #ccc;
  405. }
  406. .progress-bar {
  407. font-size: 0.7rem;
  408. font-family: Verdana, Helvetica, sans-serif;
  409. }
  410. }
  411. .file-zoom-dialog {
  412. .file-other-icon {
  413. //noinspection CssOverwrittenProperties
  414. font-size: 22em;
  415. //noinspection CssOverwrittenProperties
  416. font-size: 50vmin;
  417. }
  418. .modal-dialog {
  419. @extend %set-relative;
  420. width: auto;
  421. }
  422. .modal-header {
  423. display: flex;
  424. align-items: center;
  425. justify-content: space-between;
  426. &:before {
  427. @extend %set-hidden;
  428. }
  429. &:after {
  430. @extend %set-hidden;
  431. }
  432. }
  433. .btn-navigate {
  434. @extend %set-absolute;
  435. margin: -1.2rem 0.1rem 0;
  436. padding: 0;
  437. font-size: 1.2rem;
  438. width: 2.4rem;
  439. height: 2.4rem;
  440. top: 50%;
  441. border-radius: 50%;
  442. text-align: center;
  443. * {
  444. width: auto;
  445. }
  446. }
  447. .floating-buttons {
  448. @extend %set-absolute;
  449. top: $pad;
  450. right: multiply($pad, 2);
  451. }
  452. .btn-kv-prev {
  453. left: 0;
  454. }
  455. .btn-kv-next {
  456. right: 0;
  457. }
  458. .kv-zoom-header {
  459. padding: 0.5rem;
  460. }
  461. .kv-zoom-body {
  462. padding: 0.25rem 0.5rem 0.25rem 0;
  463. }
  464. .kv-zoom-description {
  465. position: absolute;
  466. opacity: 0.8;
  467. font-size: 0.8rem;
  468. background-color: #1a1a1a;
  469. padding: 1rem;
  470. text-align: center;
  471. border-radius: 0.5rem;
  472. color: #fff;
  473. left: 15%;
  474. right: 15%;
  475. bottom: 15%;
  476. }
  477. .kv-desc-hide {
  478. float: right;
  479. color: #fff;
  480. padding: 0 0.1rem;
  481. background: none;
  482. border: none;
  483. }
  484. .kv-desc-hide:hover,
  485. .kv-desc-hide:focus {
  486. opacity: 0.7;
  487. }
  488. }
  489. .file-input-new {
  490. .file-preview {
  491. @extend %set-hidden;
  492. }
  493. .close {
  494. @extend %set-hidden;
  495. }
  496. .glyphicon-file {
  497. @extend %set-hidden;
  498. }
  499. .fileinput-remove-button {
  500. @extend %set-hidden;
  501. }
  502. .fileinput-upload-button {
  503. @extend %set-hidden;
  504. }
  505. .no-browse {
  506. .input-group-btn {
  507. @extend %set-hidden;
  508. }
  509. .form-control {
  510. border-top-right-radius: $radius;
  511. border-bottom-right-radius: $radius;
  512. }
  513. }
  514. }
  515. .file-input-ajax-new {
  516. .fileinput-remove-button {
  517. @extend %set-hidden;
  518. }
  519. .fileinput-upload-button {
  520. @extend %set-hidden;
  521. }
  522. .no-browse {
  523. .input-group-btn {
  524. @extend %set-hidden;
  525. }
  526. .form-control {
  527. border-top-right-radius: $radius;
  528. border-bottom-right-radius: $radius;
  529. }
  530. }
  531. }
  532. .file-caption-main {
  533. width: 100%;
  534. }
  535. .file-thumb-loading {
  536. background: transparent $url-0 no-repeat scroll center center content-box !important;
  537. }
  538. .file-drop-zone {
  539. border: $border dashed $silver-chalice;
  540. border-radius: $radius;
  541. min-height: multiply($pad, 52);
  542. text-align: center;
  543. vertical-align: middle;
  544. margin: multiply($pad, 2.4) multiply($pad, 3) multiply($pad, 2.4) multiply($pad, 2.4);
  545. padding: $pad;
  546. &.clickable {
  547. &:hover {
  548. border: multiply($border, 2) dashed $mountain-mist;
  549. }
  550. &:focus {
  551. border: multiply($border, 2) solid $viking;
  552. }
  553. }
  554. .file-preview-thumbnails {
  555. cursor: default;
  556. }
  557. }
  558. .file-drop-zone-title {
  559. color: $silver-chalice;
  560. font-size: 1.6em;
  561. padding: multiply($pad, 17) multiply($pad, 2);
  562. cursor: default;
  563. }
  564. .file-highlighted {
  565. border: multiply($border, 2) dashed $mountain-mist !important;
  566. background-color: $gallery;
  567. }
  568. .file-uploading {
  569. background: $url-1 no-repeat center bottom multiply($pad, 2);
  570. opacity: 0.65;
  571. }
  572. .file-zoom-fullscreen {
  573. .modal-dialog {
  574. min-width: 100%;
  575. margin: 0;
  576. }
  577. .modal-content {
  578. border-radius: 0;
  579. box-shadow: none;
  580. min-height: 100vh;
  581. }
  582. .kv-zoom-body {
  583. overflow-y: auto;
  584. }
  585. }
  586. .floating-buttons {
  587. z-index: 3000;
  588. .btn-kv {
  589. margin-left: multiply($pad, 0.6);
  590. z-index: 3000;
  591. }
  592. }
  593. .kv-zoom-actions {
  594. min-width: 140px;
  595. }
  596. .kv-zoom-actions .btn-kv {
  597. margin-left: multiply($pad, 0.6);
  598. }
  599. .file-zoom-content {
  600. min-height: 300px;
  601. text-align: center;
  602. white-space: nowrap;
  603. .file-preview-image {
  604. max-height: 100%;
  605. }
  606. .file-preview-video {
  607. max-height: 100%;
  608. }
  609. > .file-object {
  610. &.type-image {
  611. @extend %set-object;
  612. height: auto;
  613. min-height: inherit;
  614. }
  615. &.type-video {
  616. @extend %set-object-video;
  617. }
  618. &.type-flash {
  619. @extend %set-object-video;
  620. }
  621. &.type-audio {
  622. width: auto;
  623. height: multiply($pad, 6);
  624. }
  625. &.type-pdf {
  626. @extend %set-object-default;
  627. }
  628. &.type-html {
  629. @extend %set-object-default;
  630. }
  631. &.type-text {
  632. @extend %set-object-default;
  633. }
  634. &.type-default {
  635. @extend %set-object-default;
  636. }
  637. }
  638. &:hover {
  639. background: transparent;
  640. }
  641. }
  642. @media(min-width: 576px) {
  643. .file-zoom-dialog .modal-dialog {
  644. max-width: 500px;
  645. }
  646. }
  647. @media(min-width: 992px) {
  648. .file-zoom-dialog .modal-lg {
  649. max-width: 800px;
  650. }
  651. }
  652. @media(max-width: 767px) {
  653. .file-preview-thumbnails {
  654. display: flex;
  655. justify-content: center;
  656. align-items: center;
  657. flex-direction: column;
  658. }
  659. .file-zoom-dialog .modal-header {
  660. flex-direction: column;
  661. }
  662. }
  663. @media(max-width: 350px) {
  664. .krajee-default.file-preview-frame:not([data-template="audio"]) .kv-file-content {
  665. width: 160px;
  666. }
  667. }
  668. @media(max-width: 420px) {
  669. .krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered {
  670. width: 100%;
  671. }
  672. }
  673. .file-loading[dir=rtl]:before {
  674. background: transparent $url-0 top right no-repeat;
  675. padding-left: 0;
  676. padding-right: multiply($pad, 4);
  677. }
  678. .clickable .file-drop-zone-title {
  679. cursor: pointer;
  680. }
  681. .file-sortable .file-drag-handle {
  682. cursor: grab;
  683. opacity: 1;
  684. &:hover {
  685. opacity: 0.7;
  686. }
  687. }
  688. .file-grabbing, .file-grabbing * {
  689. cursor: not-allowed !important;
  690. }
  691. .file-grabbing .file-preview-thumbnails * {
  692. cursor: grabbing !important;
  693. }
  694. .file-preview-initial.sortable-chosen {
  695. background-color: $link-water;
  696. border-color: $pelorous;
  697. box-shadow: none;
  698. }
  699. .file-preview-other-frame, .file-preview-object, .kv-zoom-body {
  700. display: flex;
  701. align-items: center;
  702. justify-content: center;
  703. }