taeny's picture
주방인테이어를 하고 싶어 그런데 여러가지 색상과 디자인을 대입해 보고 싶어 여러 위치에 주방에 주방기구를 어떻게 배치할 지도 여러가지로 보고싶어 주방인테리어를 할 수 있도록 주방을 세팅해서 거기에 맞는 가구를 내 마음데로 넣고 싶어
9d106a9 verified
// Shared JavaScript functionality
document.addEventListener('DOMContentLoaded', function() {
// Initialize tooltips
const tooltips = document.querySelectorAll('[data-tooltip]');
tooltips.forEach(tooltip => {
tooltip.addEventListener('mouseenter', showTooltip);
tooltip.addEventListener('mouseleave', hideTooltip);
});
// Mobile menu toggle functionality will be handled by navbar component
});
function showTooltip(event) {
const tooltipText = event.target.getAttribute('data-tooltip');
const tooltip = document.createElement('div');
tooltip.className = 'tooltip';
tooltip.textContent = tooltipText;
document.body.appendChild(tooltip);
const rect = event.target.getBoundingClientRect();
tooltip.style.position = 'absolute';
tooltip.style.top = `${rect.top - tooltip.offsetHeight - 10}px`;
tooltip.style.left = `${rect.left + rect.width / 2 - tooltip.offsetWidth / 2}px`;
}
function hideTooltip() {
const tooltip = document.querySelector('.tooltip');
if (tooltip) {
tooltip.remove();
}
}
// Recipe search functionality
function searchRecipes(query) {
// This would be connected to a recipe API in a real implementation
console.log(`Searching for recipes with query: ${query}`);
}
// Shopping list functionality
function addToShoppingList(ingredient) {
// This would manage a shopping list in localStorage or via an API
console.log(`Added ${ingredient} to shopping list`);
}