import { Component, Output, EventEmitter, Input } from '@angular/core'; import { CommonModule } from '@angular/common'; //TODO: Second and fourth ring of keys @Component({ selector: 'app-circle-keyboard', standalone: true, imports: [CommonModule], template: `
`, styleUrl: './circle-keyboard.component.css' }) export class CircleKeyboardComponent { @Input() shiftActive = false; @Output() keyPressed = new EventEmitter(); @Output() shiftToggled = new EventEmitter(); // 8 keys arranged in circle circleKeysFirst = ['E', 'T', 'A', 'O', 'N', 'I', 'H', 'S']; circleKeysSecond = ['R', 'L', 'D', 'U', 'C', 'M', 'W', 'Y']; circleKeysThird = ['F', 'G', 'P', 'B', 'V', 'K', 'J', 'X']; circleKeysFourth = ['Q', 'Z']; // Calculate position for each button in circle getCirclePositionFromTop(index: number, radius: number, offset: number = 0): string { const angle = ((index * 45) - 90) + offset; // Start from top (0°), 45° apart const angleRad = (angle * Math.PI) / 180; const x = Math.cos(angleRad) * radius; const y = Math.sin(angleRad) * radius; return `translate(${x}px, ${y}px)`; } }