Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <svg width="1121" height="782" viewBox="0 0 1121 782" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_f_13_70)">
<path class="class1" d="M829.274 351.307C833.288 350.185 836.75 348.784 841.306 348.024C841.561 347.822 844.442 347.662 845.182 347.662C847.369 347.662 847.667 346.066 850.071 346.031C857.373 345.923 864.836 346.087 872.034 346.584C880.077 347.14 887.962 349.056 896.124 349.112C901.817 349.151 907.33 349.468 912.995 349.615C919.801 349.792 926.575 349.791 933.388 349.847C940.948 349.91 948.81 349.978 956.237 350.582C963.409 351.165 970.294 352.36 976.883 353.603C985.646 355.256 995.271 357.533 1000.44 360.924C1008.21 366.018 1014.47 372.013 1015.24 377.983C1015.87 382.946 1015.21 387.882 1014.12 392.826C1013.11 397.424 1012.55 402.389 1007.58 406.652C1001.67 411.73 990.461 415.659 977.845 418.011C966.641 420.099 955.304 419.997 943.242 419.793C931.313 419.591 918.86 418.642 907.676 416.953C898.61 415.584 890.556 413.279 882.395 411.244C872.515 408.78 862.164 406.46 852.908 403.631C844.911 401.187 837.574 398.199 831.199 395.101C823.793 391.503 818.383 387.475 812.913 383.402L812.681 383.229C806.796 378.847 804.833 374.385 806.221 369.463C806.986 366.753 807.814 364.104 810.756 361.619C812.761 359.925 813.827 358.08 815.873 356.403C818.409 354.323 824.665 352.596 829.274 351.307Z" fill="#97C9EB"/>
<path class="class2" d="M347.413 398.9C345.236 399.204 343.808 399.446 341.371 399.446C342.759 399.446 348.081 397.738 348.169 398.163C348.203 398.325 347.909 398.598 347.501 398.887C353.315 398.076 359.295 397.349 365.29 396.654C373.184 395.738 380.454 394.577 388.202 393.599C396.653 392.533 406.162 391.863 415.185 391.318C449.191 389.261 483.117 388.089 517.787 387.372C538.822 386.938 559.986 386.972 581.069 387.04C599.637 387.099 617.468 388.278 635.328 389.63C648.994 390.665 664.095 391.652 675.32 394.241C684.725 396.41 691.081 399.915 696.386 402.94C707.916 409.517 717.086 418.069 702.428 424.806C689.488 430.754 678.324 437.085 654.841 440.112C641.631 441.816 626.381 442.362 612.164 442.965C595.126 443.687 578.041 443.794 560.842 443.891C521.694 444.114 482.513 444.042 443.469 443.178C417.443 442.603 387.8 441.709 364.87 437.831C351.351 435.544 343.447 432.511 337.258 428.395C330.068 423.613 326.48 418.853 327.061 413.671C327.6 408.866 337.407 404.003 345.735 399.922C346.178 399.704 346.945 399.281 347.501 398.887C347.472 398.891 347.443 398.895 347.413 398.9Z" fill="#BADDF5"/>
<path class="class3" d="M313.555 509.306C306.954 517.092 299.092 525.405 298 534.463C305.238 539.083 310.73 541.832 316.025 547.747C322.165 554.606 325.085 562.4 329.267 569.852C336.009 581.865 343.617 593.057 352.757 604.402C361.028 614.666 369.325 624.937 380.504 634.088C386.339 638.864 395.39 641.991 403.521 644.922C414.281 648.801 425.802 651.779 438.204 652.537C452.151 653.389 466.511 652.805 480.507 652.805C497.656 652.805 514.805 652.84 531.954 652.805C571.5 652.724 611.101 652.112 650.612 651.128C678.492 650.434 710.733 648.174 731.54 634.893C745.068 626.257 755.157 612.814 755.765 600.578C756.008 595.691 756.639 590.352 753.821 585.718C750.214 579.786 746.222 573.759 742.05 567.973C737.415 561.547 730.124 556.138 724.603 550.028C716.013 540.52 707.466 531.156 698.223 521.884C686.66 510.287 673.992 499.412 655.605 491.897C634.625 483.322 610.757 476.59 586.606 472.676C554.377 467.454 520.491 467.935 487.496 468.081C456.174 468.219 423.472 467.548 392.801 472.274C381.363 474.036 371.705 477.363 361.376 480.794C354.486 483.082 347.12 484.914 340.513 487.536C328.174 492.434 320.313 501.335 313.555 509.306Z" fill="#ACAFE2"/>
<path class="class4" d="M583.196 143.529C577.172 151.357 569.996 159.715 569 168.823C575.606 173.468 580.618 176.231 585.451 182.178C591.055 189.074 593.72 196.91 597.537 204.402C603.689 216.48 610.633 227.733 618.975 239.139C626.523 249.459 634.096 259.785 644.298 268.985C649.624 273.788 657.885 276.932 665.305 279.879C675.125 283.778 685.64 286.772 696.959 287.534C709.688 288.391 722.794 287.804 735.568 287.804C751.219 287.804 766.87 287.839 782.521 287.804C818.614 287.723 854.756 287.107 890.816 286.118C916.261 285.42 945.686 283.148 964.676 269.795C977.023 261.113 986.23 247.597 986.786 235.294C987.008 230.381 987.583 225.013 985.011 220.354C981.719 214.39 978.076 208.33 974.268 202.514C970.038 196.052 963.384 190.614 958.345 184.471C950.505 174.912 942.705 165.497 934.269 156.176C923.716 144.515 912.154 133.581 895.373 126.026C876.226 117.405 854.442 110.636 832.4 106.701C802.986 101.451 772.059 101.935 741.946 102.081C713.359 102.22 683.514 101.545 655.521 106.297C645.082 108.068 636.267 111.414 626.841 114.863C620.553 117.163 613.83 119.005 607.8 121.641C596.538 126.566 589.364 135.515 583.196 143.529Z" fill="#ACAFE2"/>
<path class="class5" d="M782.434 567.797C787.632 569.372 789.922 571.676 796.493 571.676C800.833 571.676 806.525 573.352 810.341 574.315C814.86 575.457 822.202 574.824 827.337 574.824C857.137 574.824 886.894 574.55 916.687 574.252C936.391 574.055 956.165 573.318 975.823 572.694C987.327 572.329 996.776 570.409 1006.04 567.368C1020.71 562.55 1020.48 554.667 1023.07 547.225C1024.82 542.197 1025.05 537.138 1024.99 532.058C1024.93 526.706 1021.84 521.573 1021.01 516.255C1019.74 508.166 1021.46 499.927 1017.02 491.994C1014.51 487.516 1010.84 483.179 1007.65 478.798C1004.86 474.981 1002.5 471.088 999.393 467.32C992.134 458.51 981.827 449.959 971.766 441.755C963.185 434.757 955.258 428.067 941.412 422.931C932.095 419.476 920.723 416.012 908.924 414.648C899.69 413.581 889.756 414.13 880.353 414.219C868.368 414.333 856.385 414.406 844.403 414.569C819.081 414.913 792.975 414.73 768.621 418.321C754.258 420.439 739.957 422.705 726.761 426.079C715.603 428.933 707.05 432.205 701.232 437.494C696.209 442.061 690.608 446.661 686.719 451.453C677.91 462.311 674.165 473.298 676.858 484.824C678.093 490.114 677.72 495.488 680.32 500.706C683.241 506.57 687.25 512.587 692.769 518.051C699.795 525.006 708.037 532.069 717.459 538.417C727.534 545.205 740.244 551.352 753.199 557.002C762.375 561.004 771.859 564.592 782.434 567.797Z" fill="#FFC8E8"/>
<path class="class6" d="M917.072 455.231C939.285 466.872 982.967 471.931 1016.32 476.999C1010.83 475.041 1012 474.322 1016.32 472.119C1024.27 468.061 1029.73 462.956 1037.57 458.901C1043.57 455.802 1047.22 451.461 1049.44 447.547C1051.79 443.403 1055.13 439.302 1056.2 435.04C1057.46 430.02 1056.86 424.877 1056.86 419.835C1056.86 414.811 1057.08 409.776 1056.8 404.754C1056.57 400.552 1054.5 396.39 1053.4 392.222C1051.75 385.989 1048 380.334 1043.56 374.394C1038.11 367.089 1033.87 359.616 1028.35 352.323C1018.61 339.485 1005.1 327.473 990.057 315.734L989.745 315.491C978.096 306.402 966.474 297.333 952.482 288.906C940.494 281.685 926.689 274.068 908.645 269.729C893.415 266.066 877.156 265.978 860.304 266.001C833.33 266.038 800.719 267.941 784.715 278.999C777.439 284.026 776.148 289.076 776.036 294.939C775.914 301.289 776.051 307.637 777.244 313.969C780.061 328.914 785.417 344.126 799.218 357.914C806.683 365.373 815.676 372.552 823.938 379.838C832.645 387.516 821.214 400.768 831.706 408C856.291 424.945 887.833 439.909 917.072 455.231Z" fill="#B2D1EF"/>
<path class="class7" d="M328.139 290.38C328.695 289.078 331.055 288.069 332.7 287.276C341.221 283.17 352.328 280.284 362.615 278.181C382.162 274.186 401.649 272.25 422.196 271.464C445.302 270.579 467.587 270.653 490.012 274.436C510.5 277.892 530.198 284.65 547.708 291.794C562.929 298.004 573.315 306.549 582.534 315.959C587.667 321.198 591.754 326.745 596.326 332.158C601.851 338.699 609.467 344.891 611.606 352.251C613.545 358.925 612.895 365.928 612.895 372.671C612.895 380.416 612.221 387.719 607.29 394.993C597.959 408.753 578.854 418.814 556.638 424.775C526.843 432.77 492.862 440.276 459.899 440.944C436.375 441.421 411.164 438.895 393.621 428.817C372.455 416.659 358.629 400.369 347.682 384.292C329.75 357.955 320 330.703 320 302.316C320 298.216 323.569 293.919 328.139 290.38Z" fill="#C6A2E1"/>
<path class="class8" d="M519.747 272.703C519.747 264.258 516.674 256.532 522.994 248.681C522.994 246.731 517.809 237.554 520.919 237.057C524.873 236.424 529.225 236.702 533.27 236.577C541.286 236.329 549.274 236.288 557.295 236.15C580.065 235.76 602.692 235.244 625.495 235.244C659.241 235.244 693.187 234.628 726.915 235.35C744.437 235.725 762.297 235.059 779.744 236.017C792.016 236.69 803.353 239.354 814.587 242.202C831.222 246.419 838.377 253.549 846.726 262.492C855.629 272.027 858.897 281.974 858.897 292.807C858.897 299.436 859.223 306.1 858.716 312.723C858.093 320.882 855.231 327.997 852.226 335.919C848.424 345.94 843.055 355.664 838.207 365.513C836.738 368.497 835.545 372.006 832.122 374.472C827.592 377.735 819.102 379.591 812.919 381.377C791.82 387.472 768.837 392.398 745.667 394.842C726.335 396.881 706.21 395.719 686.707 395.161C665.036 394.542 638.832 393.013 621.213 384.737C609.753 379.354 600.35 373.204 591.327 366.367C579.254 357.217 567.454 348.756 557.475 338.665C545.892 326.952 536.541 315.047 529.483 302.165C526.634 296.964 524.517 291.815 523.353 286.408C522.361 281.797 519.747 277.377 519.747 272.703Z" fill="#FBFCEB"/>
<path class="class9" d="M589.801 368.814C590.066 367.106 592.122 365.475 593.536 364.228C600.862 357.766 610.919 352.411 620.352 348.16C638.276 340.083 656.567 334.579 676.111 330.334C698.089 325.561 719.478 322.111 741.766 323.252C762.128 324.294 782.412 329.569 800.68 335.673C816.558 340.978 828.281 349.955 839.062 360.195C845.065 365.896 850.128 372.146 855.629 378.152C862.276 385.41 870.857 391.902 874.426 400.716C877.662 408.71 878.482 417.523 879.872 425.91C881.469 435.544 882.328 444.736 879.097 454.567C872.985 473.166 856.735 488.717 836.657 499.663C809.729 514.343 778.686 529.081 747.209 535.152C724.745 539.484 700.045 540.349 681.142 530.602C658.336 518.844 641.717 500.779 627.904 482.521C605.277 452.612 590.307 420.263 584.456 384.954C583.611 379.854 586.148 373.942 589.801 368.814Z" fill="#F6DDB9"/>
<path class="class10" d="M104.784 204.25C104.997 202.812 106.683 201.446 107.842 200.4C113.848 194.983 122.105 190.507 129.851 186.958C144.571 180.216 159.602 175.641 175.667 172.132C193.734 168.185 211.32 165.35 229.66 166.384C246.416 167.329 263.122 171.838 278.171 177.037C291.252 181.557 300.926 189.155 309.831 197.813C314.788 202.633 318.974 207.913 323.52 212.989C329.013 219.123 336.094 224.617 339.058 232.051C341.747 238.793 342.451 246.217 343.622 253.284C344.968 261.402 345.705 269.145 343.079 277.412C338.112 293.053 324.794 306.095 308.311 315.246C286.205 327.519 260.713 339.827 234.836 344.835C216.369 348.41 196.05 349.056 180.466 340.787C161.664 330.81 147.932 315.544 136.508 300.124C117.793 274.864 105.37 247.575 100.44 217.823C99.7275 213.526 101.796 208.556 104.784 204.25Z" fill="#F6DDB9"/>
<path class="class11" d="M443.279 254.091C443.704 252.853 445.983 251.666 447.561 250.758C455.74 246.054 466.66 242.144 476.834 239.035C496.166 233.128 515.655 229.083 536.336 225.946C559.592 222.419 582.12 219.852 605.18 220.606C626.248 221.296 646.864 225.051 665.312 229.412C681.346 233.203 692.742 239.666 703.049 247.047C708.787 251.156 713.501 255.667 718.691 259.999C724.963 265.234 733.311 269.907 736.247 276.279C738.91 282.058 738.991 288.438 739.701 294.507C740.516 301.479 740.604 308.133 736.386 315.263C728.406 328.752 710.158 340.066 688.336 348.058C659.069 358.776 625.52 369.549 592.28 374.046C568.557 377.256 542.815 377.961 524.026 370.964C501.357 362.522 485.67 349.493 472.915 336.315C452.022 314.727 439.299 291.349 436.311 265.797C435.879 262.106 439.034 257.816 443.279 254.091Z" fill="#74EEF3"/>
<path class="class12" d="M476.194 374.996C476.686 374.123 478.773 373.446 480.226 372.914C487.758 370.161 497.576 368.225 506.67 366.815C523.948 364.136 541.174 362.838 559.337 362.311C579.762 361.717 599.461 361.767 619.284 364.304C637.394 366.621 654.806 371.153 670.285 375.944C683.739 380.108 692.92 385.838 701.07 392.149C705.606 395.662 709.219 399.382 713.261 403.012C718.145 407.398 724.877 411.55 726.767 416.486C728.482 420.961 727.908 425.657 727.908 430.179C727.908 435.373 727.312 440.27 722.952 445.148C714.705 454.375 697.816 461.122 678.178 465.119C651.841 470.481 621.803 475.514 592.665 475.962C571.87 476.282 549.585 474.588 534.078 467.83C515.368 459.677 503.146 448.753 493.47 437.972C477.619 420.311 469 402.036 469 383C469 380.25 472.155 377.369 476.194 374.996Z" fill="#BA55A7"/>
<path class="class13" d="M779.194 572.996C779.686 572.123 781.773 571.446 783.226 570.914C790.758 568.161 800.576 566.225 809.67 564.815C826.948 562.136 844.174 560.838 862.337 560.311C882.762 559.717 902.461 559.767 922.284 562.304C940.394 564.621 957.806 569.153 973.285 573.944C986.739 578.108 995.92 583.838 1004.07 590.149C1008.61 593.662 1012.22 597.382 1016.26 601.012C1021.14 605.398 1027.88 609.55 1029.77 614.486C1031.48 618.961 1030.91 623.657 1030.91 628.179C1030.91 633.373 1030.31 638.27 1025.95 643.148C1017.7 652.375 1000.82 659.122 981.178 663.119C954.841 668.481 924.803 673.514 895.665 673.962C874.87 674.282 852.585 672.588 837.078 665.83C818.368 657.677 806.146 646.753 796.47 635.972C780.619 618.311 772 600.036 772 581C772 578.25 775.155 575.369 779.194 572.996Z" fill="#BA55A7"/>
<path class="class14" d="M654.476 292.3C654.673 291.181 656.638 289.687 657.985 288.582C664.962 282.854 674.671 277.162 683.806 272.302C701.164 263.065 718.979 255.331 738.076 248.079C759.552 239.923 780.496 232.725 802.496 228.15C822.596 223.971 842.777 222.424 861.001 221.868C876.842 221.384 888.725 224.153 899.729 227.925C905.855 230.025 911.076 232.688 916.719 235.095C923.538 238.005 932.234 239.983 936.078 244.583C939.563 248.755 940.7 254.006 942.381 258.859C944.313 264.433 945.502 269.908 942.685 276.747C937.356 289.686 921.925 303.144 902.552 314.663C876.569 330.112 846.533 346.572 815.748 357.779C793.777 365.777 769.475 372.163 750.489 370.619C727.582 368.757 710.537 361.533 696.249 353.525C672.842 340.406 656.89 323.967 649.811 303.538C648.788 300.587 651.068 296.333 654.476 292.3Z" fill="#E193AC"/>
<path class="class15" d="M515.25 548.313C515.793 547.187 517.948 546.378 519.453 545.737C527.249 542.412 537.33 540.246 546.649 538.742C564.356 535.883 581.942 534.835 600.442 534.831C621.248 534.827 641.283 535.639 661.323 539.716C679.632 543.441 697.122 550.042 712.633 556.91C726.116 562.879 735.175 570.739 743.156 579.322C747.6 584.1 751.093 589.114 755.027 594.026C759.78 599.962 766.426 605.661 768.108 612.204C769.633 618.137 768.82 624.272 768.599 630.2C768.345 637.01 767.5 643.409 762.827 649.638C753.987 661.424 736.478 669.63 716.308 674.127C689.255 680.158 658.455 685.62 628.794 685.103C607.626 684.735 585.04 681.669 569.596 672.221C550.962 660.823 539.063 646.038 529.747 631.536C514.486 607.78 506.611 583.492 507.541 558.534C507.675 554.929 511.025 551.271 515.25 548.313Z" fill="#E193AC"/>
<path class="class16" d="M74.5193 560.826C75.1997 559.541 77.9189 558.626 79.8166 557.899C89.6493 554.132 102.374 551.701 114.137 550.022C136.49 546.833 158.699 545.712 182.067 545.791C208.347 545.879 233.658 546.897 258.989 551.648C282.132 555.989 304.253 563.615 323.876 571.537C340.933 578.423 352.411 587.452 362.531 597.301C368.164 602.784 372.599 608.533 377.59 614.168C383.621 620.976 392.04 627.523 394.194 635.011C396.147 641.802 395.147 648.813 394.895 655.591C394.605 663.377 393.565 670.69 387.691 677.792C376.578 691.229 354.499 700.534 329.041 705.586C294.898 712.362 256.017 718.469 218.549 717.746C191.81 717.23 163.267 713.624 143.717 702.752C120.131 689.635 105.035 672.676 93.2026 656.052C73.8198 628.82 63.7647 601.014 64.8275 572.48C64.981 568.358 69.1963 564.19 74.5193 560.826Z" fill="#E193AC"/>
<path class="class17" d="M275.579 134.142C275.713 132.597 277.764 130.791 279.165 129.44C286.419 122.436 296.685 115.901 306.379 110.448C324.802 100.087 343.84 91.9111 364.325 84.6095C387.361 76.3984 409.884 69.4546 433.765 66.3673C455.583 63.5467 477.687 64.4476 497.71 66.4442C515.114 68.1797 528.405 73.8936 540.801 80.8861C547.702 84.7789 553.649 89.3253 560.042 93.5778C567.767 98.7166 577.488 102.829 582.063 109.896C586.212 116.304 587.855 123.874 590.069 130.966C592.611 139.112 594.328 147.005 591.736 156.209C586.834 173.621 570.848 190.223 550.377 203.492C522.922 221.289 491.081 239.891 458.022 250.98C434.429 258.894 408.148 264.18 387.129 259.109C361.771 252.991 342.465 240.215 326.136 226.755C299.388 204.706 280.598 179.115 271.28 149.26C269.934 144.947 272.127 139.303 275.579 134.142Z" fill="#E193AC"/>
<path class="class18" d="M801.698 362.135C801.847 360.532 803.364 359.058 804.404 357.926C809.789 352.059 817.291 347.319 824.351 343.602C837.765 336.538 851.539 331.911 866.307 328.51C882.914 324.686 899.113 322.092 916.137 323.853C931.691 325.462 947.316 331.059 961.429 337.375C973.696 342.866 982.908 351.69 991.442 361.676C996.193 367.235 1000.24 373.284 1004.62 379.116C1009.91 386.163 1016.65 392.547 1019.65 400.967C1022.36 408.603 1023.25 416.938 1024.57 424.888C1026.09 434.02 1027.02 442.713 1024.86 451.882C1020.78 469.229 1008.87 483.391 993.899 493.093C973.824 506.105 950.613 519.046 926.805 523.801C909.814 527.194 891.012 527.25 876.303 517.479C858.556 505.691 845.332 488.149 834.241 470.51C816.072 441.616 803.666 410.657 798.119 377.187C797.318 372.353 799.071 366.857 801.698 362.135Z" fill="#74DCE9"/>
<path class="class19" d="M101.167 383.358C101.356 381.353 103.264 379.507 104.571 378.089C111.345 370.743 120.778 364.806 129.653 360.148C146.518 351.297 163.833 345.495 182.395 341.226C203.269 336.426 223.629 333.164 245.023 335.352C264.568 337.351 284.199 344.339 301.929 352.229C317.34 359.086 328.909 370.119 339.625 382.605C345.59 389.556 350.676 397.121 356.173 404.414C362.815 413.227 371.281 421.208 375.032 431.74C378.434 441.292 379.553 451.719 381.201 461.666C383.094 473.09 384.264 483.966 381.541 495.44C376.388 517.149 361.409 534.88 342.588 547.033C317.347 563.333 288.165 579.546 258.241 585.518C236.885 589.78 213.255 589.867 194.779 577.656C172.488 562.924 155.885 540.987 141.963 518.928C119.157 482.792 103.595 444.067 96.6558 402.195C95.6534 396.147 97.8611 389.269 101.167 383.358Z" fill="#74DCE9"/>
</g>
<defs>
<filter id="filter0_f_13_70" x="0.751953" y="0.581055" width="1120.25" height="781.224" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="32" result="effect1_foregroundBlur_13_70"/>
</filter>
</defs>
</svg>

              
            
