index.html
Stylish Name Generator
style.cssbody {
font-family: 'Arial', sans-serif;
background-color: #f5f5f5;
margin: 0;
padding: 0;
}
.container {
max-width: 600px;
margin: 50px auto;
text-align: center;
}
h1 {
color: #333;
}
.generator {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
label {
font-size: 18px;
margin-bottom: 10px;
display: block;
}
input {
width: 100%;
padding: 10px;
margin-bottom: 15px;
font-size: 16px;
}
button {
background-color: #4caf50;
color: #fff;
padding: 10px 20px;
font-size: 16px;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
#outputName {
font-size: 18px;
margin-top: 15px;
color: #333;
}
script.jsfunction generateStylishName() {
var inputName = document.getElementById('inputName').value;
var stylishName = '';
for (var i = 0; i < inputName.length; i++) {
stylishName += getStylishChar(inputName.charAt(i));
}
document.getElementById('outputName').innerText = stylishName;
}
function getStylishChar(char) {
// You can customize this function to generate stylish characters based on your preference.
// This is just a simple example.
var stylishChars = ['𝒜', '𝐵', '𝒞', '𝒟', '𝐸', '𝐹', '𝒢', '𝐻', '𝐼', '𝒥', '𝒦', '𝐿', '𝑀', '𝒩', '𝒪', '𝒫', '𝑄', '𝑅', '𝒮', '𝒯', '𝒰', '𝒱', '𝒲', '𝒳', '𝒴', '𝒵'];
var charCode = char.charCodeAt(0);
if (charCode >= 65 && charCode <= 90) {
// Uppercase letter
return stylishChars[charCode - 65];
} else if (charCode >= 97 && charCode <= 122) {
// Lowercase letter
return stylishChars[charCode - 97];
} else {
// Non-alphabetic character, return as is
return char;
}
}