Calculator Tools Calculator Tools

Create Your Item List

Sep 18, 2023

About this app

Create your own item list by selecting items from the catalog.

Create Your Item List Create Your Item List

Put this on your site

Source

                    <html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">

<title>Create Your Item List</title>
<meta name="description" content="Create your own item list by selecting items from the catalog.">
<meta name="keywords" content="item list, catalog, select items">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.

// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
// Array to store selected items
var selectedItems = [];

// Function to handle item selection
function selectItem(item) {
if (!selectedItems.includes(item)) {
selectedItems.push(item);
$(item).addClass("selected");
} else {
var index = selectedItems.indexOf(item);
selectedItems.splice(index, 1);
$(item).removeClass("selected");
}
}

// Event listener for item selection
$(".catalog-item").on("click", function() {
selectItem(this);
});
});

} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>

<style>
/* App CSS Goes Here */
body {
font-family: 'Arial', sans-serif;
background-color: #f8f9fa;
}

h1 {
text-align: center;
margin-top: 30px;
color: #343a40;
font-size: 24px;
}

.catalog-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
margin-top: 30px;
}

.catalog-item {
display: flex;
align-items: center;
justify-content: center;
width: 200px;
height: 200px;
background-color: #ffffff;
border-radius: 10px;
cursor: pointer;
transition: transform 0.3s;
}

.catalog-item:hover {
transform: scale(1.1);
}

.selected {
background-color: #ffc107;
}

.selected .fa-check-circle {
display: block;
color: #ffffff;
font-size: 48px;
}

.fa-check-circle {
display: none;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Create Your Item List</h1>

<div class="catalog-container">
<div class="catalog-item">
<i class="fa fa-check-circle"></i>
</div>
<div class="catalog-item">
<i class="fa fa-check-circle"></i>
</div>
<div class="catalog-item">
<i class="fa fa-check-circle"></i>
</div>
<div class="catalog-item">
<i class="fa fa-check-circle"></i>
</div>
<div class="catalog-item">
<i class="fa fa-check-circle"></i>
</div>
<div class="catalog-item">
<i class="fa fa-check-circle"></i>
</div>
<div class="catalog-item">
<i class="fa fa-check-circle"></i>
</div>
<div class="catalog-item">
<i class="fa fa-check-circle"></i>
</div>
<div class="catalog-item">
<i class="fa fa-check-circle"></i>
</div>
<div class="catalog-item">
<i class="fa fa-check-circle"></i>
</div>
</div>
</div>
</body>
</html>