Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. import React from 'react';
  2. import styled from 'styled-components';
  3. import Tilt from 'react-tilt';
  4.  
  5. export const UpperImage = styled.div`
  6. width: 100%;
  7. height: 100%;
  8. background-image: url("https://www.desktopbackground.org/download/1920x1080/2012/04/21/378104_tom-ford-glasses_2560x1440_h.jpg");
  9. background-repeat: no-repeat;
  10. background-color: gray;
  11. background-size: cover;
  12. background-position: center;
  13. align-items: center;
  14. margin-top: -17%;
  15. align-self: center;
  16. filter: gray();
  17. -webkit-filter: grayscale(1) blur(8px);
  18. opacity: 0.5;
  19. border-bottom: 2px solid ${({ theme }) => theme.colors.white};
  20. -webkit-transition: All 1s ease-in-out;
  21. :hover{
  22. -webkit-transition: All 1s ease-in-out;
  23. opacity: 1;
  24. filter: none;
  25. -webkit-filter: grayscale(0);
  26. transform: scale(1.15);
  27. @include transform(translate(var(--translate-x), var(--translate-y)));
  28. }
  29. `;
  30. const Title = styled.h1`
  31. color: ${({ theme }) => theme.colors.white};
  32. font-weight: ${({ theme }) => theme.font.regular};
  33. font-size: ${({ isBig }) => (isBig ? '5em' : '2em')};
  34. font-family: "Open Sans";
  35. text-align: center;
  36. width: 450px;
  37. opacity: 0;
  38. -webkit-transition: All 1s ease-in-out;
  39. overflow: hidden;
  40. border-right: .15em solid orange;
  41. white-space: nowrap;
  42. margin: auto;
  43. margin-top: 35vh;
  44. letter-spacing: .15em;
  45.  
  46.  
  47. ${UpperImage}:hover & {
  48. opacity: 1;
  49. animation:
  50. typing 2.0s steps(30, end),
  51. blink-caret 1s step-end infinite;
  52.  
  53. @keyframes typing {
  54. from {width: 0} to {width: 25%}
  55. }
  56. @keyframes blink-caret {
  57. from, to {border-color: transparent}
  58. 50% {border-color: orange; }
  59. }
  60. }
  61. `;
  62.  
  63. const StyledSubtitle = styled.h2`
  64. color: ${({ theme }) => theme.colors.white};
  65. font-weight: ${({ theme }) => theme.font.thin};
  66. font-size: ${({ isBig }) => (isBig ? '1.5em' : '.5em')};
  67. font-family: "Open Sans";
  68. text-decoration: none;
  69. text-align: center;
  70. width: 275px;
  71. opacity: 0;
  72. -webkit-transition: All 1s ease-in-out;
  73. white-space: nowrap;
  74. margin: 0 auto;
  75. margin-top: 60vh;
  76. letter-spacing: .15em;
  77. border: 2px solid orange;
  78. border-radius: 5px;
  79. box-shadow: 10px 10px 10px gray;
  80.  
  81.  
  82. ${UpperImage}:hover & {
  83. opacity: 1;
  84. };
  85. `;
  86.  
  87. const UpperHeader = () => (
  88. <Tilt className="Tilt" options={{ max: 10 }} style={{ height: '100%', width: '100%' }}>
  89. <UpperImage>
  90. <Title>XXXXXXXXXXXXXXX</Title>
  91. <StyledSubtitle isBig>Optyk Okularowy</StyledSubtitle>
  92. </UpperImage>
  93. </Tilt>
  94. );
  95.  
  96. export default UpperHeader;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement