_imageview.scss 2.0 KB

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