Lashtw commited on
Commit
8f6f76d
·
verified ·
1 Parent(s): a56b80b

Upload 9 files

Browse files
Files changed (1) hide show
  1. src/views/InstructorView.js +28 -14
src/views/InstructorView.js CHANGED
@@ -331,9 +331,9 @@ export function setupInstructorEvents() {
331
  const dateStr = `${d.getFullYear()}.${String(d.getMonth() + 1).padStart(2, '0')}.${String(d.getDate()).padStart(2, '0')} `;
332
 
333
  watermark.innerHTML = `
334
- < span class="text-lg md:text-2xl font-black font-mono bg-clip-text text-transparent bg-gradient-to-r from-cyan-400 to-purple-400 tracking-wider" >
335
  ${dateStr} VibeCoding 怪獸成長營
336
- </span >
337
  `;
338
  relativeContainer.appendChild(watermark);
339
 
@@ -341,9 +341,9 @@ export function setupInstructorEvents() {
341
  const instructorSection = document.createElement('div');
342
  instructorSection.className = 'absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex flex-col items-center justify-center z-20 group cursor-pointer';
343
  instructorSection.innerHTML = `
344
- < div class="relative" >
345
  <div class="absolute inset-0 bg-yellow-500/20 blur-3xl rounded-full animate-pulse"></div>
346
- <!--Pixel Art Avatar-- >
347
  <img src="assets/instructor_avatar.png" class="relative w-48 h-48 md:w-64 md:h-64 object-contain pixel-art drop-shadow-[0_10px_30px_rgba(0,0,0,0.6)] z-10 hover:scale-105 transition-transform duration-300" alt="Instructor">
348
 
349
  <!-- Editable Name Tag -->
@@ -442,16 +442,28 @@ export function setupInstructorEvents() {
442
  // Radius: Random within range
443
  let radius = minR + Math.random() * (maxR - minR);
444
 
445
- // 3. Avoid Watermark (Bottom Right: 0-60 deg)
446
- // If in this sector, pull them in closer to center to avoid the corner watermark
447
- if (normFinalDeg >= 0 && normFinalDeg < 60) {
448
- radius = minR + Math.random() * 40; // Max radius restricted to minR + 40 (approx 260px)
 
 
 
 
 
 
 
 
449
  }
450
 
451
- // 4. Extra space for bottom area (outside watermark/label zones)
452
- // If 120-150 deg (Bottom Left), can go further out
453
- if (normFinalDeg > 120 && normFinalDeg < 150) {
454
- radius += 40;
 
 
 
 
455
  }
456
 
457
  const xOff = Math.cos(finalAngle) * radius;
@@ -504,8 +516,10 @@ export function setupInstructorEvents() {
504
  style.id = 'anim-float';
505
  style.innerHTML = `
506
  @keyframes float {
507
- 0 %, 100 % { transform: translateY(0) scale(1); }
508
- 50 % { transform: translateY(-5px) scale(1.02); }
 
 
509
  }
510
  `;
511
  document.head.appendChild(style);
 
331
  const dateStr = `${d.getFullYear()}.${String(d.getMonth() + 1).padStart(2, '0')}.${String(d.getDate()).padStart(2, '0')} `;
332
 
333
  watermark.innerHTML = `
334
+ <span class="text-lg md:text-2xl font-black font-mono bg-clip-text text-transparent bg-gradient-to-r from-cyan-400 to-purple-400 tracking-wider">
335
  ${dateStr} VibeCoding 怪獸成長營
336
+ </span>
337
  `;
338
  relativeContainer.appendChild(watermark);
339
 
 
341
  const instructorSection = document.createElement('div');
342
  instructorSection.className = 'absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex flex-col items-center justify-center z-20 group cursor-pointer';
343
  instructorSection.innerHTML = `
344
+ <div class="relative">
345
  <div class="absolute inset-0 bg-yellow-500/20 blur-3xl rounded-full animate-pulse"></div>
346
+ <!--Pixel Art Avatar-->
347
  <img src="assets/instructor_avatar.png" class="relative w-48 h-48 md:w-64 md:h-64 object-contain pixel-art drop-shadow-[0_10px_30px_rgba(0,0,0,0.6)] z-10 hover:scale-105 transition-transform duration-300" alt="Instructor">
348
 
349
  <!-- Editable Name Tag -->
 
442
  // Radius: Random within range
443
  let radius = minR + Math.random() * (maxR - minR);
444
 
445
+ // 3. Avoid Watermark (Bottom Right: 0-90 deg)
446
+ // Expanded zone to properly clear the label
447
+ if (normFinalDeg >= 0 && normFinalDeg < 90) {
448
+ // Push angle strictly out of the zone
449
+ const distTo0 = Math.abs(normFinalDeg - 0);
450
+ const distTo90 = Math.abs(normFinalDeg - 90);
451
+
452
+ if (distTo0 < distTo90) {
453
+ finalAngle = (-15) * (Math.PI / 180); // Move to -15 deg
454
+ } else {
455
+ finalAngle = (105) * (Math.PI / 180); // Move to 105 deg
456
+ }
457
  }
458
 
459
+ // 4. Recalculate degree after shift
460
+ const shiftFinalDeg = finalAngle * (180 / Math.PI) % 360;
461
+ const shiftNormFinalDeg = shiftFinalDeg < 0 ? shiftFinalDeg + 360 : shiftFinalDeg;
462
+
463
+ // 2. Extra space for bottom area (Instructor Name Tag)
464
+ // If 80-100 deg (Bottom Center), push radius out
465
+ if (shiftNormFinalDeg > 80 && shiftNormFinalDeg < 100) {
466
+ radius += 60;
467
  }
468
 
469
  const xOff = Math.cos(finalAngle) * radius;
 
516
  style.id = 'anim-float';
517
  style.innerHTML = `
518
  @keyframes float {
519
+ @keyframes float {
520
+ 0%, 100% { transform: translateY(0) scale(1); }
521
+ 50% { transform: translateY(-5px) scale(1.02); }
522
+ }
523
  }
524
  `;
525
  document.head.appendChild(style);