// jQuery Playground - Edit me!
import $ from 'jquery'
// Make jQuery available globally for console testing
window.$ = $
$(document).ready(function() {
console.log('jQuery loaded! Version:', $.fn.jquery)
let clickCount = 0
const $element = $('#animated-element')
const $status = $('#status')
// Update status
function setStatus(text, type = 'success') {
const colors = {
success: 'bg-emerald-500/20 text-emerald-400',
info: 'bg-blue-500/20 text-blue-400',
warning: 'bg-amber-500/20 text-amber-400'
}
$status
.removeClass()
.addClass('px-2 py-1 rounded text-xs ' + colors[type])
.text(text)
}
// Increment click counter
function incrementClicks() {
clickCount++
$('#click-count').text(clickCount)
}
// Animate button
$('#btn-animate').click(function() {
incrementClicks()
setStatus('Animating...', 'info')
$element.animate({
marginLeft: '+=100px',
borderRadius: '50%'
}, 300).animate({
marginLeft: '-=100px',
borderRadius: '12px'
}, 300, function() {
setStatus('Ready')