{"version":3,"sources":["../src/utils.ts","../src/types/dot.ts","../src/types/line.ts","../src/index.ts","../src/starback.ts"],"sourcesContent":["/**\n * Get random number between two given number.\n * @param {Number} min Minimum Number\n * @param {Number} max Maximum Number\n * @returns {Number} The random number result\n*/\nexport function randomNumber(min, max) {\n    return Math.floor(Math.random() * (max - min) + 1) + min\n}\n\nexport function randomArr(arr) {\n    return arr[Math.floor(Math.random() * arr.length)]\n}\n\n/**\n * Convert angle degree to sin degree\n * @param {*} angleDeg \n */\nexport function sinDeg(angleDeg) {\n    return Math.sin(angleDeg * (Math.PI / 180))\n}\n\n/**\n * Convert angle degree to cos degree\n * @param {*} angleDeg \n */\nexport function cosDeg(angleDeg) {\n    return Math.cos(angleDeg * (Math.PI / 180))\n}","import { StarDotConfig, StarType } from \"../types\"\nimport { cosDeg, randomArr, randomNumber, sinDeg } from '../utils'\n\nclass Dot implements StarType {\n    /**\n     * Collection of stars\n     * @param\n     */\n    stars = []\n    type: 'dot'\n    config: StarDotConfig = {\n        quantity: 100,\n        direction: 100,\n        speed: [0.5, .8],\n        backgroundColor: '#ccc',\n        starColor: 'white',\n        starSize: [0, 3],\n    }\n    overflowSize = 10\n\n\n    /** @type {HTMLCanvasElement} */\n    canvas = null\n\n    /** @type {CanvasRenderingContext2D} */\n    ctx = null\n    \n    constructor(canvas, config) {\n        this.config = {...this.config, ...config}\n        this.canvas = canvas\n        this.ctx = canvas.getContext('2d')\n        \n    }\n    draw() {\n        \n        for(let i = 0; i < this.stars.length; i++) {\n            let star = this.stars[i]\n            \n\n            this.ctx.beginPath()\n            this.ctx.fillStyle = this.config.starColor\n            this.ctx.save()\n            this.ctx.globalAlpha = star.opacity\n            this.ctx.arc(star.x, star.y, star.size, 0, Math.PI * 2)\n            this.ctx.fill()\n            this.ctx.restore()\n            this.ctx.closePath()\n        }\n    }\n    update() {\n        let dx = sinDeg(this.config.direction) \n        let dy = cosDeg(this.config.direction) \n        \n        for(let i = 0; i < this.stars.length; i++) {\n            let star = this.stars[i]\n            star.x += dx * star.speed\n            star.y += dy * star.speed\n\n            // When the star location is outside the canvas, replace the star with a new one\n            if(star.x > this.canvas.width + this.overflowSize || \n                star.x < 0 - this.overflowSize ||\n                star.y > this.canvas.height + this.overflowSize ||\n                star.y < 0 - this.overflowSize) {\n\n                    this.stars.splice(i, 1)\n                    \n                    let x, y, startX\n\n                    // If the direction is top or bottom\n                    if(dy == -1 || dy == 1) {\n                        startX = 0\n                        x = randomNumber(startX, this.canvas.width)\n                        y = dy == 1 ? 0 : this.canvas.height\n                    }\n                    // If the direction is right or left\n                    else if(dx == -1 || dx == 1) {\n                        startX = dx == 1 ? 0 : this.canvas.width\n                        x = startX + (this.overflowSize * -dx)\n                        y = randomNumber(0, this.canvas.height)\n                    }\n                    // If the direction is bottom-right\n                    else if(dx > 0  && dy > 0) {\n                        startX = -this.overflowSize\n                        x = randomArr([startX, randomNumber(startX, this.canvas.width - this.overflowSize)])\n                        y = x == startX ? randomNumber(startX, this.canvas.height - this.overflowSize) : -this.overflowSize\n                    } \n                    // If the direction is bottom-left\n                    else if(dx < 0  && dy > 0) {\n                        startX = -this.canvas.width + this.overflowSize\n                        x = randomArr ([startX, randomNumber(startX, 0 + this.overflowSize)])\n                        y = x == startX ? randomNumber(startX, 0 - this.canvas.height + this.overflowSize) : -this.overflowSize\n                    } \n                    // If the direction is top-left\n                    else if (dx < 0  && dy < 0) {\n                        startX = this.canvas.width + this.overflowSize\n                        x = randomArr([startX, randomNumber(startX, 0 + this.overflowSize)])\n                        y = x == startX ? randomNumber(startX, 0 + this.overflowSize) : this.canvas.height + this.overflowSize\n                    }\n                    // If the direction is top-right\n                    else if (dx > 0  && dy < 0) {\n                        startX = -this.overflowSize\n                        x = randomArr([startX, randomNumber(startX, this.canvas.width-this.overflowSize)])\n                        y = x == startX ? randomNumber(startX, this.canvas.height - this.overflowSize) : this.canvas.height + this.overflowSize\n                    }\n                    \n                    let newStarLocation = {\n                        x,\n                        y\n                    }\n                    this.generate(1, newStarLocation)\n                }\n        }\n    }\n    generate(amount, location = null) {\n        \n        // Generate star in specific location\n        if(location) {\n            let { x, y } = location\n            let newStar = {\n                x, \n                y, \n                size: this.randomSize(), \n                opacity: this.randomOpacity(),\n                speed: this.randomSpeed()\n            }\n            \n            return this.stars.push(newStar)\n            \n        }\n        \n        // If no location provided, it will generate stars in random locations.\n        for(let i = 0; i < amount; i++) {\n            let x = randomNumber(0, this.canvas.width)\n            let y = randomNumber(0, this.canvas.height)\n            \n\n            this.stars.push({\n                x,\n                y,   \n                size: this.randomSize(),\n                opacity: this.randomOpacity(),\n                speed: this.randomSpeed()\n            })\n        }\n\n    }\n    randomSize() {\n        return typeof this.config.starSize == 'object' ? randomNumber(this.config.starSize[0], this.config.starSize[1]) : this.config.starSize\n    }\n    randomOpacity() {\n        let opacity = this.config.randomOpacity\n        if(typeof opacity == 'boolean') \n            return !opacity ? 1 : (opacity ? Math.random() : 1).toFixed(2)\n        else \n            return (Math.random() * (opacity[1] - opacity[0]) + opacity[0]).toFixed(2)\n    }\n    randomSpeed() {\n        const speed = this.config.speed\n        \n        return typeof Array.isArray(speed) ? Math.random() * (speed[1] - speed[0]) + speed[0] : speed\n    }\n}\n\nexport default Dot","import { StarLineConfig, StarType } from '../types'\nimport {  randomArr, randomNumber } from '../utils'\n\nclass Line implements StarType {\n    /**\n     * Collection of stars\n     * @param\n     */\n    stars = []\n    config: StarLineConfig = {\n      type: 'line',  \n      slope: { x: 1, y: 1},\n      frequency: 10,\n      speed: 2,\n      starSize: 100,\n      starColor: ['#fb00ff', '#00dde0'],\n      spread: 1,\n      directionY: -1, // 1 = top-to-bottom, 2 = bottom-to-top\n      directionX: 1, // 1 = left-to-right, 2 = right-to-left\n      distanceX: 0.1,\n      quantity: 200\n    }\n    direction = 225\n\n    /** @type {HTMLCanvasElement} */\n    canvas = null\n\n    /** @type {CanvasRenderingContext2D} */\n    ctx = null\n  \n    constructor(canvas, config) {\n      this.config = {...this.config, ...config}\n      this.canvas = canvas\n      this.ctx = canvas.getContext('2d')\n    }\n    draw() {\n        this.ctx.strokeStyle = 'white'\n        this.stars.forEach((star) => {\n          // draw the stars\n          let starColor\n          if (Array.isArray(this.config.starColor)) {\n              starColor = this.ctx.createLinearGradient(0, 0, this.canvas.width, this.canvas.height)\n              this.config.starColor.forEach((color, index) => starColor.addColorStop(index / this.config.starColor.length, color))\n          } else starColor = this.config.starColor\n\n          // pathway with berzier curve\n          this.ctx.save()\n          this.ctx.strokeStyle = starColor\n          this.ctx.beginPath()\n          this.ctx.moveTo(star.start.x, star.start.y)\n          this.ctx.setLineDash([this.config.starSize, star.startPoint * this.config.frequency])\n          this.ctx.lineDashOffset = this.config.directionY * (star.progress + star.length)\n          this.ctx.quadraticCurveTo(star.curve.x, star.curve.y, star.end.x, star.end.y)\n          this.ctx.stroke()\n          this.ctx.closePath()\n          this.ctx.restore()\n        \n\n        })\n    }\n    update() {\n        this.stars.map((star, index) => {\n            star.progress += star.speed\n            // if(star.y - star.height > this.canvas.height) return stars.splice(index,1)\n        })\n    }\n    \n  generate() {\n\n    for(let i = 0; i < this.config.quantity; i++) {\n      const x = randomNumber(-20, this.canvas.width)\n      const y = x <= 0 ? randomNumber(0, this.canvas.height) : 0\n      const height = 100\n      const endX = x + (this.canvas.width * this.config.distanceX + this.config.spread * x * this.config.directionX)\n      const adjacentWidth = endX - x\n      const length = this.canvas.height\n  \n      this.stars.push({\n        x,\n        y,\n        length,\n        height,\n        progress: 0,\n        speed: this.config.speed + Math.random() / 5,\n        lineDash: randomNumber(50, 100),\n        filter: {\n          opacity: randomArr([randomNumber(20, 100) + '%', false]),\n        },\n        start: {\n          x,\n          y,\n        },\n        curve: {\n          x: x + adjacentWidth * this.config.slope.x,\n          y: y + this.canvas.height * this.config.slope.y,\n        },\n        startPoint: randomNumber(10, 100),\n        end: {\n          x: endX,\n          y: this.canvas.height,\n        },\n      })\n    }\n    return this.stars\n  }\n    \n}\n\nexport default Line","import { StarbackConfig, StarbackInterface, StarType } from \"./types\"\nimport Dot from \"./types/dot\"\nimport Line from \"./types/line\"\n\n/**\n * Default Config\n * @type {Object}\n */\nconst StarbackDefaultConfig: StarbackConfig = {\n  width: 800,\n  height: 600,\n\n  randomOpacity: true,\n  showFps: false,\n  type: 'dot'\n}\n\n/**\n * Starback class wrapper\n * @class Starback\n */\nexport default class Starback implements StarbackInterface {\n  static DefaultConfig = StarbackDefaultConfig\n\n  private ctx\n  public config: StarbackConfig = {}\n  public stars: StarType = null\n  public canvas = null\n  public starTypes = {\n    'dot': Dot,\n    'line': Line\n  }\n  public fps = 0\n  private repeat = 0\n\n  private lastCalledTime = 0\n  private lastGenerated = 0\n  private frontCallbacks: Function[] = []\n  private behindCallbacks: Function[] = []\n\n\n  /**\n   * Starback library\n   * @param {HTMLElement|string} Canvas element or the selector\n   * @param {Object} options\n   */\n  constructor(canvas: HTMLCanvasElement | string, config = {}) {\n    this.canvas = canvas instanceof HTMLCanvasElement ? canvas : document.querySelector(canvas)\n\n    this.ctx = this.canvas.getContext('2d')\n\n    // merge config\n    this.mergeConfig(config)\n\n    // storing callbacks\n    this.frontCallbacks = []\n    this.behindCallbacks = []\n\n\n    this.init()\n  }\n\n  static create(canvas: HTMLCanvasElement | string, config: StarbackConfig = {}) {\n    return new Starback(canvas, config)\n  }\n\n  /**\n   * Merge Config\n   * @param  {StarbackDefaultConfig|object} instanceConfig\n   */\n  private mergeConfig(instanceConfig) {\n    // merge config\n    let config = { ...StarbackDefaultConfig, ...instanceConfig }\n\n    // apply config\n    this.config = config\n  }\n\n  /**\n   * Initialize canvas before render\n   */\n  private init() {\n    this.canvas.setAttribute('width', this.config.width)\n    this.canvas.setAttribute('height', this.config.height)\n    this.stars = new this.starTypes[this.config.type](this.canvas, this.config)\n\n    this.generateStar()\n\n    requestAnimationFrame((t) => this.render(t))\n  }\n\n\n  /**\n   * Set background for the whole canvas\n   */\n  private setBackground() {\n    let bg\n\n    if (typeof this.config.backgroundColor == 'string') bg = this.config.backgroundColor\n    else if (typeof this.config.backgroundColor == 'object') {\n      bg = this.ctx.createLinearGradient(this.canvas.width / 2, 0, this.canvas.width / 2, this.canvas.height)\n\n      this.config.backgroundColor.forEach((bgString, index) => {\n        bg.addColorStop(index / this.config.backgroundColor.length, bgString)\n      })\n    }\n    this.ctx.fillStyle = bg\n    this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height)\n  }\n\n  /**\n   * Draw the frame into the canvas\n   */\n  private draw() {\n    this.behindCallbacks.forEach(cb => cb(this.ctx))\n    this.stars.draw()\n    this.frontCallbacks.forEach(cb => cb(this.ctx))\n\n    // Show FPS if config.showFps is enabled\n    if (this.config.showFps) this.drawFps()\n  }\n\n  /**\n   * Update everything in the canvas frame including stars\n   */\n  private update() {\n    this.stars.update()\n  }\n\n  /**\n   * Add an object in front of the stars\n   * @param {Function} cb Callback function\n   */\n  addToFront(cb) {\n    this.frontCallbacks.push(cb)\n  }\n\n  /**\n   * Add an object behind the stars\n   * @param {Function} cb Callback function\n   */\n  addToBehind(cb) {\n    this.behindCallbacks.push(cb)\n  }\n\n  /**\n   * The total quantity of stars in canvas\n   * @param {Number} amount The number of stars\n   */\n  generateStar() {\n    this.stars.generate(this.config.quantity)\n  }\n\n  /**\n   * Draw the FPS in the canvas.\n   */\n  private drawFps() {\n    this.ctx.fillStyle = 'white'\n    this.ctx.fillText(`${this.fps} fps`, 10, 10)\n  }\n\n\n  /**\n   * Canvas render function\n   * @param {DOMHighResTimeStamp} timestamp \n   */\n  private render(timestamp) {\n    if (!this.lastCalledTime) this.lastCalledTime = timestamp\n\n    let deltaTime = timestamp - this.lastCalledTime\n    this.fps = Math.round(1000 / deltaTime)\n    this.lastCalledTime = timestamp\n\n    this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)\n    this.setBackground()\n    this.draw()\n    this.update()\n\n    requestAnimationFrame((t) => this.render(t))\n  }\n\n\n}\n","import Starback from './index'\nmodule.exports = Starback"],"mappings":"0bAMO,SAASA,EAAaC,EAAKC,EAAK,CACnC,OAAO,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AAc,EACnB,KAAK,KAAK,EACV,KAAK,OAAO,EAEZ,sBAAuBE,GAAM,KAAK,OAAOA,CAAC,CAAC,CAC7C,CAGF,EAjKqBjB,EAArBD,EAAqBC,EACZ,cAAgBF,ICtBzB,IAAAoB,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAAAC,IACAD,EAAO,QAAUE","names":["randomNumber","min","max","randomArr","arr","sinDeg","angleDeg","cosDeg","init_utils","__esmMin","Dot","dot_default","init_dot","__esmMin","init_utils","canvas","config","__spreadValues","i","star","dx","sinDeg","dy","cosDeg","x","y","startX","randomNumber","randomArr","newStarLocation","amount","location","newStar","opacity","speed","Line","line_default","init_line","__esmMin","init_utils","canvas","config","__spreadValues","star","starColor","color","index","i","x","randomNumber","y","height","endX","adjacentWidth","length","randomArr","StarbackDefaultConfig","_Starback","Starback","init_src","__esmMin","init_dot","init_line","canvas","config","dot_default","line_default","instanceConfig","__spreadValues","bg","bgString","index","cb","timestamp","deltaTime","t","require_starback","__commonJSMin","exports","module","init_src","Starback"]}