amp-web-push-widget button.amp-subscribe { display: inline-flex; align-items: center; border-radius: 5px; border: 0; box-sizing: border-box; margin: 0; padding: 10px 15px; cursor: pointer; outline: none; font-size: 15px; font-weight: 500; background: #4A90E2; margin-top: 7px; color: white; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.5); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .amp-logo amp-img{width:190px} .amp-menu input{display:none;}.amp-menu li.menu-item-has-children ul{display:none;}.amp-menu li{position:relative;display:block;}.amp-menu > li a{display:block;} .icon-widgets:before {content: "\e1bd";}.icon-search:before {content: "\e8b6";}.icon-shopping-cart:after {content: "\e8cc";}
Generate unique names for your sci-fi worlds
let currentStyle = 'alien'; let history = [];
function getRandomElement(array) { return array[Math.floor(Math.random() * array.length)]; }
function generatePlanetName() { const complexity = document.getElementById("complexitySelect").value; const style = nameParts[currentStyle]; let name = '';
// Simple name: prefix + suffix if (complexity === 'simple') { name = getRandomElement(style.prefixes) + getRandomElement(style.suffixes); } // Medium complexity: prefix + middle + suffix else if (complexity === 'medium') { name = getRandomElement(style.prefixes) + getRandomElement(style.middles) + getRandomElement(style.suffixes); } // Complex name: prefix + middle + suffix + ending else { name = getRandomElement(style.prefixes) + getRandomElement(style.middles) + getRandomElement(style.suffixes) + getRandomElement(style.endings); }
// Capitalize first letter name = name.charAt(0).toUpperCase() + name.slice(1);
// Display the name document.getElementById("planetDisplay").textContent = name;
// Add to history history.unshift(name); updateHistory(); }
function setStyle(style) { currentStyle = style;
// Update active button styling document.querySelectorAll('.style-btn').forEach(btn => { btn.classList.remove('active'); }); event.target.classList.add('active');
// Generate a new name with this style generatePlanetName(); }
function updateHistory() { const historyContainer = document.getElementById("historyPlanets"); historyContainer.innerHTML = "";
// Display last 10 names const recentHistory = history.slice(0, 10); recentHistory.forEach(name => { const planetElement = document.createElement("div"); planetElement.className = "history-planet"; planetElement.textContent = name; historyContainer.appendChild(planetElement); }); }
// Generate first name on load window.onload = generatePlanetName;