* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
.container {
max-width: 900px;
width: 100%;
}
.title {
text-align: center;
color: #fff;
margin-bottom: 30px;
font-size: 2rem;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.controls {
background: rgba(255, 255, 255, 0.95);
padding: 25px;
border-radius: 12px;
margin-bottom: 30px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.control-group {
margin-bottom: 20px;
}
.control-group label {
display: block;
font-weight: bold;
color: #2c3e50;
margin-bottom: 8px;
font-size: 14px;
}
.control-group input,
.control-group select,
.control-group textarea {
width: 100%;
padding: 10px;
border: 2px solid #ddd;
border-radius: 6px;
font-size: 14px;
font-family: inherit;
transition: border-color 0.3s;
}
.control-group input:focus,
.control-group select:focus,
.control-group textarea:focus {
outline: none;
border-color: #c41e3a;
}
.control-group textarea {
resize: vertical;
min-height: 80px;
}
.button-group {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.btn {
padding: 12px 24px;
border: none;
border-radius: 6px;
font-weight: bold;
cursor: pointer;
font-size: 14px;
transition: all 0.3s;
flex: 1;
min-width: 120px;
}
.btn-primary {
background: #c41e3a;
color: white;
}
.btn-primary:hover {
background: #a01629;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(196, 30, 58, 0.4);
}
.btn-secondary {
background: #34495e;
color: white;
}
.btn-secondary:hover {
background: #2c3e50;
}
.textbox-container {
position: relative;
background: #000;
border: 6px solid #c41e3a;
border-radius: 8px;
box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8);
overflow: hidden;
}
.textbox-inner {
background: linear-gradient(to bottom, #1a1a1a 0%, #0a0a0a 100%);
padding: 20px;
min-height: 200px;
position: relative;
}
.character-name {
color: #00ff00;
font-size: 18px;
font-weight: bold;
margin-bottom: 12px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
letter-spacing: 1px;
}
.dialogue-text {
color: #ffffff;
font-size: 20px;
line-height: 1.6;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
word-wrap: break-word;
}
.blink-cursor {
display: inline-block;
width: 12px;
height: 20px;
background: #fff;
animation: blink 0.8s infinite;
margin-left: 4px;
vertical-align: text-bottom;
}
@keyframes blink {
0%, 49% { opacity: 1; }
50%, 100% { opacity: 0; }
}
.continue-arrow {
position: absolute;
bottom: 15px;
right: 20px;
color: #00ff00;
font-size: 24px;
animation: bounce 1s infinite;
}
@keyframes bounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-8px); }
}
.character-sprite {
position: absolute;
top: -100px;
right: 20px;
width: 180px;
height: 180px;
background: rgba(255, 255, 255, 0.1);
border: 3px solid #c41e3a;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: #c41e3a;
font-size: 48px;
font-weight: bold;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.sound-indicator {
position: absolute;
top: 10px;
right: 10px;
color: #00ff00;
font-size: 14px;
opacity: 0;
transition: opacity 0.3s;
}
.sound-indicator.active {
opacity: 1;
}
.character-presets {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 10px;
margin-top: 10px;
}
.preset-btn {
padding: 10px;
background: #ecf0f1;
border: 2px solid #bdc3c7;
border-radius: 6px;
cursor: pointer;
font-weight: bold;
color: #2c3e50;
transition: all 0.3s;
}
.preset-btn:hover {
background: #c41e3a;
color: white;
border-color: #c41e3a;
}
@media (max-width: 768px) {
.title {
font-size: 1.5rem;
}
.character-sprite {
width: 120px;
height: 120px;
top: -80px;
font-size: 32px;
}
.dialogue-text {
font-size: 16px;
}
.button-group {
flex-direction: column;
}
.btn {
width: 100%;
}
}
let animationInterval;
let currentIndex = 0;
let isPlaying = false;
let fullText = '';
const blipSound = {
play: function() {
const soundIndicator = document.getElementById('soundIndicator');
soundIndicator.classList.add('active');
setTimeout(() => soundIndicator.classList.remove('active'), 100);
}
};
const characterEmojis = {
'Phoenix Wright': '👨💼',
'Miles Edgeworth': '👔',
'Maya Fey': '👩',
'Judge': '⚖️'
};
function setCharacter(name) {
document.getElementById('charName').value = name;
document.getElementById('displayName').textContent = name;
const sprite = document.getElementById('charSprite');
sprite.textContent = characterEmojis[name] || '👤';
}
function playDialogue() {
if (isPlaying) return;
const charName = document.getElementById('charName').value;
const dialogueText = document.getElementById('dialogueText').value;
const textSpeed = parseInt(document.getElementById('textSpeed').value);
if (!dialogueText.trim()) {
alert('Please enter some dialogue text!');
return;
}
document.getElementById('displayName').textContent = charName;
const sprite = document.getElementById('charSprite');
sprite.textContent = characterEmojis[charName] || '👤';
fullText = dialogueText;
currentIndex = 0;
isPlaying = true;
const displayText = document.getElementById('displayText');
const continueArrow = document.getElementById('continueArrow');
displayText.innerHTML = '';
continueArrow.style.display = 'none';
if (textSpeed === 0) {
displayText.textContent = fullText;
continueArrow.style.display = 'block';
isPlaying = false;
return;
}
animationInterval = setInterval(() => {
if (currentIndex < fullText.length) {
const char = fullText[currentIndex];
displayText.textContent += char;
if (char !== ' ' && char !== '\n') {
blipSound.play();
}
displayText.innerHTML += '<span class="blink-cursor"></span>';
currentIndex++;
} else {
clearInterval(animationInterval);
displayText.innerHTML = displayText.textContent.replace(/<span class="blink-cursor"><\/span>/g, '');
continueArrow.style.display = 'block';
isPlaying = false;
}
}, textSpeed);
}
function stopDialogue() {
if (animationInterval) {
clearInterval(animationInterval);
}
isPlaying = false;
const displayText = document.getElementById('displayText');
displayText.innerHTML = displayText.textContent.replace(/<span class="blink-cursor"><\/span>/g, '');
if (currentIndex > 0) {
document.getElementById('continueArrow').style.display = 'block';
}
}
function resetDialogue() {
stopDialogue();
document.getElementById('displayText').textContent = '';
document.getElementById('continueArrow').style.display = 'none';
currentIndex = 0;
}
// Initialize
setCharacter('Phoenix Wright');
No comments yet. Be the first!