-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDigitalNameCard.html
More file actions
175 lines (106 loc) · 2.71 KB
/
Copy pathDigitalNameCard.html
File metadata and controls
175 lines (106 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>디지털 명함</title>
<script src="https://cdn.tailwindcss.com"></script>
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
</head>
<body class="bg-slate-950 min-h-screen flex items-center justify-center text-white">
<div id="root"></div>
<script>
function App(){
const profile={
name:"김이현",
title:"Backend Developer",
org:"Dongguk Univ. WISE",
phone:"010-1234-5678",
email:"you@example.com",
website:"https://example.com",
instagram:"https://instagram.com/example"
}
function copy(text){
navigator.clipboard.writeText(text)
alert("복사되었습니다")
}
return React.createElement(
"div",
{className:"w-full max-w-md p-5"},
React.createElement(
"div",
{className:"bg-slate-900 rounded-3xl shadow-2xl overflow-hidden border border-white/10"},
React.createElement(
"div",
{className:"p-6 flex justify-between items-start"},
React.createElement(
"div",
null,
React.createElement("h1",{className:"text-xl font-bold"},profile.name),
React.createElement("p",{className:"text-sm text-slate-300 mt-1"},profile.title),
React.createElement("p",{className:"text-sm text-slate-400"},profile.org)
),
React.createElement(
"span",
{className:"text-xs px-3 py-1 rounded-full bg-blue-500/20 text-blue-200"},
"Contact"
)
),
React.createElement(
"div",
{className:"px-6 pb-6 grid gap-3"},
InfoRow("전화",profile.phone,copy),
InfoRow("이메일",profile.email,copy),
InfoRow("웹",profile.website,copy)
),
React.createElement(
"div",
{className:"px-6 pb-6 grid grid-cols-2 gap-3"},
React.createElement(
"a",
{
href:`tel:${profile.phone.replace(/-/g,"")}`,
className:"flex items-center justify-center rounded-xl bg-blue-500/90 py-3 font-semibold"
},
"전화"
),
React.createElement(
"a",
{
href:profile.instagram,
target:"_blank",
className:"flex items-center justify-center rounded-xl bg-pink-500/90 py-3 font-semibold"
},
"Instagram"
)
)
)
)
}
function InfoRow(label,value,copy){
return React.createElement(
"div",
{className:"flex justify-between bg-white/5 border border-white/10 rounded-xl px-4 py-3"},
React.createElement(
"div",
null,
React.createElement("div",{className:"text-xs text-slate-400"},label),
React.createElement("div",{className:"text-sm"},value)
),
React.createElement(
"button",
{
className:"text-xs bg-white/10 px-3 py-1 rounded-lg",
onClick:()=>copy(value)
},
"복사"
)
)
}
ReactDOM.createRoot(document.getElementById("root")).render(
React.createElement(App)
)
</script>
</body>
</html>