function handleKeyPress(event) { if (event.key === 'Enter') { checkPassword(); } } function showCategory(category) { console.log(`Abrindo 3 novos projetos da categoria ${category}`); // Adicione aqui a lógica específica para abrir os projetos da categoria } function showPortfolioScreen() { const loginScreen = document.querySelector('.login-screen'); const portfolioScreen = document.querySelector('.portfolio-screen'); loginScreen.style.display = 'none'; portfolioScreen.style.display = 'flex'; } function showCategory(categoryId) { const categoryContents = document.querySelectorAll('.category-content'); categoryContents.forEach(content => { content.style.display = 'none'; }); const selectedCategory = document.getElementById(categoryId); if (selectedCategory) { selectedCategory.style.display = 'block'; } } function checkPassword() { const passwordInput = document.getElementById('password'); const enteredPassword = passwordInput.value; const currentDate = new Date(); const day = currentDate.getDate(); const month = currentDate.getMonth() + 1; const year = currentDate.getFullYear(); const correctPassword = `${day.toString().padStart(2, '0')}/${month.toString().padStart(2, '0')}/${year}`; const errorElement = document.querySelector('.error-message'); if (enteredPassword === correctPassword) { showPortfolioScreen(); document.documentElement.requestFullscreen(); } else { if (!errorElement) { const loginBox = document.querySelector('.login-box'); const newErrorElement = document.createElement('p'); newErrorElement.className = 'error-message'; newErrorElement.style.color = '#d3d3d3'; newErrorElement.style.marginTop = '10px'; loginBox.appendChild(newErrorElement); } errorElement.textContent = 'Dica sobre a senha: Data atual'; } } function togglePasswordVisibility() { const passwordInput = document.getElementById('password'); const passwordToggle = document.querySelector('.password-toggle img'); if (passwordInput.type === 'password') { passwordInput.type = 'text'; passwordToggle.src = 'https://res.cloudinary.com/dudanet/image/upload/v1701904318/icon_ver_senha_zswgqv.png'; } else { passwordInput.type = 'password'; passwordToggle.src = 'https://res.cloudinary.com/dudanet/image/upload/v1700761690/icone_AGUA2-removebg-preview_ulzzxb.png'; } } let darkMode = false; function toggleDarkMode() { darkMode = !darkMode; const body = document.body; const backgroundImageUrl = darkMode ? 'https://res-console.cloudinary.com/dudanet/thumbnails/v1/image/upload/v1701885797/bWlzdC1zdHJlZXQtbGlnaHQtYmxhY2stbWluaW1hbGlzbS13YWxscGFwZXItcHJldmlld19vc3J2dDA=/grid_landscape' : 'https://res-console.cloudinary.com/dudanet/thumbnails/v1/image/upload/v1701885797/Y29sb3JpZG9zLWF6dWlzLWFydGUtZGlnaXRhbC1pbWFnZW0tZGUtZnVuZG9fdWU5ZXBz/grid_landscape'; body.style.backgroundImage = `url('${backgroundImageUrl}')`; const buttons = document.querySelectorAll('button'); buttons.forEach(button => { button.style.backgroundColor = darkMode ? '#333' : '#0078d4'; button.style.borderColor = darkMode ? '#666' : '#0078d4'; }); const darkModeIcon = document.querySelector('.dark-mode-icon'); darkModeIcon.src = 'https://cdn-icons-png.flaticon.com/512/5262/5262027.png'; const modeLabel = document.querySelector('.mode-label'); modeLabel.textContent = darkMode ? 'Dark Mode' : 'Light Mode'; const profilePicture = document.getElementById('profile-picture'); profilePicture.style.backgroundImage = `url('${darkMode ? 'https://res.cloudinary.com/dudanet/image/upload/v1701974234/dark_img_profile_qoh7l9.png' : 'https://res-console.cloudinary.com/dudanet/thumbnails/v1/image/upload/v1701839344/V2hhdHNBcHBfSW1hZ2VfMjAyMy0xMi0wNl9hdF8wMi4wNy4yNV9kZHZqanI=/grid_landscape'}')`; } function closeTab() { window.close(); } function createCategoryButtons() { const categoriesContainer = document.querySelector('.categories'); const categoriesData = [ { id: 'category1', label: 'Categoria 1', image: 'URL_DA_IMAGEM1', url: 'https://res.cloudinary.com/dudanet/image/upload/v1700411360/icone_casa_smart_s8glnx.png' }, { id: 'category2', label: 'Categoria 2', image: 'URL_DA_IMAGEM2', url: 'URL_DA_CATEGORIA2' }, { id: 'category3', label: 'Categoria 3', image: 'URL_DA_IMAGEM3', url: 'URL_DA_CATEGORIA3' }, ]; categoriesData.forEach(category => { const button = document.createElement('button'); button.innerHTML = ` ${category.label} ${category.label} `; button.addEventListener('click', () => { showCategory(category.id); window.location.href = category.url; }); categoriesContainer.appendChild(button); }); } createCategoryButtons();