A Pen by Coran Spicer

Developer
Size
2,815 Kb
Views
20,240

How do I make an a pen by coran spicer?

What is a a pen by coran spicer? How do you make a a pen by coran spicer? This script and codes were developed by Coran Spicer on 15 October 2022, Saturday.

A Pen by Coran Spicer Previews

A Pen by Coran Spicer - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>A Pen by Coran Spicer</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="thumbnail" id="one"></div>
<div class="thumbnail" id="two"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.8/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

A Pen by Coran Spicer - Script Codes CSS Codes

.thumbnail { display: inline-block; position: absolute; width: 200px; height: 200px; background-image: url("http://placehold.it/500x300"); background-position: center center; background-size: 400px 240px; border: 4px solid black; -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
}
#one { top: 100px; left: 100px;
}
#two { top: 100px; left: 400px;
}

A Pen by Coran Spicer - Script Codes JS Codes

var ExplodingThumb = function( $el, expandStateClassOverride ){ var self = this; var settings = {}; // default settings settings.expandToX = 200; settings.expandToY = 200; settings.expandToBGWidth = 500; settings.expandToBGHeight = 300; settings.expandToWidth = 500; settings.expandToHeight = 300; var expandedStateClass = 'expanded', contractedStateClass = 'contracted'; // functions // STORE SETTINGS var storeSettings = function() { // parse the markup for data-exploding-settings // refine/override settings object above } // EXPAND var expand = function(){ // expansion animation TweenMax.to($el,.75,{x:settings.expandToX, y:settings.expandToY, backgroundSize:settings.expandToBGWidth+'px '+settings.expandToBGHeight+'px', width:settings.expandToWidth + 'px', height: settings.expandToHeight + 'px', transformOrigin:'left top', force3D:true}); }; // CONTRACT var contract = function(){ // contraction animation TweenMax.to($el,.75,{x:0, y:0, backgroundSize: '400px 240px', width:200 + 'px', height: 200 + 'px', transformOrigin:'left top', force3D:true}); }; // CHECK STATE var checkState = function() { return $el.hasClass( expandedStateClass ) ? expandedStateClass : contractedStateClass; }; // CLICK HANDLER var clicked = function(e){ // check for current state if ( checkState() == expandedStateClass ) { // add class to indicate state $el.removeClass(expandedStateClass).addClass(contractedStateClass); contract(); } else { // add class to indicate state $el.removeClass(contractedStateClass).addClass(expandedStateClass); expand(); } }; //init IIFE (function() { storeSettings(); $el.on( 'click', clicked ); })(); // API return { expandThumb: function(){ expand(); }, contractThumb: function() { contract(); } };
};
var thisThumbnail = new ExplodingThumb($('#one'));
var thisThumbnail = new ExplodingThumb($('#two'));
A Pen by Coran Spicer - Script Codes
A Pen by Coran Spicer - Script Codes
Home Page Home
Developer Coran Spicer
Username cgspicer
Uploaded October 15, 2022
Rating 3
Size 2,815 Kb
Views 20,240
Do you need developer help for A Pen by Coran Spicer?

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!

Coran Spicer (cgspicer) Script Codes
Create amazing blog posts 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!