購入するアイテムを集めるためのEコマース機能
スキューモーフィックなデザインのレスポンシブショッピングカートコンポーネントで、ダークテーマのサポートとランダムなプレースホルダー画像が特徴です。
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-5 max-w-md mx-auto"> <h2 class="text-2xl font-bold mb-4 text-gray-800 dark:text-gray-200">Shopping Cart</h2> <div class="space-y-4"> <div class="flex items-center justify-between p-4 border rounded-lg shadow-md bg-gray-100 dark:bg-gray-700"> <img src="https://picsum.photos/80" alt="Product" class="w-16 h-16 rounded-md"> <div class="flex-1 ml-4"> <h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200">Product Name</h3> <p class="text-gray-600 dark:text-gray-400">$29.99</p> </div> <input type="number" value="1" min="1" class="w-12 border rounded-md text-center bg-gray-200 dark:bg-gray-600"> </div> <div class="flex items-center justify-between p-4 border rounded-lg shadow-md bg-gray-100 dark:bg-gray-700"> <img src="https://picsum.photos/80" alt="Product" class="w-16 h-16 rounded-md"> <div class="flex-1 ml-4"> <h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200">Another Product</h3> <p class="text-gray-600 dark:text-gray-400">$49.99</p> </div> <input type="number" value="1" min="1" class="w-12 border rounded-md text-center bg-gray-200 dark:bg-gray-600"> </div> </div> <div class="mt-5 flex justify-between items-center border-t pt-4"> <h2 class="text-lg font-bold text-gray-800 dark:text-gray-200">Total</h2> <p class="text-lg font-bold text-gray-800 dark:text-gray-200">$79.98</p> </div> <button class="mt-5 w-full bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 rounded transition duration-200">Checkout</button> </div>