pixelgrid / index.html
RexyGrab's picture
Add 1 files
5691058 verified
Raw History Blame Contribute Delete
50.3 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PixelGrid - Your Digital Billboard</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">
<style>
.pixel {
border: 1px solid #e5e7eb;
transition: all 0.2s;
position: relative;
}
.pixel:hover {
transform: scale(1.05);
z-index: 10;
box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.pixel-available {
background-color: #f3f4f6;
}
.pixel-sold {
background-color: #ffffff;
}
.pixel-highlight {
background-color: #93c5fd !important;
}
.pixel-selected {
background-color: #60a5fa !important;
border: 1px solid #3b82f6 !important;
}
.grid-container {
overflow: auto;
max-width: 100%;
border: 2px solid #1e40af;
border-radius: 0.5rem;
background-color: #f9fafb;
}
.pixel-image {
width: 100%;
height: 100%;
object-fit: contain;
background-color: white;
}
.modal {
transition: all 0.3s ease;
opacity: 0;
visibility: hidden;
}
.modal.active {
opacity: 1;
visibility: visible;
}
.modal-content {
transform: scale(0.9);
transition: all 0.3s ease;
}
.modal.active .modal-content {
transform: scale(1);
}
@media (max-width: 768px) {
.pixel {
border-width: 0.5px;
}
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- Navigation -->
<nav class="bg-blue-800 text-white shadow-lg">
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-border-all text-2xl"></i>
<h1 class="text-2xl font-bold">PixelGrid</h1>
</div>
<div class="hidden md:flex space-x-6">
<a href="#about" class="hover:text-blue-200 transition">About</a>
<a href="#pricing" class="hover:text-blue-200 transition">Pricing</a>
<a href="#grid" class="hover:text-blue-200 transition">The Grid</a>
<a href="#contact" class="hover:text-blue-200 transition">Contact</a>
</div>
<button class="md:hidden text-xl" id="mobile-menu-button">
<i class="fas fa-bars"></i>
</button>
</div>
<!-- Mobile menu -->
<div class="md:hidden hidden bg-blue-700 px-4 py-2" id="mobile-menu">
<a href="#about" class="block py-2 hover:text-blue-200 transition">About</a>
<a href="#pricing" class="block py-2 hover:text-blue-200 transition">Pricing</a>
<a href="#grid" class="block py-2 hover:text-blue-200 transition">The Grid</a>
<a href="#contact" class="block py-2 hover:text-blue-200 transition">Contact</a>
</div>
</nav>
<!-- Hero Section -->
<header class="bg-gradient-to-r from-blue-600 to-blue-800 text-white py-16">
<div class="container mx-auto px-4 text-center">
<h1 class="text-4xl md:text-5xl font-bold mb-4">Own Your Piece of Digital Real Estate</h1>
<p class="text-xl md:text-2xl mb-8 max-w-3xl mx-auto">Advertise your brand on our pixel grid and get direct traffic to your website!</p>
<div class="flex flex-col md:flex-row justify-center gap-4">
<a href="#grid" class="bg-white text-blue-800 font-bold py-3 px-6 rounded-lg hover:bg-blue-100 transition duration-300">View Available Pixels</a>
<a href="#pricing" class="bg-transparent border-2 border-white text-white font-bold py-3 px-6 rounded-lg hover:bg-blue-700 transition duration-300">Pricing Plans</a>
</div>
</div>
</header>
<!-- About Section -->
<section id="about" class="py-16 bg-white">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-12 text-blue-800">About PixelGrid</h2>
<div class="flex flex-col md:flex-row items-center gap-8">
<div class="md:w-1/2">
<img src="https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Digital advertising" class="rounded-lg shadow-xl w-full h-auto">
</div>
<div class="md:w-1/2">
<h3 class="text-2xl font-semibold mb-4 text-blue-700">The Digital Billboard Revolution</h3>
<p class="text-gray-700 mb-4">PixelGrid is inspired by the original Million Dollar Homepage that took the internet by storm. We've created a modern, responsive platform where businesses and individuals can purchase pixel blocks to display their ads.</p>
<p class="text-gray-700 mb-6">Each pixel block you purchase becomes a clickable advertisement that directs visitors straight to your website. It's simple, effective, and gets your brand in front of thousands of potential customers.</p>
<div class="bg-blue-50 p-4 rounded-lg border-l-4 border-blue-600">
<p class="text-blue-800 font-medium"><i class="fas fa-lightbulb mr-2"></i> Did you know? The original Million Dollar Homepage sold all its pixels in just 5 months!</p>
</div>
</div>
</div>
</div>
</section>
<!-- Pricing Section -->
<section id="pricing" class="py-16 bg-gray-50">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-4 text-blue-800">Simple Pricing</h2>
<p class="text-center text-gray-600 max-w-2xl mx-auto mb-12">Choose the perfect pixel block size for your advertising needs. All prices are one-time payments.</p>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8 max-w-5xl mx-auto">
<!-- Small Block -->
<div class="bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200 hover:border-blue-500 transition duration-300">
<div class="bg-blue-600 text-white py-4 px-6">
<h3 class="text-xl font-bold">10×10 Block</h3>
<p class="text-blue-100">Perfect for small brands</p>
</div>
<div class="p-6">
<div class="text-3xl font-bold mb-4">$10</div>
<ul class="space-y-3 mb-6">
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> 100 pixels total</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Image upload</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Clickable link</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Permanent placement</li>
</ul>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded transition duration-300" onclick="showPurchaseModal(10)">Select Block</button>
</div>
</div>
<!-- Medium Block -->
<div class="bg-white rounded-lg shadow-lg overflow-hidden border-2 border-blue-500 transform scale-105 z-10">
<div class="bg-blue-700 text-white py-4 px-6">
<h3 class="text-xl font-bold">20×20 Block</h3>
<p class="text-blue-100">Most popular choice</p>
</div>
<div class="p-6">
<div class="text-3xl font-bold mb-4">$35 <span class="text-sm font-normal text-gray-500">(Save $5)</span></div>
<ul class="space-y-3 mb-6">
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> 400 pixels total</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Image upload</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Clickable link</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Permanent placement</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Priority positioning</li>
</ul>
<button class="w-full bg-blue-700 hover:bg-blue-800 text-white font-bold py-3 px-4 rounded transition duration-300" onclick="showPurchaseModal(20)">Select Block</button>
</div>
</div>
<!-- Large Block -->
<div class="bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200 hover:border-blue-500 transition duration-300">
<div class="bg-blue-600 text-white py-4 px-6">
<h3 class="text-xl font-bold">50×50 Block</h3>
<p class="text-blue-100">For maximum visibility</p>
</div>
<div class="p-6">
<div class="text-3xl font-bold mb-4">$200 <span class="text-sm font-normal text-gray-500">(Save $50)</span></div>
<ul class="space-y-3 mb-6">
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> 2,500 pixels total</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Image upload</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Clickable link</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Permanent placement</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Premium positioning</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i> Featured in newsletter</li>
</ul>
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded transition duration-300" onclick="showPurchaseModal(50)">Select Block</button>
</div>
</div>
</div>
<div class="mt-12 bg-white p-6 rounded-lg shadow-md max-w-4xl mx-auto">
<h3 class="text-xl font-semibold mb-4 text-blue-700">Custom Block Sizes</h3>
<p class="text-gray-700 mb-4">Need a different size? We offer custom pixel block configurations to meet your specific advertising needs.</p>
<button class="bg-gray-800 hover:bg-gray-900 text-white font-bold py-2 px-4 rounded transition duration-300" onclick="showCustomSizeModal()">Request Custom Size</button>
</div>
</div>
</section>
<!-- The Grid Section -->
<section id="grid" class="py-16 bg-white">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-4 text-blue-800">The Pixel Grid</h2>
<p class="text-center text-gray-600 max-w-2xl mx-auto mb-8">Click and drag to explore. Select available blocks to purchase.</p>
<div class="flex flex-col md:flex-row gap-8">
<div class="md:w-3/4">
<!-- Grid Controls -->
<div class="flex justify-between items-center mb-4">
<div class="flex items-center space-x-2">
<button id="zoom-in" class="bg-gray-200 hover:bg-gray-300 p-2 rounded">
<i class="fas fa-search-plus"></i>
</button>
<button id="zoom-out" class="bg-gray-200 hover:bg-gray-300 p-2 rounded">
<i class="fas fa-search-minus"></i>
</button>
<button id="reset-zoom" class="bg-gray-200 hover:bg-gray-300 p-2 rounded">
<i class="fas fa-expand"></i>
</button>
</div>
<div class="text-sm text-gray-600">
<span id="selected-count">0</span> pixels selected
</div>
</div>
<!-- The Pixel Grid -->
<div class="grid-container relative" id="grid-container">
<div id="pixel-grid" class="grid grid-cols-100 gap-0 bg-white" style="width: 1000px; height: 1000px;"></div>
</div>
<div class="mt-4 flex justify-between items-center">
<div class="text-sm text-gray-600">
Grid size: 100×100 (10,000 total pixels)
</div>
<div class="text-sm text-gray-600">
<span id="available-pixels">9,500</span> pixels available
</div>
</div>
</div>
<!-- Purchase Panel -->
<div class="md:w-1/4">
<div class="bg-gray-50 p-6 rounded-lg shadow-md sticky top-4">
<h3 class="text-xl font-semibold mb-4 text-blue-700">Purchase Details</h3>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2" for="block-size">
Selected Block Size
</label>
<select id="block-size" class="block w-full bg-white border border-gray-300 rounded py-2 px-3 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="10">10×10 ($10)</option>
<option value="20">20×20 ($35)</option>
<option value="50">50×50 ($200)</option>
</select>
</div>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2">
Selected Coordinates
</label>
<div id="selected-coordinates" class="bg-white p-3 rounded border border-gray-300 text-sm h-24 overflow-y-auto">
No pixels selected
</div>
</div>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2">
Total Cost
</label>
<div class="text-2xl font-bold text-blue-700" id="total-cost">$0</div>
</div>
<button id="purchase-button" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded transition duration-300 disabled:opacity-50 disabled:cursor-not-allowed" disabled onclick="showPurchaseModal()">
Purchase Selected
</button>
<div class="mt-4 text-sm text-gray-600">
<p>Or click directly on the grid to select blocks</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Stats Section -->
<section class="py-12 bg-blue-800 text-white">
<div class="container mx-auto px-4">
<div class="grid grid-cols-2 md:grid-cols-4 gap-8 text-center">
<div>
<div class="text-4xl font-bold mb-2" id="total-pixels-sold">500</div>
<div class="text-blue-200">Pixels Sold</div>
</div>
<div>
<div class="text-4xl font-bold mb-2" id="total-revenue">$5,000</div>
<div class="text-blue-200">Revenue Generated</div>
</div>
<div>
<div class="text-4xl font-bold mb-2" id="daily-visitors">1,200</div>
<div class="text-blue-200">Daily Visitors</div>
</div>
<div>
<div class="text-4xl font-bold mb-2" id="days-remaining">120</div>
<div class="text-blue-200">Days Until Sold Out</div>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact" class="py-16 bg-white">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-12 text-blue-800">Have Questions?</h2>
<div class="flex flex-col md:flex-row gap-12 max-w-6xl mx-auto">
<div class="md:w-1/2">
<form class="space-y-6">
<div>
<label for="name" class="block text-gray-700 font-medium mb-2">Your Name</label>
<input type="text" id="name" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label for="email" class="block text-gray-700 font-medium mb-2">Email Address</label>
<input type="email" id="email" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label for="message" class="block text-gray-700 font-medium mb-2">Your Message</label>
<textarea id="message" rows="5" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
</div>
<button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg transition duration-300 w-full">
Send Message
</button>
</form>
</div>
<div class="md:w-1/2">
<div class="bg-gray-50 p-6 rounded-lg shadow-sm h-full">
<h3 class="text-xl font-semibold mb-4 text-blue-700">Contact Information</h3>
<div class="space-y-4">
<div class="flex items-start">
<i class="fas fa-envelope text-blue-600 mt-1 mr-3"></i>
<div>
<h4 class="font-medium text-gray-800">Email</h4>
<p class="text-gray-600">contact@pixelgrid.com</p>
</div>
</div>
<div class="flex items-start">
<i class="fas fa-phone-alt text-blue-600 mt-1 mr-3"></i>
<div>
<h4 class="font-medium text-gray-800">Phone</h4>
<p class="text-gray-600">+1 (555) 123-4567</p>
</div>
</div>
<div class="flex items-start">
<i class="fas fa-map-marker-alt text-blue-600 mt-1 mr-3"></i>
<div>
<h4 class="font-medium text-gray-800">Address</h4>
<p class="text-gray-600">123 Digital Street, Silicon Valley, CA 94025</p>
</div>
</div>
</div>
<div class="mt-8">
<h4 class="font-medium text-gray-800 mb-3">Follow Us</h4>
<div class="flex space-x-4">
<a href="#" class="text-blue-600 hover:text-blue-800 text-xl"><i class="fab fa-twitter"></i></a>
<a href="#" class="text-blue-600 hover:text-blue-800 text-xl"><i class="fab fa-facebook"></i></a>
<a href="#" class="text-blue-600 hover:text-blue-800 text-xl"><i class="fab fa-instagram"></i></a>
<a href="#" class="text-blue-600 hover:text-blue-800 text-xl"><i class="fab fa-linkedin"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-8">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<div class="flex items-center space-x-2">
<i class="fas fa-border-all text-xl"></i>
<h2 class="text-xl font-bold">PixelGrid</h2>
</div>
<p class="text-gray-400 text-sm mt-1">Your digital advertising platform</p>
</div>
<div class="flex flex-col md:flex-row space-y-2 md:space-y-0 md:space-x-6 text-sm">
<a href="#" class="hover:text-blue-300 transition">Terms of Service</a>
<a href="#" class="hover:text-blue-300 transition">Privacy Policy</a>
<a href="#" class="hover:text-blue-300 transition">FAQ</a>
<a href="#" class="hover:text-blue-300 transition">Refund Policy</a>
</div>
</div>
<div class="border-t border-gray-700 mt-6 pt-6 text-center text-gray-400 text-sm">
<p>&copy; 2023 PixelGrid. All rights reserved.</p>
</div>
</div>
</footer>
<!-- Purchase Modal -->
<div id="purchase-modal" class="modal fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
<div class="modal-content bg-white rounded-lg shadow-xl w-full max-w-md mx-4">
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-blue-800">Purchase Pixel Block</h3>
<button onclick="hideModal('purchase-modal')" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-6">
<div class="flex justify-between mb-2">
<span class="text-gray-700">Block Size:</span>
<span class="font-medium" id="modal-block-size">10×10</span>
</div>
<div class="flex justify-between mb-2">
<span class="text-gray-700">Total Pixels:</span>
<span class="font-medium" id="modal-total-pixels">100</span>
</div>
<div class="flex justify-between mb-4">
<span class="text-gray-700">Total Cost:</span>
<span class="text-xl font-bold text-blue-700" id="modal-total-cost">$10</span>
</div>
<div class="border-t border-gray-200 pt-4">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="pixel-url">
Destination URL
</label>
<input type="url" id="pixel-url" class="w-full px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="https://yourwebsite.com">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="pixel-image">
Upload Image (optional)
</label>
<div class="flex items-center justify-center w-full">
<label for="pixel-image-upload" class="flex flex-col items-center justify-center w-full h-32 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 hover:bg-gray-100">
<div class="flex flex-col items-center justify-center pt-5 pb-6">
<i class="fas fa-cloud-upload-alt text-gray-400 text-3xl mb-2"></i>
<p class="mb-2 text-sm text-gray-500">Click to upload or drag and drop</p>
<p class="text-xs text-gray-500">PNG, JPG (max. 100KB)</p>
</div>
<input id="pixel-image-upload" type="file" class="hidden" accept="image/png, image/jpeg" />
</label>
</div>
<div id="image-preview" class="mt-2 hidden">
<img id="preview-image" src="#" alt="Preview" class="max-w-full h-auto max-h-32 mx-auto">
<button type="button" onclick="removeImage()" class="mt-2 text-red-600 text-sm hover:text-red-800">
<i class="fas fa-trash mr-1"></i> Remove Image
</button>
</div>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="pixel-email">
Your Email
</label>
<input type="email" id="pixel-email" class="w-full px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="your@email.com" required>
</div>
</div>
</div>
<div class="flex justify-end space-x-3">
<button onclick="hideModal('purchase-modal')" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-100 transition">
Cancel
</button>
<button onclick="completePurchase()" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition">
Complete Purchase
</button>
</div>
</div>
</div>
</div>
<!-- Custom Size Modal -->
<div id="custom-size-modal" class="modal fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
<div class="modal-content bg-white rounded-lg shadow-xl w-full max-w-md mx-4">
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-blue-800">Request Custom Size</h3>
<button onclick="hideModal('custom-size-modal')" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-6">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="custom-width">
Width (in pixels)
</label>
<input type="number" id="custom-width" min="10" max="100" class="w-full px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="e.g. 30">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="custom-height">
Height (in pixels)
</label>
<input type="number" id="custom-height" min="10" max="100" class="w-full px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="e.g. 40">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="custom-email">
Your Email
</label>
<input type="email" id="custom-email" class="w-full px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="your@email.com" required>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="custom-message">
Additional Notes
</label>
<textarea id="custom-message" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Any special requirements..."></textarea>
</div>
</div>
<div class="flex justify-end space-x-3">
<button onclick="hideModal('custom-size-modal')" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-100 transition">
Cancel
</button>
<button onclick="submitCustomRequest()" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition">
Submit Request
</button>
</div>
</div>
</div>
</div>
<!-- Success Modal -->
<div id="success-modal" class="modal fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
<div class="modal-content bg-white rounded-lg shadow-xl w-full max-w-md mx-4">
<div class="p-6 text-center">
<div class="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100 mb-4">
<i class="fas fa-check text-green-600 text-xl"></i>
</div>
<h3 class="text-lg font-medium text-gray-900 mb-2" id="success-title">Purchase Successful!</h3>
<div class="mt-2 text-sm text-gray-500" id="success-message">
Your pixel block has been reserved. We've sent a confirmation email with payment instructions.
</div>
<div class="mt-6">
<button onclick="hideModal('success-modal')" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition">
Continue Browsing
</button>
</div>
</div>
</div>
</div>
<script>
// Mobile menu toggle
document.getElementById('mobile-menu-button').addEventListener('click', function() {
const menu = document.getElementById('mobile-menu');
menu.classList.toggle('hidden');
});
// Initialize the pixel grid
document.addEventListener('DOMContentLoaded', function() {
initializeGrid();
setupEventListeners();
});
// Grid variables
const GRID_SIZE = 100;
const PIXEL_SIZE = 10; // Each pixel is 10px × 10px
let selectedPixels = [];
let currentBlockSize = 10;
let zoomLevel = 1;
// Initialize the grid
function initializeGrid() {
const grid = document.getElementById('pixel-grid');
grid.innerHTML = '';
// Create 100×100 grid
for (let y = 0; y < GRID_SIZE; y++) {
for (let x = 0; x < GRID_SIZE; x++) {
const pixel = document.createElement('div');
pixel.className = 'pixel pixel-available';
pixel.dataset.x = x;
pixel.dataset.y = y;
// Randomly mark some pixels as sold (for demo purposes)
if (Math.random() < 0.05) {
pixel.classList.remove('pixel-available');
pixel.classList.add('pixel-sold');
// Add a demo image to some sold pixels
if (Math.random() < 0.3) {
const img = document.createElement('img');
img.src = `https://picsum.photos/50/50?random=${x}${y}`;
img.className = 'pixel-image';
img.alt = `Ad at ${x},${y}`;
pixel.appendChild(img);
// Make it clickable
pixel.onclick = function(e) {
e.preventDefault();
e.stopPropagation();
window.open('https://example.com', '_blank');
};
}
}
pixel.addEventListener('click', function() {
handlePixelClick(x, y);
});
pixel.addEventListener('mouseover', function() {
highlightBlock(x, y, currentBlockSize);
});
pixel.addEventListener('mouseout', function() {
clearHighlights();
});
grid.appendChild(pixel);
}
}
// Update available pixels count
updateAvailablePixels();
}
// Set up event listeners
function setupEventListeners() {
// Block size selector
document.getElementById('block-size').addEventListener('change', function() {
currentBlockSize = parseInt(this.value);
clearSelection();
});
// Zoom controls
document.getElementById('zoom-in').addEventListener('click', function() {
zoomLevel = Math.min(zoomLevel + 0.1, 2);
updateZoom();
});
document.getElementById('zoom-out').addEventListener('click', function() {
zoomLevel = Math.max(zoomLevel - 0.1, 0.5);
updateZoom();
});
document.getElementById('reset-zoom').addEventListener('click', function() {
zoomLevel = 1;
updateZoom();
});
// Image upload preview
document.getElementById('pixel-image-upload').addEventListener('change', function(e) {
if (e.target.files.length > 0) {
const file = e.target.files[0];
const reader = new FileReader();
reader.onload = function(event) {
document.getElementById('preview-image').src = event.target.result;
document.getElementById('image-preview').classList.remove('hidden');
};
reader.readAsDataURL(file);
}
});
}
// Handle pixel click
function handlePixelClick(x, y) {
const pixel = getPixelElement(x, y);
// Don't allow selection of sold pixels
if (pixel.classList.contains('pixel-sold')) {
return;
}
// Check if we can select a block starting at this pixel
if (!canSelectBlock(x, y, currentBlockSize)) {
alert('This block would extend beyond the grid or include sold pixels. Please select a different area.');
return;
}
// Clear previous selection
clearSelection();
// Select the block
selectBlock(x, y, currentBlockSize);
}
// Get pixel element at coordinates
function getPixelElement(x, y) {
return document.querySelector(`.pixel[data-x="${x}"][data-y="${y}"]`);
}
// Check if a block can be selected
function canSelectBlock(startX, startY, size) {
for (let y = startY; y < startY + size; y++) {
for (let x = startX; x < startX + size; x++) {
// Check if coordinates are within grid
if (x >= GRID_SIZE || y >= GRID_SIZE) {
return false;
}
// Check if pixel is already sold
const pixel = getPixelElement(x, y);
if (pixel.classList.contains('pixel-sold')) {
return false;
}
}
}
return true;
}
// Select a block of pixels
function selectBlock(startX, startY, size) {
selectedPixels = [];
for (let y = startY; y < startY + size; y++) {
for (let x = startX; x < startX + size; x++) {
const pixel = getPixelElement(x, y);
pixel.classList.add('pixel-selected');
selectedPixels.push({x, y});
}
}
// Update UI
updateSelectionUI(startX, startY, size);
}
// Highlight a block on hover
function highlightBlock(startX, startY, size) {
// Don't highlight if we're in the middle of a selection
if (selectedPixels.length > 0) return;
// Don't highlight if the block can't be selected
if (!canSelectBlock(startX, startY, size)) return;
for (let y = startY; y < startY + size; y++) {
for (let x = startX; x < startX + size; x++) {
const pixel = getPixelElement(x, y);
if (!pixel.classList.contains('pixel-sold')) {
pixel.classList.add('pixel-highlight');
}
}
}
}
// Clear all highlights
function clearHighlights() {
if (selectedPixels.length > 0) return;
document.querySelectorAll('.pixel-highlight').forEach(pixel => {
pixel.classList.remove('pixel-highlight');
});
}
// Clear current selection
function clearSelection() {
selectedPixels.forEach(pixel => {
const element = getPixelElement(pixel.x, pixel.y);
element.classList.remove('pixel-selected');
});
selectedPixels = [];
updateSelectionUI();
}
// Update UI based on current selection
function updateSelectionUI(startX, startY, size) {
const selectedCount = selectedPixels.length;
document.getElementById('selected-count').textContent = selectedCount;
// Update coordinates display
const coordinatesElement = document.getElementById('selected-coordinates');
if (selectedCount > 0) {
coordinatesElement.innerHTML = `Block: ${startX},${startY} to ${startX+size-1},${startY+size-1}`;
} else {
coordinatesElement.textContent = 'No pixels selected';
}
// Update total cost
const totalCost = calculateTotalCost();
document.getElementById('total-cost').textContent = `$${totalCost}`;
// Enable/disable purchase button
document.getElementById('purchase-button').disabled = selectedCount === 0;
}
// Calculate total cost based on block size
function calculateTotalCost() {
if (selectedPixels.length === 0) return 0;
const blockSize = currentBlockSize;
// Pricing based on block size
if (blockSize === 10) return 10;
if (blockSize === 20) return 35;
if (blockSize === 50) return 200;
// Default price per pixel for other sizes
return selectedPixels.length * 0.01;
}
// Update zoom level
function updateZoom() {
const grid = document.getElementById('pixel-grid');
grid.style.transform = `scale(${zoomLevel})`;
grid.style.transformOrigin = '0 0';
}
// Update available pixels count
function updateAvailablePixels() {
const available = document.querySelectorAll('.pixel-available').length;
document.getElementById('available-pixels').textContent = available;
}
// Show purchase modal
function showPurchaseModal(blockSize = null) {
if (blockSize) {
currentBlockSize = blockSize;
document.getElementById('block-size').value = blockSize;
// Simulate selecting a random available block
findAvailableBlock(blockSize);
}
if (selectedPixels.length === 0) {
alert('Please select a block of pixels first.');
return;
}
// Set modal values
document.getElementById('modal-block-size').textContent = `${currentBlockSize}×${currentBlockSize}`;
document.getElementById('modal-total-pixels').textContent = selectedPixels.length;
document.getElementById('modal-total-cost').textContent = `$${calculateTotalCost()}`;
// Show modal
document.getElementById('purchase-modal').classList.add('active');
}
// Find an available block of given size (for demo purposes)
function findAvailableBlock(size) {
// Try to find a random available block
for (let attempt = 0; attempt < 100; attempt++) {
const x = Math.floor(Math.random() * (GRID_SIZE - size));
const y = Math.floor(Math.random() * (GRID_SIZE - size));
if (canSelectBlock(x, y, size)) {
clearSelection();
selectBlock(x, y, size);
return;
}
}
alert('Could not find an available block of that size. Please try a smaller size or different location.');
}
// Hide modal
function hideModal(modalId) {
document.getElementById(modalId).classList.remove('active');
// Reset image preview if it's the purchase modal
if (modalId === 'purchase-modal') {
document.getElementById('pixel-image-upload').value = '';
document.getElementById('image-preview').classList.add('hidden');
}
}
// Remove uploaded image
function removeImage() {
document.getElementById('pixel-image-upload').value = '';
document.getElementById('image-preview').classList.add('hidden');
document.getElementById('preview-image').src = '#';
}
// Show custom size modal
function showCustomSizeModal() {
document.getElementById('custom-size-modal').classList.add('active');
}
// Complete purchase
function completePurchase() {
const email = document.getElementById('pixel-email').value;
const url = document.getElementById('pixel-url').value;
// Simple validation
if (!email || !url) {
alert('Please provide both your email and a destination URL.');
return;
}
// In a real app, you would process payment here
// For this demo, we'll just show a success message
// Mark pixels as sold
selectedPixels.forEach(pixel => {
const element = getPixelElement(pixel.x, pixel.y);
element.classList.remove('pixel-available');
element.classList.add('pixel-sold');
// Add image if uploaded
const fileInput = document.getElementById('pixel-image-upload');
if (fileInput.files.length > 0) {
const img = document.createElement('img');
img.src = URL.createObjectURL(fileInput.files[0]);
img.className = 'pixel-image';
img.alt = 'Your ad';
element.appendChild(img);
}
// Make it clickable
element.onclick = function(e) {
e.preventDefault();
e.stopPropagation();
window.open(url, '_blank');
};
});
// Update stats
updateAvailablePixels();
updateStats();
// Hide purchase modal
hideModal('purchase-modal');
// Show success modal
document.getElementById('success-title').textContent = 'Purchase Successful!';
document.getElementById('success-message').textContent = 'Your pixel block has been reserved. We\'ve sent a confirmation email with payment instructions.';
document.getElementById('success-modal').classList.add('active');
// Clear selection
clearSelection();
}
// Submit custom size request
function submitCustomRequest() {
const width = parseInt(document.getElementById('custom-width').value);
const height = parseInt(document.getElementById('custom-height').value);
const email = document.getElementById('custom-email').value;
if (!width || !height || !email) {
alert('Please fill in all required fields.');
return;
}
if (width < 10 || width > 100 || height < 10 || height > 100) {
alert('Please enter dimensions between 10 and 100 pixels.');
return;
}
// In a real app, you would send this to your backend
console.log('Custom request submitted:', {width, height, email});
// Hide modal
hideModal('custom-size-modal');
// Show success modal
document.getElementById('success-title').textContent = 'Request Received!';
document.getElementById('success-message').textContent = 'We\'ve received your custom size request and will contact you shortly with pricing details.';
document.getElementById('success-modal').classList.add('active');
}
// Update stats (for demo purposes)
function updateStats() {
const soldPixels = GRID_SIZE * GRID_SIZE - document.querySelectorAll('.pixel-available').length;
const revenue = soldPixels * 0.01; // $0.01 per pixel for demo
document.getElementById('total-pixels-sold').textContent = soldPixels;
document.getElementById('total-revenue').textContent = `$${revenue.toLocaleString()}`;
// Randomize other stats for demo
document.getElementById('daily-visitors').textContent = Math.floor(1000 + Math.random() * 500);
document.getElementById('days-remaining').textContent = Math.floor(365 * (1 - soldPixels / (GRID_SIZE * GRID_SIZE)));
}
</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=RexyGrab/pixelgrid" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>