fileinput.scss 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. /*!
  2. * bootstrap-fileinput v5.1.1
  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-thumb-progress {
  381. .progress {
  382. background-color: #ccc;
  383. }
  384. .progress-bar {
  385. font-size: 0.7rem;
  386. font-family: Verdana, Helvetica, sans-serif;
  387. }
  388. }
  389. .file-zoom-dialog {
  390. .file-other-icon {
  391. //noinspection CssOverwrittenProperties
  392. font-size: 22em;
  393. //noinspection CssOverwrittenProperties
  394. font-size: 50vmin;
  395. }
  396. .modal-dialog {
  397. @extend %set-relative;
  398. width: auto;
  399. }
  400. .modal-header {
  401. display: flex;
  402. align-items: center;
  403. justify-content: space-between;
  404. &:before {
  405. @extend %set-hidden;
  406. }
  407. &:after {
  408. @extend %set-hidden;
  409. }
  410. }
  411. .btn-navigate {
  412. @extend %set-absolute;
  413. padding: 0;
  414. margin: -60px 0 0;
  415. font-size: 60px;
  416. background: transparent;
  417. text-decoration: none;
  418. outline: none;
  419. opacity: 0.7;
  420. top: 50%;
  421. color: $curious-blue;
  422. &:not([disabled]):hover {
  423. outline: none;
  424. box-shadow: none;
  425. opacity: 0.6;
  426. }
  427. }
  428. .floating-buttons {
  429. @extend %set-absolute;
  430. top: $pad;
  431. right: multiply($pad, 2);
  432. }
  433. .btn-navigate[disabled] {
  434. opacity: 0.3;
  435. }
  436. .btn-prev {
  437. left: multiply($pad, 0.2);
  438. }
  439. .btn-next {
  440. right: multiply($pad, 0.2);
  441. }
  442. .kv-zoom-title {
  443. font-weight: 300;
  444. color: $mountain-mist;
  445. max-width: 50%;
  446. overflow: hidden;
  447. white-space: nowrap;
  448. text-overflow: ellipsis;
  449. }
  450. }
  451. .file-input-new {
  452. .file-preview {
  453. @extend %set-hidden;
  454. }
  455. .close {
  456. @extend %set-hidden;
  457. }
  458. .glyphicon-file {
  459. @extend %set-hidden;
  460. }
  461. .fileinput-remove-button {
  462. @extend %set-hidden;
  463. }
  464. .fileinput-upload-button {
  465. @extend %set-hidden;
  466. }
  467. .no-browse {
  468. .input-group-btn {
  469. @extend %set-hidden;
  470. }
  471. .form-control {
  472. border-top-right-radius: $radius;
  473. border-bottom-right-radius: $radius;
  474. }
  475. }
  476. }
  477. .file-input-ajax-new {
  478. .fileinput-remove-button {
  479. @extend %set-hidden;
  480. }
  481. .fileinput-upload-button {
  482. @extend %set-hidden;
  483. }
  484. .no-browse {
  485. .input-group-btn {
  486. @extend %set-hidden;
  487. }
  488. .form-control {
  489. border-top-right-radius: $radius;
  490. border-bottom-right-radius: $radius;
  491. }
  492. }
  493. }
  494. .file-caption-main {
  495. width: 100%;
  496. }
  497. .file-thumb-loading {
  498. background: transparent $url-0 no-repeat scroll center center content-box !important;
  499. }
  500. .file-drop-zone {
  501. border: $border dashed $silver-chalice;
  502. border-radius: $radius;
  503. height: 100%;
  504. text-align: center;
  505. vertical-align: middle;
  506. margin: multiply($pad, 2.4) multiply($pad, 3) multiply($pad, 2.4) multiply($pad, 2.4);
  507. padding: $pad;
  508. &.clickable {
  509. &:hover {
  510. border: multiply($border, 2) dashed $mountain-mist;
  511. }
  512. &:focus {
  513. border: multiply($border, 2) solid $viking;
  514. }
  515. }
  516. .file-preview-thumbnails {
  517. cursor: default;
  518. }
  519. }
  520. .file-drop-zone-title {
  521. color: $silver-chalice;
  522. font-size: 1.6em;
  523. padding: multiply($pad, 17) multiply($pad, 2);
  524. cursor: default;
  525. }
  526. .file-highlighted {
  527. border: multiply($border, 2) dashed $mountain-mist !important;
  528. background-color: $gallery;
  529. }
  530. .file-uploading {
  531. background: $url-1 no-repeat center bottom multiply($pad, 2);
  532. opacity: 0.65;
  533. }
  534. .file-zoom-fullscreen {
  535. .modal-dialog {
  536. min-width: 100%;
  537. margin: 0;
  538. }
  539. .modal-content {
  540. border-radius: 0;
  541. box-shadow: none;
  542. min-height: 100vh;
  543. }
  544. .modal-body {
  545. overflow-y: auto;
  546. }
  547. }
  548. .floating-buttons {
  549. z-index: 3000;
  550. .btn-kv {
  551. margin-left: multiply($pad, 0.6);
  552. z-index: 3000;
  553. }
  554. }
  555. .kv-zoom-actions .btn-kv {
  556. margin-left: multiply($pad, 0.6);
  557. }
  558. .file-zoom-content {
  559. min-height: 300px;
  560. text-align: center;
  561. .file-preview-image {
  562. max-height: 100%;
  563. }
  564. .file-preview-video {
  565. max-height: 100%;
  566. }
  567. > .file-object {
  568. &.type-image {
  569. @extend %set-object;
  570. height: auto;
  571. min-height: inherit;
  572. }
  573. &.type-video {
  574. @extend %set-object-video;
  575. }
  576. &.type-flash {
  577. @extend %set-object-video;
  578. }
  579. &.type-audio {
  580. width: auto;
  581. height: multiply($pad, 6);
  582. }
  583. &.type-pdf {
  584. @extend %set-object-default;
  585. }
  586. &.type-html {
  587. @extend %set-object-default;
  588. }
  589. &.type-text {
  590. @extend %set-object-default;
  591. }
  592. &.type-default {
  593. @extend %set-object-default;
  594. }
  595. }
  596. }
  597. @media(min-width: 576px) {
  598. .file-zoom-dialog .modal-dialog {
  599. max-width: 500px;
  600. }
  601. }
  602. @media(min-width: 992px) {
  603. .file-zoom-dialog .modal-lg {
  604. max-width: 800px;
  605. }
  606. }
  607. @media(max-width: 767px) {
  608. .file-preview-thumbnails {
  609. display: flex;
  610. justify-content: center;
  611. align-items: center;
  612. flex-direction: column;
  613. }
  614. .file-zoom-dialog .modal-header {
  615. flex-direction: column;
  616. }
  617. }
  618. @media(max-width: 350px) {
  619. .krajee-default.file-preview-frame:not([data-template="audio"]) .kv-file-content {
  620. width: 160px;
  621. }
  622. }
  623. @media(max-width: 420px) {
  624. .krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered {
  625. width: 100%;
  626. }
  627. }
  628. .file-loading[dir=rtl]:before {
  629. background: transparent $url-0 top right no-repeat;
  630. padding-left: 0;
  631. padding-right: multiply($pad, 4);
  632. }
  633. .clickable .file-drop-zone-title {
  634. cursor: pointer;
  635. }
  636. .file-sortable .file-drag-handle {
  637. cursor: grab;
  638. opacity: 1;
  639. &:hover {
  640. opacity: 0.7;
  641. }
  642. }
  643. .file-grabbing, .file-grabbing * {
  644. cursor: not-allowed !important;
  645. }
  646. .file-grabbing .file-preview-thumbnails * {
  647. cursor: grabbing !important;
  648. }
  649. .file-preview-initial.sortable-chosen {
  650. background-color: $link-water;
  651. }