Skip to content

Instantly share code, notes, and snippets.

View JunsikChoi's full-sized avatar
🎯
Focusing

Jun JunsikChoi

🎯
Focusing
  • Seoul, Korea
  • 12:01 (UTC +09:00)
View GitHub Profile
@JunsikChoi
JunsikChoi / otp.svelte
Created December 15, 2023 05:42
svelte otp input
<script lang="ts">
const digitStyle =
'w-12 h-12 text-xl font-bold text-center text-gray-800 bg-gray-200 rounded-md focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-opacity-50';
const handleKeyup = (e: KeyboardEvent) => {
const target = e.target as HTMLInputElement;
const next = target.dataset.next;
const previous = target.dataset.previous;
const value = target.value;