SOY NV AI
Fix: Add Permissions-Policy header and replace autofocus with JavaScript to fix iframe warnings
12d93bf
| <html lang="ko"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>๋ก๊ทธ์ธ - SOY AI ์น์์ค ์ด์์คํดํธ</title> | |
| <link rel="preconnect" href="https://fonts.googleapis.com" crossorigin> | |
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet"> | |
| <style> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| min-height: 100vh; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| padding: 20px; | |
| } | |
| .login-container { | |
| background: white; | |
| border-radius: 16px; | |
| box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); | |
| padding: 40px; | |
| width: 100%; | |
| max-width: 400px; | |
| } | |
| .login-header { | |
| text-align: center; | |
| margin-bottom: 32px; | |
| } | |
| .login-header h1 { | |
| font-size: 28px; | |
| font-weight: 600; | |
| color: #202124; | |
| margin-bottom: 8px; | |
| } | |
| .login-header p { | |
| font-size: 14px; | |
| color: #5f6368; | |
| } | |
| .login-icon { | |
| margin-bottom: 16px; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| } | |
| .login-icon img { | |
| width: 64px; | |
| height: 64px; | |
| object-fit: contain; | |
| } | |
| .form-group { | |
| margin-bottom: 20px; | |
| } | |
| .form-group label { | |
| display: block; | |
| font-size: 14px; | |
| font-weight: 500; | |
| color: #202124; | |
| margin-bottom: 8px; | |
| } | |
| .form-group input { | |
| width: 100%; | |
| padding: 12px 16px; | |
| border: 1px solid #dadce0; | |
| border-radius: 8px; | |
| font-size: 15px; | |
| font-family: inherit; | |
| transition: border-color 0.2s, box-shadow 0.2s; | |
| } | |
| .form-group input:focus { | |
| outline: none; | |
| border-color: #1a73e8; | |
| box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1); | |
| } | |
| .login-button { | |
| width: 100%; | |
| padding: 12px; | |
| background: #1a73e8; | |
| color: white; | |
| border: none; | |
| border-radius: 8px; | |
| font-size: 15px; | |
| font-weight: 500; | |
| cursor: pointer; | |
| transition: background 0.2s; | |
| margin-top: 8px; | |
| } | |
| .login-button:hover { | |
| background: #1557b0; | |
| } | |
| .login-button:active { | |
| transform: scale(0.98); | |
| } | |
| .alert { | |
| padding: 12px 16px; | |
| border-radius: 8px; | |
| margin-bottom: 20px; | |
| font-size: 14px; | |
| } | |
| .alert.error { | |
| background: #fce8e6; | |
| color: #c5221f; | |
| border: 1px solid #f28b82; | |
| } | |
| .alert.info { | |
| background: #e8f0fe; | |
| color: #1967d2; | |
| border: 1px solid #aecbfa; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="login-container"> | |
| <div class="login-header"> | |
| <div class="login-icon"> | |
| <img src="{{ url_for('static', filename='logo.webp') }}" alt="SOY AI ๋ก๊ณ "> | |
| </div> | |
| <h1>SOY AI<br/>์ํ ๊ฐ๋ฐ ์ด์์คํดํธ</h1> | |
| <p>๋ก๊ทธ์ธ์ด ํ์ํฉ๋๋ค</p> | |
| </div> | |
| {% with messages = get_flashed_messages(with_categories=true) %} | |
| {% if messages %} | |
| {% for category, message in messages %} | |
| <div class="alert {{ category }}"> | |
| {{ message }} | |
| </div> | |
| {% endfor %} | |
| {% endif %} | |
| {% endwith %} | |
| <form method="POST" action="{{ url_for('main.login') }}"> | |
| <div class="form-group"> | |
| <label for="username">์ฌ์ฉ์๋ช </label> | |
| <input type="text" id="username" name="username" required> | |
| </div> | |
| <div class="form-group"> | |
| <label for="password">๋น๋ฐ๋ฒํธ</label> | |
| <input type="password" id="password" name="password" required> | |
| </div> | |
| <button type="submit" class="login-button">๋ก๊ทธ์ธ</button> | |
| </form> | |
| </div> | |
| <script> | |
| // iframe ๋ด๋ถ์์๋ ์๋ํ๋๋ก JavaScript๋ก autofocus ์ฒ๋ฆฌ | |
| // Cross-origin iframe์์ autofocus๊ฐ ์ฐจ๋จ๋๋ ๋ฌธ์ ํด๊ฒฐ | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const usernameInput = document.getElementById('username'); | |
| if (usernameInput) { | |
| // ์ฝ๊ฐ์ ์ง์ฐ์ ๋์ด iframe ๋ก๋ฉ ์๋ฃ ํ ํฌ์ปค์ค | |
| setTimeout(function() { | |
| try { | |
| usernameInput.focus(); | |
| } catch (e) { | |
| // iframe์์ ํฌ์ปค์ค๊ฐ ์ฐจ๋จ๋ ์ ์์ผ๋ฏ๋ก ๋ฌด์ | |
| console.debug('Autofocus blocked in iframe (expected behavior)'); | |
| } | |
| }, 100); | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> | |