_imageview.scss 2.1 KB

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