Spaces:
Running
Running
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>InstaAnalyzer - Competitor Insights Tool</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> | |
.gradient-bg { | |
background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%); | |
} | |
.card-hover:hover { | |
transform: translateY(-5px); | |
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); | |
} | |
.loading-spinner { | |
border-top-color: #ec4899; | |
animation: spin 1s linear infinite; | |
} | |
@keyframes spin { | |
0% { transform: rotate(0deg); } | |
100% { transform: rotate(360deg); } | |
} | |
</style> | |
</head> | |
<body class="bg-gray-50 min-h-screen"> | |
<!-- Navigation --> | |
<nav class="gradient-bg text-white shadow-lg"> | |
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> | |
<div class="flex justify-between h-16 items-center"> | |
<div class="flex items-center"> | |
<i class="fab fa-instagram text-2xl mr-2"></i> | |
<span class="text-xl font-bold">InstaAnalyzer</span> | |
</div> | |
<div class="hidden md:block"> | |
<div class="ml-10 flex items-baseline space-x-4"> | |
<a href="#" class="px-3 py-2 rounded-md text-sm font-medium bg-white bg-opacity-20">Dashboard</a> | |
<a href="#" class="px-3 py-2 rounded-md text-sm font-medium hover:bg-white hover:bg-opacity-20">Reports</a> | |
<a href="#" class="px-3 py-2 rounded-md text-sm font-medium hover:bg-white hover:bg-opacity-20">Pricing</a> | |
<a href="#" class="px-3 py-2 rounded-md text-sm font-medium hover:bg-white hover:bg-opacity-20">Support</a> | |
</div> | |
</div> | |
<div class="hidden md:block"> | |
<button class="bg-white text-pink-600 px-4 py-2 rounded-md text-sm font-medium hover:bg-gray-100">Logout</button> | |
</div> | |
</div> | |
</div> | |
</nav> | |
<!-- Main Content --> | |
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"> | |
<div class="mb-8"> | |
<h1 class="text-3xl font-bold text-gray-900">Competitor Analysis</h1> | |
<p class="mt-2 text-gray-600">Analyze competitor Instagram accounts and optimize your strategy</p> | |
</div> | |
<!-- Connect Account Section --> | |
<div class="bg-white rounded-lg shadow-md p-6 mb-8"> | |
<div class="flex items-center justify-between"> | |
<div> | |
<h2 class="text-xl font-semibold text-gray-800">Connect Your Instagram Account</h2> | |
<p class="text-gray-600 mt-1">Secure connection required to access competitor data</p> | |
</div> | |
<button id="connectBtn" class="gradient-bg text-white px-6 py-3 rounded-md font-medium hover:opacity-90 transition"> | |
<i class="fab fa-instagram mr-2"></i> Connect Instagram | |
</button> | |
</div> | |
</div> | |
<!-- Analysis Form (initially hidden) --> | |
<div id="analysisForm" class="hidden bg-white rounded-lg shadow-md p-6 mb-8"> | |
<h2 class="text-xl font-semibold text-gray-800 mb-4">Analyze Competitor Account</h2> | |
<div class="grid grid-cols-1 md:grid-cols-3 gap-6"> | |
<div> | |
<label for="competitorUsername" class="block text-sm font-medium text-gray-700 mb-1">Competitor Username</label> | |
<input type="text" id="competitorUsername" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-pink-500 focus:border-pink-500" placeholder="e.g., nike"> | |
</div> | |
<div> | |
<label for="postLimit" class="block text-sm font-medium text-gray-700 mb-1">Number of Posts</label> | |
<select id="postLimit" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-pink-500 focus:border-pink-500"> | |
<option value="10">10 Posts</option> | |
<option value="25">25 Posts</option> | |
<option value="50">50 Posts</option> | |
<option value="100">100 Posts</option> | |
</select> | |
</div> | |
<div class="flex items-end"> | |
<button id="analyzeBtn" class="gradient-bg text-white px-6 py-2 rounded-md font-medium hover:opacity-90 transition w-full"> | |
Analyze Competitor | |
</button> | |
</div> | |
</div> | |
</div> | |
<!-- Loading State --> | |
<div id="loadingState" class="hidden flex flex-col items-center justify-center py-12"> | |
<div class="w-16 h-16 border-4 border-pink-500 border-solid rounded-full loading-spinner mb-4"></div> | |
<p class="text-gray-700">Analyzing competitor posts. This may take a few minutes...</p> | |
</div> | |
<!-- Results Section --> | |
<div id="resultsSection" class="hidden"> | |
<div class="flex justify-between items-center mb-6"> | |
<h2 class="text-2xl font-bold text-gray-800">Analysis Results</h2> | |
<div class="flex space-x-2"> | |
<button id="sortLikesBtn" class="bg-pink-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-pink-700"> | |
Sort by Likes <i class="fas fa-arrow-down ml-1"></i> | |
</button> | |
<button id="sortCommentsBtn" class="bg-gray-200 text-gray-700 px-4 py-2 rounded-md text-sm font-medium hover:bg-gray-300"> | |
Sort by Comments | |
</button> | |
<button id="sortDateBtn" class="bg-gray-200 text-gray-700 px-4 py-2 rounded-md text-sm font-medium hover:bg-gray-300"> | |
Sort by Date | |
</button> | |
</div> | |
</div> | |
<div id="resultsGrid" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> | |
<!-- Results will be populated here by JavaScript --> | |
</div> | |
</div> | |
<!-- Sample Data (hidden by default) --> | |
<div id="sampleData" class="hidden"> | |
<!-- This will be used by JavaScript to clone sample posts --> | |
<div class="post-card bg-white rounded-lg shadow-md overflow-hidden card-hover transition duration-300"> | |
<div class="relative"> | |
<img src="https://via.placeholder.com/600x600" alt="Post image" class="w-full h-64 object-cover"> | |
<div class="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black to-transparent p-4"> | |
<div class="flex justify-between items-center text-white"> | |
<span class="font-semibold">Posted: <span class="post-date">2 days ago</span></span> | |
<div class="flex items-center space-x-4"> | |
<span class="flex items-center"> | |
<i class="fas fa-heart mr-1"></i> | |
<span class="post-likes">12.4k</span> | |
</span> | |
<span class="flex items-center"> | |
<i class="fas fa-comment mr-1"></i> | |
<span class="post-comments">843</span> | |
</span> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="p-4"> | |
<p class="post-caption text-gray-700 mb-3 line-clamp-2">This is a sample Instagram post caption that would be analyzed for performance metrics...</p> | |
<a href="#" class="post-link text-pink-600 hover:underline flex items-center"> | |
<i class="fas fa-external-link-alt mr-2"></i> View on Instagram | |
</a> | |
</div> | |
</div> | |
</div> | |
</main> | |
<!-- Footer --> | |
<footer class="bg-gray-800 text-white py-8"> | |
<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">InstaAnalyzer</h3> | |
<p class="text-gray-400">Powerful Instagram analytics and competitor research tools to grow your brand.</p> | |
</div> | |
<div> | |
<h3 class="text-lg font-semibold mb-4">Features</h3> | |
<ul class="space-y-2"> | |
<li><a href="#" class="text-gray-400 hover:text-white">Competitor Analysis</a></li> | |
<li><a href="#" class="text-gray-400 hover:text-white">Post Performance</a></li> | |
<li><a href="#" class="text-gray-400 hover:text-white">Audience Insights</a></li> | |
<li><a href="#" class="text-gray-400 hover:text-white">Content Strategy</a></li> | |
</ul> | |
</div> | |
<div> | |
<h3 class="text-lg font-semibold mb-4">Legal</h3> | |
<ul class="space-y-2"> | |
<li><a href="#" class="text-gray-400 hover:text-white">Terms of Service</a></li> | |
<li><a href="#" class="text-gray-400 hover:text-white">Privacy Policy</a></li> | |
<li><a href="#" class="text-gray-400 hover:text-white">Cookie Policy</a></li> | |
</ul> | |
</div> | |
<div> | |
<h3 class="text-lg font-semibold mb-4">Contact</h3> | |
<ul class="space-y-2"> | |
<li class="text-gray-400">support@instaanalyzer.com</li> | |
<li class="text-gray-400">+1 (555) 123-4567</li> | |
<li class="flex space-x-4 mt-4"> | |
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-twitter"></i></a> | |
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-facebook"></i></a> | |
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-linkedin"></i></a> | |
</li> | |
</ul> | |
</div> | |
</div> | |
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400"> | |
<p>© 2023 InstaAnalyzer. All rights reserved.</p> | |
</div> | |
</div> | |
</footer> | |
<script> | |
document.addEventListener('DOMContentLoaded', function() { | |
// DOM elements | |
const connectBtn = document.getElementById('connectBtn'); | |
const analysisForm = document.getElementById('analysisForm'); | |
const analyzeBtn = document.getElementById('analyzeBtn'); | |
const loadingState = document.getElementById('loadingState'); | |
const resultsSection = document.getElementById('resultsSection'); | |
const resultsGrid = document.getElementById('resultsGrid'); | |
const samplePost = document.querySelector('#sampleData .post-card'); | |
const sortLikesBtn = document.getElementById('sortLikesBtn'); | |
const sortCommentsBtn = document.getElementById('sortCommentsBtn'); | |
const sortDateBtn = document.getElementById('sortDateBtn'); | |
// Sample competitor data | |
const samplePosts = [ | |
{ | |
image: 'https://source.unsplash.com/random/600x600/?fashion', | |
date: '3 hours ago', | |
likes: '24.7k', | |
comments: '1.2k', | |
caption: 'Our new summer collection is now live! Check out these amazing styles that are perfect for the season. #summerfashion #newcollection', | |
link: '#' | |
}, | |
{ | |
image: 'https://source.unsplash.com/random/600x600/?model', | |
date: '1 day ago', | |
likes: '18.3k', | |
comments: '945', | |
caption: 'Behind the scenes at our latest photoshoot with the incredible @modelname. The energy was electric! #photoshoot #behindthescenes', | |
link: '#' | |
}, | |
{ | |
image: 'https://source.unsplash.com/random/600x600/?shoes', | |
date: '2 days ago', | |
likes: '32.1k', | |
comments: '2.4k', | |
caption: 'These limited edition sneakers are selling out fast! Get yours before theyre gone forever. #sneakers #limitededition', | |
link: '#' | |
}, | |
{ | |
image: 'https://source.unsplash.com/random/600x600/?accessories', | |
date: '3 days ago', | |
likes: '15.6k', | |
comments: '782', | |
caption: 'Accessorize your look with our new jewelry line. Perfect for any occasion and any outfit. #jewelry #accessories', | |
link: '#' | |
}, | |
{ | |
image: 'https://source.unsplash.com/random/600x600/?sale', | |
date: '4 days ago', | |
likes: '28.9k', | |
comments: '1.8k', | |
caption: 'FLASH SALE! 50% off everything for the next 24 hours only. Use code FLASH50 at checkout. Dont miss out! #flashsale #discount', | |
link: '#' | |
}, | |
{ | |
image: 'https://source.unsplash.com/random/600x600/?event', | |
date: '5 days ago', | |
likes: '9.7k', | |
comments: '512', | |
caption: 'Thank you to everyone who came out to our launch event last night! The turnout was incredible. #launchevent #thankyou', | |
link: '#' | |
} | |
]; | |
// Connect Instagram button click handler | |
connectBtn.addEventListener('click', function() { | |
// Simulate connection process | |
connectBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Connecting...'; | |
connectBtn.disabled = true; | |
setTimeout(function() { | |
connectBtn.innerHTML = '<i class="fas fa-check-circle mr-2"></i> Connected'; | |
analysisForm.classList.remove('hidden'); | |
// Change button to show connected state | |
setTimeout(function() { | |
connectBtn.innerHTML = '<i class="fab fa-instagram mr-2"></i> Account Connected'; | |
connectBtn.classList.remove('gradient-bg'); | |
connectBtn.classList.add('bg-green-600'); | |
}, 1000); | |
}, 2000); | |
}); | |
// Analyze button click handler | |
analyzeBtn.addEventListener('click', function() { | |
const competitorUsername = document.getElementById('competitorUsername').value; | |
const postLimit = document.getElementById('postLimit').value; | |
if (!competitorUsername) { | |
alert('Please enter a competitor username'); | |
return; | |
} | |
// Show loading state | |
analysisForm.classList.add('hidden'); | |
loadingState.classList.remove('hidden'); | |
// Simulate analysis process | |
setTimeout(function() { | |
loadingState.classList.add('hidden'); | |
resultsSection.classList.remove('hidden'); | |
displayResults(samplePosts); | |
}, 3000); | |
}); | |
// Display results in the grid | |
function displayResults(posts) { | |
resultsGrid.innerHTML = ''; | |
posts.forEach(post => { | |
const newPost = samplePost.cloneNode(true); | |
// Update post data | |
newPost.querySelector('img').src = post.image; | |
newPost.querySelector('img').alt = 'Instagram post by ' + post.username; | |
newPost.querySelector('.post-date').textContent = post.date; | |
newPost.querySelector('.post-likes').textContent = post.likes; | |
newPost.querySelector('.post-comments').textContent = post.comments; | |
newPost.querySelector('.post-caption').textContent = post.caption; | |
newPost.querySelector('.post-link').href = post.link; | |
// Store numerical likes for sorting (remove 'k' and multiply by 1000) | |
const likesNum = parseFloat(post.likes.replace('k', '')) * 1000; | |
newPost.dataset.likes = likesNum; | |
newPost.dataset.comments = parseInt(post.comments.replace(',', '')); | |
// Add to grid | |
resultsGrid.appendChild(newPost); | |
}); | |
} | |
// Sort buttons functionality | |
sortLikesBtn.addEventListener('click', function() { | |
const posts = Array.from(document.querySelectorAll('.post-card')); | |
posts.sort((a, b) => { | |
return b.dataset.likes - a.dataset.likes; | |
}); | |
// Re-append sorted posts | |
posts.forEach(post => { | |
resultsGrid.appendChild(post); | |
}); | |
// Update active button state | |
sortLikesBtn.classList.remove('bg-gray-200', 'text-gray-700'); | |
sortLikesBtn.classList.add('bg-pink-600', 'text-white'); | |
sortCommentsBtn.classList.remove('bg-pink-600', 'text-white'); | |
sortCommentsBtn.classList.add('bg-gray-200', 'text-gray-700'); | |
sortDateBtn.classList.remove('bg-pink-600', 'text-white'); | |
sortDateBtn.classList.add('bg-gray-200', 'text-gray-700'); | |
}); | |
sortCommentsBtn.addEventListener('click', function() { | |
const posts = Array.from(document.querySelectorAll('.post-card')); | |
posts.sort((a, b) => { | |
return b.dataset.comments - a.dataset.comments; | |
}); | |
// Re-append sorted posts | |
posts.forEach(post => { | |
resultsGrid.appendChild(post); | |
}); | |
// Update active button state | |
sortCommentsBtn.classList.remove('bg-gray-200', 'text-gray-700'); | |
sortCommentsBtn.classList.add('bg-pink-600', 'text-white'); | |
sortLikesBtn.classList.remove('bg-pink-600', 'text-white'); | |
sortLikesBtn.classList.add('bg-gray-200', 'text-gray-700'); | |
sortDateBtn.classList.remove('bg-pink-600', 'text-white'); | |
sortDateBtn.classList.add('bg-gray-200', 'text-gray-700'); | |
}); | |
sortDateBtn.addEventListener('click', function() { | |
// This would require actual date data to sort properly | |
// For demo, we'll just reverse the array | |
const posts = Array.from(document.querySelectorAll('.post-card')); | |
posts.reverse(); | |
// Re-append sorted posts | |
posts.forEach(post => { | |
resultsGrid.appendChild(post); | |
}); | |
// Update active button state | |
sortDateBtn.classList.remove('bg-gray-200', 'text-gray-700'); | |
sortDateBtn.classList.add('bg-pink-600', 'text-white'); | |
sortLikesBtn.classList.remove('bg-pink-600', 'text-white'); | |
sortLikesBtn.classList.add('bg-gray-200', 'text-gray-700'); | |
sortCommentsBtn.classList.remove('bg-pink-600', 'text-white'); | |
sortCommentsBtn.classList.add('bg-gray-200', 'text-gray-700'); | |
}); | |
}); | |
</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=phantomDOCTOR314/insta-analyzer" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
</html> |