pml1's picture
make a rendering based on the dimensions of sofa
2345dbc verified
Raw History Blame Contribute Delete
12.3 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SofaVision 3D Showcase</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script>
<style>
#canvas-container {
position: relative;
width: 100%;
height: 70vh;
overflow: hidden;
}
.angle-btn {
transition: all 0.3s ease;
}
.angle-btn:hover {
transform: translateY(-3px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.dimension-label {
background: rgba(255, 255, 255, 0.9);
border-radius: 9999px;
padding: 0.25rem 0.75rem;
font-weight: 600;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body class="bg-gray-50 font-sans">
<!-- Navigation -->
<nav class="bg-white shadow-sm">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<i data-feather="box" class="text-indigo-600 mr-2"></i>
<span class="text-xl font-bold text-gray-800">SofaVision</span>
</div>
<div class="flex items-center space-x-4">
<a href="#" class="text-gray-700 hover:text-indigo-600 px-3 py-2 rounded-md text-sm font-medium">Home</a>
<a href="#" class="text-gray-700 hover:text-indigo-600 px-3 py-2 rounded-md text-sm font-medium">Gallery</a>
<a href="#" class="text-gray-700 hover:text-indigo-600 px-3 py-2 rounded-md text-sm font-medium">About</a>
</div>
</div>
</div>
</nav>
<!-- Hero Section -->
<div class="relative bg-gradient-to-r from-indigo-500 to-purple-600 text-white py-16">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
<h1 class="text-4xl md:text-5xl font-bold mb-4">3D Sofa Visualization</h1>
<p class="text-xl md:text-2xl mb-8">Precision-rendered sofa models with accurate dimensions</p>
<div class="flex justify-center space-x-4">
<button class="bg-white text-indigo-600 px-6 py-3 rounded-full font-medium hover:bg-gray-100 transition duration-300 flex items-center">
<i data-feather="download" class="mr-2"></i> Download CAD Files
</button>
<button class="bg-indigo-700 text-white px-6 py-3 rounded-full font-medium hover:bg-indigo-800 transition duration-300 flex items-center">
<i data-feather="rotate-cw" class="mr-2"></i> Customize Design
</button>
</div>
</div>
</div>
<!-- 3D Viewer Section -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div class="text-center mb-12">
<h2 class="text-3xl font-bold text-gray-800 mb-4">Interactive 3D Sofa Viewer</h2>
<p class="text-gray-600 max-w-3xl mx-auto">Explore our premium sofa model from every angle with realistic textures and lighting</p>
</div>
<div id="canvas-container" class="rounded-xl shadow-2xl overflow-hidden bg-gray-100">
<!-- 3D canvas will be inserted here by JavaScript -->
</div>
<div class="flex justify-center mt-8 space-x-4">
<button onclick="changeView('front')" class="angle-btn bg-white text-indigo-600 px-6 py-2 rounded-full font-medium border border-gray-200 hover:bg-gray-50 flex items-center">
<i data-feather="square" class="mr-2"></i> Front View
</button>
<button onclick="changeView('side')" class="angle-btn bg-white text-indigo-600 px-6 py-2 rounded-full font-medium border border-gray-200 hover:bg-gray-50 flex items-center">
<i data-feather="sidebar" class="mr-2"></i> Side View
</button>
<button onclick="changeView('top')" class="angle-btn bg-white text-indigo-600 px-6 py-2 rounded-full font-medium border border-gray-200 hover:bg-gray-50 flex items-center">
<i data-feather="maximize" class="mr-2"></i> Top View
</button>
<button onclick="changeView('iso')" class="angle-btn bg-indigo-600 text-white px-6 py-2 rounded-full font-medium hover:bg-indigo-700 flex items-center">
<i data-feather="rotate-cw" class="mr-2"></i> Isometric View
</button>
</div>
</div>
<!-- Dimensions Section -->
<div class="bg-gray-100 py-16">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-12">
<h2 class="text-3xl font-bold text-gray-800 mb-4">Precision Measurements</h2>
<p class="text-gray-600 max-w-3xl mx-auto">Every dimension is accurately represented in our 3D models</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div class="bg-white p-6 rounded-xl shadow-md">
<div class="flex items-center mb-4">
<div class="bg-indigo-100 p-3 rounded-full mr-4">
<i data-feather="maximize-2" class="text-indigo-600"></i>
</div>
<h3 class="text-xl font-semibold text-gray-800">Overall Dimensions</h3>
</div>
<ul class="space-y-3">
<li class="flex justify-between">
<span class="text-gray-600">Width</span>
<span class="font-medium">220 cm</span>
</li>
<li class="flex justify-between">
<span class="text-gray-600">Depth</span>
<span class="font-medium">95 cm</span>
</li>
<li class="flex justify-between">
<span class="text-gray-600">Height</span>
<span class="font-medium">85 cm</span>
</li>
</ul>
</div>
<div class="bg-white p-6 rounded-xl shadow-md">
<div class="flex items-center mb-4">
<div class="bg-indigo-100 p-3 rounded-full mr-4">
<i data-feather="layers" class="text-indigo-600"></i>
</div>
<h3 class="text-xl font-semibold text-gray-800">Seating Details</h3>
</div>
<ul class="space-y-3">
<li class="flex justify-between">
<span class="text-gray-600">Seat Height</span>
<span class="font-medium">45 cm</span>
</li>
<li class="flex justify-between">
<span class="text-gray-600">Seat Depth</span>
<span class="font-medium">60 cm</span>
</li>
<li class="flex justify-between">
<span class="text-gray-600">Back Height</span>
<span class="font-medium">40 cm</span>
</li>
</ul>
</div>
<div class="bg-white p-6 rounded-xl shadow-md">
<div class="flex items-center mb-4">
<div class="bg-indigo-100 p-3 rounded-full mr-4">
<i data-feather="box" class="text-indigo-600"></i>
</div>
<h3 class="text-xl font-semibold text-gray-800">Packaging Info</h3>
</div>
<ul class="space-y-3">
<li class="flex justify-between">
<span class="text-gray-600">Box Width</span>
<span class="font-medium">230 cm</span>
</li>
<li class="flex justify-between">
<span class="text-gray-600">Box Depth</span>
<span class="font-medium">100 cm</span>
</li>
<li class="flex justify-between">
<span class="text-gray-600">Box Height</span>
<span class="font-medium">90 cm</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-12">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 class="text-lg font-semibold mb-4">SofaVision</h3>
<p class="text-gray-400">Precision 3D sofa visualizations for designers and manufacturers.</p>
</div>
<div>
<h3 class="text-lg font-semibold mb-4">Quick Links</h3>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-white">Home</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Gallery</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Pricing</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Contact</a></li>
</ul>
</div>
<div>
<h3 class="text-lg font-semibold mb-4">Resources</h3>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-white">Documentation</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">API Reference</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Tutorials</a></li>
</ul>
</div>
<div>
<h3 class="text-lg font-semibold mb-4">Connect</h3>
<div class="flex space-x-4">
<a href="#" class="text-gray-400 hover:text-white"><i data-feather="facebook"></i></a>
<a href="#" class="text-gray-400 hover:text-white"><i data-feather="twitter"></i></a>
<a href="#" class="text-gray-400 hover:text-white"><i data-feather="instagram"></i></a>
<a href="#" class="text-gray-400 hover:text-white"><i data-feather="linkedin"></i></a>
</div>
</div>
</div>
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400">
<p>&copy; 2023 SofaVision. All rights reserved.</p>
</div>
</div>
</footer>
<script>
// This would be replaced with actual Three.js code for rendering a sofa
// For demonstration purposes, we're just showing a placeholder
function changeView(angle) {
alert(`View changed to ${angle} angle. In a real implementation, this would rotate the 3D model.`);
}
// Initialize Vanta.js background
VANTA.GLOBE({
el: "#canvas-container",
mouseControls: true,
touchControls: true,
gyroControls: false,
minHeight: 200.00,
minWidth: 200.00,
scale: 1.00,
scaleMobile: 1.00,
color: 0x3f83f8,
backgroundColor: 0xf1f5f9,
size: 1.00
});
// Initialize feather icons
feather.replace();
</script>
</body>
</html>