!

CSS

              
                path{
  position:relative
}
svg{
  width:100%;
  scale:2
}
body{
  overflow:hidden;
  background:tomato
}
              
            
!

JS

              
                function animateDivsInCircle() {
    // Step 1: Get all elements by class name and their initial positions
    let elements = [];
    let initialPositions = [];

    for (let i = 1; i <= 19; i++) {
        let el = document.getElementsByClassName(`class${i}`);
        for (let j = 0; j < el.length; j++) {
            elements.push(el[j]);
            let rect = el[j].getBoundingClientRect();
            initialPositions.push({
                x: rect.left + rect.width / 2,
                y: rect.top + rect.height / 2
            });
        }
    }

    // Step 2: Animate elements in a circle relative to their initial positions
    let angle = 0;
    const radius = 50; // Adjust radius as needed
    const speed = 0.02; // Adjust for faster or slower animation

    function animate() {
        for (let i = 0; i < elements.length; i++) {
            let currentAngle = angle + (2 * Math.PI / elements.length) * i;
            let x = initialPositions[i].x + radius * Math.cos(currentAngle) - initialPositions[i].x;
            let y = initialPositions[i].y + radius * Math.sin(currentAngle) - initialPositions[i].y;
            elements[i].style.transform = `translate(${x}px, ${y}px)`;
        }
        angle += speed;
        requestAnimationFrame(animate);
    }

    animate();
}

// Call the function after DOM has loaded
document.addEventListener("DOMContentLoaded", animateDivsInCircle);

              
            
!
999px

Console