* Создает стили для userbar из настроек
1016function tma__userbar__createUserbarStyles() { 1017 if (!window.tildaMembers.settingStyles) return; 1018 var userBarStyle = document.getElementById('tlk-userbar-style'); 1020 userBarStyle.remove(); 1023 var styles = window.tildaMembers.settingStyles.controlblock; 1026 if (!styles || (styles && Array.isArray(styles) && !styles.length)) return; 1028 if (styles.user_vertical_coordinate_px || styles.user_horizontal_coordinate_px) textStyle += '.tlk-userbar {'; 1030 if (!styles.user_position || (styles.user_position.indexOf('top') !== -1 && styles.user_vertical_coordinate_px)) { 1031 textStyle += 'top: ' + styles.user_vertical_coordinate_px + ' !important; '; 1032 textStyle += 'bottom: auto !important; '; 1033 } else if (styles.user_vertical_coordinate_px) { 1034 textStyle += 'bottom: ' + styles.user_vertical_coordinate_px + '!important; '; 1035 textStyle += 'top: auto !important; '; 1038 if (styles.user_position && styles.user_position.indexOf('left') !== -1 && styles.user_horizontal_coordinate_px) { 1039 textStyle += 'left: ' + styles.user_horizontal_coordinate_px + '!important; '; 1040 textStyle += 'right: auto !important; '; 1041 } else if (styles.user_horizontal_coordinate_px) { 1042 textStyle += 'right: ' + styles.user_horizontal_coordinate_px + '!important; '; 1043 textStyle += 'left: auto !important; '; 1046 if (styles.user_vertical_coordinate_px || styles.user_horizontal_coordinate_px) textStyle += '}\n'; 1048 if (styles.user_background || styles.user_background_opacity || styles.border_color || styles.border_width_px) { 1049 textStyle += '.tlk-userbar__user-image, .tlk-userbar_store .tlk-userbar__user-image {'; 1051 if (styles.user_background || styles.user_background_opacity) { 1052 var defaultBackgroundColor = '0, 0, 0, '; 1054 if (window.tildaMembers.is_init_store) defaultBackgroundColor = '255, 255, 255, '; 1056 var backgroundColor = styles.user_background 1057 ? tma__userbar__hexToRgb(styles.user_background).join(', ') + ', ' 1058 : defaultBackgroundColor; 1059 var backgroundColorOpacity = tma__userbar__getOpacity(styles.user_background_opacity); 1061 textStyle += 'background-color: rgba(' + backgroundColor + backgroundColorOpacity + ');\n'; 1064 if (styles.border_color || styles.border_width_px) { 1065 var borderWidth = styles.border_width_px || 1; 1066 var borderColor = styles.border_color || 'transparent'; 1068 textStyle += 'border: ' + borderWidth + ' solid ' + borderColor + ';'; 1074 if (styles.user_size) { 1075 textStyle += '.tlk-userbar__user-image {'; 1076 textStyle += 'width: ' + styles.user_size + '; '; 1077 textStyle += 'height: ' + styles.user_size + '; '; 1081 if (styles.user_size_mobile) { 1082 textStyle += ' @media screen and (max-width: 1023px) {'; 1083 textStyle += '.tlk-userbar__user-image {'; 1084 textStyle += 'width: ' + styles.user_size_mobile + '; '; 1085 textStyle += 'height: ' + styles.user_size_mobile + '; '; 1090 if (styles.user_color) { 1091 textStyle += '.tlk-userbar__user-image svg {'; 1092 textStyle += 'fill: ' + styles.user_color + '; '; 1096 if (styles.user_border_color) { 1097 textStyle += ' .tlk-userbar__user-image circle, .tlk-userbar__user-image path,'; 1099 ' .tlk-userbar_store .tlk-userbar__user-image circle, .tlk-userbar_store .tlk-userbar__user-image path {'; 1100 textStyle += 'stroke: ' + styles.user_border_color + '; ';