fileinput.scss 14 KB

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