_imageview.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * @copyright 2015 by Tobias Reich
  3. */
  4. #imageview {
  5. position: fixed;
  6. display: none;
  7. top: 0;
  8. left: 0;
  9. width: 100%;
  10. height: 100%;
  11. background-color: rgba(10, 10, 10, .98);
  12. transition: background-color .3s;
  13. /* Modes ------------------------------------------------*/
  14. &.view { background-color: inherit; }
  15. &.full { background-color: black(1); }
  16. /* ImageView ------------------------------------------------*/
  17. #image {
  18. position: absolute;
  19. top: 60px;
  20. right: 30px;
  21. bottom: 30px;
  22. left: 30px;
  23. background-repeat: no-repeat;
  24. background-position: 50% 50%;
  25. background-size: contain;
  26. transition: top .3s, right .3s, bottom .3s, left .3s, margin-top .3s, opacity .2s, transform .3s $timingBounce;
  27. animation-name: zoomIn;
  28. animation-duration: .3s;
  29. animation-timing-function: $timingBounce;
  30. will-change: transform;
  31. &.small {
  32. top: 50%;
  33. right: auto;
  34. bottom: auto;
  35. left: 50%;
  36. }
  37. &.full {
  38. top: 0;
  39. right: 0;
  40. bottom: 0;
  41. left: 0;
  42. }
  43. }
  44. /* Previous/Next Buttons ------------------------------------------------*/
  45. .arrow_wrapper {
  46. position: fixed;
  47. width: 15%;
  48. height: calc(100% - 60px);
  49. top: 60px;
  50. &--previous { left: 0; }
  51. &--next { right: 0; }
  52. a {
  53. position: fixed;
  54. top: 50%;
  55. margin: -19px 0 0;
  56. padding: 8px 12px;
  57. width: 16px;
  58. height: 22px;
  59. // The background-image will be styled dynamically via JS
  60. // background-image: linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url('');
  61. background-size: 100% 100%;
  62. border: 1px solid white(.8);
  63. opacity: .6;
  64. z-index: 2;
  65. transition: transform .2s ease-out, opacity .2s ease-out;
  66. will-change: transform;
  67. &#previous {
  68. left: -1px;
  69. transform: translateX(-100%);
  70. }
  71. &#next {
  72. right: -1px;
  73. transform: translateX(100%);
  74. }
  75. }
  76. &:hover a#previous,
  77. &:hover a#next { transform: translateX(0); }
  78. a:hover { opacity: 1; }
  79. .iconic {
  80. fill: white(.8);
  81. filter: drop-shadow(0 1px 0 black(.4));
  82. }
  83. }
  84. }