Entrar
Ainda não tem conta? Cadastre-se
function toggleRegister() {
document.getElementById('login-form').classList.toggle('hidden');
document.getElementById('register-form').classList.toggle('hidden');
}
function doRegister() {
const username = document.getElementById('register-username').value;
const password = document.getElementById('register-password').value;
if (username && password) {
localStorage.setItem(username, password);
alert('Conta criada com sucesso!');
toggleRegister();
}
}
function doLogin() {
const username = document.getElementById('login-username').value;
const password = document.getElementById('login-password').value;
if (localStorage.getItem(username) === password) {
loggedInUser = username;
document.getElementById('auth-section').classList.add('hidden');
document.getElementById('home-section').classList.remove('hidden');
loadProducts();
} else {
alert('Login inválido');
}
}
function loadProducts() {
const productList = document.getElementById('product-list');
productList.innerHTML = '';
for (let i = 1; i <= 30; i++) {
let div = document.createElement('div');
div.classList.add('product');
div.innerHTML = `
<img src="https://via.placeholder.com/200?text=Nike+TN1+${i}" alt="Nike TN1 ${i}" />
<h3>Nike TN1 Modelo ${i}</h3>
<p>R$130 ou 2 por R$180</p>
<button onclick="checkout('${i}')">Comprar</button>
`;
productList.appendChild(div);
}
}
function checkout(model) {
orderNumber++;
const orderId = `#LULU${orderNumber}`;
alert(`Pedido ${orderId} criado! Entraremos em contato pelo seu Instagram.`);
// Aqui poderia disparar notificação DM no Instagram (via integração API)
window.open('https://www.instagram.com/luluu_imports?igsh=NThsZnFmcnF0c3F0', '_blank');
}
</script>