HTML 代码
<div class="container mx-auto p-4">
<div class="max-w-md mx-auto rounded-lg shadow-lg bg-white dark:bg-gray-800 overflow-hidden">
<div class="px-6 py-4">
<h2 class="text-2xl font-bold text-gray-800 dark:text-white mb-4">Shopping Cart</h2>
<div class="flex items-center mb-4">
<img src="https://picsum.photos/seed/retro1/80/80" alt="Product Image" class="w-16 h-16 object-cover rounded-lg dark:brightness-75">
<div class="ml-4">
<h3 class="text-lg font-semibold text-gray-700 dark:text-gray-200">Product Name 1</h3>
<p class="text-gray-600 dark:text-gray-400">$19.99</p>
</div>
<div class="ml-auto">
<span class="text-gray-700 dark:text-gray-200">Qty: 1</span>
</div>
</div>
<div class="flex items-center mb-4">
<img src="https://picsum.photos/seed/retro2/80/80" alt="Product Image" class="w-16 h-16 object-cover rounded-lg dark:brightness-75">
<div class="ml-4">
<h3 class="text-lg font-semibold text-gray-700 dark:text-gray-200">Product Name 2</h3>
<p class="text-gray-600 dark:text-gray-400">$29.99</p>
</div>
<div class="ml-auto">
<span class="text-gray-700 dark:text-gray-200">Qty: 2</span>
</div>
</div>
<div class="border-t border-gray-200 dark:border-gray-600 pt-4">
<div class="flex justify-between">
<span class="text-lg font-semibold text-gray-800 dark:text-white">Total:</span>
<span class="text-lg font-semibold text-gray-800 dark:text-white">$79.97</span>
</div>
</div>
</div>
<div class="bg-gray-50 dark:bg-gray-700 px-6 py-4">
<button class="w-full bg-blue-500 dark:bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50">Checkout</button>
</div>
</div>
</div>
相关组件
购物车组件
一个简单的响应式购物车组件,支持深色主题,使用 Tailwind CSS 设置样式,遵循 Material Design 原则和灰度配色方案。将 picsum.photos 用于产品图片。
购物车组件
复古/复古风格的购物车组件,具有灰度配色方案、适度的复杂度和响应式设计,支持深色主题。专为使用 Tailwind CSS 的商业/公司网站而设计。没有 JavaScript,只有带有 Tailwind 类的 HTML。将 picsum.photos 用于图像,将 randomuser.me 用于头像。
3D 购物车组件
一个具有视觉冲击力的购物车组件,具有 3D 设计元素,可创造深度和参与度。使用三色配色方案(原色蓝、鲜艳的红色和琥珀色黄色)来增加视觉趣味。这个复杂的界面包括带有图像的产品列表、数量控制、价格摘要和模拟 3D 运动的悬停效果。完全响应,支持深色主题。该组件专为内容/博客环境而设计,读者可能会在其中购买推荐产品,同时使用内容。