The content on this website, including videos and code examples, is for educational purposes only. All demonstrations and designs are fictional and created to illustrate coding techniques. Any resemblance to existing websites or brands is purely coincidental.
The creators and administrators of this website do not claim ownership or affiliation with any existing websites or companies. Users are encouraged to use the information responsibly for learning purposes. Liability for any misuse of the content provided is not accepted.
Below is the html code for this video.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hypnotic Ellipses and Springs</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<svg viewBox="0 0 100 100">
<defs>
<marker id="pad1" viewBox="0 0 10 5" refX="5" refY="5" markerWidth="20" markerHeight="10">
<rect x="0" y="0" height="5" width="10" rx="1" fill="#ffc1cb" />
</marker>
<marker id="pad2" viewBox="0 0 5 10" refX="0" refY="5" markerWidth="10" markerHeight="20">
<rect x="0" y="0" height="10" width="5" rx="1" fill="#ffc1cb" />
</marker>
<path id="jumpBack" d="M 20 80 h 60 c 0 -80 -60 -80 -60 0z" stroke="none" fill="none" />
</defs>
<path d="M1 91 h 68 m22 0 h8" stroke="#ffc1cb" stroke-linecap="round" fill="none" />
<ellipse id="ellipse1" cx="0" cy="0" rx="10" ry="10" fill="#fc8eac">
<animateMotion id="a1" href="#ellipse1" dur="3000ms" begin="0s" fill="freeze" repeatCount="indefinite">
<mpath href="#jumpBack" />
</animateMotion>
<animate attributeName="ry" values="8; 10; 10; 10; 10; 8" dur="3s" begin="-1.75s"
repeatCount="indefinite" />
<animate attributeName="cy" values="-4; 0; 0; 0; 0; -4" dur="3s" begin="-1.75s" repeatCount="indefinite" />
<animate attributeName="rx" values="8; 10; 10; 10; 10; 8" dur="3s" begin="-2.75s"
repeatCount="indefinite" />
<animate attributeName="cx" values="4; 0; 0; 0; 0; 4" dur="3s" begin="-2.75s" repeatCount="indefinite" />
</ellipse>
<ellipse id="ellipse2" cx="0" cy="0" rx="10" ry="10" fill="#ffd1dc">
<animateMotion id="a2" href="#ellipse2" dur="3000ms" begin="-1s" fill="freeze" repeatCount="indefinite">
<mpath href="#jumpBack" />
</animateMotion>
<animate attributeName="ry" values="8; 10; 10; 10; 10; 8" dur="3s" begin="-2.75s"
repeatCount="indefinite" />
<animate attributeName="cy" values="-4; 0; 0; 0; 0; -4" dur="3s" begin="-2.75s" repeatCount="indefinite" />
<animate attributeName="rx" values="8; 10; 10; 10; 10; 8" dur="3s" begin="-3.75s"
repeatCount="indefinite" />
<animate attributeName="cx" values="4; 0; 0; 0; 0; 4" dur="3s" begin="-3.75s" repeatCount="indefinite" />
</ellipse>
<ellipse id="ellipse3" cx="0" cy="0" rx="10" ry="10" fill="#ffa6c9">
<animateMotion id="a3" href="#ellipse3" dur="3000ms" begin="-2s" fill="freeze" repeatCount="indefinite">
<mpath href="#jumpBack" />
</animateMotion>
<animate attributeName="ry" values="8; 10; 10; 10; 10; 8" dur="3s" begin="-0.75s"
repeatCount="indefinite" />
<animate attributeName="cy" values="-4; 0; 0; 0; 0; -4" dur="3s" begin="-0.75s" repeatCount="indefinite" />
<animate attributeName="rx" values="8; 10; 10; 10; 10; 8" dur="3s" begin="-1.75s"
repeatCount="indefinite" />
<animate attributeName="cx" values="4; 0; 0; 0; 0; 4" dur="3s" begin="-1.75s" repeatCount="indefinite" />
</ellipse>
<path d="M 80 105 q -7 -2 0 -5 q 7 -3 0 -5 q -7 -2 0 -5 q 7 -3 0 -5 q -7 -2 0 -5" stroke="#ffc1cb" fill="none"
stroke-linecap="round" marker-end="url(#pad1)">
<animate attributeName="d" values="M 80 110 q -7 -1 0 -2 q 7 -1 0 -2 q -7 -1 0 -2 q 7 -1 0 -2 q -7 -1 0 -2;
M 80 105 q -7 -2 0 -5 q 7 -3 0 -5 q -7 -2 0 -5 q 7 -3 0 -5 q -7 -2 0 -5;
M 80 110 q -7 -1 0 -2 q 7 -1 0 -2 q -7 -1 0 -2 q 7 -1 0 -2 q -7 -1 0 -2;
M 80 110 q -7 -1 0 -2 q 7 -1 0 -2 q -7 -1 0 -2 q 7 -1 0 -2 q -7 -1 0 -2;" dur="1s" begin="-1.2s"
repeatCount="indefinite" />
</path>
<path d="M -10 80 q 1 -7 2 0 q 1 6 2 0 q 1 -7 2 0 q 1 6 2 0 q 1 -7 2 0" stroke="#ffc1cb" fill="none"
stroke-linecap="round" marker-end="url(#pad2)">
<animate attributeName="d" values="M -15 80 q 3 -7 5 0 q 2 7 5 0 q 3 -7 5 0 q 2 7 5 0 q 3 -7 5 0;
M -10 80 q 1 -7 2 0 q 1 6 2 0 q 1 -7 2 0 q 1 6 2 0 q 1 -7 2 0;
M -15 80 q 3 -7 5 0 q 2 7 5 0 q 3 -7 5 0 q 2 6 5 0 q 3 -7 5 0;
M -15 80 q 3 -7 5 0 q 2 7 5 0 q 3 -7 5 0 q 2 7 5 0 q 3 -7 5 0;" dur="1s" begin="-0.5s"
repeatCount="indefinite" />
</path>
</svg>
</body>
</html>
Below is the css code for this video.
style.css
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
height: 100vh;
width: 100%;
background-color: #fff9fa;
overflow: hidden;
}
svg {
position: absolute;
top: 50%;
left: 50%;
height: 240px;
width: 240px;
transform: translate(-50%, -50%);
}
Thanks for visiting