Iris

Developer
Size
2,587 Kb
Views
36,432

How do I make an iris?

Meet Iris... she doesn't talk much and her other eye was poked out in an unfortunate Touch Event accident... Her mom and dad are Greensock and SVG.. What is a iris? How do you make a iris? This script and codes were developed by Elliot Geno on 11 September 2022, Sunday.

Iris Previews

Iris - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Iris</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <svg version="1.1" id="eye" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 200 200" enable-background="new 0 0 200 200" xml:space="preserve"> <g id="iris"> <defs> <path id="eyeMaskReference" d="M45.9,100c15.2,42.7,93,42.7,108.2,0C138.9,57.3,61.1,57.3,45.9,100z"/> </defs> <clipPath id="eyeMask"> <use xlink:href="#eyeMaskReference" overflow="visible"/> </clipPath> <path id="whites" clip-path="url(#eyeMask)" fill="#dddddd" d="M45.9,100c15.2,42.7,93,42.7,108.2,0C138.9,57.3,61.1,57.3,45.9,100z"/> <circle id="pupil" clip-path="url(#eyeMask)" fill="#222222" cx="100" cy="100" r="18.7"/> </g> <path id="outline" fill="none" stroke="#222222" stroke-width="10" stroke-miterlimit="2" d="M45.9,100c15.2,42.7,93,42.7,108.2,0C138.9,57.3,61.1,57.3,45.9,100z"/> <path id="eyeLash" fill="none" stroke="#222222" stroke-width="10" stroke-miterlimit="10" d="M100,55.5v-31 M83.9,56.5l-6.4-28.6M66.8,61.3l-9.7-23.2 M38.9,51.2L52,71.1 M24.7,68.5L40.2,82 M122.5,27.9l-6.4,28.6 M142.9,38.1l-9.7,23.2 M161.1,51.2L148,71.1M159.8,82l15.5-13.5"/>
</svg> <script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.14.2/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Iris - Script Codes CSS Codes

body{ background-color:#444444; margin: 0px; overflow: hidden;
}

Iris - Script Codes JS Codes

var outline,eyeMask;
var outlinePath={valueY:57.3};
var pathString;
outline= document.getElementById("outline");
eyeMask= document.getElementById("eyeMaskReference");
var pathString=outline.getAttribute("d");
outlinePath.prefix=pathString.substring(0,pathString.indexOf("57.3,61.1,57.3"));
outlinePath.suffix=pathString.substring(pathString.indexOf("57.3,61.1,57.3")+14,pathString.length);
animatePupil();
animateBlink();
function animatePupil(){ var x=((Math.random()*50)-25)+100; var y=((Math.random()*50)-25)+100; TweenMax.to("#pupil",.3,{delay:(Math.random()*3)+.1,attr:{cx:x,cy:y},ease:Quint.easeInOut,onComplete:animatePupil})
}
function animateBlink(){ var delay=(Math.random()*3)+1; TweenMax.to(outlinePath,.2,{delay:delay,valueY:140,ease:Quint.easeInOut,onUpdate:updatePath}); TweenMax.to(outlinePath,.2,{delay:delay+.2,valueY:57.3,ease:Quint.easeOut,onUpdate:updatePath,onComplete:animateBlink}); TweenMax.to("#eyeLash",.2,{delay:delay,scaleY:-1,transformOrigin:"50% 130%",ease:Quint.easeInOut}); TweenMax.to("#eyeLash",.2,{delay:delay+.2,scaleY:1,transformOrigin:"50% 130%",ease:Quint.easeOut});
}
function updatePath(object,path){ var string=outlinePath.prefix+outlinePath.valueY+",61.1,"+outlinePath.valueY+outlinePath.suffix; outline.setAttribute("d",string); eyeMask.setAttribute("d",string);
}
Iris - Script Codes
Iris - Script Codes
Home Page Home
Developer Elliot Geno
Username pyrografix
Uploaded September 11, 2022
Rating 3.5
Size 2,587 Kb
Views 36,432
Do you need developer help for Iris?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Elliot Geno (pyrografix) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!