'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createShadow = exports.calculateStyle = undefined;

var _constant = require('../constant');

var calculateStyle = exports.calculateStyle = function calculateStyle(_ref) {
  var width = _ref.width,
      height = _ref.height,
      x = _ref.x,
      y = _ref.y;

  return {
    height: _constant.BIT * height - 4,
    width: _constant.BIT * width - 4,
    left: _constant.BIT * x,
    top: _constant.BIT * y
  };
}; /**
    * Created by baoyinghai on 6/2/17.
    */
var createShadow = exports.createShadow = function createShadow(style) {
  var shadow = document.createElement('div');
  shadow.style.left = style.left + 'px';
  shadow.style.top = style.top + 'px';
  shadow.style.height = style.height + 'px';
  shadow.style.width = style.width + 'px';
  shadow.style.position = 'absolute';
  shadow.style.backgroundColor = '#C6C6C6';
  shadow.style.transition = 'all .2s ease';
  shadow.style.opacity = 0.5;
  shadow.style.zIndex = 1;
  return shadow;
};