fileinput.scss 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  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. $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. }
  242. .file-preview-image {
  243. font: multiply($pad, 8) $font-0, $font-1, $font-2;
  244. color: $green;
  245. }
  246. .krajee-default {
  247. &.file-preview-frame {
  248. @extend %set-relative;
  249. margin: multiply($pad, 1.6);
  250. border: $border solid $black-20;
  251. box-shadow: 0 0 multiply($pad, 2) 0 $black-20;
  252. padding: multiply($pad, 1.2);
  253. float: left;
  254. text-align: center;
  255. .kv-file-content {
  256. width: multiply($pad, 42.6);
  257. height: multiply($pad, 32);
  258. &.kv-pdf-rendered {
  259. width: 400px;
  260. }
  261. }
  262. .file-thumbnail-footer {
  263. height: multiply($pad, 14);
  264. }
  265. &:not(.file-preview-error):hover {
  266. border: $border solid $black-30;
  267. box-shadow: 0 0 multiply($pad, 2) 0 $black-40;
  268. }
  269. &[data-template="audio"] .kv-file-content {
  270. width: 240px;
  271. height: 55px;
  272. }
  273. }
  274. .file-preview-other-frame {
  275. display: flex;
  276. align-items: center;
  277. justify-content: center;
  278. }
  279. .file-preview-text {
  280. display: block;
  281. color: $boston-blue;
  282. border: $border solid $alto;
  283. font-family: $font-3, $font-4, $font-5, $font-6, $font-7;
  284. outline: none;
  285. padding: multiply($pad, 1.6);
  286. resize: none;
  287. }
  288. .file-preview-html {
  289. border: $border solid $alto;
  290. padding: multiply($pad, 1.6);
  291. overflow: auto;
  292. }
  293. .file-actions {
  294. @extend %set-text-left;
  295. }
  296. .file-other-error {
  297. @extend %set-text-left;
  298. }
  299. .file-other-icon {
  300. font-size: 6em;
  301. line-height: 1;
  302. }
  303. .file-footer-buttons {
  304. float: right;
  305. }
  306. .file-footer-caption {
  307. display: block;
  308. text-align: center;
  309. padding-top: multiply($pad, 0.8);
  310. font-size: multiply($pad, 2.2);
  311. color: $tapa;
  312. margin-bottom: multiply($pad, 3);
  313. }
  314. .file-preview-error {
  315. opacity: 0.65;
  316. box-shadow: none;
  317. }
  318. .file-drag-handle {
  319. @extend %set-indicator;
  320. }
  321. .file-upload-indicator {
  322. @extend %set-indicator;
  323. }
  324. .file-thumb-progress {
  325. @extend %set-absolute;
  326. height: multiply($pad, 2.2);
  327. top: multiply($pad, 7.4);
  328. left: 0;
  329. right: 0;
  330. .progress {
  331. @extend %set-progress;
  332. color: $celeste;
  333. }
  334. .progress-bar {
  335. @extend %set-progress;
  336. font-family: Verdana, Helvetica, sans-serif;
  337. }
  338. }
  339. .file-thumbnail-footer {
  340. @extend %set-relative;
  341. }
  342. .file-caption-info {
  343. @extend %set-caption;
  344. }
  345. .file-size-info {
  346. @extend %set-caption;
  347. }
  348. &.kvsortable-ghost {
  349. background: $mystic;
  350. border: multiply($border, 2) solid $perano;
  351. }
  352. .file-preview-other:hover {
  353. opacity: 0.8;
  354. }
  355. .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover {
  356. color: $black;
  357. }
  358. }
  359. .file-upload-stats {
  360. font-size: 9px;
  361. text-align: center;
  362. width: 100%;
  363. }
  364. .kv-upload-progress {
  365. .progress {
  366. height: multiply($pad, 4);
  367. line-height: multiply($pad, 4);
  368. margin: multiply($pad, 2) 0;
  369. overflow: hidden;
  370. color: $celeste;
  371. }
  372. .progress-bar {
  373. height: multiply($pad, 4);
  374. font-family: Verdana, Helvetica, sans-serif;
  375. }
  376. .file-upload-stats {
  377. font-size: 11px;
  378. margin: -10px 0 5px;
  379. }
  380. }
  381. .file-thumb-progress {
  382. .progress {
  383. background-color: #ccc;
  384. }
  385. .progress-bar {
  386. font-size: 0.7rem;
  387. font-family: Verdana, Helvetica, sans-serif;
  388. }
  389. }
  390. .file-zoom-dialog {
  391. .file-other-icon {
  392. //noinspection CssOverwrittenProperties
  393. font-size: 22em;
  394. //noinspection CssOverwrittenProperties
  395. font-size: 50vmin;
  396. }
  397. .modal-dialog {
  398. @extend %set-relative;
  399. width: auto;
  400. }
  401. .modal-header {
  402. display: flex;
  403. align-items: center;
  404. justify-content: space-between;
  405. &:before {
  406. @extend %set-hidden;
  407. }
  408. &:after {
  409. @extend %set-hidden;
  410. }
  411. }
  412. .btn-navigate {
  413. @extend %set-absolute;
  414. padding: 0;
  415. margin: -60px 0 0;
  416. font-size: 60px;
  417. background: transparent;
  418. text-decoration: none;
  419. outline: none;
  420. opacity: 0.7;
  421. top: 50%;
  422. color: $curious-blue;
  423. &:not([disabled]):hover {
  424. outline: none;
  425. box-shadow: none;
  426. opacity: 0.6;
  427. }
  428. }
  429. .floating-buttons {
  430. @extend %set-absolute;
  431. top: $pad;
  432. right: multiply($pad, 2);
  433. }
  434. .btn-navigate[disabled] {
  435. opacity: 0.3;
  436. }
  437. .btn-prev {
  438. left: multiply($pad, 0.2);
  439. }
  440. .btn-next {
  441. right: multiply($pad, 0.2);
  442. }
  443. .kv-zoom-title {
  444. font-weight: 300;
  445. color: $mountain-mist;
  446. max-width: 50%;
  447. overflow: hidden;
  448. white-space: nowrap;
  449. text-overflow: ellipsis;
  450. }
  451. }
  452. .file-input-new {
  453. .file-preview {
  454. @extend %set-hidden;
  455. }
  456. .close {
  457. @extend %set-hidden;
  458. }
  459. .glyphicon-file {
  460. @extend %set-hidden;
  461. }
  462. .fileinput-remove-button {
  463. @extend %set-hidden;
  464. }
  465. .fileinput-upload-button {
  466. @extend %set-hidden;
  467. }
  468. .no-browse {
  469. .input-group-btn {
  470. @extend %set-hidden;
  471. }
  472. .form-control {
  473. border-top-right-radius: $radius;
  474. border-bottom-right-radius: $radius;
  475. }
  476. }
  477. }
  478. .file-input-ajax-new {
  479. .fileinput-remove-button {
  480. @extend %set-hidden;
  481. }
  482. .fileinput-upload-button {
  483. @extend %set-hidden;
  484. }
  485. .no-browse {
  486. .input-group-btn {
  487. @extend %set-hidden;
  488. }
  489. .form-control {
  490. border-top-right-radius: $radius;
  491. border-bottom-right-radius: $radius;
  492. }
  493. }
  494. }
  495. .file-caption-main {
  496. width: 100%;
  497. }
  498. .file-thumb-loading {
  499. background: transparent $url-0 no-repeat scroll center center content-box !important;
  500. }
  501. .file-drop-zone {
  502. border: $border dashed $silver-chalice;
  503. border-radius: $radius;
  504. height: 100%;
  505. text-align: center;
  506. vertical-align: middle;
  507. margin: multiply($pad, 2.4) multiply($pad, 3) multiply($pad, 2.4) multiply($pad, 2.4);
  508. padding: $pad;
  509. &.clickable {
  510. &:hover {
  511. border: multiply($border, 2) dashed $mountain-mist;
  512. }
  513. &:focus {
  514. border: multiply($border, 2) solid $viking;
  515. }
  516. }
  517. .file-preview-thumbnails {
  518. cursor: default;
  519. }
  520. }
  521. .file-drop-zone-title {
  522. color: $silver-chalice;
  523. font-size: 1.6em;
  524. padding: multiply($pad, 17) multiply($pad, 2);
  525. cursor: default;
  526. }
  527. .file-highlighted {
  528. border: multiply($border, 2) dashed $mountain-mist !important;
  529. background-color: $gallery;
  530. }
  531. .file-uploading {
  532. background: $url-1 no-repeat center bottom multiply($pad, 2);
  533. opacity: 0.65;
  534. }
  535. .file-zoom-fullscreen {
  536. .modal-dialog {
  537. min-width: 100%;
  538. margin: 0;
  539. }
  540. .modal-content {
  541. border-radius: 0;
  542. box-shadow: none;
  543. min-height: 100vh;
  544. }
  545. .modal-body {
  546. overflow-y: auto;
  547. }
  548. }
  549. .floating-buttons {
  550. z-index: 3000;
  551. .btn-kv {
  552. margin-left: multiply($pad, 0.6);
  553. z-index: 3000;
  554. }
  555. }
  556. .kv-zoom-actions .btn-kv {
  557. margin-left: multiply($pad, 0.6);
  558. }
  559. .file-zoom-content {
  560. min-height: 300px;
  561. text-align: center;
  562. .file-preview-image {
  563. max-height: 100%;
  564. }
  565. .file-preview-video {
  566. max-height: 100%;
  567. }
  568. > .file-object {
  569. &.type-image {
  570. @extend %set-object;
  571. height: auto;
  572. min-height: inherit;
  573. }
  574. &.type-video {
  575. @extend %set-object-video;
  576. }
  577. &.type-flash {
  578. @extend %set-object-video;
  579. }
  580. &.type-audio {
  581. width: auto;
  582. height: multiply($pad, 6);
  583. }
  584. &.type-pdf {
  585. @extend %set-object-default;
  586. }
  587. &.type-html {
  588. @extend %set-object-default;
  589. }
  590. &.type-text {
  591. @extend %set-object-default;
  592. }
  593. &.type-default {
  594. @extend %set-object-default;
  595. }
  596. }
  597. }
  598. @media(min-width: 576px) {
  599. .file-zoom-dialog .modal-dialog {
  600. max-width: 500px;
  601. }
  602. }
  603. @media(min-width: 992px) {
  604. .file-zoom-dialog .modal-lg {
  605. max-width: 800px;
  606. }
  607. }
  608. @media(max-width: 767px) {
  609. .file-preview-thumbnails {
  610. display: flex;
  611. justify-content: center;
  612. align-items: center;
  613. flex-direction: column;
  614. }
  615. .file-zoom-dialog .modal-header {
  616. flex-direction: column;
  617. }
  618. }
  619. @media(max-width: 350px) {
  620. .krajee-default.file-preview-frame:not([data-template="audio"]) .kv-file-content {
  621. width: 160px;
  622. }
  623. }
  624. @media(max-width: 420px) {
  625. .krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered {
  626. width: 100%;
  627. }
  628. }
  629. .file-loading[dir=rtl]:before {
  630. background: transparent $url-0 top right no-repeat;
  631. padding-left: 0;
  632. padding-right: multiply($pad, 4);
  633. }
  634. .clickable .file-drop-zone-title {
  635. cursor: pointer;
  636. }
  637. .file-sortable .file-drag-handle {
  638. cursor: grab;
  639. opacity: 1;
  640. &:hover {
  641. opacity: 0.7;
  642. }
  643. }
  644. .file-grabbing, .file-grabbing * {
  645. cursor: not-allowed !important;
  646. }
  647. .file-grabbing .file-preview-thumbnails * {
  648. cursor: grabbing !important;
  649. }
  650. .file-preview-initial.sortable-chosen {
  651. background-color: $link-water;
  652. border-color: $pelorous;
  653. box-shadow: none;
  654. }