fileinput.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. /*!
  2. * bootstrap-fileinput v4.4.5
  3. * http://plugins.krajee.com/file-input
  4. *
  5. * Krajee default styling for bootstrap-fileinput.
  6. *
  7. * Author: Kartik Visweswaran
  8. * Copyright: 2014 - 2017, 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-loading {
  132. input[type=file] {
  133. @extend %set-invisible;
  134. }
  135. &:before {
  136. @extend %set-relative;
  137. content: " Loading...";
  138. display: inline-block;
  139. padding-left: multiply($pad, 4);
  140. line-height: multiply($pad, 3.2);
  141. font-size: multiply($pad, 2.6);
  142. font-variant: small-caps;
  143. color: $mountain-mist;
  144. background: transparent $url-0 top left no-repeat;
  145. }
  146. }
  147. input[type=file].file-loading {
  148. @extend %set-invisible;
  149. }
  150. .file-object {
  151. margin: 0 0 (-$pad) 0;
  152. padding: 0;
  153. }
  154. .btn-file {
  155. @extend %set-relative;
  156. overflow: hidden;
  157. input[type=file] {
  158. @extend %set-absolute;
  159. top: 0;
  160. right: 0;
  161. min-width: 100%;
  162. min-height: 100%;
  163. text-align: right;
  164. opacity: 0;
  165. background: none repeat scroll 0 0 transparent;
  166. cursor: inherit;
  167. display: block;
  168. }
  169. ::-ms-browse {
  170. font-size: multiply($pad, 2000);
  171. width: 100%;
  172. height: 100%;
  173. }
  174. }
  175. .file-caption {
  176. @extend %set-relative;
  177. .file-caption-name {
  178. width: 100%;
  179. margin: 0;
  180. padding: 0;
  181. box-shadow: none;
  182. border: none;
  183. background: none;
  184. outline: none;
  185. }
  186. &.icon-visible {
  187. .file-caption-icon {
  188. display: inline-block;
  189. }
  190. .file-caption-name {
  191. padding-left: multiply($pad, 3);
  192. }
  193. }
  194. }
  195. .file-caption-icon {
  196. @extend %set-hidden;
  197. @extend %set-absolute;
  198. line-height: 1;
  199. left: multiply($pad, 1.6);
  200. }
  201. .file-error-message {
  202. color: $apple-blossom;
  203. background-color: $vanilla-ice;
  204. margin: $pad;
  205. border: $border solid $oyster-pink;
  206. border-radius: $radius;
  207. padding: multiply($pad, 3);
  208. pre {
  209. @extend %set-error;
  210. margin: $pad 0;
  211. }
  212. ul {
  213. @extend %set-error;
  214. }
  215. }
  216. .file-caption-disabled {
  217. background-color: $gallery;
  218. cursor: not-allowed;
  219. opacity: 1;
  220. }
  221. .file-preview {
  222. @extend %set-relative;
  223. border-radius: multiply($radius, 1.25);
  224. border: $border solid $alto;
  225. padding: multiply($pad, 1.6);
  226. width: 100%;
  227. margin-bottom: $pad;
  228. .btn-xs {
  229. padding: multiply($pad, 0.2) $pad;
  230. font-size: multiply($pad, 2.4);
  231. line-height: 1.5;
  232. border-radius: multiply($radius, 0.75);
  233. }
  234. .fileinput-remove {
  235. @extend %set-absolute;
  236. top: multiply($pad, 0.2);
  237. right: multiply($pad, 0.2);
  238. line-height: multiply($pad, 2);
  239. }
  240. .clickable {
  241. cursor: pointer;
  242. }
  243. }
  244. .file-preview-image {
  245. font: multiply($pad, 8) $font-0, $font-1, $font-2;
  246. color: $green;
  247. }
  248. .krajee-default {
  249. &.file-preview-frame {
  250. @extend %set-relative;
  251. margin: multiply($pad, 1.6);
  252. border: $border solid $alto;
  253. box-shadow: $border $border $pad 0 $zorba;
  254. padding: multiply($pad, 1.2);
  255. float: left;
  256. text-align: center;
  257. .kv-file-content {
  258. width: multiply($pad, 42.6);
  259. height: multiply($pad, 32);
  260. }
  261. .file-thumbnail-footer {
  262. height: multiply($pad, 14);
  263. }
  264. &:not(.file-preview-error):hover {
  265. box-shadow: multiply($pad, 0.6) multiply($pad, 0.6) $pad 0 $mine-shaft;
  266. }
  267. }
  268. .file-preview-text {
  269. display: block;
  270. color: $boston-blue;
  271. border: $border solid $alto;
  272. font-family: $font-3, $font-4, $font-5, $font-6, $font-7;
  273. outline: none;
  274. padding: multiply($pad, 1.6);
  275. resize: none;
  276. }
  277. .file-preview-html {
  278. border: $border solid $alto;
  279. padding: multiply($pad, 1.6);
  280. overflow: auto;
  281. }
  282. .file-actions {
  283. @extend %set-text-left;
  284. }
  285. .file-other-error {
  286. @extend %set-text-left;
  287. }
  288. .file-other-icon {
  289. font-size: 6em;
  290. }
  291. .file-footer-buttons {
  292. float: right;
  293. }
  294. .file-footer-caption {
  295. display: block;
  296. text-align: center;
  297. padding-top: multiply($pad, 0.8);
  298. font-size: multiply($pad, 2.2);
  299. color: $tapa;
  300. margin-bottom: multiply($pad, 3);
  301. }
  302. .file-preview-error {
  303. opacity: 0.65;
  304. box-shadow: none;
  305. }
  306. .file-drag-handle {
  307. @extend %set-indicator;
  308. }
  309. .file-upload-indicator {
  310. @extend %set-indicator;
  311. }
  312. .file-thumb-progress {
  313. @extend %set-absolute;
  314. height: multiply($pad, 2.2);
  315. top: multiply($pad, 7.4);
  316. left: 0;
  317. right: 0;
  318. .progress {
  319. @extend %set-progress;
  320. }
  321. .progress-bar {
  322. @extend %set-progress;
  323. }
  324. }
  325. .file-thumbnail-footer {
  326. @extend %set-relative;
  327. }
  328. .file-caption-info {
  329. @extend %set-caption;
  330. }
  331. .file-size-info {
  332. @extend %set-caption;
  333. }
  334. &.kvsortable-ghost {
  335. background: $mystic;
  336. border: multiply($border, 2) solid $perano;
  337. }
  338. .file-preview-other:hover {
  339. opacity: 0.8;
  340. }
  341. .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover {
  342. color: $black;
  343. }
  344. }
  345. .kv-upload-progress {
  346. .progress {
  347. height: multiply($pad, 4);
  348. line-height: multiply($pad, 4);
  349. margin: multiply($pad, 2) 0;
  350. overflow: hidden;
  351. }
  352. .progress-bar {
  353. height: multiply($pad, 4);
  354. line-height: multiply($pad, 4);
  355. }
  356. }
  357. .file-zoom-dialog {
  358. .file-other-icon {
  359. //noinspection CssOverwrittenProperties
  360. font-size: 22em;
  361. //noinspection CssOverwrittenProperties
  362. font-size: 50vmin;
  363. }
  364. .modal-dialog {
  365. @extend %set-relative;
  366. width: auto;
  367. }
  368. .modal-header {
  369. display: flex;
  370. align-items: center;
  371. justify-content: space-between;
  372. &:before {
  373. @extend %set-hidden;
  374. }
  375. &:after {
  376. @extend %set-hidden;
  377. }
  378. }
  379. .btn-navigate {
  380. @extend %set-absolute;
  381. padding: 0;
  382. margin: 0;
  383. background: transparent;
  384. text-decoration: none;
  385. outline: none;
  386. opacity: 0.7;
  387. top: 45%;
  388. font-size: 4em;
  389. color: $curious-blue;
  390. &:not([disabled]):hover {
  391. outline: none;
  392. box-shadow: none;
  393. opacity: 0.6;
  394. }
  395. }
  396. .floating-buttons {
  397. @extend %set-absolute;
  398. top: $pad;
  399. right: multiply($pad, 2);
  400. }
  401. .btn-navigate[disabled] {
  402. opacity: 0.3;
  403. }
  404. .btn-prev {
  405. left: multiply($pad, 0.2);
  406. }
  407. .btn-next {
  408. right: multiply($pad, 0.2);
  409. }
  410. .kv-zoom-title {
  411. font-weight: 300;
  412. color: $mountain-mist;
  413. max-width: 50%;
  414. overflow: hidden;
  415. white-space: nowrap;
  416. text-overflow: ellipsis;
  417. }
  418. }
  419. .file-input-new {
  420. .file-preview {
  421. @extend %set-hidden;
  422. }
  423. .close {
  424. @extend %set-hidden;
  425. }
  426. .glyphicon-file {
  427. @extend %set-hidden;
  428. }
  429. .fileinput-remove-button {
  430. @extend %set-hidden;
  431. }
  432. .fileinput-upload-button {
  433. @extend %set-hidden;
  434. }
  435. .no-browse {
  436. .input-group-btn {
  437. @extend %set-hidden;
  438. }
  439. .form-control {
  440. border-top-right-radius: $radius;
  441. border-bottom-right-radius: $radius;
  442. }
  443. }
  444. }
  445. .file-input-ajax-new {
  446. .fileinput-remove-button {
  447. @extend %set-hidden;
  448. }
  449. .fileinput-upload-button {
  450. @extend %set-hidden;
  451. }
  452. .no-browse {
  453. .input-group-btn {
  454. @extend %set-hidden;
  455. }
  456. .form-control {
  457. border-top-right-radius: $radius;
  458. border-bottom-right-radius: $radius;
  459. }
  460. }
  461. }
  462. .file-caption-main {
  463. width: 100%;
  464. }
  465. .file-thumb-loading {
  466. background: transparent $url-0 no-repeat scroll center center content-box !important;
  467. }
  468. .file-drop-zone {
  469. border: $border dashed $silver-chalice;
  470. border-radius: $radius;
  471. height: 100%;
  472. text-align: center;
  473. vertical-align: middle;
  474. margin: multiply($pad, 2.4) multiply($pad, 3) multiply($pad, 2.4) multiply($pad, 2.4);
  475. padding: $pad;
  476. &.clickable {
  477. &:hover {
  478. border: multiply($border, 2) dashed $mountain-mist;
  479. }
  480. &:focus {
  481. border: multiply($border, 2) solid $viking;
  482. }
  483. }
  484. .file-preview-thumbnails {
  485. cursor: default;
  486. }
  487. }
  488. .file-drop-zone-title {
  489. color: $silver-chalice;
  490. font-size: 1.6em;
  491. padding: multiply($pad, 17) multiply($pad, 2);
  492. cursor: default;
  493. }
  494. .file-highlighted {
  495. border: multiply($border, 2) dashed $mountain-mist !important;
  496. background-color: $gallery;
  497. }
  498. .file-uploading {
  499. background: $url-1 no-repeat center bottom multiply($pad, 2);
  500. opacity: 0.65;
  501. }
  502. @media(min-width: 576px) {
  503. .file-zoom-dialog .modal-dialog {
  504. max-width: 500px;
  505. }
  506. }
  507. @media(min-width: 992px) {
  508. .file-zoom-dialog .modal-lg {
  509. max-width: 800px;
  510. }
  511. }
  512. .file-zoom-fullscreen {
  513. &.modal {
  514. position: fixed;
  515. top: 0;
  516. right: 0;
  517. bottom: 0;
  518. left: 0;
  519. }
  520. .modal-dialog {
  521. position: fixed;
  522. margin: 0;
  523. padding: 0;
  524. width: 100%;
  525. height: 100%;
  526. max-width: 100%;
  527. max-height: 100%;
  528. }
  529. .modal-content {
  530. border-radius: 0;
  531. box-shadow: none;
  532. }
  533. .modal-body {
  534. overflow-y: auto;
  535. }
  536. }
  537. .btn-kv {
  538. display: inline-block;
  539. text-align: center;
  540. width: multiply($pad, 6);
  541. height: multiply($pad, 6);
  542. line-height: multiply($pad, 6);
  543. padding: 0;
  544. font-size: 0.875rem;
  545. border-radius: 0.2rem;
  546. }
  547. .floating-buttons {
  548. z-index: 3000;
  549. .btn-kv {
  550. margin-left: multiply($pad, 0.6);
  551. z-index: 3000;
  552. }
  553. }
  554. .file-zoom-content {
  555. height: multiply($pad, 96);
  556. text-align: center;
  557. .file-preview-image {
  558. max-height: 100%;
  559. }
  560. .file-preview-video {
  561. max-height: 100%;
  562. }
  563. .is-portrait-gt4 {
  564. margin-top: multiply($pad, 12);
  565. }
  566. > .file-object {
  567. &.type-image {
  568. @extend %set-object;
  569. height: auto;
  570. min-height: inherit;
  571. }
  572. &.type-video {
  573. @extend %set-object-video;
  574. }
  575. &.type-flash {
  576. @extend %set-object-video;
  577. }
  578. &.type-audio {
  579. width: auto;
  580. height: multiply($pad, 6);
  581. }
  582. &.type-pdf {
  583. @extend %set-object-default;
  584. }
  585. &.type-html {
  586. @extend %set-object-default;
  587. }
  588. &.type-text {
  589. @extend %set-object-default;
  590. }
  591. &.type-default {
  592. @extend %set-object-default;
  593. }
  594. }
  595. }
  596. @media screen and(max-width: 767px) {
  597. .file-preview-thumbnails {
  598. display: flex;
  599. justify-content: center;
  600. align-items: center;
  601. flex-direction: column;
  602. }
  603. .file-zoom-dialog .modal-header {
  604. flex-direction: column;
  605. }
  606. }
  607. @media screen and(max-width: 350px) {
  608. .krajee-default.file-preview-frame .kv-file-content {
  609. width: multiply($pad, 32);
  610. }
  611. }
  612. .file-loading[dir=rtl]:before {
  613. background: transparent $url-0 top right no-repeat;
  614. padding-left: 0;
  615. padding-right: multiply($pad, 4);
  616. }
  617. .file-sortable .file-drag-handle {
  618. cursor: move;
  619. opacity: 1;
  620. &:hover {
  621. opacity: 0.7;
  622. }
  623. }
  624. .clickable .file-drop-zone-title {
  625. cursor: pointer;
  626. }
  627. .kv-zoom-actions .btn-kv {
  628. margin-left: multiply($pad, 0.6);
  629. }
  630. .file-preview-initial.sortable-chosen {
  631. background-color: $link-water;
  632. }