Guest User

Untitled

a guest
Mar 7th, 2024
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.89 KB | None | 0 0
  1. <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js"></script>
  2. <style>
  3. body, html {
  4. margin:0;
  5. padding:0;
  6. width:100%;
  7. height:100%;
  8. overflow:hidden;
  9. }
  10.  
  11. /* Контейнер для кнопок */
  12. .buttons-container {
  13. display: flex; /* Используем Flexbox для выравнивания кнопок */
  14. position: absolute; /* Позиционируем контейнер абсолютно, чтобы он не занимал место в потоке документа */
  15. top: 20px;
  16. left: 20px;
  17. z-index: 100;
  18. }
  19.  
  20. /* Стили для кнопок */
  21. .toggleWeather {
  22. opacity: 0.15; /* Добавляем полупрозрачность */
  23. background-color: rgba(255, 255, 255, 0.1); /* Добавляем полупрозрачный белый фон */
  24. border: none; /* Убираем границу */
  25. color: white; /* Устанавливаем белый цвет текста */
  26. font-size: large; /* Увеличиваем размер шрифта */
  27. cursor: pointer; /* Устанавливаем курсор в виде указателя */
  28. border-radius: 40%; /* Делаем кнопки круглыми */
  29. width: 30px; /* Устанавливаем ширину кнопки */
  30. height: 30px; /* Устанавливаем высоту кнопки */
  31. filter: grayscale(100%); /* Делаем кнопки черно-белыми */
  32. display: flex; /* Используем Flexbox для выравнивания */
  33. justify-content: center; /* Центрируем содержимое по горизонтали */
  34. align-items: center; /* Центрируем содержимое по вертикали */
  35. text-align: center; /* Центрируем текст */
  36. margin-right: 1px; /* Добавляем отступ справа */
  37. }
  38.  
  39. /* Стили для наведения мыши на кнопки */
  40. .toggleWeather:hover {
  41. opacity: 0.25; /* Убираем полупрозрачность */
  42. background-color: rgba(255, 255, 255, 0.2); /* Делаем фон более непрозрачным при наведении */
  43. filter: none; /* Убираем черно-белый фильтр при наведении */
  44. }
  45.  
  46. /* Убираем отступ справа для последней кнопки */
  47. .toggleWeather:last-child {
  48. margin-right: 0;
  49. }
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. #fireflies-effect, #snow-container, #rain-container, #fog__container, #petals-container, #canvas {
  57. position: absolute;
  58. top:0;
  59. left:0;
  60. width:100%;
  61. height:100%;
  62. visibility: hidden; /* Изначально скрыт */
  63. }
  64.  
  65. /* Стили для снега */
  66. .snowflake {
  67. position: absolute;
  68. top: -10px;
  69. width:5px;
  70. height:5px;
  71. background:white;
  72. border-radius:50%;
  73. }
  74.  
  75. /* Стили для дождя */
  76. .rain__drop {
  77. animation-delay: calc(var(--d) *1s);
  78. animation-duration: calc(var(--s) *2s);
  79. animation-iteration-count: infinite;
  80. animation-name: drop;
  81. animation-timing-function: linear;
  82. height:15px;
  83. left: calc(var(--x) *1%);
  84. position: absolute;
  85. top: calc(var(--s) *-1px);
  86. width:2px;
  87. background-color: #A1C6CC;
  88. opacity: var(--o);
  89. }
  90.  
  91. @keyframes drop {
  92. to {
  93. transform: translateY(100vh);
  94. opacity:0;
  95. }
  96. }
  97.  
  98. /* Стили для сакуры */
  99. .petal {
  100. width:1rem;
  101. height:1rem;
  102. position: absolute;
  103. background-image: url('https://i.ibb.co/dLPvsXQ/q8s1ib.png');
  104. background-size: contain;
  105. background-repeat: no-repeat;
  106. opacity:0;
  107. }
  108.  
  109. @keyframes fall {
  110. to {
  111. transform: translateY(100vh) rotate(720deg);
  112. opacity:1;
  113. }
  114. }
  115. </style>
  116. </head>
  117. <body>
  118.  
  119. <!-- Контейнер для кнопок -->
  120. <div class="buttons-container">
  121. <button class="toggleWeather" onclick="toggleFireflies()">🪰</button>
  122. <button class="toggleWeather" onclick="toggleSnow()">❄️</button>
  123. <button class="toggleWeather" onclick="toggleRain()">🌧️</button>
  124. <button class="toggleWeather" onclick="toggleFog()">🌫️</button>
  125. <button class="toggleWeather" onclick="togglePetals()">🌸</button>
  126. <button class="toggleWeather" onclick="toggleRays()">🌟</button>
  127. <button class="toggleWeather" onclick="toggleLeaves()">🍁</button>
  128. </div>
  129.  
  130.  
  131.  
  132. <canvas id="fireflies-effect"></canvas>
  133. <div id="snow-container"></div>
  134. <div id="rain-container"></div>
  135. <div id="petals-container"></div>
  136. <!-- Контейнер для сакуры -->
  137. <!-- Контейнер для листьев -->
  138. <div id="leaves-container"></div>
  139. <!-- Модуль тумана -->
  140. <section id="fog-container" class="fog">
  141. <div class="fog__container">
  142. <div class="fog__img fog__img--first"></div>
  143. <div class="fog__img fog__img--second"></div>
  144. </div>
  145. </section>
  146. <!-- Канвас для лучей -->
  147. <canvas id="canvas"></canvas>
  148. <style>
  149. /* Стили для тумана */
  150. .fog {
  151. position: fixed;
  152. top:0;
  153. left:0;
  154. width:100%;
  155. height:100%;
  156. overflow:hidden;
  157. z-index:20; /* Убедитесь, что туман отображается поверх других элементов */
  158. visibility: hidden; /* Изначально скрыт */
  159. }
  160.  
  161. .fog__container {
  162. position: absolute;
  163. top:0;
  164. left:0;
  165. width:100%;
  166. height:100%;
  167. overflow:hidden;
  168. }
  169.  
  170. .fog__img {
  171. position: absolute;
  172. top:0;
  173. left:0;
  174. width:300vw; /* Убедитесь, что ширина достаточно велика, чтобы покрыть весь экран */
  175. height:100%; /* Убедитесь, что высота растягивается на всю высоту экрана */
  176. }
  177.  
  178. .fog__img--first {
  179. background: url('https://i.ibb.co/wSwQhRY/download.png') repeat-x;
  180. background-size: contain;
  181. background-position: center;
  182. animation: marquee-1st-layer linear infinite;
  183. animation-duration:60s;
  184. }
  185.  
  186. .fog__img--second {
  187. background: url('https://i.ibb.co/3ryRX0w/download-1.png') repeat-x;
  188. background-size: contain;
  189. background-position: center;
  190. animation: marquee-2nd-layer linear infinite;
  191. animation-duration:40s;
  192. }
  193.  
  194. @keyframes marquee-1st-layer {
  195. to {
  196. transform: translate3d(-200vw,0,0);
  197. }
  198. }
  199.  
  200. @keyframes marquee-2nd-layer {
  201. to {
  202. transform: translate3d(-200vw,0,0);
  203. }
  204. }
  205. </style>
  206.  
  207. <script>
  208. // Функция для переключения тумана
  209. let fogActive = false; // Флаг активности тумана
  210.  
  211. function toggleFog() {
  212. fogActive = !fogActive;
  213. const fogContainer = document.getElementById('fog-container');
  214. fogContainer.style.visibility = fogActive ? 'visible' : 'hidden';
  215. }
  216.  
  217. </script>
  218. <script>
  219. const firefliesCanvas = document.getElementById('fireflies-effect');
  220. const ctx = firefliesCanvas.getContext('2d');
  221. const fireflies = [];
  222. let firefliesAnimationId;
  223. let snowflakesActive = false; // Флаг активности снега
  224. let rainActive = false; // Флаг активности дождя
  225. let petalsActive = false; // Флаг активности сакуры
  226. let raysActive = false; // Флаг активности лучей
  227.  
  228. class Firefly {
  229. constructor() {
  230. this.x = Math.random() * firefliesCanvas.width;
  231. this.y = Math.random() * firefliesCanvas.height;
  232. this.s = Math.random() * 2;
  233. this.ang = Math.random() * 2 * Math.PI;
  234. this.v = this.s * this.s / 4;
  235. }
  236. move() {
  237. this.x += this.v * Math.cos(this.ang);
  238. this.y += this.v * Math.sin(this.ang);
  239. this.ang += Math.random() * 20 * Math.PI / 180 - 10 * Math.PI / 180;
  240. }
  241. show() {
  242. ctx.beginPath();
  243. ctx.arc(this.x, this.y, this.s, 0, 2 * Math.PI);
  244. ctx.fillStyle = "#fddba3";
  245. ctx.fill();
  246. }
  247. }
  248.  
  249. function drawFireflies() {
  250. if (fireflies.length < 100) {
  251. fireflies.push(new Firefly());
  252. }
  253. ctx.clearRect(0, 0, firefliesCanvas.width, firefliesCanvas.height);
  254. fireflies.forEach((firefly, index) => {
  255. firefly.move();
  256. firefly.show();
  257. if (firefly.x < 0 || firefly.x > firefliesCanvas.width || firefly.y < 0 || firefly.y > firefliesCanvas.height) {
  258. fireflies.splice(index, 1);
  259. }
  260. });
  261. }
  262.  
  263. let firefliesActive = false; // Переменная для отслеживания состояния анимации светлячков
  264.  
  265. function loopFireflies() {
  266. drawFireflies();
  267. firefliesAnimationId = requestAnimationFrame(loopFireflies);
  268. }
  269.  
  270. function startFireflies() {
  271. if (!firefliesAnimationId) { // Запускаем анимацию, только если она еще не запущена
  272. firefliesCanvas.style.visibility = 'visible';
  273. loopFireflies();
  274. }
  275. }
  276.  
  277. function stopFireflies() {
  278. if (firefliesAnimationId) { // Останавливаем анимацию, только если она была запущена
  279. cancelAnimationFrame(firefliesAnimationId);
  280. firefliesAnimationId = null; // Сбрасываем ID анимации
  281. firefliesCanvas.style.visibility = 'hidden';
  282. }
  283. }
  284.  
  285. function toggleFireflies() {
  286. firefliesActive = !firefliesActive;
  287. if (firefliesActive) {
  288. startFireflies();
  289. } else {
  290. stopFireflies();
  291. }
  292. }
  293.  
  294.  
  295. </script>
  296. <script>
  297. function toggleSnow() {
  298. snowflakesActive = !snowflakesActive;
  299. const snowContainer = document.getElementById('snow-container');
  300. snowContainer.style.visibility = snowflakesActive ? 'visible' : 'hidden';
  301. if (snowflakesActive) {
  302. startSnow();
  303. } else {
  304. stopSnow();
  305. }
  306. }
  307.  
  308. let rainAnimationId;
  309.  
  310. function createRainDrops() {
  311. const rainContainer = document.getElementById('rain-container');
  312. const droplets = 250;
  313. // Создаем капли дождя
  314. Array.from({ length: droplets }).forEach((_, index) => {
  315. const rainDrop = document.createElement('div');
  316. rainDrop.classList.add('rain__drop');
  317. rainDrop.style.setProperty('--x', Math.floor(Math.random() * 100));
  318. rainDrop.style.setProperty('--d', (Math.random() * 2) - 1);
  319. rainDrop.style.setProperty('--s', Math.random() + 0.5);
  320. rainDrop.style.setProperty('--o', Math.random());
  321. rainContainer.appendChild(rainDrop);
  322. });
  323. }
  324.  
  325. function animateRain() {
  326. // Здесь может быть ваш код для анимации капель дождя, если он требуется
  327. // Если анимация дождя полностью на CSS, этот шаг не нужен
  328. rainAnimationId = requestAnimationFrame(animateRain);
  329. }
  330.  
  331. function startRain() {
  332. if (!rainAnimationId) {
  333. createRainDrops();
  334. animateRain();
  335. }
  336. }
  337.  
  338. function stopRain() {
  339. if (rainAnimationId) {
  340. cancelAnimationFrame(rainAnimationId);
  341. rainAnimationId = null;
  342. const rainContainer = document.getElementById('rain-container');
  343. rainContainer.innerHTML = '';
  344. }
  345. }
  346. function toggleRain() {
  347. rainActive = !rainActive;
  348. const rainContainer = document.getElementById('rain-container');
  349. rainContainer.style.visibility = rainActive ? 'visible' : 'hidden';
  350. if (rainActive) {
  351. startRain();
  352. } else {
  353. stopRain();
  354. }
  355. }
  356.  
  357. function togglePetals() {
  358. petalsActive = !petalsActive;
  359. const petalsContainer = document.getElementById('petals-container');
  360. petalsContainer.style.visibility = petalsActive ? 'visible' : 'hidden';
  361. if (petalsActive) {
  362. startPetals();
  363. } else {
  364. stopPetals();
  365. }
  366. }
  367.  
  368. </script>
  369. <script>
  370. // Создаем снежинки
  371. let snowAnimationId;
  372.  
  373. function createSnowflakes() {
  374. const snowContainer = document.getElementById('snow-container');
  375. const total = 200;
  376. // Создаем снежинки
  377. Array.from({ length: total }).forEach((_, index) => {
  378. const snowflake = document.createElement('div');
  379. snowflake.classList.add('snowflake');
  380. snowContainer.appendChild(snowflake);
  381.  
  382. // Стили и анимация для снежинки
  383. const randomX = Math.random() * 100;
  384. const randomOffset = (Math.random() * 200 - 100);
  385. const randomXEnd = randomX + randomOffset;
  386. const randomScale = Math.random();
  387. const fallDuration = (Math.random() * 20 + 10) + 's';
  388. const fallDelay = (Math.random() * -30) + 's';
  389.  
  390. snowflake.style.opacity = Math.random();
  391. snowflake.style.transform = `translate(${randomX}vw, -10px) scale(${randomScale})`;
  392. snowflake.style.animation = `fall-${index} ${fallDuration} ${fallDelay} linear infinite`;
  393.  
  394. const keyframes = `
  395. @keyframes fall-${index} {
  396. to {
  397. transform: translate(${randomXEnd}vw, ${window.innerHeight}px) scale(${randomScale});
  398. }
  399. }
  400. `;
  401. const styleSheet = document.createElement('style');
  402. styleSheet.type = 'text/css';
  403. styleSheet.innerText = keyframes;
  404. document.head.appendChild(styleSheet);
  405. });
  406. }
  407.  
  408. function animateSnow() {
  409. // Здесь может быть ваш код для анимации снежинок, если он требуется
  410. // Если анимация снежинок полностью на CSS, этот шаг не нужен
  411. snowAnimationId = requestAnimationFrame(animateSnow);
  412. }
  413.  
  414. function startSnow() {
  415. if (!snowAnimationId) {
  416. createSnowflakes();
  417. animateSnow();
  418. }
  419. }
  420.  
  421. function stopSnow() {
  422. if (snowAnimationId) {
  423. cancelAnimationFrame(snowAnimationId);
  424. snowAnimationId = null;
  425. document.querySelectorAll('.snowflake').forEach(el => el.remove());
  426. }
  427. }
  428.  
  429. // Функции для сакуры
  430. let petalsAnimationId;
  431.  
  432. function createPetals() {
  433. const petalsContainer = document.getElementById('petals-container');
  434. const totalPetals = Math.floor(Math.random() * (50 - 20) + 20);
  435. for (let i = 0; i < totalPetals; i++) {
  436. const petal = document.createElement('div');
  437. petal.classList.add('petal');
  438. petal.style.top = '-10rem';
  439. petal.style.left = `${Math.random() * window.innerWidth}px`;
  440. petal.style.animation = `fall ${Math.random() * (30 - 10) + 10}s linear infinite`;
  441. petal.style.animationDelay = `${Math.random() * -20}s`;
  442. petalsContainer.appendChild(petal);
  443. }
  444. }
  445.  
  446. function animatePetals() {
  447. // Здесь может быть ваш код для анимации лепестков, если он требуется
  448. // Если анимация лепестков полностью на CSS, этот шаг не нужен
  449. petalsAnimationId = requestAnimationFrame(animatePetals);
  450. }
  451.  
  452. function startPetals() {
  453. if (!petalsAnimationId) {
  454. createPetals();
  455. animatePetals();
  456. }
  457. }
  458.  
  459. function stopPetals() {
  460. if (petalsAnimationId) {
  461. cancelAnimationFrame(petalsAnimationId);
  462. petalsAnimationId = null;
  463. clearPetals();
  464. }
  465. }
  466.  
  467. function togglePetals() {
  468. petalsActive = !petalsActive;
  469. const petalsContainer = document.getElementById('petals-container');
  470. petalsContainer.style.visibility = petalsActive ? 'visible' : 'hidden';
  471. if (petalsActive) {
  472. startPetals();
  473. } else {
  474. stopPetals();
  475. }
  476. }
  477.  
  478. </script>
  479. <script>
  480. function resizeCanvas() {
  481. firefliesCanvas.width = window.innerWidth;
  482. firefliesCanvas.height = window.innerHeight;
  483. // Перезапускаем анимацию светлячков при изменении размера окна, чтобы обновить позиции
  484. if (firefliesActive) {
  485. stopFireflies();
  486. startFireflies();
  487. }
  488. }
  489.  
  490. window.addEventListener('resize', resizeCanvas);
  491. resizeCanvas();
  492.  
  493. // Функции для управления анимацией лучей
  494. function startRays() {
  495. // Здесь должен быть код для запуска анимации лучей
  496. }
  497.  
  498. function stopRays() {
  499. // Здесь должен быть код для остановки анимации лучей
  500. }
  501.  
  502. function toggleRays() {
  503. raysActive = !raysActive;
  504. const raysCanvas = document.getElementById('canvas');
  505. raysCanvas.style.visibility = raysActive ? 'visible' : 'hidden';
  506. if (raysActive) {
  507. startRays();
  508. } else {
  509. stopRays();
  510. }
  511. }
  512. </script>
  513. <script>
  514. (function(window, document, undefined) {
  515. var canvas = document.getElementById('canvas'),
  516. ctx = canvas.getContext('2d'),
  517. osCanvas = document.createElement('canvas'),
  518. osCtx = osCanvas.getContext('2d'),
  519. objects = [],
  520. numRays = 30,
  521. numParticles = 0,
  522. raysAnimationId; // Добавляем переменную для хранения ID анимационного кадра
  523.  
  524.  
  525. class Ray {
  526. constructor() {
  527. this.ctx = osCtx;
  528. this.angle = 85 * Math.PI / 180;
  529. this.init();
  530. }
  531. init() {
  532. this.velocity = 0.25 - Math.random() * 0.5;
  533. this.len = canvas.height / 2 + Math.random() * (canvas.height / 2);
  534. this.start = {
  535. x: Math.random() * (canvas.width + 100) - 50,
  536. y: 0
  537. };
  538. this.end = {
  539. x: this.start.x + this.len * Math.cos(this.angle),
  540. y: this.start.y + this.len * Math.sin(this.angle)
  541. };
  542. this.ttl = 100 + Math.random() * 200;
  543. this.life = 0;
  544. this.width = 0.5 + Math.random() * 4;
  545. this.hue = Math.round(45 + Math.random() * 15).toString();
  546. this.saturation = Math.round(20 + Math.random() * 40).toString();
  547. }
  548. color() {
  549. var alpha = wave(this.life, this.ttl) * 0.005,
  550. color1 = `hsla(${this.hue},${this.saturation}%,60%,${alpha})`,
  551. color2 = 'hsla(50,20%,20%,0)',
  552. gradient = ctx.createLinearGradient(this.start.x, this.start.y, this.end.x, this.end.y);
  553. gradient.addColorStop(0, color1);
  554. gradient.addColorStop(1, color2);
  555. return gradient;
  556. }
  557. draw() {
  558. this.ctx.beginPath();
  559. this.ctx.strokeStyle = this.color();
  560. this.ctx.lineWidth = this.width;
  561. this.ctx.moveTo(this.start.x, this.start.y);
  562. this.ctx.lineTo(this.end.x, this.end.y);
  563. this.ctx.stroke();
  564. this.ctx.closePath();
  565. }
  566. update() {
  567. if (this.life > this.ttl) {
  568. this.init();
  569. }
  570. this.life++;
  571. this.start.x += this.velocity;
  572. this.end.x += this.velocity;
  573. }
  574. }
  575.  
  576. function wave(t, a) {
  577. return Math.abs((t + a / 2) % a - a / 2);
  578. }
  579.  
  580. function createObjects() {
  581. objects = [];
  582. for (var i = 0; i < numRays; i++) {
  583. var ray = new Ray();
  584. objects.push(ray);
  585. }
  586. }
  587.  
  588. function render() {
  589. osCtx.clearRect(0, 0, canvas.width, canvas.height);
  590. osCtx.shadowBlur = 30;
  591. osCtx.shadowColor = "white";
  592. osCtx.globalCompositeOperation = "lighter";
  593. for (var i = 0, len = objects.length; i < len; i++) {
  594. var obj = objects[i];
  595. obj.update();
  596. obj.draw();
  597. }
  598. ctx.clearRect(0, 0, canvas.width, canvas.height);
  599. ctx.drawImage(osCanvas, 0, 0);
  600. }
  601.  
  602. function loop() {
  603. render();
  604. raysAnimationId = window.requestAnimationFrame(loop); // Обновляем ID анимационного кадра
  605. }
  606.  
  607. function onResize() {
  608. canvas.width = window.innerWidth;
  609. canvas.height = window.innerHeight;
  610. osCanvas.width = window.innerWidth;
  611. osCanvas.height = window.innerHeight;
  612. }
  613.  
  614. window.addEventListener('resize', onResize);
  615. onResize();
  616. createObjects();
  617. // loop(); // Убираем вызов loop из самовызывающейся функции
  618.  
  619. window.startRays = function() {
  620. if (!raysAnimationId) { // Запускаем анимацию, только если она еще не запущена
  621. document.getElementById('canvas').style.visibility = 'visible';
  622. loop();
  623. }
  624. };
  625.  
  626. window.stopRays = function() {
  627. if (raysAnimationId) { // Останавливаем анимацию, только если она была запущена
  628. window.cancelAnimationFrame(raysAnimationId);
  629. raysAnimationId = null; // Сбрасываем ID анимации
  630. document.getElementById('canvas').style.visibility = 'hidden';
  631. }
  632. };
  633. })(this, document);
  634.  
  635. </script>
  636. <script>
  637. // Функции для осенних листьев
  638. let leavesActive = false; // Флаг активности падения листьев
  639. let leavesAnimationId;
  640.  
  641. function createLeaves() {
  642. const leavesContainer = document.getElementById('leaves-container');
  643. const totalLeaves = 30; // Количество листьев
  644. for (let i = 0; i < totalLeaves; i++) {
  645. const leaf = document.createElement('div');
  646. leaf.classList.add('leaf');
  647. leaf.style.top = '-10rem';
  648. leaf.style.left = `${Math.random() * window.innerWidth}px`;
  649. leaf.style.animation = `fall ${Math.random() * (30 - 10) + 10}s linear infinite`;
  650. leaf.style.animationDelay = `${Math.random() * -20}s`;
  651. leavesContainer.appendChild(leaf);
  652. }
  653. }
  654.  
  655. function animateLeaves() {
  656. // Здесь может быть ваш код для анимации листьев, если он требуется
  657. // Если анимация листьев полностью на CSS, этот шаг не нужен
  658. leavesAnimationId = requestAnimationFrame(animateLeaves);
  659. }
  660.  
  661. function startLeaves() {
  662. if (!leavesAnimationId) {
  663. createLeaves();
  664. animateLeaves();
  665. }
  666. }
  667.  
  668. function stopLeaves() {
  669. if (leavesAnimationId) {
  670. cancelAnimationFrame(leavesAnimationId);
  671. leavesAnimationId = null;
  672. clearLeaves();
  673. }
  674. }
  675.  
  676. function toggleLeaves() {
  677. leavesActive = !leavesActive;
  678. const leavesContainer = document.getElementById('leaves-container');
  679. leavesContainer.style.visibility = leavesActive ? 'visible' : 'hidden';
  680. if (leavesActive) {
  681. startLeaves();
  682. } else {
  683. stopLeaves();
  684. }
  685. }
  686.  
  687. function clearLeaves() {
  688. const leavesContainer = document.getElementById('leaves-container');
  689. leavesContainer.innerHTML = '';
  690. }
  691.  
  692. // Добавляем стили для анимации падения листьев
  693. const leavesStyles = `
  694. @keyframes fall {
  695. to {
  696. transform: translateY(100vh) rotate(720deg);
  697. opacity: 1;
  698. }
  699. }
  700. .leaf {
  701. width: 35px;
  702. height: 35px;
  703. position: absolute;
  704. background: url('https://i.ibb.co/L00m47b/zyjs9l.png');
  705. background-size: 100% 100%;
  706. opacity: 0;
  707. }
  708. `;
  709. const leavesStyleSheet = document.createElement('style');
  710. leavesStyleSheet.type = 'text/css';
  711. leavesStyleSheet.innerText = leavesStyles;
  712. document.head.appendChild(leavesStyleSheet);
  713. </script>
Advertisement
Add Comment
Please, Sign In to add comment