Tooltip kustom premium via Alpine directive x-tooltip

- Directive global di app.js: satu tooltip singleton di body, posisi dari
  getBoundingClientRect (fixed, tidak terpotong overflow-hidden), animasi
  fade + slide halus, delay 120ms anti-kedip, fallback ke bawah jika di
  tepi atas viewport, clamp ke viewport
- Tooltip gelap glass: bg-slate-900/95 + ring + shadow + backdrop-blur
- Badge kalender pelanggaran ('X pelanggaran') & presensi ('X siswa, Y
  alpha') beralih dari :title native ke x-tooltip
- Sembunyi otomatis saat scroll/resize/klik
This commit is contained in:
Novy San87
2026-08-03 18:08:57 +07:00
parent 349ebb2b30
commit 3169c636c5
3 changed files with 85 additions and 2 deletions
+1 -1
View File
@@ -196,7 +196,7 @@
<a :href="'{{ route('violations.index') }}?date_from=' + day.dateStr + '&date_to=' + day.dateStr"
class="absolute bottom-1.5 right-1.5 inline-flex items-center justify-center min-w-[28px] h-[28px] text-xs font-extrabold text-white rounded-full shadow-lg transition-transform hover:scale-110"
:class="day.count >= 3 ? 'bg-gradient-to-br from-red-500 to-rose-600 shadow-red-500/30' : (day.count >= 2 ? 'bg-gradient-to-br from-orange-400 to-orange-500 shadow-orange-400/30' : 'bg-gradient-to-br from-blue-400 to-blue-500 shadow-blue-400/30')"
:title="day.count + ' pelanggaran'"
x-tooltip="day.count + ' pelanggaran'"
x-text="day.count">
</a>
</template>