A Pen by Daniel Winterstein on CodePen.
Created
July 15, 2021 16:53
-
-
Save winterstein/834ffc2478db3b78ca16541cf99b60d5 to your computer and use it in GitHub Desktop.
Simple Advert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
@import url('https://fonts.googleapis.com/css2?family=Festive&display=swap'); | |
</style> | |
<div id='box'> | |
<div id='bg'></div> | |
<img id='product' src='https://source.unsplash.com/dcPNZeSY3yk'> | |
<img id='person' src='https://source.unsplash.com/UOavP_Z38lE/800x450'> | |
<div id='tagline' class="text">Spring Sale!</div> | |
<div id='cta' class="btn btn-lg btn-outline-dark bg-light">Don't Miss It!</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let t1 = gsap.timeline(); | |
t1.from("#tagline", {duration: 1, left:"50%"}); | |
t1.to("#cta", {duration: 2, left:"25%"}, "-=0.5"); | |
t1.fromTo("#cta", {fontSize:"100%"}, {duration: 2, fontSize:"130%"}, "-=0.5"); | |
t1.play(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://unpkg.co/gsap@3/dist/gsap.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#box { | |
width:500px; | |
height:500px; | |
} | |
#bg { | |
width:100%; | |
height:100%; | |
background: white; | |
position:absolute; | |
} | |
#person { | |
width:70%; | |
right:0; | |
top:0; | |
border: solid white 3px; | |
position:absolute; | |
} | |
#product { | |
width:50%; | |
left:0; | |
top:30%; | |
position:absolute; | |
} | |
#tagline { | |
font-size:60pt; | |
left:10%; | |
top:10%; | |
position:absolute; | |
font-family: 'Festive', cursive; | |
text-shadow: 2px 2px #ffffff; | |
} | |
#cta { | |
left:0; | |
top:40%; | |
position:absolute; | |
font-size:100% | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.2/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment