fileinput.scss 14 KB

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