Skip to content

Instantly share code, notes, and snippets.

@speckworks
Created April 11, 2020 16:36
Show Gist options
  • Save speckworks/c532ecba2b91572ee1e6ccc6f4625446 to your computer and use it in GitHub Desktop.
Save speckworks/c532ecba2b91572ee1e6ccc6f4625446 to your computer and use it in GitHub Desktop.
Zebra Sphere
<div class=cropper>
<img class="sphere" src="https://cdn1.vectorstock.com/i/thumb-large/47/65/zebra-pattern-eps-10-vector-10114765.jpg" alt="Zebra Pattern EPS 10">
</div>
var tl = new TimelineLite;
tl.to(".cropper", 2, {
// transformOrigin: "130px 50px",
rotation: 160,
x: 500,
ease: Sine.easeIn,
// force3d: true
})
.to(".cropper", 2, {
rotation: 320,
x: 1000
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script>
.cropper{
width: 200px;
height: 200px;
position: relative;
overflow: hidden;
border-radius: 50%;
}
.sphere {
height: 300px;
width: 300px;
transform: translate(0px, -50px);
}
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment