diff --git a/src/components/ScreenKeyboard.tsx b/src/components/ScreenKeyboard.tsx index 3929384..165a459 100644 --- a/src/components/ScreenKeyboard.tsx +++ b/src/components/ScreenKeyboard.tsx @@ -205,9 +205,9 @@ const ScreenKeyboard: React.FC = ({ onStudentIdChange, onDr ]; return ( -
+ <> {/* 学号显示区域 */} -
+
@@ -244,7 +244,8 @@ const ScreenKeyboard: React.FC = ({ onStudentIdChange, onDr whileTap={{ scale: 0.98 }} onClick={handleDraw} disabled={studentId.length !== 12 || isDrawing || isCheckingLimit || studentDrawCount >= maxDrawTimes || isDebouncing} - className="w-full py-6 bg-gradient-to-r from-green-500 to-blue-600 hover:from-green-600 hover:to-blue-700 disabled:from-gray-500 disabled:to-gray-600 disabled:cursor-not-allowed text-white font-bold text-xl rounded-xl shadow-lg transition-all duration-200 flex items-center justify-center space-x-2" + className="py-6 bg-gradient-to-r from-green-500 to-blue-600 hover:from-green-600 hover:to-blue-700 disabled:from-gray-500 disabled:to-gray-600 disabled:cursor-not-allowed text-white font-bold text-xl rounded-xl shadow-lg transition-all duration-200 flex items-center justify-center space-x-2" + style={{ width: '100%' }} > {isDrawing ? '抽奖中...' : @@ -255,9 +256,9 @@ const ScreenKeyboard: React.FC = ({ onStudentIdChange, onDr
- {/* 屏幕键盘 - 140px*140px */} -
-
+ {/* 屏幕键盘 - 调整按钮大小以适应容器 */} +
+
{keys.flat().map((key, index) => { let content; @@ -276,7 +277,7 @@ const ScreenKeyboard: React.FC = ({ onStudentIdChange, onDr ${typeof key === 'number' ? '' : 'text-lg'} `; - const numberStyle = /^[0-9]$/.test(key) ? { fontSize: '112px', lineHeight: '140px' } : {}; + const numberStyle = /^[0-9]$/.test(key) ? { fontSize: 'clamp(2rem, 6vw, 5rem)' } : {}; if (key === 'clear') { content = ; @@ -291,8 +292,8 @@ const ScreenKeyboard: React.FC = ({ onStudentIdChange, onDr key={index} whileHover={isDrawing || isNumberKeyDisabled ? {} : { scale: 1.05 }} whileTap={isDrawing || isNumberKeyDisabled ? {} : { scale: 0.95 }} - className={className} - style={{ width: '140px', height: '140px', ...numberStyle }} + className={`${className} w-full h-full min-h-0`} + style={{ ...numberStyle }} disabled={isDrawing || isNumberKeyDisabled} onClick={() => { if (key === 'clear') { @@ -310,7 +311,7 @@ const ScreenKeyboard: React.FC = ({ onStudentIdChange, onDr })}
-
+ ); }