fileinput.scss 15 KB

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