Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,1510 +1,35 @@
|
|
| 1 |
-
from flask import Flask, render_template_string, send_file, jsonify
|
| 2 |
import os
|
| 3 |
-
import
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
def index():
|
| 12 |
-
# HTML_TEMPLATE에 기본 이미지 자동 로드 스크립트 추가
|
| 13 |
-
return render_template_string(HTML_TEMPLATE)
|
| 14 |
-
|
| 15 |
-
@app.route('/webtoon.png')
|
| 16 |
-
def serve_webtoon_image():
|
| 17 |
-
# 실제 webtoon.png 파일 체크
|
| 18 |
-
image_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'webtoon.png')
|
| 19 |
-
|
| 20 |
-
if os.path.exists(image_path):
|
| 21 |
-
return send_file(image_path, mimetype='image/png')
|
| 22 |
-
else:
|
| 23 |
-
# 파일이 없으면 샘플 이미지 생성
|
| 24 |
-
from PIL import Image, ImageDraw, ImageFont
|
| 25 |
-
import io
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
|
|
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
|
| 32 |
-
|
|
|
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
img_io.seek(0)
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
* {
|
| 52 |
-
margin: 0;
|
| 53 |
-
padding: 0;
|
| 54 |
-
box-sizing: border-box;
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
-
body {
|
| 58 |
-
font-family: 'Noto Sans KR', sans-serif;
|
| 59 |
-
background: #1a1a1a;
|
| 60 |
-
color: #fff;
|
| 61 |
-
overflow: hidden;
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
-
.container {
|
| 65 |
-
display: flex;
|
| 66 |
-
height: 100vh;
|
| 67 |
-
}
|
| 68 |
-
|
| 69 |
-
/* 좌측 툴바 */
|
| 70 |
-
.toolbar {
|
| 71 |
-
width: 320px;
|
| 72 |
-
background: #2a2a2a;
|
| 73 |
-
padding: 20px;
|
| 74 |
-
overflow-y: auto;
|
| 75 |
-
border-right: 1px solid #444;
|
| 76 |
-
}
|
| 77 |
-
|
| 78 |
-
.toolbar::-webkit-scrollbar {
|
| 79 |
-
width: 8px;
|
| 80 |
-
}
|
| 81 |
-
|
| 82 |
-
.toolbar::-webkit-scrollbar-track {
|
| 83 |
-
background: #1a1a1a;
|
| 84 |
-
}
|
| 85 |
-
|
| 86 |
-
.toolbar::-webkit-scrollbar-thumb {
|
| 87 |
-
background: #4a9eff;
|
| 88 |
-
border-radius: 4px;
|
| 89 |
-
}
|
| 90 |
-
|
| 91 |
-
.toolbar h2 {
|
| 92 |
-
font-size: 18px;
|
| 93 |
-
margin-bottom: 20px;
|
| 94 |
-
color: #fff;
|
| 95 |
-
border-bottom: 2px solid #4a9eff;
|
| 96 |
-
padding-bottom: 10px;
|
| 97 |
-
}
|
| 98 |
-
|
| 99 |
-
.tool-section {
|
| 100 |
-
margin-bottom: 30px;
|
| 101 |
-
}
|
| 102 |
-
|
| 103 |
-
.tool-section h3 {
|
| 104 |
-
font-size: 14px;
|
| 105 |
-
margin-bottom: 15px;
|
| 106 |
-
color: #aaa;
|
| 107 |
-
text-transform: uppercase;
|
| 108 |
-
}
|
| 109 |
-
|
| 110 |
-
/* 파일 업로드 영역 */
|
| 111 |
-
.file-upload {
|
| 112 |
-
border: 2px dashed #4a9eff;
|
| 113 |
-
border-radius: 8px;
|
| 114 |
-
padding: 20px;
|
| 115 |
-
text-align: center;
|
| 116 |
-
cursor: pointer;
|
| 117 |
-
transition: all 0.3s;
|
| 118 |
-
margin-bottom: 20px;
|
| 119 |
-
}
|
| 120 |
-
|
| 121 |
-
.file-upload:hover {
|
| 122 |
-
background: rgba(74, 158, 255, 0.1);
|
| 123 |
-
border-color: #6ab7ff;
|
| 124 |
-
}
|
| 125 |
-
|
| 126 |
-
.file-upload input {
|
| 127 |
-
display: none;
|
| 128 |
-
}
|
| 129 |
-
|
| 130 |
-
/* 파일 리스트 */
|
| 131 |
-
.file-list {
|
| 132 |
-
background: #333;
|
| 133 |
-
border-radius: 8px;
|
| 134 |
-
padding: 10px;
|
| 135 |
-
margin-top: 10px;
|
| 136 |
-
max-height: 150px;
|
| 137 |
-
overflow-y: auto;
|
| 138 |
-
}
|
| 139 |
-
|
| 140 |
-
.file-item {
|
| 141 |
-
font-size: 12px;
|
| 142 |
-
color: #aaa;
|
| 143 |
-
padding: 3px 0;
|
| 144 |
-
border-bottom: 1px solid #444;
|
| 145 |
-
}
|
| 146 |
-
|
| 147 |
-
.file-item:last-child {
|
| 148 |
-
border-bottom: none;
|
| 149 |
-
}
|
| 150 |
-
|
| 151 |
-
/* 컴포넌트 버튼들 */
|
| 152 |
-
.component-grid {
|
| 153 |
-
display: grid;
|
| 154 |
-
grid-template-columns: repeat(3, 1fr);
|
| 155 |
-
gap: 8px;
|
| 156 |
-
}
|
| 157 |
-
|
| 158 |
-
.component-btn {
|
| 159 |
-
background: #3a3a3a;
|
| 160 |
-
border: 1px solid #555;
|
| 161 |
-
border-radius: 8px;
|
| 162 |
-
padding: 10px;
|
| 163 |
-
cursor: pointer;
|
| 164 |
-
transition: all 0.3s;
|
| 165 |
-
text-align: center;
|
| 166 |
-
color: #fff;
|
| 167 |
-
}
|
| 168 |
-
|
| 169 |
-
.component-btn:hover {
|
| 170 |
-
background: #4a4a4a;
|
| 171 |
-
border-color: #4a9eff;
|
| 172 |
-
transform: translateY(-2px);
|
| 173 |
-
}
|
| 174 |
-
|
| 175 |
-
.component-btn svg {
|
| 176 |
-
width: 35px;
|
| 177 |
-
height: 35px;
|
| 178 |
-
margin-bottom: 3px;
|
| 179 |
-
}
|
| 180 |
-
|
| 181 |
-
.component-btn span {
|
| 182 |
-
display: block;
|
| 183 |
-
font-size: 11px;
|
| 184 |
-
}
|
| 185 |
-
|
| 186 |
-
/* 속성 편집 패널 */
|
| 187 |
-
.properties-panel {
|
| 188 |
-
background: #333;
|
| 189 |
-
border-radius: 8px;
|
| 190 |
-
padding: 15px;
|
| 191 |
-
margin-top: 20px;
|
| 192 |
-
}
|
| 193 |
-
|
| 194 |
-
.property-group {
|
| 195 |
-
margin-bottom: 15px;
|
| 196 |
-
}
|
| 197 |
-
|
| 198 |
-
.property-group label {
|
| 199 |
-
display: block;
|
| 200 |
-
font-size: 12px;
|
| 201 |
-
color: #aaa;
|
| 202 |
-
margin-bottom: 5px;
|
| 203 |
-
}
|
| 204 |
-
|
| 205 |
-
.property-group input,
|
| 206 |
-
.property-group select,
|
| 207 |
-
.property-group textarea {
|
| 208 |
-
width: 100%;
|
| 209 |
-
padding: 8px;
|
| 210 |
-
background: #2a2a2a;
|
| 211 |
-
border: 1px solid #444;
|
| 212 |
-
border-radius: 4px;
|
| 213 |
-
color: #fff;
|
| 214 |
-
}
|
| 215 |
-
|
| 216 |
-
.color-picker {
|
| 217 |
-
display: grid;
|
| 218 |
-
grid-template-columns: repeat(6, 1fr);
|
| 219 |
-
gap: 5px;
|
| 220 |
-
}
|
| 221 |
-
|
| 222 |
-
.color-option {
|
| 223 |
-
width: 35px;
|
| 224 |
-
height: 35px;
|
| 225 |
-
border-radius: 4px;
|
| 226 |
-
cursor: pointer;
|
| 227 |
-
border: 2px solid transparent;
|
| 228 |
-
}
|
| 229 |
-
|
| 230 |
-
.color-option.selected {
|
| 231 |
-
border-color: #4a9eff;
|
| 232 |
-
box-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
|
| 233 |
-
}
|
| 234 |
-
|
| 235 |
-
/* 메인 작업 영역 */
|
| 236 |
-
.workspace {
|
| 237 |
-
flex: 1;
|
| 238 |
-
display: flex;
|
| 239 |
-
flex-direction: column;
|
| 240 |
-
background: #1a1a1a;
|
| 241 |
-
}
|
| 242 |
-
|
| 243 |
-
.workspace-header {
|
| 244 |
-
background: #2a2a2a;
|
| 245 |
-
padding: 15px 20px;
|
| 246 |
-
border-bottom: 1px solid #444;
|
| 247 |
-
display: flex;
|
| 248 |
-
justify-content: space-between;
|
| 249 |
-
align-items: center;
|
| 250 |
-
}
|
| 251 |
-
|
| 252 |
-
.workspace-tools {
|
| 253 |
-
display: flex;
|
| 254 |
-
gap: 10px;
|
| 255 |
-
}
|
| 256 |
-
|
| 257 |
-
.tool-btn {
|
| 258 |
-
background: #3a3a3a;
|
| 259 |
-
border: 1px solid #555;
|
| 260 |
-
border-radius: 6px;
|
| 261 |
-
padding: 8px 16px;
|
| 262 |
-
color: #fff;
|
| 263 |
-
cursor: pointer;
|
| 264 |
-
transition: all 0.3s;
|
| 265 |
-
}
|
| 266 |
-
|
| 267 |
-
.tool-btn:hover {
|
| 268 |
-
background: #4a4a4a;
|
| 269 |
-
border-color: #4a9eff;
|
| 270 |
-
}
|
| 271 |
-
|
| 272 |
-
.tool-btn.primary {
|
| 273 |
-
background: #4a9eff;
|
| 274 |
-
border-color: #4a9eff;
|
| 275 |
-
}
|
| 276 |
-
|
| 277 |
-
.tool-btn.primary:hover {
|
| 278 |
-
background: #6ab7ff;
|
| 279 |
-
}
|
| 280 |
-
|
| 281 |
-
/* 캔버스 영역 */
|
| 282 |
-
.canvas-container {
|
| 283 |
-
flex: 1;
|
| 284 |
-
overflow: auto;
|
| 285 |
-
padding: 20px;
|
| 286 |
-
display: flex;
|
| 287 |
-
justify-content: center;
|
| 288 |
-
background: #222;
|
| 289 |
-
position: relative;
|
| 290 |
-
}
|
| 291 |
-
|
| 292 |
-
.canvas-wrapper {
|
| 293 |
-
position: relative;
|
| 294 |
-
background: white;
|
| 295 |
-
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
|
| 296 |
-
min-height: 800px;
|
| 297 |
-
width: 700px;
|
| 298 |
-
}
|
| 299 |
-
|
| 300 |
-
/* 이미지 컨테이너 */
|
| 301 |
-
.image-container {
|
| 302 |
-
position: relative;
|
| 303 |
-
width: 100%;
|
| 304 |
-
}
|
| 305 |
-
|
| 306 |
-
.image-number {
|
| 307 |
-
position: absolute;
|
| 308 |
-
left: -40px;
|
| 309 |
-
top: 10px;
|
| 310 |
-
background: #4a9eff;
|
| 311 |
-
color: white;
|
| 312 |
-
width: 30px;
|
| 313 |
-
height: 30px;
|
| 314 |
-
border-radius: 50%;
|
| 315 |
-
display: flex;
|
| 316 |
-
align-items: center;
|
| 317 |
-
justify-content: center;
|
| 318 |
-
font-weight: bold;
|
| 319 |
-
font-size: 14px;
|
| 320 |
-
z-index: 10;
|
| 321 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.3);
|
| 322 |
-
}
|
| 323 |
-
|
| 324 |
-
.webtoon-image {
|
| 325 |
-
width: 100%;
|
| 326 |
-
display: block;
|
| 327 |
-
margin-bottom: 20px;
|
| 328 |
-
}
|
| 329 |
-
|
| 330 |
-
/* 드래그 가능한 컴포넌트 */
|
| 331 |
-
.draggable-component {
|
| 332 |
-
position: absolute;
|
| 333 |
-
cursor: move;
|
| 334 |
-
user-select: none;
|
| 335 |
-
z-index: 50;
|
| 336 |
-
}
|
| 337 |
-
|
| 338 |
-
.draggable-component.dragging {
|
| 339 |
-
z-index: 1000;
|
| 340 |
-
opacity: 0.8;
|
| 341 |
-
}
|
| 342 |
-
|
| 343 |
-
.draggable-component.selected {
|
| 344 |
-
outline: 2px solid #4a9eff;
|
| 345 |
-
z-index: 100;
|
| 346 |
-
}
|
| 347 |
-
|
| 348 |
-
.draggable-component .resize-handle {
|
| 349 |
-
position: absolute;
|
| 350 |
-
width: 10px;
|
| 351 |
-
height: 10px;
|
| 352 |
-
background: #4a9eff;
|
| 353 |
-
border: 1px solid #fff;
|
| 354 |
-
display: none;
|
| 355 |
-
}
|
| 356 |
-
|
| 357 |
-
.draggable-component.selected .resize-handle {
|
| 358 |
-
display: block;
|
| 359 |
-
}
|
| 360 |
-
|
| 361 |
-
.resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
|
| 362 |
-
.resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
|
| 363 |
-
.resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
|
| 364 |
-
.resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }
|
| 365 |
-
|
| 366 |
-
/* 말풍선 스타일들 */
|
| 367 |
-
.speech-bubble {
|
| 368 |
-
background: white;
|
| 369 |
-
border: 2px solid black;
|
| 370 |
-
border-radius: 20px;
|
| 371 |
-
padding: 15px;
|
| 372 |
-
min-width: 100px;
|
| 373 |
-
min-height: 50px;
|
| 374 |
-
position: relative;
|
| 375 |
-
width: 100%;
|
| 376 |
-
height: 100%;
|
| 377 |
-
display: flex;
|
| 378 |
-
align-items: center;
|
| 379 |
-
justify-content: center;
|
| 380 |
-
box-sizing: border-box;
|
| 381 |
-
}
|
| 382 |
-
|
| 383 |
-
.speech-bubble .component-text {
|
| 384 |
-
margin-top: 0;
|
| 385 |
-
padding-top: 8px;
|
| 386 |
-
padding-bottom: 8px;
|
| 387 |
-
}
|
| 388 |
-
|
| 389 |
-
.speech-bubble-tail {
|
| 390 |
-
position: absolute;
|
| 391 |
-
bottom: -10px;
|
| 392 |
-
left: 20px;
|
| 393 |
-
width: 0;
|
| 394 |
-
height: 0;
|
| 395 |
-
border-left: 10px solid transparent;
|
| 396 |
-
border-right: 10px solid transparent;
|
| 397 |
-
border-top: 10px solid black;
|
| 398 |
-
}
|
| 399 |
-
|
| 400 |
-
.speech-bubble-tail::after {
|
| 401 |
-
content: '';
|
| 402 |
-
position: absolute;
|
| 403 |
-
bottom: 3px;
|
| 404 |
-
left: -10px;
|
| 405 |
-
width: 0;
|
| 406 |
-
height: 0;
|
| 407 |
-
border-left: 10px solid transparent;
|
| 408 |
-
border-right: 10px solid transparent;
|
| 409 |
-
border-top: 10px solid white;
|
| 410 |
-
}
|
| 411 |
-
|
| 412 |
-
.thought-bubble {
|
| 413 |
-
background: white;
|
| 414 |
-
border: 2px solid black;
|
| 415 |
-
border-radius: 50%;
|
| 416 |
-
padding: 20px;
|
| 417 |
-
min-width: 120px;
|
| 418 |
-
min-height: 80px;
|
| 419 |
-
position: relative;
|
| 420 |
-
width: 100%;
|
| 421 |
-
height: 100%;
|
| 422 |
-
display: flex;
|
| 423 |
-
align-items: center;
|
| 424 |
-
justify-content: center;
|
| 425 |
-
box-sizing: border-box;
|
| 426 |
-
}
|
| 427 |
-
|
| 428 |
-
.thought-bubble .component-text {
|
| 429 |
-
margin-top: 0;
|
| 430 |
-
padding-top: 8px;
|
| 431 |
-
padding-bottom: 8px;
|
| 432 |
-
}
|
| 433 |
-
|
| 434 |
-
.thought-bubble-dots {
|
| 435 |
-
position: absolute;
|
| 436 |
-
bottom: -25px;
|
| 437 |
-
left: 20px;
|
| 438 |
-
}
|
| 439 |
-
|
| 440 |
-
.thought-dot {
|
| 441 |
-
position: absolute;
|
| 442 |
-
background: white;
|
| 443 |
-
border: 2px solid black;
|
| 444 |
-
border-radius: 50%;
|
| 445 |
-
}
|
| 446 |
-
|
| 447 |
-
.thought-dot.large {
|
| 448 |
-
width: 20px;
|
| 449 |
-
height: 20px;
|
| 450 |
-
}
|
| 451 |
-
|
| 452 |
-
.thought-dot.small {
|
| 453 |
-
width: 12px;
|
| 454 |
-
height: 12px;
|
| 455 |
-
left: -5px;
|
| 456 |
-
top: 10px;
|
| 457 |
-
}
|
| 458 |
-
|
| 459 |
-
.shout-bubble {
|
| 460 |
-
background: white;
|
| 461 |
-
border: 3px solid black;
|
| 462 |
-
padding: 15px;
|
| 463 |
-
min-width: 100px;
|
| 464 |
-
min-height: 50px;
|
| 465 |
-
position: relative;
|
| 466 |
-
width: 100%;
|
| 467 |
-
height: 100%;
|
| 468 |
-
clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
|
| 469 |
-
display: flex;
|
| 470 |
-
align-items: center;
|
| 471 |
-
justify-content: center;
|
| 472 |
-
}
|
| 473 |
-
|
| 474 |
-
.narration-box {
|
| 475 |
-
background: rgba(0, 0, 0, 0.85);
|
| 476 |
-
border: 2px solid white;
|
| 477 |
-
padding: 15px;
|
| 478 |
-
min-width: 150px;
|
| 479 |
-
min-height: 40px;
|
| 480 |
-
width: 100%;
|
| 481 |
-
height: 100%;
|
| 482 |
-
display: flex;
|
| 483 |
-
align-items: center;
|
| 484 |
-
justify-content: center;
|
| 485 |
-
}
|
| 486 |
-
|
| 487 |
-
.narration-box .component-text {
|
| 488 |
-
color: white !important;
|
| 489 |
-
}
|
| 490 |
-
|
| 491 |
-
.text-box {
|
| 492 |
-
background: white;
|
| 493 |
-
border: 2px solid black;
|
| 494 |
-
padding: 10px;
|
| 495 |
-
min-width: 100px;
|
| 496 |
-
min-height: 40px;
|
| 497 |
-
width: 100%;
|
| 498 |
-
height: 100%;
|
| 499 |
-
display: flex;
|
| 500 |
-
align-items: center;
|
| 501 |
-
justify-content: center;
|
| 502 |
-
}
|
| 503 |
-
|
| 504 |
-
.transparent-box {
|
| 505 |
-
background: rgba(255, 255, 255, 0.8);
|
| 506 |
-
border: 1px dashed #999;
|
| 507 |
-
padding: 10px;
|
| 508 |
-
min-width: 100px;
|
| 509 |
-
min-height: 40px;
|
| 510 |
-
width: 100%;
|
| 511 |
-
height: 100%;
|
| 512 |
-
display: flex;
|
| 513 |
-
align-items: center;
|
| 514 |
-
justify-content: center;
|
| 515 |
-
}
|
| 516 |
-
|
| 517 |
-
.action-effect {
|
| 518 |
-
background: transparent;
|
| 519 |
-
border: none;
|
| 520 |
-
padding: 10px;
|
| 521 |
-
min-width: 80px;
|
| 522 |
-
min-height: 40px;
|
| 523 |
-
width: 100%;
|
| 524 |
-
height: 100%;
|
| 525 |
-
font-weight: bold;
|
| 526 |
-
text-shadow: 2px 2px 0 white, -2px -2px 0 white, 2px -2px 0 white, -2px 2px 0 white;
|
| 527 |
-
display: flex;
|
| 528 |
-
align-items: center;
|
| 529 |
-
justify-content: center;
|
| 530 |
-
}
|
| 531 |
-
|
| 532 |
-
.emotion-bubble {
|
| 533 |
-
background: #ffeb3b;
|
| 534 |
-
border: 2px solid black;
|
| 535 |
-
border-radius: 15px;
|
| 536 |
-
padding: 10px;
|
| 537 |
-
min-width: 80px;
|
| 538 |
-
min-height: 40px;
|
| 539 |
-
width: 100%;
|
| 540 |
-
height: 100%;
|
| 541 |
-
display: flex;
|
| 542 |
-
align-items: center;
|
| 543 |
-
justify-content: center;
|
| 544 |
-
}
|
| 545 |
-
|
| 546 |
-
.whisper-bubble {
|
| 547 |
-
background: #f0f0f0;
|
| 548 |
-
border: 1px dashed #666;
|
| 549 |
-
border-radius: 15px;
|
| 550 |
-
padding: 10px;
|
| 551 |
-
min-width: 100px;
|
| 552 |
-
min-height: 40px;
|
| 553 |
-
width: 100%;
|
| 554 |
-
height: 100%;
|
| 555 |
-
opacity: 0.9;
|
| 556 |
-
display: flex;
|
| 557 |
-
align-items: center;
|
| 558 |
-
justify-content: center;
|
| 559 |
-
}
|
| 560 |
-
|
| 561 |
-
.gradient-box {
|
| 562 |
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 563 |
-
border: 2px solid white;
|
| 564 |
-
border-radius: 10px;
|
| 565 |
-
padding: 15px;
|
| 566 |
-
min-width: 100px;
|
| 567 |
-
min-height: 40px;
|
| 568 |
-
width: 100%;
|
| 569 |
-
height: 100%;
|
| 570 |
-
display: flex;
|
| 571 |
-
align-items: center;
|
| 572 |
-
justify-content: center;
|
| 573 |
-
}
|
| 574 |
-
|
| 575 |
-
.gradient-box .component-text {
|
| 576 |
-
color: white !important;
|
| 577 |
-
}
|
| 578 |
-
|
| 579 |
-
.component-text {
|
| 580 |
-
width: 100%;
|
| 581 |
-
height: 100%;
|
| 582 |
-
border: none;
|
| 583 |
-
background: transparent;
|
| 584 |
-
resize: none;
|
| 585 |
-
outline: none;
|
| 586 |
-
font-family: inherit;
|
| 587 |
-
font-size: 22px;
|
| 588 |
-
color: black;
|
| 589 |
-
text-align: center;
|
| 590 |
-
padding: 5px;
|
| 591 |
-
overflow: visible;
|
| 592 |
-
line-height: 1.5;
|
| 593 |
-
vertical-align: middle;
|
| 594 |
-
white-space: pre-wrap;
|
| 595 |
-
word-break: break-word;
|
| 596 |
-
}
|
| 597 |
-
|
| 598 |
-
/* 로딩 인디케이터 */
|
| 599 |
-
.loading {
|
| 600 |
-
display: none;
|
| 601 |
-
position: fixed;
|
| 602 |
-
top: 50%;
|
| 603 |
-
left: 50%;
|
| 604 |
-
transform: translate(-50%, -50%);
|
| 605 |
-
background: rgba(0,0,0,0.9);
|
| 606 |
-
padding: 30px;
|
| 607 |
-
border-radius: 10px;
|
| 608 |
-
z-index: 10000;
|
| 609 |
-
text-align: center;
|
| 610 |
-
}
|
| 611 |
-
|
| 612 |
-
.loading.active {
|
| 613 |
-
display: block;
|
| 614 |
-
}
|
| 615 |
-
|
| 616 |
-
.loading-spinner {
|
| 617 |
-
border: 3px solid #f3f3f3;
|
| 618 |
-
border-top: 3px solid #4a9eff;
|
| 619 |
-
border-radius: 50%;
|
| 620 |
-
width: 40px;
|
| 621 |
-
height: 40px;
|
| 622 |
-
animation: spin 1s linear infinite;
|
| 623 |
-
margin: 0 auto 10px;
|
| 624 |
-
}
|
| 625 |
-
|
| 626 |
-
@keyframes spin {
|
| 627 |
-
0% { transform: rotate(0deg); }
|
| 628 |
-
100% { transform: rotate(360deg); }
|
| 629 |
-
}
|
| 630 |
-
|
| 631 |
-
/* 이미지 간격 조절 */
|
| 632 |
-
.spacing-control {
|
| 633 |
-
display: flex;
|
| 634 |
-
align-items: center;
|
| 635 |
-
gap: 10px;
|
| 636 |
-
}
|
| 637 |
-
|
| 638 |
-
.spacing-control input[type="range"] {
|
| 639 |
-
flex: 1;
|
| 640 |
-
}
|
| 641 |
-
|
| 642 |
-
.spacing-value {
|
| 643 |
-
width: 50px;
|
| 644 |
-
text-align: center;
|
| 645 |
-
}
|
| 646 |
-
|
| 647 |
-
/* 개별 저장 입력 */
|
| 648 |
-
.save-individual {
|
| 649 |
-
display: flex;
|
| 650 |
-
gap: 5px;
|
| 651 |
-
margin-top: 10px;
|
| 652 |
-
}
|
| 653 |
-
|
| 654 |
-
.save-individual input {
|
| 655 |
-
width: 60px;
|
| 656 |
-
}
|
| 657 |
-
|
| 658 |
-
.save-individual button {
|
| 659 |
-
flex: 1;
|
| 660 |
-
padding: 5px;
|
| 661 |
-
background: #28a745;
|
| 662 |
-
border: none;
|
| 663 |
-
border-radius: 4px;
|
| 664 |
-
color: white;
|
| 665 |
-
cursor: pointer;
|
| 666 |
-
}
|
| 667 |
-
|
| 668 |
-
.save-individual button:hover {
|
| 669 |
-
background: #5cbf5c;
|
| 670 |
-
}
|
| 671 |
-
/* 배지 컨테이너 */
|
| 672 |
-
/* 배지 컨테이너 - 기존 코드 대체 */
|
| 673 |
-
.badges-container {
|
| 674 |
-
display: flex;
|
| 675 |
-
flex-direction: row;
|
| 676 |
-
gap: 10px;
|
| 677 |
-
margin-left: 20px; /* 제목과 간격 */
|
| 678 |
-
}
|
| 679 |
-
|
| 680 |
-
.badges-container a {
|
| 681 |
-
display: block;
|
| 682 |
-
transition: transform 0.3s ease;
|
| 683 |
-
height: 28px; /* 배지 높이 조정 */
|
| 684 |
-
}
|
| 685 |
-
|
| 686 |
-
.badges-container a:hover {
|
| 687 |
-
transform: scale(1.05);
|
| 688 |
-
}
|
| 689 |
-
|
| 690 |
-
.badges-container img {
|
| 691 |
-
height: 100%; /* 배지 이미지 크기 조정 */
|
| 692 |
-
}
|
| 693 |
-
|
| 694 |
-
/* 워크스페이스 헤더 수정 */
|
| 695 |
-
.workspace-header {
|
| 696 |
-
background: #2a2a2a;
|
| 697 |
-
padding: 15px 20px;
|
| 698 |
-
border-bottom: 1px solid #444;
|
| 699 |
-
display: flex;
|
| 700 |
-
justify-content: space-between;
|
| 701 |
-
align-items: center;
|
| 702 |
-
}
|
| 703 |
-
|
| 704 |
-
.workspace-header-left {
|
| 705 |
-
display: flex;
|
| 706 |
-
align-items: center;
|
| 707 |
-
}
|
| 708 |
-
|
| 709 |
-
</style>
|
| 710 |
-
</head>
|
| 711 |
-
<body>
|
| 712 |
-
<div class="container">
|
| 713 |
-
<!-- 좌측 툴바 -->
|
| 714 |
-
<div class="toolbar">
|
| 715 |
-
<h2>🎨 웹툰 편집 스튜디오</h2>
|
| 716 |
-
|
| 717 |
-
<!-- 파일 업로드 -->
|
| 718 |
-
<div class="tool-section">
|
| 719 |
-
<h3>📁 이미지 업로드</h3>
|
| 720 |
-
<div class="file-upload" onclick="document.getElementById('fileInput').click()">
|
| 721 |
-
<svg width="40" height="40" fill="#4a9eff">
|
| 722 |
-
<rect x="5" y="10" width="30" height="25" fill="none" stroke="currentColor" stroke-width="2"/>
|
| 723 |
-
<polyline points="15,25 20,20 25,25" fill="none" stroke="currentColor" stroke-width="2"/>
|
| 724 |
-
<line x1="20" y1="20" x2="20" y2="30" stroke="currentColor" stroke-width="2"/>
|
| 725 |
-
</svg>
|
| 726 |
-
<p>클릭하여 이미지 선택</p>
|
| 727 |
-
<p style="font-size: 11px; color: #888; margin-top: 5px;">파일명 기준 자동 정렬 (1.jpg, 2.jpg...)</p>
|
| 728 |
-
<input type="file" id="fileInput" multiple accept="image/*">
|
| 729 |
-
</div>
|
| 730 |
-
<div id="fileList"></div>
|
| 731 |
-
|
| 732 |
-
<!-- 이미지 간격 조절 -->
|
| 733 |
-
<div class="property-group">
|
| 734 |
-
<label>이미지 간격</label>
|
| 735 |
-
<div class="spacing-control">
|
| 736 |
-
<input type="range" id="imageSpacing" min="0" max="100" value="20" onchange="updateImageSpacing()">
|
| 737 |
-
<span class="spacing-value" id="spacingValue">20px</span>
|
| 738 |
-
</div>
|
| 739 |
-
</div>
|
| 740 |
-
|
| 741 |
-
<!-- 개별 이미지 저장 -->
|
| 742 |
-
<div class="property-group">
|
| 743 |
-
<label>개별 이미지 저장</label>
|
| 744 |
-
<div class="save-individual">
|
| 745 |
-
<input type="number" id="imageNumber" placeholder="번호" min="1">
|
| 746 |
-
<button onclick="exportSingleImage()">저장</button>
|
| 747 |
-
</div>
|
| 748 |
-
</div>
|
| 749 |
-
</div>
|
| 750 |
-
|
| 751 |
-
<!-- 컴포넌트 -->
|
| 752 |
-
<div class="tool-section">
|
| 753 |
-
<h3>💬 말풍선 & 효과</h3>
|
| 754 |
-
<div class="component-grid">
|
| 755 |
-
<div class="component-btn" onclick="addComponent('speech')">
|
| 756 |
-
<svg viewBox="0 0 100 100" fill="none" stroke="white" stroke-width="2">
|
| 757 |
-
<ellipse cx="50" cy="40" rx="40" ry="30"/>
|
| 758 |
-
<path d="M 30 55 L 25 75 L 40 55"/>
|
| 759 |
-
</svg>
|
| 760 |
-
<span>말풍선</span>
|
| 761 |
-
</div>
|
| 762 |
-
<div class="component-btn" onclick="addComponent('thought')">
|
| 763 |
-
<svg viewBox="0 0 100 100" fill="none" stroke="white" stroke-width="2">
|
| 764 |
-
<ellipse cx="50" cy="40" rx="35" ry="25"/>
|
| 765 |
-
<circle cx="30" cy="65" r="8"/>
|
| 766 |
-
<circle cx="20" cy="75" r="5"/>
|
| 767 |
-
</svg>
|
| 768 |
-
<span>생각풍선</span>
|
| 769 |
-
</div>
|
| 770 |
-
<div class="component-btn" onclick="addComponent('shout')">
|
| 771 |
-
<svg viewBox="0 0 100 100" fill="none" stroke="white" stroke-width="3">
|
| 772 |
-
<polygon points="50,10 90,30 85,70 50,90 15,70 10,30"/>
|
| 773 |
-
</svg>
|
| 774 |
-
<span>외침풍선</span>
|
| 775 |
-
</div>
|
| 776 |
-
<div class="component-btn" onclick="addComponent('whisper')">
|
| 777 |
-
<svg viewBox="0 0 100 100" fill="none" stroke="white" stroke-width="1" stroke-dasharray="3,3">
|
| 778 |
-
<ellipse cx="50" cy="45" rx="35" ry="25"/>
|
| 779 |
-
</svg>
|
| 780 |
-
<span>속삭임</span>
|
| 781 |
-
</div>
|
| 782 |
-
<div class="component-btn" onclick="addComponent('emotion')">
|
| 783 |
-
<svg viewBox="0 0 100 100" fill="#ffeb3b" stroke="white" stroke-width="2">
|
| 784 |
-
<ellipse cx="50" cy="45" rx="35" ry="25"/>
|
| 785 |
-
</svg>
|
| 786 |
-
<span>감정표현</span>
|
| 787 |
-
</div>
|
| 788 |
-
<div class="component-btn" onclick="addComponent('action')">
|
| 789 |
-
<svg viewBox="0 0 100 100" fill="none" stroke="white" stroke-width="2">
|
| 790 |
-
<text x="50" y="50" text-anchor="middle" font-size="30" fill="white">!</text>
|
| 791 |
-
</svg>
|
| 792 |
-
<span>효과음</span>
|
| 793 |
-
</div>
|
| 794 |
-
<div class="component-btn" onclick="addComponent('narration')">
|
| 795 |
-
<svg viewBox="0 0 100 100" fill="#333" stroke="white" stroke-width="2">
|
| 796 |
-
<rect x="15" y="30" width="70" height="40"/>
|
| 797 |
-
</svg>
|
| 798 |
-
<span>나레이션</span>
|
| 799 |
-
</div>
|
| 800 |
-
<div class="component-btn" onclick="addComponent('box')">
|
| 801 |
-
<svg viewBox="0 0 100 100" fill="none" stroke="white" stroke-width="2">
|
| 802 |
-
<rect x="20" y="30" width="60" height="40"/>
|
| 803 |
-
</svg>
|
| 804 |
-
<span>텍스트박스</span>
|
| 805 |
-
</div>
|
| 806 |
-
<div class="component-btn" onclick="addComponent('transparent')">
|
| 807 |
-
<svg viewBox="0 0 100 100" fill="none" stroke="white" stroke-width="2" stroke-dasharray="5,5">
|
| 808 |
-
<rect x="20" y="30" width="60" height="40"/>
|
| 809 |
-
</svg>
|
| 810 |
-
<span>투명박스</span>
|
| 811 |
-
</div>
|
| 812 |
-
<div class="component-btn" onclick="addComponent('gradient')">
|
| 813 |
-
<svg viewBox="0 0 100 100">
|
| 814 |
-
<defs>
|
| 815 |
-
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
|
| 816 |
-
<stop offset="0%" style="stop-color:#667eea;stop-opacity:1" />
|
| 817 |
-
<stop offset="100%" style="stop-color:#764ba2;stop-opacity:1" />
|
| 818 |
-
</linearGradient>
|
| 819 |
-
</defs>
|
| 820 |
-
<rect x="20" y="30" width="60" height="40" fill="url(#grad1)" stroke="white" stroke-width="2"/>
|
| 821 |
-
</svg>
|
| 822 |
-
<span>그라디언트</span>
|
| 823 |
-
</div>
|
| 824 |
-
</div>
|
| 825 |
-
</div>
|
| 826 |
-
|
| 827 |
-
<!-- 속성 편집 -->
|
| 828 |
-
<div class="tool-section">
|
| 829 |
-
<h3>⚙️ 속성 편집</h3>
|
| 830 |
-
<div class="properties-panel">
|
| 831 |
-
<div class="property-group">
|
| 832 |
-
<label>폰트</label>
|
| 833 |
-
<select id="fontSelect" onchange="updateSelectedComponent()">
|
| 834 |
-
<optgroup label="기본 폰트">
|
| 835 |
-
<option value="Arial">Arial</option>
|
| 836 |
-
<option value="Verdana">Verdana</option>
|
| 837 |
-
<option value="Georgia">Georgia</option>
|
| 838 |
-
<option value="'Times New Roman'">Times New Roman</option>
|
| 839 |
-
<option value="'Courier New'">Courier New</option>
|
| 840 |
-
<option value="'Comic Sans MS'">Comic Sans MS</option>
|
| 841 |
-
</optgroup>
|
| 842 |
-
<optgroup label="한글 폰트">
|
| 843 |
-
<option value="'Noto Sans KR'" selected>노토 산스</option>
|
| 844 |
-
<option value="'Black Han Sans'">검은고딕</option>
|
| 845 |
-
<option value="'Jua'">주아</option>
|
| 846 |
-
<option value="'Do Hyeon'">도현</option>
|
| 847 |
-
<option value="'Sunflower'">해바라기</option>
|
| 848 |
-
<option value="'Cute Font'">귀여운 글꼴</option>
|
| 849 |
-
<option value="'Gamja Flower'">감자꽃</option>
|
| 850 |
-
<option value="'Hi Melody'">하이 멜로디</option>
|
| 851 |
-
<option value="'Nanum Pen Script'">나눔펜</option>
|
| 852 |
-
<option value="'Stylish'">스타일리시</option>
|
| 853 |
-
<option value="'Single Day'">싱글데이</option>
|
| 854 |
-
<option value="'Gaegu'">개구쟁이</option>
|
| 855 |
-
</optgroup>
|
| 856 |
-
</select>
|
| 857 |
-
</div>
|
| 858 |
-
<div class="property-group">
|
| 859 |
-
<label>글자 크기</label>
|
| 860 |
-
<input type="number" id="fontSizeInput" value="22" min="8" max="72" onchange="updateSelectedComponent()">
|
| 861 |
-
</div>
|
| 862 |
-
<div class="property-group">
|
| 863 |
-
<label>글자 굵기</label>
|
| 864 |
-
<select id="fontWeightSelect" onchange="updateSelectedComponent()">
|
| 865 |
-
<option value="100">아주 얇게</option>
|
| 866 |
-
<option value="300">얇게</option>
|
| 867 |
-
<option value="400" selected>보통</option>
|
| 868 |
-
<option value="500">약간 굵게</option>
|
| 869 |
-
<option value="700">굵게</option>
|
| 870 |
-
<option value="900">아주 굵게</option>
|
| 871 |
-
</select>
|
| 872 |
-
</div>
|
| 873 |
-
<div class="property-group">
|
| 874 |
-
<label>글자 색상</label>
|
| 875 |
-
<div class="color-picker">
|
| 876 |
-
<div class="color-option selected" style="background: black" onclick="selectColor(this, 'black')"></div>
|
| 877 |
-
<div class="color-option" style="background: white; border: 1px solid #ccc;" onclick="selectColor(this, 'white')"></div>
|
| 878 |
-
<div class="color-option" style="background: #ff0000" onclick="selectColor(this, '#ff0000')"></div>
|
| 879 |
-
<div class="color-option" style="background: #ff6b6b" onclick="selectColor(this, '#ff6b6b')"></div>
|
| 880 |
-
<div class="color-option" style="background: #0066ff" onclick="selectColor(this, '#0066ff')"></div>
|
| 881 |
-
<div class="color-option" style="background: #4ecdc4" onclick="selectColor(this, '#4ecdc4')"></div>
|
| 882 |
-
<div class="color-option" style="background: #00b300" onclick="selectColor(this, '#00b300')"></div>
|
| 883 |
-
<div class="color-option" style="background: #95e1d3" onclick="selectColor(this, '#95e1d3')"></div>
|
| 884 |
-
<div class="color-option" style="background: #ffe100" onclick="selectColor(this, '#ffe100')"></div>
|
| 885 |
-
<div class="color-option" style="background: #ff9800" onclick="selectColor(this, '#ff9800')"></div>
|
| 886 |
-
<div class="color-option" style="background: #9c27b0" onclick="selectColor(this, '#9c27b0')"></div>
|
| 887 |
-
<div class="color-option" style="background: #ff00ff" onclick="selectColor(this, '#ff00ff')"></div>
|
| 888 |
-
</div>
|
| 889 |
-
</div>
|
| 890 |
-
<div class="property-group">
|
| 891 |
-
<label>텍스트</label>
|
| 892 |
-
<textarea id="textInput" rows="3" placeholder="텍스트 입력..." onkeyup="updateSelectedComponent()"></textarea>
|
| 893 |
-
</div>
|
| 894 |
-
</div>
|
| 895 |
-
</div>
|
| 896 |
-
</div>
|
| 897 |
-
|
| 898 |
-
<!-- 메인 작업 영역 -->
|
| 899 |
-
<!-- 메인 작업 영역 -->
|
| 900 |
-
<div class="workspace">
|
| 901 |
-
<div class="workspace-header">
|
| 902 |
-
<div class="workspace-header-left">
|
| 903 |
-
<h1 style="font-size: 20px;">🎨 Webtoon Studio</h1>
|
| 904 |
-
<!-- 배지 컨테이너 추가 -->
|
| 905 |
-
<div class="badges-container">
|
| 906 |
-
<a href="https://huggingface.co/spaces/ginigen/AGI-WebToon" target="_blank">
|
| 907 |
-
<img src="https://img.shields.io/static/v1?label=WEBTOON&message=Generator&color=%23800080&labelColor=%23ffa500&logo=huggingface&logoColor=white&style=for-the-badge" alt="badge">
|
| 908 |
-
</a>
|
| 909 |
-
<a href="https://huggingface.co/spaces/ginigen/webtoon-studio" target="_blank">
|
| 910 |
-
<img src="https://img.shields.io/static/v1?label=WEBTOON&message=STUDIO&color=%2300ff00&labelColor=%23ffa500&logo=huggingface&logoColor=white&style=for-the-badge" alt="badge">
|
| 911 |
-
</a>
|
| 912 |
-
</div>
|
| 913 |
-
</div>
|
| 914 |
-
<div class="workspace-tools">
|
| 915 |
-
<button class="tool-btn" onclick="deleteSelected()">🗑️ 선택 삭제</button>
|
| 916 |
-
<button class="tool-btn" onclick="clearAll()">🔄 전체 초기화</button>
|
| 917 |
-
<button class="tool-btn primary" onclick="exportSingleImage()">💾 이미지 저장</button>
|
| 918 |
-
</div>
|
| 919 |
-
</div>
|
| 920 |
-
|
| 921 |
-
<div class="canvas-container">
|
| 922 |
-
<div class="canvas-wrapper" id="canvas">
|
| 923 |
-
<!-- 업로드된 이미지와 컴포넌트들이 여기에 추가됩니다 -->
|
| 924 |
-
</div>
|
| 925 |
-
</div>
|
| 926 |
-
</div>
|
| 927 |
-
</div>
|
| 928 |
-
|
| 929 |
-
<div class="loading" id="loading">
|
| 930 |
-
<div class="loading-spinner"></div>
|
| 931 |
-
<p>처리 중...</p>
|
| 932 |
-
</div>
|
| 933 |
-
|
| 934 |
-
<!-- html2canvas 라이브러리 -->
|
| 935 |
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
| 936 |
-
|
| 937 |
-
<script>
|
| 938 |
-
let selectedComponent = null;
|
| 939 |
-
let isDragging = false;
|
| 940 |
-
let isResizing = false;
|
| 941 |
-
let dragOffset = { x: 0, y: 0 };
|
| 942 |
-
let componentCounter = 0;
|
| 943 |
-
let selectedColor = 'black';
|
| 944 |
-
let uploadedImages = [];
|
| 945 |
-
let currentDragElement = null;
|
| 946 |
-
const DEFAULT_FONT_SIZE = 22; // 기본 글자 크기 상수
|
| 947 |
-
|
| 948 |
-
// 페이지 로드 시 기본 이미지 로드
|
| 949 |
-
window.addEventListener('DOMContentLoaded', function() {
|
| 950 |
-
loadDefaultImage();
|
| 951 |
-
});
|
| 952 |
-
|
| 953 |
-
// 기본 이미지 로드 함수
|
| 954 |
-
function loadDefaultImage() {
|
| 955 |
-
const canvas = document.getElementById('canvas');
|
| 956 |
-
|
| 957 |
-
// 이미지 컨테이너 생성
|
| 958 |
-
const container = document.createElement('div');
|
| 959 |
-
container.className = 'image-container';
|
| 960 |
-
container.id = 'image-container-1';
|
| 961 |
-
|
| 962 |
-
// 번호 라벨 생성
|
| 963 |
-
const numberLabel = document.createElement('div');
|
| 964 |
-
numberLabel.className = 'image-number';
|
| 965 |
-
numberLabel.textContent = '1';
|
| 966 |
-
|
| 967 |
-
// 이미지 생성
|
| 968 |
-
const img = document.createElement('img');
|
| 969 |
-
img.src = 'webtoon.png';
|
| 970 |
-
img.className = 'webtoon-image';
|
| 971 |
-
img.alt = 'webtoon.png';
|
| 972 |
-
img.id = 'webtoon-image-1';
|
| 973 |
-
|
| 974 |
-
// 이미지 로드 에러 처리
|
| 975 |
-
img.onerror = function() {
|
| 976 |
-
console.error('기본 이미지(webtoon.png)를 불러올 수 없습니다.');
|
| 977 |
-
// 에러 시 파일 리스트에 메시지 표시
|
| 978 |
-
const fileList = document.getElementById('fileList');
|
| 979 |
-
fileList.innerHTML = '<p style="font-size: 12px; color: #ff6b6b;">⚠️ webtoon.png 파일을 찾을 수 없습니다.</p>';
|
| 980 |
-
};
|
| 981 |
-
|
| 982 |
-
// 이미지 로드 성공 시
|
| 983 |
-
img.onload = function() {
|
| 984 |
-
// 파일 리스트 업데이트
|
| 985 |
-
const fileList = document.getElementById('fileList');
|
| 986 |
-
fileList.innerHTML = '<p style="font-size: 12px; color: #4a9eff; margin-bottom: 10px;">✅ 기본 이미지 로드됨</p><div class="file-list"><div class="file-item">1. webtoon.png (기본)</div></div>';
|
| 987 |
-
|
| 988 |
-
// uploadedImages 배열에 추가
|
| 989 |
-
uploadedImages.push({
|
| 990 |
-
id: 1,
|
| 991 |
-
name: 'webtoon.png',
|
| 992 |
-
element: img
|
| 993 |
-
});
|
| 994 |
-
|
| 995 |
-
// 이미지 간격 적용
|
| 996 |
-
updateImageSpacing();
|
| 997 |
-
};
|
| 998 |
-
|
| 999 |
-
container.appendChild(numberLabel);
|
| 1000 |
-
container.appendChild(img);
|
| 1001 |
-
canvas.appendChild(container);
|
| 1002 |
-
}
|
| 1003 |
-
|
| 1004 |
-
// 자연스러운 정렬 함수
|
| 1005 |
-
function naturalSort(a, b) {
|
| 1006 |
-
const extractNumber = (filename) => {
|
| 1007 |
-
const match = filename.match(/(\d+)/);
|
| 1008 |
-
return match ? parseInt(match[1]) : 0;
|
| 1009 |
-
};
|
| 1010 |
-
|
| 1011 |
-
const aNum = extractNumber(a.name);
|
| 1012 |
-
const bNum = extractNumber(b.name);
|
| 1013 |
-
|
| 1014 |
-
if (aNum !== bNum) {
|
| 1015 |
-
return aNum - bNum;
|
| 1016 |
-
}
|
| 1017 |
-
|
| 1018 |
-
return a.name.localeCompare(b.name);
|
| 1019 |
-
}
|
| 1020 |
-
|
| 1021 |
-
// 파일 업로드 처리
|
| 1022 |
-
document.getElementById('fileInput').addEventListener('change', async function(e) {
|
| 1023 |
-
const files = Array.from(e.target.files);
|
| 1024 |
-
files.sort(naturalSort);
|
| 1025 |
-
|
| 1026 |
-
const canvas = document.getElementById('canvas');
|
| 1027 |
-
canvas.querySelectorAll('.image-container').forEach(container => container.remove());
|
| 1028 |
-
uploadedImages = [];
|
| 1029 |
-
|
| 1030 |
-
let fileListHTML = '<div class="file-list">';
|
| 1031 |
-
|
| 1032 |
-
const loadPromises = files.map((file, index) => {
|
| 1033 |
-
return new Promise((resolve) => {
|
| 1034 |
-
if (file.type.startsWith('image/')) {
|
| 1035 |
-
const reader = new FileReader();
|
| 1036 |
-
|
| 1037 |
-
reader.onload = function(event) {
|
| 1038 |
-
resolve({
|
| 1039 |
-
index: index,
|
| 1040 |
-
src: event.target.result,
|
| 1041 |
-
name: file.name
|
| 1042 |
-
});
|
| 1043 |
-
};
|
| 1044 |
-
|
| 1045 |
-
reader.readAsDataURL(file);
|
| 1046 |
-
} else {
|
| 1047 |
-
resolve(null);
|
| 1048 |
-
}
|
| 1049 |
-
});
|
| 1050 |
-
});
|
| 1051 |
-
|
| 1052 |
-
const loadedImages = await Promise.all(loadPromises);
|
| 1053 |
-
|
| 1054 |
-
loadedImages.forEach((imageData, index) => {
|
| 1055 |
-
if (imageData) {
|
| 1056 |
-
const container = document.createElement('div');
|
| 1057 |
-
container.className = 'image-container';
|
| 1058 |
-
container.id = 'image-container-' + (index + 1);
|
| 1059 |
-
|
| 1060 |
-
const numberLabel = document.createElement('div');
|
| 1061 |
-
numberLabel.className = 'image-number';
|
| 1062 |
-
numberLabel.textContent = index + 1;
|
| 1063 |
-
|
| 1064 |
-
const img = document.createElement('img');
|
| 1065 |
-
img.src = imageData.src;
|
| 1066 |
-
img.className = 'webtoon-image';
|
| 1067 |
-
img.alt = imageData.name;
|
| 1068 |
-
img.id = 'webtoon-image-' + (index + 1);
|
| 1069 |
-
|
| 1070 |
-
container.appendChild(numberLabel);
|
| 1071 |
-
container.appendChild(img);
|
| 1072 |
-
canvas.appendChild(container);
|
| 1073 |
-
|
| 1074 |
-
uploadedImages.push({
|
| 1075 |
-
id: index + 1,
|
| 1076 |
-
name: imageData.name,
|
| 1077 |
-
element: img
|
| 1078 |
-
});
|
| 1079 |
-
|
| 1080 |
-
fileListHTML += `<div class="file-item">${index + 1}. ${imageData.name}</div>`;
|
| 1081 |
-
}
|
| 1082 |
-
});
|
| 1083 |
-
|
| 1084 |
-
fileListHTML += '</div>';
|
| 1085 |
-
|
| 1086 |
-
const fileList = document.getElementById('fileList');
|
| 1087 |
-
fileList.innerHTML = '<p style="font-size: 12px; color: #4a9eff; margin-bottom: 10px;">✅ 업로드된 파일: ' + files.length + '개</p>' + fileListHTML;
|
| 1088 |
-
|
| 1089 |
-
updateImageSpacing();
|
| 1090 |
-
});
|
| 1091 |
-
|
| 1092 |
-
// 이미지 간격 업데이트
|
| 1093 |
-
function updateImageSpacing() {
|
| 1094 |
-
const spacing = document.getElementById('imageSpacing').value;
|
| 1095 |
-
document.getElementById('spacingValue').textContent = spacing + 'px';
|
| 1096 |
-
|
| 1097 |
-
document.querySelectorAll('.webtoon-image').forEach(img => {
|
| 1098 |
-
img.style.marginBottom = spacing + 'px';
|
| 1099 |
-
});
|
| 1100 |
-
}
|
| 1101 |
-
|
| 1102 |
-
// 컴포넌트 추가 (기본 폰트 크기 수정)
|
| 1103 |
-
function addComponent(type) {
|
| 1104 |
-
const canvas = document.getElementById('canvas');
|
| 1105 |
-
const component = document.createElement('div');
|
| 1106 |
-
component.className = 'draggable-component';
|
| 1107 |
-
component.id = 'component-' + componentCounter++;
|
| 1108 |
-
|
| 1109 |
-
const canvasContainer = document.querySelector('.canvas-container');
|
| 1110 |
-
const scrollTop = canvasContainer.scrollTop;
|
| 1111 |
-
|
| 1112 |
-
component.style.left = '50px';
|
| 1113 |
-
component.style.top = (scrollTop + 50) + 'px';
|
| 1114 |
-
component.style.width = '150px';
|
| 1115 |
-
component.style.height = '80px';
|
| 1116 |
-
|
| 1117 |
-
let innerContent = '';
|
| 1118 |
-
|
| 1119 |
-
switch(type) {
|
| 1120 |
-
case 'speech':
|
| 1121 |
-
innerContent = `
|
| 1122 |
-
<div class="speech-bubble">
|
| 1123 |
-
<textarea class="component-text" placeholder="대사 입력..." style="font-size: ${DEFAULT_FONT_SIZE}px;"></textarea>
|
| 1124 |
-
<div class="speech-bubble-tail"></div>
|
| 1125 |
-
</div>`;
|
| 1126 |
-
break;
|
| 1127 |
-
case 'thought':
|
| 1128 |
-
innerContent = `
|
| 1129 |
-
<div class="thought-bubble">
|
| 1130 |
-
<textarea class="component-text" placeholder="생각 입력..." style="font-size: ${DEFAULT_FONT_SIZE}px;"></textarea>
|
| 1131 |
-
<div class="thought-bubble-dots">
|
| 1132 |
-
<div class="thought-dot large"></div>
|
| 1133 |
-
<div class="thought-dot small"></div>
|
| 1134 |
-
</div>
|
| 1135 |
-
</div>`;
|
| 1136 |
-
break;
|
| 1137 |
-
case 'shout':
|
| 1138 |
-
innerContent = `
|
| 1139 |
-
<div class="shout-bubble">
|
| 1140 |
-
<textarea class="component-text" placeholder="외침!" style="font-weight: bold; font-size: ${DEFAULT_FONT_SIZE}px;"></textarea>
|
| 1141 |
-
</div>`;
|
| 1142 |
-
break;
|
| 1143 |
-
case 'whisper':
|
| 1144 |
-
innerContent = `
|
| 1145 |
-
<div class="whisper-bubble">
|
| 1146 |
-
<textarea class="component-text" placeholder="속삭임..." style="font-style: italic; font-size: ${DEFAULT_FONT_SIZE}px;"></textarea>
|
| 1147 |
-
</div>`;
|
| 1148 |
-
break;
|
| 1149 |
-
case 'emotion':
|
| 1150 |
-
innerContent = `
|
| 1151 |
-
<div class="emotion-bubble">
|
| 1152 |
-
<textarea class="component-text" placeholder="♥ ♪ ★" style="font-size: ${DEFAULT_FONT_SIZE}px;"></textarea>
|
| 1153 |
-
</div>`;
|
| 1154 |
-
break;
|
| 1155 |
-
case 'action':
|
| 1156 |
-
innerContent = `
|
| 1157 |
-
<div class="action-effect">
|
| 1158 |
-
<textarea class="component-text" placeholder="쿵!" style="font-size: 28px; font-weight: bold;"></textarea>
|
| 1159 |
-
</div>`;
|
| 1160 |
-
break;
|
| 1161 |
-
case 'narration':
|
| 1162 |
-
innerContent = `
|
| 1163 |
-
<div class="narration-box">
|
| 1164 |
-
<textarea class="component-text" placeholder="나레이션..." style="font-size: ${DEFAULT_FONT_SIZE}px;"></textarea>
|
| 1165 |
-
</div>`;
|
| 1166 |
-
break;
|
| 1167 |
-
case 'box':
|
| 1168 |
-
innerContent = `
|
| 1169 |
-
<div class="text-box">
|
| 1170 |
-
<textarea class="component-text" placeholder="텍스트 입력..." style="font-size: ${DEFAULT_FONT_SIZE}px;"></textarea>
|
| 1171 |
-
</div>`;
|
| 1172 |
-
break;
|
| 1173 |
-
case 'transparent':
|
| 1174 |
-
innerContent = `
|
| 1175 |
-
<div class="transparent-box">
|
| 1176 |
-
<textarea class="component-text" placeholder="텍스트 입력..." style="font-size: ${DEFAULT_FONT_SIZE}px;"></textarea>
|
| 1177 |
-
</div>`;
|
| 1178 |
-
break;
|
| 1179 |
-
case 'gradient':
|
| 1180 |
-
innerContent = `
|
| 1181 |
-
<div class="gradient-box">
|
| 1182 |
-
<textarea class="component-text" placeholder="특수 효과!" style="font-size: ${DEFAULT_FONT_SIZE}px;"></textarea>
|
| 1183 |
-
</div>`;
|
| 1184 |
-
break;
|
| 1185 |
-
}
|
| 1186 |
-
|
| 1187 |
-
component.innerHTML = innerContent + `
|
| 1188 |
-
<div class="resize-handle nw"></div>
|
| 1189 |
-
<div class="resize-handle ne"></div>
|
| 1190 |
-
<div class="resize-handle sw"></div>
|
| 1191 |
-
<div class="resize-handle se"></div>
|
| 1192 |
-
`;
|
| 1193 |
-
|
| 1194 |
-
canvas.appendChild(component);
|
| 1195 |
-
|
| 1196 |
-
// 이벤트 리스너 추가
|
| 1197 |
-
component.addEventListener('mousedown', startDrag);
|
| 1198 |
-
|
| 1199 |
-
// 텍스트 영역 클릭 시 드래그 방지
|
| 1200 |
-
const textArea = component.querySelector('.component-text');
|
| 1201 |
-
if (textArea) {
|
| 1202 |
-
textArea.addEventListener('mousedown', function(e) {
|
| 1203 |
-
e.stopPropagation();
|
| 1204 |
-
});
|
| 1205 |
-
textArea.addEventListener('click', function(e) {
|
| 1206 |
-
e.stopPropagation();
|
| 1207 |
-
selectComponent(component);
|
| 1208 |
-
});
|
| 1209 |
-
}
|
| 1210 |
-
|
| 1211 |
-
// 리사이즈 핸들 이벤트
|
| 1212 |
-
component.querySelectorAll('.resize-handle').forEach(handle => {
|
| 1213 |
-
handle.addEventListener('mousedown', startResize);
|
| 1214 |
-
});
|
| 1215 |
-
|
| 1216 |
-
selectComponent(component);
|
| 1217 |
-
}
|
| 1218 |
-
|
| 1219 |
-
// 컴포넌트 선택
|
| 1220 |
-
function selectComponent(component) {
|
| 1221 |
-
document.querySelectorAll('.draggable-component').forEach(c => {
|
| 1222 |
-
c.classList.remove('selected');
|
| 1223 |
-
});
|
| 1224 |
-
|
| 1225 |
-
component.classList.add('selected');
|
| 1226 |
-
selectedComponent = component;
|
| 1227 |
-
|
| 1228 |
-
const textArea = component.querySelector('.component-text');
|
| 1229 |
-
if (textArea) {
|
| 1230 |
-
document.getElementById('textInput').value = textArea.value;
|
| 1231 |
-
document.getElementById('fontSizeInput').value = parseInt(textArea.style.fontSize) || DEFAULT_FONT_SIZE;
|
| 1232 |
-
document.getElementById('fontSelect').value = textArea.style.fontFamily || "'Noto Sans KR'";
|
| 1233 |
-
document.getElementById('fontWeightSelect').value = textArea.style.fontWeight || '400';
|
| 1234 |
-
}
|
| 1235 |
-
}
|
| 1236 |
-
|
| 1237 |
-
// 드래그 시작
|
| 1238 |
-
function startDrag(e) {
|
| 1239 |
-
if (e.target.classList.contains('resize-handle')) return;
|
| 1240 |
-
if (e.target.classList.contains('component-text')) return;
|
| 1241 |
-
|
| 1242 |
-
const component = e.currentTarget;
|
| 1243 |
-
selectComponent(component);
|
| 1244 |
-
|
| 1245 |
-
isDragging = true;
|
| 1246 |
-
currentDragElement = component;
|
| 1247 |
-
|
| 1248 |
-
// 드래그 중 클래스 추가
|
| 1249 |
-
component.classList.add('dragging');
|
| 1250 |
-
|
| 1251 |
-
const canvasRect = document.getElementById('canvas').getBoundingClientRect();
|
| 1252 |
-
const componentRect = component.getBoundingClientRect();
|
| 1253 |
-
|
| 1254 |
-
dragOffset.x = e.clientX - componentRect.left;
|
| 1255 |
-
dragOffset.y = e.clientY - componentRect.top;
|
| 1256 |
-
|
| 1257 |
-
document.addEventListener('mousemove', drag);
|
| 1258 |
-
document.addEventListener('mouseup', stopDrag);
|
| 1259 |
-
|
| 1260 |
-
e.preventDefault();
|
| 1261 |
-
}
|
| 1262 |
-
|
| 1263 |
-
// 드래그 중
|
| 1264 |
-
function drag(e) {
|
| 1265 |
-
if (!isDragging || !currentDragElement) return;
|
| 1266 |
-
|
| 1267 |
-
const canvas = document.getElementById('canvas');
|
| 1268 |
-
const canvasRect = canvas.getBoundingClientRect();
|
| 1269 |
-
const containerScrollTop = document.querySelector('.canvas-container').scrollTop;
|
| 1270 |
-
|
| 1271 |
-
let newX = e.clientX - canvasRect.left - dragOffset.x;
|
| 1272 |
-
let newY = e.clientY - canvasRect.top - dragOffset.y + containerScrollTop;
|
| 1273 |
-
|
| 1274 |
-
// 캔버스 범위 내로 제한
|
| 1275 |
-
newX = Math.max(0, Math.min(newX, canvas.offsetWidth - currentDragElement.offsetWidth));
|
| 1276 |
-
newY = Math.max(0, newY);
|
| 1277 |
-
|
| 1278 |
-
currentDragElement.style.left = newX + 'px';
|
| 1279 |
-
currentDragElement.style.top = newY + 'px';
|
| 1280 |
-
|
| 1281 |
-
e.preventDefault();
|
| 1282 |
-
}
|
| 1283 |
-
|
| 1284 |
-
// 드래그 종료
|
| 1285 |
-
function stopDrag(e) {
|
| 1286 |
-
if (currentDragElement) {
|
| 1287 |
-
currentDragElement.classList.remove('dragging');
|
| 1288 |
-
}
|
| 1289 |
-
isDragging = false;
|
| 1290 |
-
currentDragElement = null;
|
| 1291 |
-
document.removeEventListener('mousemove', drag);
|
| 1292 |
-
document.removeEventListener('mouseup', stopDrag);
|
| 1293 |
-
|
| 1294 |
-
e.preventDefault();
|
| 1295 |
-
}
|
| 1296 |
-
|
| 1297 |
-
// 리사이즈 시작
|
| 1298 |
-
function startResize(e) {
|
| 1299 |
-
e.stopPropagation();
|
| 1300 |
-
isResizing = true;
|
| 1301 |
-
|
| 1302 |
-
const handle = e.target;
|
| 1303 |
-
const component = handle.parentElement;
|
| 1304 |
-
selectComponent(component);
|
| 1305 |
-
|
| 1306 |
-
const startX = e.clientX;
|
| 1307 |
-
const startY = e.clientY;
|
| 1308 |
-
const startWidth = component.offsetWidth;
|
| 1309 |
-
const startHeight = component.offsetHeight;
|
| 1310 |
-
const startLeft = component.offsetLeft;
|
| 1311 |
-
const startTop = component.offsetTop;
|
| 1312 |
-
|
| 1313 |
-
function resize(e) {
|
| 1314 |
-
if (!isResizing) return;
|
| 1315 |
-
|
| 1316 |
-
const dx = e.clientX - startX;
|
| 1317 |
-
const dy = e.clientY - startY;
|
| 1318 |
-
|
| 1319 |
-
if (handle.classList.contains('se')) {
|
| 1320 |
-
component.style.width = Math.max(80, startWidth + dx) + 'px';
|
| 1321 |
-
component.style.height = Math.max(40, startHeight + dy) + 'px';
|
| 1322 |
-
} else if (handle.classList.contains('sw')) {
|
| 1323 |
-
component.style.width = Math.max(80, startWidth - dx) + 'px';
|
| 1324 |
-
component.style.height = Math.max(40, startHeight + dy) + 'px';
|
| 1325 |
-
component.style.left = Math.min(startLeft + dx, startLeft + startWidth - 80) + 'px';
|
| 1326 |
-
} else if (handle.classList.contains('ne')) {
|
| 1327 |
-
component.style.width = Math.max(80, startWidth + dx) + 'px';
|
| 1328 |
-
component.style.height = Math.max(40, startHeight - dy) + 'px';
|
| 1329 |
-
component.style.top = Math.min(startTop + dy, startTop + startHeight - 40) + 'px';
|
| 1330 |
-
} else if (handle.classList.contains('nw')) {
|
| 1331 |
-
component.style.width = Math.max(80, startWidth - dx) + 'px';
|
| 1332 |
-
component.style.height = Math.max(40, startHeight - dy) + 'px';
|
| 1333 |
-
component.style.left = Math.min(startLeft + dx, startLeft + startWidth - 80) + 'px';
|
| 1334 |
-
component.style.top = Math.min(startTop + dy, startTop + startHeight - 40) + 'px';
|
| 1335 |
-
}
|
| 1336 |
-
}
|
| 1337 |
-
|
| 1338 |
-
function stopResize() {
|
| 1339 |
-
isResizing = false;
|
| 1340 |
-
document.removeEventListener('mousemove', resize);
|
| 1341 |
-
document.removeEventListener('mouseup', stopResize);
|
| 1342 |
-
}
|
| 1343 |
-
|
| 1344 |
-
document.addEventListener('mousemove', resize);
|
| 1345 |
-
document.addEventListener('mouseup', stopResize);
|
| 1346 |
-
}
|
| 1347 |
-
|
| 1348 |
-
// 선택된 컴포넌트 업데이트
|
| 1349 |
-
function updateSelectedComponent() {
|
| 1350 |
-
if (!selectedComponent) return;
|
| 1351 |
-
|
| 1352 |
-
const textArea = selectedComponent.querySelector('.component-text');
|
| 1353 |
-
if (textArea) {
|
| 1354 |
-
textArea.value = document.getElementById('textInput').value;
|
| 1355 |
-
textArea.style.fontSize = document.getElementById('fontSizeInput').value + 'px';
|
| 1356 |
-
textArea.style.fontFamily = document.getElementById('fontSelect').value;
|
| 1357 |
-
textArea.style.fontWeight = document.getElementById('fontWeightSelect').value;
|
| 1358 |
-
textArea.style.color = selectedColor;
|
| 1359 |
-
}
|
| 1360 |
-
}
|
| 1361 |
-
|
| 1362 |
-
// 색상 선택
|
| 1363 |
-
function selectColor(element, color) {
|
| 1364 |
-
document.querySelectorAll('.color-option').forEach(opt => {
|
| 1365 |
-
opt.classList.remove('selected');
|
| 1366 |
-
});
|
| 1367 |
-
element.classList.add('selected');
|
| 1368 |
-
selectedColor = color;
|
| 1369 |
-
updateSelectedComponent();
|
| 1370 |
-
}
|
| 1371 |
-
|
| 1372 |
-
// 선택된 컴포넌트 삭제
|
| 1373 |
-
function deleteSelected() {
|
| 1374 |
-
if (selectedComponent) {
|
| 1375 |
-
selectedComponent.remove();
|
| 1376 |
-
selectedComponent = null;
|
| 1377 |
-
document.getElementById('textInput').value = '';
|
| 1378 |
-
}
|
| 1379 |
-
}
|
| 1380 |
-
|
| 1381 |
-
// 전체 초기화
|
| 1382 |
-
function clearAll() {
|
| 1383 |
-
if (confirm('모든 컴포넌트를 삭제하시겠습니까?')) {
|
| 1384 |
-
document.querySelectorAll('.draggable-component').forEach(c => c.remove());
|
| 1385 |
-
selectedComponent = null;
|
| 1386 |
-
document.getElementById('textInput').value = '';
|
| 1387 |
-
}
|
| 1388 |
-
}
|
| 1389 |
-
|
| 1390 |
-
// 개별 이미지 저장
|
| 1391 |
-
function exportSingleImage() {
|
| 1392 |
-
const imageNumber = parseInt(document.getElementById('imageNumber').value);
|
| 1393 |
-
|
| 1394 |
-
if (!imageNumber || imageNumber < 1) {
|
| 1395 |
-
alert('⚠️ 저장할 이미지 번호를 입력해주세요.');
|
| 1396 |
-
return;
|
| 1397 |
-
}
|
| 1398 |
-
|
| 1399 |
-
const imageContainer = document.getElementById('image-container-' + imageNumber);
|
| 1400 |
-
|
| 1401 |
-
if (!imageContainer) {
|
| 1402 |
-
alert('⚠️ ' + imageNumber + '번 이미지를 찾을 수 없습니다.');
|
| 1403 |
-
return;
|
| 1404 |
-
}
|
| 1405 |
-
|
| 1406 |
-
const loading = document.getElementById('loading');
|
| 1407 |
-
loading.classList.add('active');
|
| 1408 |
-
|
| 1409 |
-
document.querySelectorAll('.draggable-component').forEach(c => {
|
| 1410 |
-
c.classList.remove('selected');
|
| 1411 |
-
});
|
| 1412 |
-
|
| 1413 |
-
const numberLabel = imageContainer.querySelector('.image-number');
|
| 1414 |
-
if (numberLabel) numberLabel.style.display = 'none';
|
| 1415 |
-
|
| 1416 |
-
const tempContainer = document.createElement('div');
|
| 1417 |
-
tempContainer.style.position = 'relative';
|
| 1418 |
-
tempContainer.style.width = imageContainer.offsetWidth + 'px';
|
| 1419 |
-
tempContainer.style.background = 'white';
|
| 1420 |
-
|
| 1421 |
-
const imgClone = imageContainer.querySelector('.webtoon-image').cloneNode(true);
|
| 1422 |
-
imgClone.style.marginBottom = '0';
|
| 1423 |
-
tempContainer.appendChild(imgClone);
|
| 1424 |
-
|
| 1425 |
-
const imageTop = imageContainer.offsetTop;
|
| 1426 |
-
const imageBottom = imageTop + imageContainer.offsetHeight;
|
| 1427 |
-
|
| 1428 |
-
document.querySelectorAll('.draggable-component').forEach(component => {
|
| 1429 |
-
const compTop = parseInt(component.style.top);
|
| 1430 |
-
const compBottom = compTop + component.offsetHeight;
|
| 1431 |
-
|
| 1432 |
-
if (compTop < imageBottom && compBottom > imageTop) {
|
| 1433 |
-
const compClone = component.cloneNode(true);
|
| 1434 |
-
compClone.classList.remove('selected');
|
| 1435 |
-
compClone.style.top = (compTop - imageTop) + 'px';
|
| 1436 |
-
tempContainer.appendChild(compClone);
|
| 1437 |
-
}
|
| 1438 |
-
});
|
| 1439 |
-
|
| 1440 |
-
tempContainer.style.position = 'absolute';
|
| 1441 |
-
tempContainer.style.left = '-9999px';
|
| 1442 |
-
document.body.appendChild(tempContainer);
|
| 1443 |
-
|
| 1444 |
-
// html2canvas 옵션
|
| 1445 |
-
html2canvas(tempContainer, {
|
| 1446 |
-
backgroundColor: '#ffffff',
|
| 1447 |
-
scale: 2,
|
| 1448 |
-
useCORS: true,
|
| 1449 |
-
logging: false,
|
| 1450 |
-
scrollY: 0,
|
| 1451 |
-
scrollX: 0,
|
| 1452 |
-
windowHeight: tempContainer.scrollHeight,
|
| 1453 |
-
windowWidth: tempContainer.scrollWidth,
|
| 1454 |
-
onclone: function(clonedDoc) {
|
| 1455 |
-
// 클론된 문서에서 텍스트 영역 스타일 조정
|
| 1456 |
-
const textAreas = clonedDoc.querySelectorAll('.component-text');
|
| 1457 |
-
textAreas.forEach(textarea => {
|
| 1458 |
-
textarea.style.paddingTop = '10px';
|
| 1459 |
-
textarea.style.lineHeight = '1.6';
|
| 1460 |
-
textarea.style.overflow = 'visible';
|
| 1461 |
-
});
|
| 1462 |
-
}
|
| 1463 |
-
}).then(function(canvas) {
|
| 1464 |
-
const link = document.createElement('a');
|
| 1465 |
-
link.download = 'webtoon_' + imageNumber + '_' + new Date().getTime() + '.png';
|
| 1466 |
-
link.href = canvas.toDataURL('image/png');
|
| 1467 |
-
link.click();
|
| 1468 |
-
|
| 1469 |
-
document.body.removeChild(tempContainer);
|
| 1470 |
-
|
| 1471 |
-
if (numberLabel) numberLabel.style.display = 'flex';
|
| 1472 |
-
|
| 1473 |
-
loading.classList.remove('active');
|
| 1474 |
-
|
| 1475 |
-
alert('✅ ' + imageNumber + '번 이미지가 성공적으로 저장되었습니다!');
|
| 1476 |
-
}).catch(function(error) {
|
| 1477 |
-
document.body.removeChild(tempContainer);
|
| 1478 |
-
if (numberLabel) numberLabel.style.display = 'flex';
|
| 1479 |
-
loading.classList.remove('active');
|
| 1480 |
-
console.error('Error:', error);
|
| 1481 |
-
alert('⚠️ 이미지 저장 중 오류가 발생했습니다.');
|
| 1482 |
-
});
|
| 1483 |
-
}
|
| 1484 |
-
|
| 1485 |
-
// 캔버스 클릭 이벤트
|
| 1486 |
-
document.getElementById('canvas').addEventListener('click', function(e) {
|
| 1487 |
-
if (e.target === this || e.target.classList.contains('webtoon-image')) {
|
| 1488 |
-
document.querySelectorAll('.draggable-component').forEach(c => {
|
| 1489 |
-
c.classList.remove('selected');
|
| 1490 |
-
});
|
| 1491 |
-
selectedComponent = null;
|
| 1492 |
-
document.getElementById('textInput').value = '';
|
| 1493 |
-
}
|
| 1494 |
-
});
|
| 1495 |
-
|
| 1496 |
-
// 키보드 단축키
|
| 1497 |
-
document.addEventListener('keydown', function(e) {
|
| 1498 |
-
if (e.key === 'Delete' && selectedComponent) {
|
| 1499 |
-
deleteSelected();
|
| 1500 |
-
}
|
| 1501 |
-
});
|
| 1502 |
-
</script>
|
| 1503 |
-
</body>
|
| 1504 |
-
</html>
|
| 1505 |
-
'''
|
| 1506 |
-
|
| 1507 |
-
# Hugging Face Spaces 또는 Render 배포용
|
| 1508 |
-
if __name__ == '__main__':
|
| 1509 |
-
port = int(os.environ.get('PORT', 7860))
|
| 1510 |
-
app.run(host='0.0.0.0', port=port, debug=False)
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
import sys
|
| 3 |
+
import streamlit as st
|
| 4 |
+
from tempfile import NamedTemporaryFile
|
| 5 |
+
|
| 6 |
+
def main():
|
| 7 |
+
try:
|
| 8 |
+
# Get the code from secrets
|
| 9 |
+
code = os.environ.get("MAIN_CODE")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
if not code:
|
| 12 |
+
st.error("⚠️ The application code wasn't found in secrets. Please add the MAIN_CODE secret.")
|
| 13 |
+
return
|
| 14 |
|
| 15 |
+
# Create a temporary Python file
|
| 16 |
+
with NamedTemporaryFile(suffix='.py', delete=False, mode='w') as tmp:
|
| 17 |
+
tmp.write(code)
|
| 18 |
+
tmp_path = tmp.name
|
| 19 |
|
| 20 |
+
# Execute the code
|
| 21 |
+
exec(compile(code, tmp_path, 'exec'), globals())
|
|
|
|
| 22 |
|
| 23 |
+
# Clean up the temporary file
|
| 24 |
+
try:
|
| 25 |
+
os.unlink(tmp_path)
|
| 26 |
+
except:
|
| 27 |
+
pass
|
| 28 |
+
|
| 29 |
+
except Exception as e:
|
| 30 |
+
st.error(f"⚠️ Error loading or executing the application: {str(e)}")
|
| 31 |
+
import traceback
|
| 32 |
+
st.code(traceback.format_exc())
|
| 33 |
+
|
| 34 |
+
if __name__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