正在进行的过程的可视化指示
一个复古/古董风格的进度指示器组件,采用响应式设计,使用 Tailwind CSS,支持暗主题。
<div class="bg-gray-100 dark:bg-gray-800 p-6 rounded-lg shadow-md max-w-md mx-auto"> <h2 class="text-2xl font-bold text-center text-gray-800 dark:text-white mb-4">Progress Indicators</h2> <div class="mb-4"> <h3 class="text-lg font-semibold text-gray-700 dark:text-gray-300">Loading...</h3> <div class="w-full bg-gray-300 dark:bg-gray-700 rounded-full h-4 mt-2"> <div class="bg-blue-500 h-4 rounded-full transition-all duration-500 ease-in-out" style="width: 70%;"></div> </div> <p class="text-sm text-gray-600 dark:text-gray-400 mt-1">70% Complete</p> </div> <div class="mb-4"> <h3 class="text-lg font-semibold text-gray-700 dark:text-gray-300">Uploading...</h3> <div class="w-full bg-gray-300 dark:bg-gray-700 rounded-full h-4 mt-2"> <div class="bg-blue-500 h-4 rounded-full transition-all duration-500 ease-in-out" style="width: 50%;"></div> </div> <p class="text-sm text-gray-600 dark:text-gray-400 mt-1">50% Uploaded</p> </div> <div class="mb-4"> <h3 class="text-lg font-semibold text-gray-700 dark:text-gray-300">Downloading...</h3> <div class="w-full bg-gray-300 dark:bg-gray-700 rounded-full h-4 mt-2"> <div class="bg-blue-500 h-4 rounded-full transition-all duration-500 ease-in-out" style="width: 30%;"></div> </div> <p class="text-sm text-gray-600 dark:text-gray-400 mt-1">30% Downloaded</p> </div> <div class="mt-6"> <img class="rounded-full w-12 h-12 mx-auto" src="https://picsum.photos/200/200" alt="Random Image" /> <p class="text-center text-gray-600 dark:text-gray-400 mt-2">Vintage Style Image</p> </div> <div class="mt-6"> <img class="rounded-full w-12 h-12 mx-auto" src="https://randomuser.me/api/portraits/men/32.jpg" alt="Random Avatar" /> <p class="text-center text-gray-600 dark:text-gray-400 mt-2">User Avatar</p> </div> </div>
响应式进度指示器组件,具有玻璃化风格,包含磨砂玻璃似的透明元素和模糊效果,支持暗主题,使用Tailwind CSS。
<div class="flex flex-col items-center justify-center min-h-screen p-4 bg-gray-100 dark:bg-gray-900"> <div class="bg-white bg-opacity-20 backdrop-blur-lg border border-white border-opacity-30 rounded-lg shadow-lg p-6 max-w-md w-full"> <h2 class="text-center text-2xl font-bold text-gray-800 dark:text-gray-200 mb-4">Progress Indicators</h2> <div class="w-full mb-4"> <div class="flex justify-between mb-1"> <span class="text-sm text-gray-700 dark:text-gray-300">Task 1</span> <span class="text-sm text-gray-700 dark:text-gray-300">75%</span> </div> <div class="bg-gray-300 rounded-full h-2.5 dark:bg-gray-700"> <div class="bg-blue-600 h-2.5 rounded-full" style="width: 75%"></div> </div> </div> <div class="w-full mb-4"> <div class="flex justify-between mb-1"> <span class="text-sm text-gray-700 dark:text-gray-300">Task 2</span> <span class="text-sm text-gray-700 dark:text-gray-300">50%</span> </div> <div class="bg-gray-300 rounded-full h-2.5 dark:bg-gray-700"> <div class="bg-green-600 h-2.5 rounded-full" style="width: 50%"></div> </div> </div> <div class="w-full mb-4"> <div class="flex justify-between mb-1"> <span class="text-sm text-gray-700 dark:text-gray-300">Task 3</span> <span class="text-sm text-gray-700 dark:text-gray-300">25%</span> </div> <div class="bg-gray-300 rounded-full h-2.5 dark:bg-gray-700"> <div class="bg-red-600 h-2.5 rounded-full" style="width: 25%"></div> </div> </div> <div class="flex items-center justify-between mt-4"> <img src="https://picsum.photos/50" alt="Placeholder Image" class="rounded-full"> <img src="https://randomuser.me/api/portraits/men/1.jpg" alt="User Avatar" class="rounded-full"> </div> </div> </div>
一种响应式进度指示器,具有Tailwind CSS中的微交互,支持黑暗主题。
<div class="relative flex items-center justify-center h-screen bg-gray-100 dark:bg-gray-900"> <div class="progress-container flex items-center justify-center"> <div class="progress-bar relative w-64 h-2 bg-gray-300 dark:bg-gray-700 rounded-full overflow-hidden"> <div class="progress-fill w-1/2 h-full bg-blue-500 rounded-full transition-all duration-300 ease-in-out"></div> </div> <div class="progress-indicators flex justify-between w-full mt-2"> <div class="indicator flex flex-col items-center"> <img src="https://picsum.photos/id/101/50" alt="Avatar 1" class="mb-1 rounded-full border border-white dark:border-gray-800"> <span class="text-xs text-gray-700 dark:text-gray-300">Step 1</span> </div> <div class="indicator flex flex-col items-center"> <img src="https://picsum.photos/id/102/50" alt="Avatar 2" class="mb-1 rounded-full border border-white dark:border-gray-800"> <span class="text-xs text-gray-700 dark:text-gray-300">Step 2</span> </div> <div class="indicator flex flex-col items-center"> <img src="https://picsum.photos/id/103/50" alt="Avatar 3" class="mb-1 rounded-full border border-white dark:border-gray-800"> <span class="text-xs text-gray-700 dark:text-gray-300">Step 3</span> </div> </div> </div> <style> .progress-fill { animation: fill 1.5s forwards; } @keyframes fill { from { width: 0%; } to { width: 50%; } } </style> </div>
一个受材料设计启发的进度指示器组件,具有响应式效果和深色主题支持,由 Tailwind CSS 构建。
<div class="container mx-auto p-5"> <h2 class="text-2xl font-bold mb-6 text-gray-800 dark:text-gray-200">Progress Indicators</h2> <div class="flex flex-col space-y-4"> <!-- Linear Progress Bar --> <div class="w-full"> <div class="bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"> <div class="bg-blue-600 h-2.5 rounded-full w-3/4" style="transition: width 0.5s;"></div> </div> <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">Loading... 75%</p> </div> <!-- Circular Progress Indicator --> <div class="flex items-center space-x-2"> <div class="relative flex items-center justify-center w-12 h-12"> <svg class="absolute animate-spin -ml-1 mr-3" xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"> <circle class="text-gray-200 dark:text-gray-700" cx="25" cy="25" r="20" stroke-width="5" fill="none"></circle> <path class="text-blue-600" fill="none" stroke-width="5" stroke-linecap="round" d="M25 5a20 20 0 1 0 0 40A20 20 0 0 0 25 5z" style="stroke-dasharray: 125; stroke-dashoffset: 62.5;"></path> </svg> <span class="text-lg text-gray-800 dark:text-gray-200">Processing</span> </div> </div> <!-- Steps Progress Indicator --> <div class="relative"> <div class="flex"> <div class="flex items-center justify-center w-10 h-10 bg-blue-600 text-white rounded-full">1</div> <div class="flex-1 h-1 bg-gray-300 dark:bg-gray-600"></div> <div class="flex items-center justify-center w-10 h-10 bg-gray-300 text-gray-700 rounded-full dark:bg-gray-700 dark:text-gray-400">2</div> <div class="flex-1 h-1 bg-gray-300 dark:bg-gray-600"></div> <div class="flex items-center justify-center w-10 h-10 bg-gray-300 text-gray-700 rounded-full dark:bg-gray-700 dark:text-gray-400">3</div> </div> <div class="absolute top-[-1rem] left-[calc(50%_-_2.5rem)] bg-white dark:bg-gray-800 p-2 rounded shadow-md text-center text-sm text-gray-800 dark:text-gray-200">Step 1: Details</div> </div> <!-- Avatar Loading Indicator --> <div class="flex items-center space-x-3"> <img src="https://randomuser.me/api/portraits/men/1.jpg" alt="Avatar" class="w-10 h-10 rounded-full border-2 border-gray-200 dark:border-gray-700" /> <div class="flex-1"> <div class="bg-gray-300 h-2 rounded w-3/4 dark:bg-gray-600"></div> <div class="text-gray-600 dark:text-gray-400 text-sm">User is online</div> </div> </div> <!-- Image Progress Indicator --> <div class="flex flex-col items-center space-y-1"> <img src="https://picsum.photos/50/50" alt="Progress Image" class="rounded-md shadow-md w-full max-w-xs" /> <div class="bg-blue-600 h-2 rounded w-2/3 dark:bg-blue-500"></div> </div> </div> </div> <style> @media (prefers-color-scheme: dark) { body { background-color: #181818; } } </style>