port / index.html
barshbub's picture
good now add "supply chain dsh board that show major trade routes and the ports used in them - Initial Deployment
43beaef verified
Raw History Blame Contribute Delete
27.4 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Global Port Health Dashboard</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#0056b3',
secondary: '#003366',
dark: '#1a1a2e',
light: '#f8f9fa'
}
}
}
}
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Inter', sans-serif;
background-color: #f8f9fa;
}
.chat-container {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
border: 1px solid #e0e0e0;
}
.message-bubble {
max-width: 80%;
animation: fadeIn 0.3s ease-in-out;
border-radius: 8px;
}
.user-bubble {
background-color: #0056b3;
color: white;
}
.bot-bubble {
background-color: #ffffff;
border: 1px solid #e0e0e0;
color: #333;
}
.typing-indicator {
display: flex;
justify-content: center;
padding: 8px;
}
.typing-dot {
width: 8px;
height: 8px;
margin: 0 3px;
background-color: #94a3b8;
border-radius: 50%;
display: inline-block;
animation: typing 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
0%, 60%, 100% { transform: translateY(0); }
30% { transform: translateY(-5px); }
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.send-btn {
transition: all 0.2s ease;
}
.send-btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3), 0 2px 4px -1px rgba(99, 102, 241, 0.1);
}
</style>
</head>
<body class="min-h-screen bg-gray-50">
<div class="container mx-auto p-4">
<div class="flex flex-col lg:flex-row gap-6">
<!-- Main Dashboard -->
<div class="flex-1">
<div class="bg-white shadow rounded-lg p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800">Global Port Health Monitor</h2>
<div class="relative">
<input
type="text"
placeholder="Search ports..."
class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
>
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
</div>
<!-- Health Overview Cards -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
<div class="bg-green-50 p-4 rounded-lg border border-green-100">
<div class="flex items-center">
<div class="w-12 h-12 bg-green-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-check-circle text-green-600 text-xl"></i>
</div>
<div>
<p class="text-gray-500">Operational</p>
<p class="text-2xl font-bold">287</p>
</div>
</div>
</div>
<div class="bg-yellow-50 p-4 rounded-lg border border-yellow-100">
<div class="flex items-center">
<div class="w-12 h-12 bg-yellow-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-exclamation-triangle text-yellow-500 text-xl"></i>
</div>
<div>
<p class="text-gray-500">Under Inspection</p>
<p class="text-2xl font-bold">43</p>
</div>
</div>
</div>
<div class="bg-red-50 p-4 rounded-lg border border-red-100">
<div class="flex items-center">
<div class="w-12 h-12 bg-red-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-times-circle text-red-600 text-xl"></i>
</div>
<div>
<p class="text-gray-500">Restricted</p>
<p class="text-2xl font-bold">19</p>
</div>
</div>
</div>
</div>
<!-- Supply Chain Dashboard -->
<div class="bg-white p-6 rounded-lg border mb-6">
<h3 class="text-xl font-semibold mb-4 text-gray-800">Major Global Supply Chains</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<!-- Route 1 -->
<div class="border rounded-lg p-4 hover:bg-gray-50">
<div class="flex justify-between items-start mb-2">
<h4 class="font-medium text-blue-700">Asia-Europe Trade Lane</h4>
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">Operational</span>
</div>
<div class="flex items-center justify-between text-sm text-gray-600">
<div class="flex items-center">
<i class="fas fa-ship mr-1 text-blue-500"></i>
<span>Shanghai →</span>
</div>
<div class="flex items-center">
<i class="fas fa-ship mr-1 text-blue-500"></i>
<span>Singapore →</span>
</div>
<div class="flex items-center">
<i class="fas fa-ship mr-1 text-blue-500"></i>
<span>Hamburg</span>
</div>
</div>
<p class="mt-3 text-sm text-gray-500">Current status: All ports operational, no delays</p>
</div>
<!-- Route 2 -->
<div class="border rounded-lg p-4 hover:bg-gray-50">
<div class="flex justify-between items-start mb-2">
<h4 class="font-medium text-blue-700">Trans-Pacific Route</h4>
<span class="bg-yellow-100 text-yellow-800 text-xs px-2 py-1 rounded-full">Monitoring</span>
</div>
<div class="flex items-center justify-between text-sm text-gray-600">
<div class="flex items-center">
<i class="fas fa-ship mr-1 text-blue-500"></i>
<span>Los Angeles →</span>
</div>
<div class="flex items-center">
<i class="fas fa-ship mr-1 text-blue-500"></i>
<span>Yokohama →</span>
</div>
<div class="flex items-center">
<i class="fas fa-ship mr-1 text-blue-500"></i>
<span>Busan</span>
</div>
</div>
<p class="mt-3 text-sm text-gray-500">Potential delays: LA port experiencing 12hr delays</p>
</div>
<!-- More routes would go here -->
</div>
<div class="mt-4 flex justify-between items-center">
<p class="text-sm text-gray-500">Last updated: May 25, 2023</p>
<button class="text-blue-600 text-sm font-medium hover:text-blue-800">
<i class="fas fa-plus-circle mr-1"></i> View all trade routes
</button>
</div>
</div>
<!-- Port Table -->
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Port Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Location</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Last Inspection</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<!-- Example port data rows -->
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-3">
<i class="fas fa-anchor text-blue-600"></i>
</div>
<div>
<p class="font-medium">Port of Shanghai</p>
<p class="text-sm text-gray-500">China</p>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<p>31.23°N, 121.47°E</p>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-3 py-1 rounded-full text-xs font-semibold bg-green-100 text-green-800">Operational</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-gray-500">
May 12, 2023
</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-3">
<i class="fas fa-anchor text-blue-600"></i>
</div>
<div>
<p class="font-medium">Port of Los Angeles</p>
<p class="text-sm text-gray-500">USA</p>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<p>33.72°N, 118.26°W</p>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-3 py-1 rounded-full text-xs font-semibold bg-yellow-100 text-yellow-800">Under Inspection</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-gray-500">
April 28, 2023
</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-3">
<i class="fas fa-anchor text-blue-600"></i>
</div>
<div>
<p class="font-medium">Port of Hamburg</p>
<p class="text-sm text-gray-500">Germany</p>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<p>53.54°N, 9.98°E</p>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-3 py-1 rounded-full text-xs font-semibold bg-red-100 text-red-800">Restricted</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-gray-500">
March 15, 2023
</td>
</tr>
<!-- Add the rest of your port data here -->
</tbody>
</table>
</div>
</div>
</div>
<!-- Chat Assistant Sidebar -->
<div class="lg:w-96">
<div class="h-[80vh] flex flex-col bg-white rounded-lg shadow-lg overflow-hidden">
<!-- Header -->
<div class="bg-blue-800 p-4 text-white">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full bg-white/10 flex items-center justify-center mr-3">
<i class="fas fa-robot text-xl"></i>
</div>
<div>
<h1 class="text-xl font-bold">Port Health Assistant</h1>
<p class="text-xs opacity-80">Powered by IMO & WHO Data</p>
</div>
<div class="ml-auto flex space-x-2">
<button class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center hover:bg-white/20">
<i class="fas fa-question-circle"></i>
</button>
</div>
</div>
</div>
<!-- Chat Messages -->
<div id="chat-messages" class="flex-1 overflow-y-auto p-4 bg-gray-50">
<!-- Welcome message -->
<div class="message-bubble bot-bubble p-4 mb-4">
<div class="flex items-start">
<div class="w-8 h-8 rounded-full bg-blue-800 flex items-center justify-center mr-3 flex-shrink-0">
<i class="fas fa-robot text-white"></i>
</div>
<div>
<p class="font-medium text-gray-800">Welcome to the Port Health Assistant</p>
<p class="mt-1 text-gray-700">I can help you understand port health statuses and supply chain implications. Ask me about any port's current status, inspection reports, or regulations.</p>
<div class="mt-3 flex flex-wrap gap-2">
<span class="px-2 py-1 bg-gray-100 rounded text-xs text-gray-600 border border-gray-200">Try: Status of Shanghai Port</span>
<span class="px-2 py-1 bg-gray-100 rounded text-xs text-gray-600 border border-gray-200">Try: Import restrictions in USA</span>
<span class="px-2 py-1 bg-gray-100 rounded text-xs text-gray-600 border border-gray-200">Try: What does restricted mean?</span>
</div>
</div>
</div>
</div>
<!-- Example messages -->
<div class="message-bubble user-bubble p-4 mb-4 ml-auto text-white">
<div class="flex items-start">
<div class="ml-3">
<p>Hi there! What can you help me with?</p>
</div>
<div class="w-8 h-8 rounded-full bg-white/20 flex items-center justify-center ml-3 flex-shrink-0">
<i class="fas fa-user"></i>
</div>
</div>
</div>
<div class="message-bubble bot-bubble p-4 mb-4">
<div class="flex items-start">
<div class="w-8 h-8 rounded-full bg-primary flex items-center justify-center mr-3 flex-shrink-0">
<i class="fas fa-robot text-white"></i>
</div>
<div>
<p class="font-medium text-gray-800">I can assist with many things!</p>
<p class="mt-1 text-gray-700">Here are some examples:</p>
<ul class="mt-2 text-gray-700 list-disc list-inside space-y-1">
<li>Answering general knowledge questions</li>
<li>Helping with writing and editing</li>
<li>Providing explanations on various topics</li>
<li>Generating creative ideas</li>
<li>And much more!</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Typing indicator (hidden by default) -->
<div id="typing-indicator" class="typing-indicator hidden">
<div class="flex items-center bg-gray-100 px-4 py-2 rounded-full">
<div class="typing-dot"></div>
<div class="typing-dot"></div>
<div class="typing-dot"></div>
<span class="ml-2 text-sm text-gray-500">Assistant is typing...</span>
</div>
</div>
<!-- Input Area -->
<div class="p-4 border-t border-gray-200 bg-white">
<div class="flex items-center">
<div class="flex-1 relative">
<input
id="message-input"
type="text"
placeholder="Ask about economic data or policy insights..."
class="w-full py-3 px-4 bg-gray-100 rounded focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500"
>
</div>
<button id="send-btn" class="send-btn w-12 h-12 rounded bg-blue-800 flex items-center justify-center ml-3 text-white hover:bg-blue-900">
<i class="fas fa-paper-plane"></i>
</button>
</div>
<div class="mt-2 flex justify-center text-xs text-gray-500">
<span>This service provides general information only. For official reports, visit imo.org or who.int</span>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const chatMessages = document.getElementById('chat-messages');
const messageInput = document.getElementById('message-input');
const sendBtn = document.getElementById('send-btn');
const typingIndicator = document.getElementById('typing-indicator');
// Function to add a message to the chat
function addMessage(message, isUser = false) {
const messageDiv = document.createElement('div');
messageDiv.classList.add('message-bubble', 'p-4', 'mb-4');
if (isUser) {
messageDiv.classList.add('user-bubble', 'ml-auto', 'text-white');
messageDiv.innerHTML = `
<div class="flex items-start">
<div class="ml-3">
<p>${message}</p>
</div>
<div class="w-8 h-8 rounded-full bg-white/20 flex items-center justify-center ml-3 flex-shrink-0">
<i class="fas fa-user"></i>
</div>
</div>
`;
} else {
messageDiv.classList.add('bot-bubble');
messageDiv.innerHTML = `
<div class="flex items-start">
<div class="w-8 h-8 rounded-full bg-primary flex items-center justify-center mr-3 flex-shrink-0">
<i class="fas fa-robot text-white"></i>
</div>
<div>
<p class="text-gray-700">${message}</p>
</div>
</div>
`;
}
chatMessages.appendChild(messageDiv);
// Scroll to the bottom
chatMessages.scrollTop = chatMessages.scrollHeight;
}
// Function to simulate bot response
function botResponse(userMessage) {
// Show typing indicator
typingIndicator.classList.remove('hidden');
chatMessages.scrollTop = chatMessages.scrollHeight;
// Simulate thinking time
setTimeout(() => {
typingIndicator.classList.add('hidden');
// Simple responses based on user input
let response;
userMessage = userMessage.toLowerCase();
if (userMessage.includes('hello') || userMessage.includes('hi') || userMessage.includes('hey')) {
response = "Hello there! How can I assist you today?";
} else if (userMessage.includes('how are you')) {
response = "I'm just a bot, but I'm functioning perfectly! How can I help you?";
} else if (userMessage.includes('thank')) {
response = "You're welcome! Is there anything else I can help with?";
} else if (userMessage.includes('joke')) {
response = "Why don't scientists trust atoms?<br>Because they make up everything! 😄";
} else if (userMessage.includes('name')) {
response = "I'm your friendly AI assistant! You can call me whatever you like.";
} else if (userMessage.includes('weather')) {
response = "I don't have access to real-time weather data, but I can help you find weather information if you tell me your location!";
} else if (userMessage.includes('help')) {
response = "I can help with answering questions, providing information, generating ideas, explaining concepts, and much more! What do you need assistance with?";
} else {
// Default response
response = "Thanks for your message! I'm an AI assistant designed to help with various tasks. How can I assist you today?";
}
addMessage(response, false);
}, 1500);
}
// Send message function
function sendMessage() {
const message = messageInput.value.trim();
if (message) {
addMessage(message, true);
messageInput.value = '';
botResponse(message);
}
}
// Event listeners
sendBtn.addEventListener('click', sendMessage);
messageInput.addEventListener('keypress', function(e) {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
sendMessage();
}
});
// Initial scroll to bottom
chatMessages.scrollTop = chatMessages.scrollHeight;
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=barshbub/port" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>