fileinput.scss 14 KB

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