fileinput.scss 15 KB

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