Adding Items
How do I make an adding items?
What is a adding items? How do you make a adding items? This script and codes were developed by Val Head on 07 August 2022, Sunday.
Adding Items - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Adding Items</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { background: #B7C9E5; color: #F4F4F4; font-family: 'Dosis', Helvetica, Arial, sans-serif; font-weight: 600;
}
section { width: 40%; margin: 4em auto; overflow: hidden;
}
ul { list-style: none; margin: 0 0 .5em 0; padding: 0;
}
ul li { text-transform: uppercase; padding: 10px 0 0 5%; margin: 0; height: 30px; display: block; background: #141619; border-bottom: 1px solid rgba(252, 252, 252, 0.1);
}
button { width: 50%; padding: .75em 0; float: left; border: none; text-transform: uppercase; color: white; background: #419FE8;
}
.remove { background: #A6365A;
}
.new-item { max-height: 0; opacity: 0; transform: translateX(-600px); animation: openList 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, itemEnter 0.3s 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, itemHighlight 2s 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}
.old-item { animation: itemExit 0.75s cubic-bezier(0.245, -0.09, 0.735, 0.045) forwards;
}
@keyframes openList { to { max-height: 40px; }
}
@keyframes itemEnter { to { opacity: 1; transform: translateX(0); }
}
@keyframes itemExit { 15%, 30% { background: #A6365A; opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(600px); }
}
@keyframes itemHighlight { 5%, 60% { background: #419FE8; } 100% { background: #141619; }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <link href='http://fonts.googleapis.com/css?family=Dosis:600' rel='stylesheet' type='text/css'>
<section>
<div class="sample-list"> <ul> <li>Milk</li> <li>Cookies</li> <li>Ice Cream</li> <li>Bread</li> </ul> </div> <button class="add">Add</button> <button class="remove">Remove</button>
</section> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Adding Items - Script Codes CSS Codes
body { background: #B7C9E5; color: #F4F4F4; font-family: 'Dosis', Helvetica, Arial, sans-serif; font-weight: 600;
}
section { width: 40%; margin: 4em auto; overflow: hidden;
}
ul { list-style: none; margin: 0 0 .5em 0; padding: 0;
}
ul li { text-transform: uppercase; padding: 10px 0 0 5%; margin: 0; height: 30px; display: block; background: #141619; border-bottom: 1px solid rgba(252, 252, 252, 0.1);
}
button { width: 50%; padding: .75em 0; float: left; border: none; text-transform: uppercase; color: white; background: #419FE8;
}
.remove { background: #A6365A;
}
.new-item { max-height: 0; opacity: 0; transform: translateX(-600px); animation: openList 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, itemEnter 0.3s 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, itemHighlight 2s 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}
.old-item { animation: itemExit 0.75s cubic-bezier(0.245, -0.09, 0.735, 0.045) forwards;
}
@keyframes openList { to { max-height: 40px; }
}
@keyframes itemEnter { to { opacity: 1; transform: translateX(0); }
}
@keyframes itemExit { 15%, 30% { background: #A6365A; opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(600px); }
}
@keyframes itemHighlight { 5%, 60% { background: #419FE8; } 100% { background: #141619; }
}
Adding Items - Script Codes JS Codes
var foodItems = ["Wine", "Cheese", "Pizza", "Cupcakes", "Bananas", "Apples", "Oranges", "Granola", "Cereal"];
$(".add").on("click", function() { var insertPoint = $(this).parent().find("li:nth-child(3)"); $("<li />", { 'text': foodItems[randomInt(0,foodItems.length-1)], 'class': "new-item" }).insertAfter(insertPoint);
});
$(".remove").on("click", function() { $(this).parent().find("li:nth-child(4)").removeClass('new-item').addClass('old-item'); $('.old-item').bind( 'animationend webkitAnimationEnd', function(event) {onAnimationEnd(event); });
});
function onAnimationEnd(e) { if ($('.old-item')) { $('.old-item').remove(); }
}
function randomInt(min, max) { return Math.floor(Math.random() * (max+1-min)) +min;
}
Developer | Val Head |
Username | valhead |
Uploaded | August 07, 2022 |
Rating | 4.5 |
Size | 4,008 Kb |
Views | 26,312 |
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!
Name | Size |
Adding Items | 4,008 Kb |
Net magazine demo - Complete | 5,291 Kb |
Net magazine example - Start | 4,830 Kb |
500 coffee cup icons | 3,169 Kb |
Neon glow letters | 2,595 Kb |
Geometric Pattern Mask | 2,527 Kb |
Nav animation exercise - START | 3,402 Kb |
Spring physics with CSS variables | 3,591 Kb |
Steps Sprite Animation | 1,942 Kb |
3D dancing dots | 2,334 Kb |
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!
Name | Username | Size |
Zip Button test | Lje7462 | 1,932 Kb |
Flat UI Button | Honchoman | 2,289 Kb |
Commuter Line Tokyu 8500 | Pedox | 7,031 Kb |
Christ the Redeemer | Prashantsani | 2,208 Kb |
Opening Reveal Modal On Document Ready | Winghouchan | 1,787 Kb |
Page Transitions in Backbone | Mikefowler | 3,691 Kb |
A Pen by Rob Levin | Roblevin | 2,787 Kb |
Nice responsive team page | Infomiho | 3,139 Kb |
Learning FlexBox | Alex_rodrigues | 2,821 Kb |
Elephants Full screen site | Orrinward | 3,981 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!