James Peret's blog. Built with Jekyll and the Mikey theme.

_modal.scss 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. //
  2. // Modal
  3. // --------------------------------------------------
  4. .fullscreenModal {
  5. position: fixed;
  6. top: 0;
  7. left: 50%;
  8. transform: translateX(-50%);
  9. width: 80%; // temp solution
  10. height: 100%;
  11. color: $white;
  12. text-align: center;
  13. opacity: 0;
  14. visibility: hidden;
  15. background: transparent;
  16. -webkit-transition-delay: 0.5s;
  17. transition-delay: 0.5s;
  18. -webkit-transition: opacity 0.3s ease-in;
  19. -moz-transition: opacity 0.3s ease-in;
  20. transition: opacity 0.3s ease-in;
  21. z-index: $zIndex-8--fullscreen-modal;
  22. }
  23. .fullscreenModal.active {
  24. opacity: 1;
  25. visibility: visible;
  26. -webkit-transition-delay: 0.5s;
  27. transition-delay: 0.5s;
  28. }
  29. .fullscreenModal h2 {
  30. font-size: $font-M;
  31. }
  32. .modal-toggle-group {
  33. position: fixed;
  34. display: block;
  35. bottom: 30px;
  36. right: 3%;
  37. opacity: 0;
  38. visibility: hidden;
  39. transition: all .5s cubic-bezier(0.23, 1, 0.32, 1);
  40. z-index: $zIndex-7--modal-toggle-group;
  41. }
  42. .modal-toggle-group.active {
  43. opacity: 1;
  44. visibility: visible;
  45. &.scaleIn {
  46. transform: scale(1);
  47. }
  48. }
  49. .modal-toggle-group,
  50. .modal-toggle-wrapper,
  51. .modal-toggle-close-wrapper,
  52. .modal-toggle-bubble,
  53. .modal-toggle-bubbleShadow {
  54. height: 44px;
  55. width: 44px;
  56. border-radius: 50%;
  57. }
  58. .modal-toggle-wrapper {
  59. position: absolute;
  60. top: 0;
  61. display: block;
  62. background-image: url(../images/heart.svg);
  63. background-repeat: no-repeat;
  64. background-position: center center;
  65. background-size: 60%;
  66. background-color: transparent;
  67. cursor: pointer;
  68. -webkit-transform: scale(1);
  69. -webkit-transition: all 0.3s ease-out;
  70. z-index: $zIndex-7--modal-toggle-wrapper;
  71. }
  72. .modal-toggle-wrapper.active {
  73. opacity: 0;
  74. -webkit-transform: rotate(360deg);
  75. -moz-transform: rotate(360deg);
  76. -ms-transform: rotate(360deg);
  77. -o-transform: rotate(360deg);
  78. transform: rotate(360deg);
  79. }
  80. .modal-toggle-close-wrapper {
  81. position: absolute;
  82. top: 0;
  83. z-index: $zIndex-6--modal-toggle-close;
  84. opacity: 0;
  85. -webkit-transition: opacity 0.3s;
  86. -moz-transition: opacity 0.3s;
  87. transition: opacity 0.3s;
  88. .modal-toggle-close {
  89. position: absolute;
  90. top: 48%;
  91. left: 15%;
  92. display: block;
  93. width: 30px;
  94. height: 2px;
  95. background: transparent;
  96. -webkit-transition: background 0.3s;
  97. -moz-transition: background 0.3s;
  98. transition: background 0.3s;
  99. z-index: inherit;
  100. &:before,
  101. &:after {
  102. content: '';
  103. position: absolute;
  104. left: 0;
  105. background: inherit;
  106. width: 100%;
  107. height: 100%;
  108. -webkit-transform: translateZ(0);
  109. -moz-transform: translateZ(0);
  110. -ms-transform: translateZ(0);
  111. -o-transform: translateZ(0);
  112. transform: translateZ(0);
  113. -webkit-backface-visibility: hidden;
  114. backface-visibility: hidden;
  115. -webkit-transition: -webkit-transform 0.5s, background 0s;
  116. -moz-transition: -moz-transform 0.5s, background 0s;
  117. transition: transform 0.5s, background 0s;
  118. }
  119. &:before {
  120. top: -6px;
  121. -webkit-transform: rotate(0);
  122. -moz-transform: rotate(0);
  123. -ms-transform: rotate(0);
  124. -o-transform: rotate(0);
  125. transform: rotate(0);
  126. }
  127. &:after {
  128. bottom: -6px;
  129. -webkit-transform: rotate(0);
  130. -moz-transform: rotate(0);
  131. -ms-transform: rotate(0);
  132. -o-transform: rotate(0);
  133. transform: rotate(0);
  134. }
  135. }
  136. }
  137. .modal-toggle-close-wrapper.active {
  138. opacity: 1;
  139. z-index: $zIndex-6--modal-toggle-close;
  140. .modal-toggle-close {
  141. background: transparent;
  142. &:before,
  143. &:after {
  144. background: $white;
  145. }
  146. &:before {
  147. top: 0;
  148. -webkit-transform: rotate(135deg);
  149. -moz-transform: rotate(135deg);
  150. -ms-transform: rotate(135deg);
  151. -o-transform: rotate(135deg);
  152. transform: rotate(135deg);
  153. }
  154. &:after {
  155. bottom: 0;
  156. -webkit-transform: rotate(225deg);
  157. -moz-transform: rotate(225deg);
  158. -ms-transform: rotate(225deg);
  159. -o-transform: rotate(225deg);
  160. transform: rotate(225deg);
  161. }
  162. }
  163. }
  164. .modal-toggle-bubble {
  165. position: absolute;
  166. top: 0;
  167. background-color: rgba($black,.9);
  168. -webkit-transform: scale(1);
  169. -webkit-transition: all 0.3s ease-out;
  170. z-index: $zIndex-6--modal-toggle-bubble;
  171. }
  172. .modal-toggle-bubble.active {
  173. -webkit-transform: scale(100);
  174. -webkit-transition: all 0.6s ease-out;
  175. -webkit-transition-delay: .4s;
  176. }
  177. .modal-toggle-bubbleShadow {
  178. position: absolute;
  179. top: 0;
  180. background-color: $black;
  181. -webkit-transform: scale(1);
  182. opacity: 1;
  183. z-index: $zIndex-5--modal-toggle-bubbleshadow;
  184. }
  185. .modal-toggle-bubbleShadow.active {
  186. -webkit-transform: scale(1.5);
  187. opacity: 0;
  188. -webkit-transition: all 0.3s ease-out;
  189. }
  190. // share buttons
  191. .h2--shareTitle {
  192. margin-top: -100px;
  193. }
  194. .shareWrapper {
  195. @include clearfix();
  196. list-style: none;
  197. margin: $leading auto 0;
  198. padding: 0;
  199. width: 60%;
  200. li .shareButton {
  201. display: block;
  202. float: left;
  203. margin: 0;
  204. padding: 0 15px;
  205. width: 16.66%;
  206. height: 80px;
  207. background-repeat: no-repeat;
  208. background-position: center center;
  209. background-size: contain;
  210. opacity: 0.8;
  211. &:hover {
  212. opacity: 1;
  213. }
  214. @media (min-width: $screen-sm-max) and (max-width: $screen-lg-min) {
  215. width: 16.66%;
  216. height: 60px;
  217. }
  218. @media (max-width: $screen-xs-max) {
  219. float: none;
  220. width: 100%;
  221. height: 40px;
  222. margin-bottom: 20px;
  223. }
  224. }
  225. }
  226. .shareButton--twitter {
  227. background-image: url(../images/twitter.svg);
  228. }
  229. .shareButton--facebook {
  230. background-image: url(../images/facebook.svg);
  231. }
  232. .shareButton--linkedin {
  233. background-image: url(../images/linkedin.svg);
  234. }
  235. .shareButton--buffer {
  236. background-image: url(../images/buffer.svg);
  237. }
  238. .shareButton--hackernews {
  239. background-image: url(../images/ycombinator.svg);
  240. }
  241. .shareButton--pocket {
  242. background-image: url(../images/pocket.svg);
  243. }