project init & fix ui

This commit is contained in:
2023-01-06 14:24:11 +08:00
parent abc4f65a8e
commit ac9b479805
866 changed files with 39916 additions and 53 deletions

View File

@@ -0,0 +1,24 @@
var isEmptyObj = function (obj) {
return JSON.stringify(obj) === '{}';
};
var changeNumToStr = function (arr) {
return arr.map(function (item) {
return typeof item === 'number' ? item + 'rpx' : item;
});
};
var getMessageStyles = function (zIndex, offset, wrapTop, customStyle) {
var arr = changeNumToStr(offset);
var styleOffset = '';
styleOffset += 'top:' + changeNumToStr([wrapTop * 2]) + ';';
styleOffset += 'right:' + arr[1] + ';';
styleOffset += 'left:' + arr[1] + ';';
var zIndexStyle = zIndex ? 'z-index:' + zIndex + ';' : '';
return zIndexStyle + styleOffset + customStyle;
};
module.exports = {
getMessageStyles: getMessageStyles,
isEmptyObj: isEmptyObj,
};