11'use client'
2- import { Flex , Image , Input } from '@devup-ui/react'
2+ import { Flex , Image , Input , Text , VStack } from '@devup-ui/react'
33import { useEffect , useState } from 'react'
44
55export function Trans ( ) {
@@ -9,81 +9,102 @@ export function Trans() {
99 > ( ( ) => ( ) => '' )
1010 useEffect ( ( ) => {
1111 import ( 'braillify' ) . then ( ( mod ) => {
12- setTranslateToUnicode ( ( ) => mod . translateToUnicode )
12+ setTranslateToUnicode ( ( ) => ( input : string ) => {
13+ try {
14+ return mod . translateToUnicode ( input )
15+ } catch ( e ) {
16+ console . error ( e )
17+ return '점역할 수 없는 문자가 있습니다.'
18+ }
19+ } )
1320 } )
1421 } , [ input ] )
1522 return (
16- < Flex
17- alignItems = "center"
18- flexDirection = { [ 'column' , null , null , 'row' ] }
19- gap = { [ '12px' , null , null , '30px' ] }
20- h = { [ 'auto' , null , null , '500px' ] }
21- >
22- < Flex flex = "1" h = "100%" w = "100%" >
23- < Input
24- as = "textarea"
25- bg = "$containerBackground"
26- border = "none"
27- borderRadius = { [ '16px' , null , null , '30px' ] }
28- color = "$text"
29- h = { [ '400px' , null , null , 'auto' ] }
30- onChange = { ( e ) => setInput ( e . target . value ) }
31- p = { [ '16px' , null , null , '40px' ] }
32- placeholder = {
33- 'braillify는 한글 점역을 빠르고 안정적으로 처리하는 Rust 기반 라이브러리입니다.\nNode.js, WebAssembly, Python 등 다양한 환경에서 사용할 수 있어요.\n점역하고 싶은 문장이나 단어를 여기에 입력해 직접 확인해보세요!'
34- }
35- resize = "none"
36- selectors = { {
37- '&::placeholder' : {
38- color : '$text' ,
39- typography : 'braille' ,
40- opacity : 0.5 ,
41- } ,
42- } }
43- typography = "braille"
44- value = { input }
45- w = "100%"
46- />
47- </ Flex >
48- < Flex >
23+ < VStack gap = "30px" >
24+ < Flex alignItems = "flex-start" gap = "20px" >
4925 < Image
50- display = { [ 'none' , null , null , 'block' ] }
51- mr = "10px"
52- src = "/images/home/translate-arrow-circle.svg"
53- w = "16px"
54- />
55- < Image
56- src = "/images/home/translate-arrow.svg"
57- transform = { [ 'rotate(0deg)' , null , null , 'rotate(-90deg)' ] }
58- w = { [ '16px' , null , null , '24px' ] }
26+ alt = "Finger point image"
27+ src = "/images/home/finger-point.svg"
28+ w = "28px"
5929 />
30+ < Text color = "$text" pos = "relative" top = "-2px" typography = "mainTextSm" >
31+ 직접 입력해 실시간 점자 번역을 체험해보세요!
32+ </ Text >
6033 </ Flex >
61- < Flex flex = "1" h = "100%" w = "100%" >
62- < Input
63- as = "textarea"
64- bg = "$containerBackground"
65- border = "none"
66- borderRadius = { [ '16px' , null , null , '30px' ] }
67- color = "$text"
68- h = { [ '400px' , null , null , 'auto' ] }
69- p = { [ '16px' , null , null , '40px' ] }
70- placeholder = {
71- '⠴⠃⠗⠁⠊⠇⠇⠊⠋⠽⠲⠉⠵ ⠚⠒⠈⠮ ⠨⠎⠢⠱⠁⠮ ⠠⠘⠐⠪⠈⠥ ⠣⠒⠨⠻⠨⠹⠪⠐⠥ ⠰⠎⠐⠕⠚⠉⠵ ⠴⠠⠗⠥⠌⠲ ⠈⠕⠘⠒ ⠐⠣⠕⠘⠪⠐⠎⠐⠕⠕⠃⠉⠕⠊⠲\n⠴⠠⠝⠕⠙⠑⠲⠚⠎⠂ ⠠⠺⠑⠃⠠⠁⠎⠎⠑⠍⠃⠇⠽⠂ ⠠⠏⠽⠹⠕⠝⠲ ⠊⠪⠶ ⠊⠣⠜⠶⠚⠒ ⠚⠧⠒⠈⠻⠝⠠⠎ ⠇⠬⠶⠚⠂ ⠠⠍ ⠕⠌⠎⠬⠲\n⠨⠎⠢⠱⠁⠚⠈⠥ ⠠⠕⠲⠵ ⠑⠛⠨⠶⠕⠉ ⠊⠒⠎⠐⠮ ⠱⠈⠕⠝ ⠕⠃⠐⠱⠁⠚⠗ ⠨⠕⠁⠨⠎⠃ ⠚⠧⠁⠟⠚⠗⠘⠥⠠⠝⠬⠖'
72- }
73- readOnly
74- resize = "none"
75- selectors = { {
76- '&::placeholder' : {
77- color : '$text' ,
78- typography : 'braille' ,
79- opacity : 0.5 ,
80- } ,
81- } }
82- typography = "braille"
83- value = { translateToUnicode ( input ) }
84- w = "100%"
85- />
34+ < Flex
35+ alignItems = "center"
36+ flexDirection = { [ 'column' , null , null , 'row' ] }
37+ gap = { [ '12px' , null , null , '30px' ] }
38+ h = { [ 'auto' , null , null , '500px' ] }
39+ >
40+ < Flex flex = "1" h = "100%" w = "100%" >
41+ < Input
42+ as = "textarea"
43+ bg = "$containerBackground"
44+ border = "none"
45+ borderRadius = { [ '16px' , null , null , '30px' ] }
46+ color = "$text"
47+ h = { [ '400px' , null , null , 'auto' ] }
48+ onChange = { ( e ) => setInput ( e . target . value ) }
49+ p = { [ '16px' , null , null , '40px' ] }
50+ placeholder = {
51+ 'braillify는 한글 점역을 빠르고 안정적으로 처리하는 Rust 기반 라이브러리입니다.\nNode.js, WebAssembly, Python 등 다양한 환경에서 사용할 수 있어요.\n\n점역하고 싶은 문장이나 단어를 여기에 입력해 직접 확인해보세요!'
52+ }
53+ resize = "none"
54+ selectors = { {
55+ '&::placeholder' : {
56+ color : '$text' ,
57+ typography : 'braille' ,
58+ opacity : 0.5 ,
59+ } ,
60+ } }
61+ typography = "braille"
62+ value = { input }
63+ w = "100%"
64+ />
65+ </ Flex >
66+ < Flex >
67+ < Image
68+ alt = ""
69+ display = { [ 'none' , null , null , 'block' ] }
70+ mr = "10px"
71+ src = "/images/home/translate-arrow-circle.svg"
72+ w = "16px"
73+ />
74+ < Image
75+ alt = ""
76+ src = "/images/home/translate-arrow.svg"
77+ transform = { [ 'rotate(0deg)' , null , null , 'rotate(-90deg)' ] }
78+ w = { [ '16px' , null , null , '24px' ] }
79+ />
80+ </ Flex >
81+ < Flex flex = "1" h = "100%" w = "100%" >
82+ < Input
83+ as = "textarea"
84+ bg = "$containerBackground"
85+ border = "none"
86+ borderRadius = { [ '16px' , null , null , '30px' ] }
87+ color = "$text"
88+ h = { [ '400px' , null , null , 'auto' ] }
89+ p = { [ '16px' , null , null , '40px' ] }
90+ placeholder = {
91+ '⠴⠃⠗⠁⠊⠇⠇⠊⠋⠽⠲⠉⠵ ⠚⠒⠈⠮ ⠨⠎⠢⠱⠁⠮ ⠠⠘⠐⠪⠈⠥ ⠣⠒⠨⠻⠨⠹⠪⠐⠥ ⠰⠎⠐⠕⠚⠉⠵ ⠴⠠⠗⠥⠌⠲ ⠈⠕⠘⠒ ⠐⠣⠕⠘⠪⠐⠎⠐⠕⠕⠃⠉⠕⠊⠲\n⠴⠠⠝⠕⠙⠑⠲⠚⠎⠂ ⠠⠺⠑⠃⠠⠁⠎⠎⠑⠍⠃⠇⠽⠂ ⠠⠏⠽⠹⠕⠝⠲ ⠊⠪⠶ ⠊⠣⠜⠶⠚⠒ ⠚⠧⠒⠈⠻⠝⠠⠎ ⠇⠬⠶⠚⠂ ⠠⠍ ⠕⠌⠎⠬⠲\n\n⠨⠎⠢⠱⠁⠚⠈⠥ ⠠⠕⠲⠵ ⠑⠛⠨⠶⠕⠉ ⠊⠒⠎⠐⠮ ⠱⠈⠕⠝ ⠕⠃⠐⠱⠁⠚⠗ ⠨⠕⠁⠨⠎⠃ ⠚⠧⠁⠟⠚⠗⠘⠥⠠⠝⠬⠖'
92+ }
93+ readOnly
94+ resize = "none"
95+ selectors = { {
96+ '&::placeholder' : {
97+ color : '$text' ,
98+ typography : 'braille' ,
99+ opacity : 0.5 ,
100+ } ,
101+ } }
102+ typography = "braille"
103+ value = { translateToUnicode ( input ) }
104+ w = "100%"
105+ />
106+ </ Flex >
86107 </ Flex >
87- </ Flex >
108+ </ VStack >
88109 )
89110}
0 commit comments