Sha256: 1c57502a2359e39a8e651b11ec74057dc61b2a2830ba9eda415c4fef4b383c6a

Contents?: true

Size: 1.99 KB

Versions: 96

Compression:

Stored size: 1.99 KB

Contents

$(document).ready(function () {

  const origin = 23
  scale = 200 // pixels per dollar



  $(".gameuiW").each( function (idx, w) {
    // logg($(w).data(), 'data')

    let ans

    let ccStrike = $(w).data('ccStrike')
    let ccStartPrice = $(w).data('ccStartprice') // e.g. 0.88
    let ccCurrentPrice = $(w).data('ccCurrentprice')
    let cUS = $(w).data('ccCus')

    $(".c-u-s").each(function (idx, elem) {
      $(elem).html(cUS)
    })

    $(".windW").each(function (idx, elem) {
      ans = ( origin - cUS ) * scale
      $(elem).css('left', ans)
    })

    $($(w).find('.elephantW')).css('left', (origin - ccStrike)* scale )
    $(w).find('.elephantC > .amount').html( " $" + ccStrike )
    $(w).find('.riderStart > .amount').html( " $" + ccStartPrice )
    $(w).find('.riderStart').css('width', scale * ccStartPrice )
    $(w).find('.riderStart').css('left', -1 * scale * ccStartPrice )
    $(w).find('.riderStart2').css('width', scale * ccStartPrice )

    let currentAmount = ((ccStartPrice - ccCurrentPrice)*100).toPrecision(2)/100
    let ccCurrentGain = ccStartPrice - ccCurrentPrice
    $(w).find('.riderCurrent > .amount').html( " $" + currentAmount )
    ans = `${-1*ccCurrentGain*scale}px`
    $(w).find('.riderW').css('left', ans)

    if (ccCurrentGain > 0) {
      $(w).find('.riderCurrent').css('width', scale * ccCurrentGain )
    } else {
      $(w).find('.riderCurrent').css('display', 'none')
      $(w).find('.riderCurrent2').css('display', 'block')
      $(w).find('.riderCurrent2').css('width', -1 * scale * ccCurrentGain )
      $(w).find('.rider').addClass('riderF')
    }
  })



  $(".gameuiW.next-position").each( function (idx, w) {
    logg($(w).data(), 'next-position')

    let ans

    let gainp = $(w).data('ccGainp')
    if (gainp > 0) {
      $(w).find('.elephant').css('border-width', `${gainp*200 + 1}px` )
      $(w).find('.elephantLoss').css('display', 'none')
    } else {
      gainp = -1 * gainp
      $(w).find('.elephantLoss').css('border-width', `${gainp*200 + 1}px` )
    }
  })

})

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
ish_manager-0.1.8.513 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.512 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.511 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.510 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.509 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.508 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.507 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.506 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.505 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.504 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.503 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.500 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.499 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.498 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.497 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.496 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.495 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.494 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.493 app/assets/javascripts/ish_manager/iro0.js
ish_manager-0.1.8.492 app/assets/javascripts/ish_manager/iro0.js