_imageview.scss 2.1 KB

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