fileinput.scss 14 KB

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