fileinput.scss 14 KB

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