Adding Items

Developer
Size
4,008 Kb
Views
26,312

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 Previews

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;
}
Adding Items - Script Codes
Adding Items - Script Codes
Home Page Home
Developer Val Head
Username valhead
Uploaded August 07, 2022
Rating 4.5
Size 4,008 Kb
Views 26,312
Do you need developer help for Adding Items?

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!

Val Head (valhead) Script Codes
Create amazing love letters 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!