Source: interactables.js

/**
 * Interactables module
 * @module interactables
 */

// Patch drag items
/**
 * Heart patch element.
 * 
 * @type {HTMLElement}
 */
export const heartPatch = document.getElementById("heart-patch");

/**
 * Star patch element.
 * 
 * @type {HTMLElement}
 */
export const starPatch = document.getElementById("star-patch");

/**
 * Smiley patch element.
 * 
 * @type {HTMLElement}
 */
export const smileyPatch = document.getElementById("smiley-patch");

// Stitch drag items
/**
 * Needle with black thread.
 * 
 * @type {HTMLElement | null}
 */
export const blackNeedle = document.getElementById("black-needle");

/**
 * Needle with white thread.
 * 
 * @type {HTMLElement | null}
 */
export const whiteNeedle = document.getElementById("white-needle");

// Dye drag items
/**
 * Green dye bucket.
 * 
 * @type {HTMLElement | null}
 */
export const greenBucket = document.getElementById("green-bucket");

/**
 * Orange dye bucket.
 * 
 * @type {HTMLElement | null}
 */
export const orangeBucket = document.getElementById("orange-bucket");

/**
 * Pink dye bucket.
 * 
 * @type {HTMLElement | null}
 */
export const pinkBucket = document.getElementById("pink-bucket");

// Cut drag items
/**
 * Scissors element.
 * 
 * @type {HTMLElement | null}
 */
export const scrissors = document.getElementById("scrissors");

/**
 * Determines if the interactable is a patch.
 * 
 * @param {HTMLElement} interactable - Drag item to check.
 * @returns {boolean} `true` if the item is a patch; otherwise, `false`.
 */
export function isPatch(interactable) {
    return interactable === heartPatch || interactable === starPatch || interactable === smileyPatch;
}

/**
 * Determines if the interactable is a big patch (heart patch or smiley patch).
 * 
 * @param {HTMLElement} interactable - Drag item to check.
 * @returns {boolean} `true` if the item is a big patch; otherwise, `false`.
 */
export function isBigPatch(interactable) {
    return interactable === heartPatch || interactable === smileyPatch;
}

/**
 * Determines if the interactable is a star patch.
 * 
 * @param {HTMLElement} interactable - Drag item to check.
 * @returns {boolean} `true` if the item is a star patch; otherwise, `false`.
 */
export function isStarPatch(interactable) {
    return interactable === starPatch;
}

/**
 * Determines if the interactable is a needle.
 * 
 * @param {HTMLElement} interactable - Drag item to check.
 * @returns {boolean} `true` if the item is a needle; otherwise, `false`.
 */
export function isNeedle(interactable) {
    return interactable === blackNeedle || interactable === whiteNeedle;
}

/**
 * Determines if the interactable is a dye bucket.
 * 
 * @param {HTMLElement} interactable - Drag item to check.
 * @returns {boolean} `true` if the item is a dye bucket; otherwise, `false`.
 */
export function isBucket(interactable) {
    return interactable === greenBucket || interactable === orangeBucket || interactable === pinkBucket;
}