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. line-height: multiply($pad, 2);
  82. }
  83. %set-caption {
  84. display: block;
  85. white-space: nowrap;
  86. overflow: hidden;
  87. text-overflow: ellipsis;
  88. width: multiply($pad, 32);
  89. height: multiply($pad, 3);
  90. margin: auto;
  91. }
  92. %set-object {
  93. max-width: 100%;
  94. max-height: 100%;
  95. width: auto;
  96. }
  97. %set-object-video {
  98. @extend %set-object;
  99. height: 100%;
  100. }
  101. %set-object-default {
  102. width: 100%;
  103. }
  104. .kv-hidden {
  105. @extend %set-hidden;
  106. }
  107. .hide-content .kv-file-content {
  108. @extend %set-hidden;
  109. }
  110. .rotate-2 {
  111. transform: rotateY(180deg);
  112. }
  113. .rotate-3 {
  114. transform: rotate(180deg);
  115. }
  116. .rotate-4 {
  117. transform: rotate(180deg) rotateY(180deg);
  118. }
  119. .rotate-5 {
  120. transform: rotate(270deg) rotateY(180deg);
  121. }
  122. .rotate-6 {
  123. transform: rotate(90deg);
  124. }
  125. .rotate-7 {
  126. transform: rotate(90deg) rotateY(180deg);
  127. }
  128. .rotate-8 {
  129. transform: rotate(270deg);
  130. }
  131. .file-input {
  132. @extend %set-relative;
  133. }
  134. .file-no-browse {
  135. @extend %set-absolute;
  136. left: 50%;
  137. bottom: 20%;
  138. width: 1px;
  139. height: 1px;
  140. font-size: 0;
  141. opacity: 0;
  142. border: none;
  143. background: none;
  144. outline: none;
  145. box-shadow: none;
  146. }
  147. .file-loading {
  148. input[type=file] {
  149. @extend %set-invisible;
  150. }
  151. &:before {
  152. @extend %set-relative;
  153. content: " Loading...";
  154. display: inline-block;
  155. padding-left: multiply($pad, 4);
  156. line-height: multiply($pad, 3.2);
  157. font-size: multiply($pad, 2.6);
  158. font-variant: small-caps;
  159. color: $mountain-mist;
  160. background: transparent $url-0 top left no-repeat;
  161. }
  162. }
  163. input[type=file].file-loading {
  164. @extend %set-invisible;
  165. }
  166. .file-object {
  167. margin: 0 0 (-$pad) 0;
  168. padding: 0;
  169. }
  170. .btn-file {
  171. @extend %set-relative;
  172. overflow: hidden;
  173. input[type=file] {
  174. @extend %set-absolute;
  175. top: 0;
  176. left: 0;
  177. min-width: 100%;
  178. min-height: 100%;
  179. text-align: right;
  180. opacity: 0;
  181. background: none repeat scroll 0 0 transparent;
  182. cursor: inherit;
  183. display: block;
  184. }
  185. ::-ms-browse {
  186. font-size: multiply($pad, 2000);
  187. width: 100%;
  188. height: 100%;
  189. }
  190. }
  191. .file-caption {
  192. @extend %set-relative;
  193. .file-caption-name {
  194. width: 100%;
  195. margin: 0;
  196. padding: 0;
  197. box-shadow: none;
  198. border: none;
  199. background: none;
  200. outline: none;
  201. }
  202. &.icon-visible {
  203. .file-caption-icon {
  204. display: inline-block;
  205. }
  206. .file-caption-name {
  207. padding-left: multiply($pad, 3);
  208. }
  209. }
  210. }
  211. .file-caption-icon {
  212. @extend %set-hidden;
  213. @extend %set-absolute;
  214. left: multiply($pad, 1.6);
  215. }
  216. .file-error-message {
  217. color: $apple-blossom;
  218. background-color: $vanilla-ice;
  219. margin: $pad;
  220. border: $border solid $oyster-pink;
  221. border-radius: $radius;
  222. padding: multiply($pad, 3);
  223. pre {
  224. @extend %set-error;
  225. margin: $pad 0;
  226. }
  227. ul {
  228. @extend %set-error;
  229. }
  230. }
  231. .file-caption-disabled {
  232. background-color: $gallery;
  233. cursor: not-allowed;
  234. opacity: 1;
  235. }
  236. .file-preview {
  237. @extend %set-relative;
  238. border-radius: multiply($radius, 1.25);
  239. border: $border solid $alto;
  240. padding: multiply($pad, 1.6);
  241. width: 100%;
  242. margin-bottom: $pad;
  243. .btn-xs {
  244. padding: multiply($pad, 0.2) $pad;
  245. font-size: multiply($pad, 2.4);
  246. line-height: 1.5;
  247. border-radius: multiply($radius, 0.75);
  248. }
  249. .fileinput-remove {
  250. @extend %set-absolute;
  251. top: multiply($pad, 0.2);
  252. right: multiply($pad, 0.2);
  253. line-height: multiply($pad, 2);
  254. }
  255. .clickable {
  256. cursor: pointer;
  257. }
  258. }
  259. .file-preview-image {
  260. font: multiply($pad, 8) $font-0, $font-1, $font-2;
  261. color: $green;
  262. }
  263. .krajee-default {
  264. &.file-preview-frame {
  265. @extend %set-relative;
  266. margin: multiply($pad, 1.6);
  267. border: $border solid $alto;
  268. box-shadow: $border $border $pad 0 $zorba;
  269. padding: multiply($pad, 1.2);
  270. float: left;
  271. text-align: center;
  272. .kv-file-content {
  273. width: multiply($pad, 42.6);
  274. height: multiply($pad, 32);
  275. &.kv-pdf-rendered {
  276. width: 400px;
  277. }
  278. }
  279. .file-thumbnail-footer {
  280. height: multiply($pad, 14);
  281. }
  282. &:not(.file-preview-error):hover {
  283. box-shadow: multiply($pad, 0.6) multiply($pad, 0.6) $pad 0 $mine-shaft;
  284. }
  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. }
  309. .file-footer-buttons {
  310. float: right;
  311. }
  312. .file-footer-caption {
  313. display: block;
  314. text-align: center;
  315. padding-top: multiply($pad, 0.8);
  316. font-size: multiply($pad, 2.2);
  317. color: $tapa;
  318. margin-bottom: multiply($pad, 3);
  319. }
  320. .file-preview-error {
  321. opacity: 0.65;
  322. box-shadow: none;
  323. }
  324. .file-drag-handle {
  325. @extend %set-indicator;
  326. }
  327. .file-upload-indicator {
  328. @extend %set-indicator;
  329. }
  330. .file-thumb-progress {
  331. @extend %set-absolute;
  332. height: multiply($pad, 2.2);
  333. top: multiply($pad, 7.4);
  334. left: 0;
  335. right: 0;
  336. .progress {
  337. @extend %set-progress;
  338. }
  339. .progress-bar {
  340. @extend %set-progress;
  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. line-height: multiply($pad, 4);
  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. }