<commit_before>import Geometric from './geometric/geometric.js'

export default class Background
{
  static draw(p)
  {
    Background.changeColor(p)
    Background.translateCamera(p)
    Background.translateCameraByMouse(p)

    Geometric.draw(p)
  }

  static changeColor(p)
  {
    const hexColorMax          = 255
    const radianX2             = p.PI * 2
    const fps                  = 60
    const fpsGear              = 1 / 20

    const radianPerFrame       = radianX2 / fps
    const radianPerFrameGeared = radianPerFrame * fpsGear
    const fpsReal              = fps / fpsGear
    const frame                = p.frameCount % fpsReal
    const radian               = radianPerFrameGeared * frame
    const sine                 = p.sin(radian)
    const sineMapped1          = (sine + 1) / 2
    const hexColor             = sineMapped1 * hexColorMax

    p.background(hexColor)
  }

  static translateCamera(p)
  {
    const xTranslate = p.frameCount * 0.01
    const yTranslate = 0
    const zTranslate = -(p.windowHeight / 2)

    p.translate(xTranslate, yTranslate, zTranslate)
  }

  static translateCameraByMouse(p)
  {
    const xTranslate = -p.mouseX / 10
    const yTranslate = -p.mouseY / 10

    p.translate(xTranslate, yTranslate)
  }
}<commit_msg>Fix main camera zTranslation responsive issue<commit_after>import Geometric from './geometric/geometric.js'

export default class Background
{
  static draw(p)
  {
    Background.changeColor(p)
    Background.translateCamera(p)
    Background.translateCameraByMouse(p)

    Geometric.draw(p)
  }

  static changeColor(p)
  {
    const hexColorMax          = 255
    const radianX2             = p.PI * 2
    const fps                  = 60
    const fpsGear              = 1 / 20

    const radianPerFrame       = radianX2 / fps
    const radianPerFrameGeared = radianPerFrame * fpsGear
    const fpsReal              = fps / fpsGear
    const frame                = p.frameCount % fpsReal
    const radian               = radianPerFrameGeared * frame
    const sine                 = p.sin(radian)
    const sineMapped1          = (sine + 1) / 2
    const hexColor             = sineMapped1 * hexColorMax

    p.background(hexColor)
  }

  static translateCamera(p)
  {
    const xTranslate = p.frameCount * 0.01
    const yTranslate = 0

    let zTranslate = -(p.width / 3)
    if (window.screen.width < 600) {
      zTranslate = window.screen.width / 5
    }

    p.translate(xTranslate, yTranslate, zTranslate)
  }

  static translateCameraByMouse(p)
  {
    const xTranslate = -p.mouseX / 10
    const yTranslate = -p.mouseY / 10

    p.translate(xTranslate, yTranslate)
  }
}
{'fraction_non_alphanumeric': 0.07880844645550528, 'fraction_numerical': 0.0196078431372549, 'mean_word_length': 1.9909808342728297, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '809290', 'n_tokens_mistral': 907, 'n_tokens_neox': 829, 'n_words': 193}