maddada

welcome to contso from codepen

Dec 16th, 2024
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.58 KB | None | 0 0
  1. :root {
  2. --color-bg1: rgb(8, 10, 15);
  3. --color-bg2: rgb(0, 17, 32);
  4. --color1: 18, 113, 255;
  5. --color2: 107, 74, 255;
  6. --color3: 100, 100, 255;
  7. --color4: 50, 160, 220;
  8. --color5: 80, 47, 122;
  9. --color-interactive: 140, 100, 255;
  10. --circle-size: 80%;
  11. --blending: hard-light;
  12. }
  13.  
  14.  
  15. .card-container * {
  16. margin: 0;
  17. padding: 0;
  18. outline: none;
  19. list-style: none;
  20. text-decoration: none;
  21. box-sizing: border-box;
  22. color: #fff;
  23. background: transparent;
  24. border: none;
  25. }
  26.  
  27. html,
  28. body {
  29. font-family: 'Dongle', sans-serif;
  30. margin: 0;
  31. padding: 0;
  32. height: 100%;
  33. width: 100%;
  34. }
  35.  
  36. body {
  37. background: #FFF;
  38. font-family: 'Montserrat', sans-serif;
  39. overflow: hidden;
  40. }
  41.  
  42. h1,
  43. h2,
  44. h3 {
  45. font-family: 'Montserrat', sans-serif;
  46. font-weight: 700;
  47. }
  48.  
  49. .card {
  50. position: absolute;
  51. z-index: 10;
  52. top: 50%;
  53. left: 50%;
  54. transform: translate(-50%, -50%);
  55. user-select: none;
  56. max-width: 600px;
  57. padding: 48px;
  58. -webkit-backdrop-filter: blur(10px);
  59. backdrop-filter: blur(10px);
  60. border-radius: 8px;
  61. box-shadow: 0 4px 90px rgba(0, 0, 0, 0.1);
  62. overflow: hidden;
  63.  
  64. &:before {
  65. content: "";
  66. position: absolute;
  67. z-index: 2;
  68. top: 0;
  69. left: 0;
  70. width: 100%;
  71. height: 2px;
  72. background: rgb(255, 255, 255);
  73. background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 34%, rgba(255, 255, 255, 1) 89%, rgba(255, 255, 255, 0) 100%);
  74. opacity: 0.3;
  75. filter: blur(.5px);
  76. mix-blend-mode: hard-light;
  77. }
  78.  
  79.  
  80. .noise {
  81. position: absolute;
  82. top: 0;
  83. left: 0;
  84. height: 100%;
  85. width: 100%;
  86. z-index: 1;
  87. opacity: 0.1;
  88. }
  89.  
  90. .content {
  91. position: relative;
  92. z-index: 2;
  93. text-shadow: -3px 0px 2px rgba(0, 0, 0, 0.1);
  94. }
  95. }
  96.  
  97. h1 {
  98. font-size: 3rem;
  99. margin-bottom: 16px;
  100. }
  101.  
  102. p {
  103. line-height: 1.6;
  104. }
  105.  
  106.  
  107. @keyframes moveInCircle {
  108. 0% {
  109. transform: rotate(0deg);
  110. }
  111.  
  112. 50% {
  113. transform: rotate(180deg);
  114. }
  115.  
  116. 100% {
  117. transform: rotate(360deg);
  118. }
  119. }
  120.  
  121. @keyframes moveVertical {
  122. 0% {
  123. transform: translateY(-50%);
  124. }
  125.  
  126. 50% {
  127. transform: translateY(50%);
  128. }
  129.  
  130. 100% {
  131. transform: translateY(-50%);
  132. }
  133. }
  134.  
  135. @keyframes moveHorizontal {
  136. 0% {
  137. transform: translateX(-50%) translateY(-10%);
  138. }
  139.  
  140. 50% {
  141. transform: translateX(50%) translateY(10%);
  142. }
  143.  
  144. 100% {
  145. transform: translateX(-50%) translateY(-10%);
  146. }
  147. }
  148.  
  149.  
  150. .gradient-bg {
  151. width: 100%;
  152. height: 600px;
  153. position: relative;
  154. overflow: hidden;
  155. background: linear-gradient(40deg, var(--color-bg1), var(--color-bg2));
  156. top: 0;
  157. left: 0;
  158.  
  159. .svgBlur {
  160. display: none;
  161. }
  162.  
  163. .noiseBg {
  164. position: absolute;
  165. width: 100%;
  166. height: 100%;
  167. top: 0;
  168. left: 0;
  169. z-index: 1;
  170. mix-blend-mode: soft-light;
  171. opacity: 0.3;
  172. }
  173.  
  174. .gradients-container {
  175. filter: url(#goo) blur(40px);
  176. width: 100%;
  177. height: 100%;
  178. }
  179.  
  180. .g1 {
  181. position: absolute;
  182. background: radial-gradient(circle at center, rgba(var(--color1), 0.8) 0, rgba(var(--color1), 0) 50%) no-repeat;
  183. mix-blend-mode: var(--blending);
  184.  
  185. width: var(--circle-size);
  186. height: var(--circle-size);
  187. top: calc(50% - var(--circle-size) / 2);
  188. left: calc(50% - var(--circle-size) / 2);
  189.  
  190. transform-origin: center center;
  191. animation: moveVertical 30s ease infinite;
  192.  
  193. opacity: 1;
  194. }
  195.  
  196. .g2 {
  197. position: absolute;
  198. background: radial-gradient(circle at center, rgba(var(--color2), 0.8) 0, rgba(var(--color2), 0) 50%) no-repeat;
  199. mix-blend-mode: var(--blending);
  200.  
  201. width: var(--circle-size);
  202. height: var(--circle-size);
  203. top: calc(50% - var(--circle-size) / 2);
  204. left: calc(50% - var(--circle-size) / 2);
  205.  
  206. transform-origin: calc(50% - 400px);
  207. animation: moveInCircle 20s reverse infinite;
  208.  
  209. opacity: 1;
  210. }
  211.  
  212. .g3 {
  213. position: absolute;
  214. background: radial-gradient(circle at center, rgba(var(--color3), 0.8) 0, rgba(var(--color3), 0) 50%) no-repeat;
  215. mix-blend-mode: var(--blending);
  216.  
  217. width: var(--circle-size);
  218. height: var(--circle-size);
  219. top: calc(50% - var(--circle-size) / 2 + 200px);
  220. left: calc(50% - var(--circle-size) / 2 - 500px);
  221.  
  222. transform-origin: calc(50% + 400px);
  223. animation: moveInCircle 40s linear infinite;
  224.  
  225. opacity: 1;
  226. }
  227.  
  228. .g4 {
  229. position: absolute;
  230. background: radial-gradient(circle at center, rgba(var(--color4), 0.8) 0, rgba(var(--color4), 0) 50%) no-repeat;
  231. mix-blend-mode: var(--blending);
  232.  
  233. width: var(--circle-size);
  234. height: var(--circle-size);
  235. top: calc(50% - var(--circle-size) / 2);
  236. left: calc(50% - var(--circle-size) / 2);
  237.  
  238. transform-origin: calc(50% - 200px);
  239. animation: moveHorizontal 40s ease infinite;
  240.  
  241. opacity: 0.7;
  242. }
  243.  
  244. .g5 {
  245. position: absolute;
  246. background: radial-gradient(circle at center, rgba(var(--color5), 0.8) 0, rgba(var(--color5), 0) 50%) no-repeat;
  247. mix-blend-mode: var(--blending);
  248.  
  249. width: calc(var(--circle-size) * 2);
  250. height: calc(var(--circle-size) * 2);
  251. top: calc(50% - var(--circle-size));
  252. left: calc(50% - var(--circle-size));
  253.  
  254. transform-origin: calc(50% - 800px) calc(50% + 200px);
  255. animation: moveInCircle 20s ease infinite;
  256.  
  257. opacity: 1;
  258. }
  259.  
  260. .interactive {
  261. position: absolute;
  262. background: radial-gradient(circle at center, rgba(var(--color-interactive), 0.8) 0, rgba(var(--color-interactive), 0) 50%) no-repeat;
  263. mix-blend-mode: var(--blending);
  264.  
  265. width: 100%;
  266. height: 100%;
  267. top: -50%;
  268. left: -50%;
  269.  
  270. opacity: 0.7;
  271. }
  272. }
  273. |||||
  274. <div class="card-container">
  275. <div class="card">
  276. <svg viewBox="0 0 100% 100%" xmlns='http://www.w3.org/2000/svg' class="noise">
  277. <filter id='noiseFilter'>
  278. <feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='6' stitchTiles='stitch' />
  279. </filter>
  280.  
  281. <rect width='100%' height='100%' preserveAspectRatio="xMidYMid meet" filter='url(#noiseFilter)' />
  282. </svg>
  283. <div class="content">
  284. <h1>Welcome to Contoso</h1>
  285. <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsum tempore unde ex pariatur distinctio laboriosam, dolorem quibusdam aperiam expedita consequuntur dolorum porro vitae earum quos voluptates et maxime. Tempora, mollitia.</p>
  286. </div>
  287. </div>
  288. <div class="gradient-bg">
  289. <svg viewBox="0 0 100vw 100vw" xmlns='http://www.w3.org/2000/svg' class="noiseBg">
  290. <filter id='noiseFilterBg'>
  291. <feTurbulence type='fractalNoise' baseFrequency='0.6' stitchTiles='stitch' />
  292. </filter>
  293.  
  294. <rect width='100%' height='100%' preserveAspectRatio="xMidYMid meet" filter='url(#noiseFilterBg)' />
  295. </svg>
  296. <svg xmlns="http://www.w3.org/2000/svg" class="svgBlur">
  297. <defs>
  298. <filter id="goo">
  299. <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
  300. <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -8" result="goo" />
  301. <feBlend in="SourceGraphic" in2="goo" />
  302. </filter>
  303. </defs>
  304. </svg>
  305. <div class="gradients-container">
  306. <div class="g1"></div>
  307. <div class="g2"></div>
  308. <div class="g3"></div>
  309. <div class="g4"></div>
  310. <div class="g5"></div>
  311. <div class="interactive"></div>
  312. </div>
  313. </div>
  314. </div>
  315. |||||
  316. const interBubble = document.querySelector('.interactive');
  317. let curX = 0;
  318. let curY = 0;
  319. let tgX = 0;
  320. let tgY = 0;
  321.  
  322. const move = () => {
  323. curX += (tgX - curX) / 20;
  324. curY += (tgY - curY) / 20;
  325. interBubble.style.transform = `translate(${Math.round(curX) - 120}px, ${Math.round(curY - 130)}px)`;
  326. requestAnimationFrame(move);
  327. };
  328.  
  329. window.addEventListener('mousemove', event => {
  330. tgX = event.clientX;
  331. tgY = event.clientY;
  332. });
  333.  
  334. move();
Advertisement
Add Comment
Please, Sign In to add comment