Skip to content

Commit

Permalink
fix: 调整提示框默认样式的最小高度为100px
Browse files Browse the repository at this point in the history
  • Loading branch information
hacxy committed Mar 12, 2024
1 parent 3850838 commit fe2b19b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
7 changes: 5 additions & 2 deletions packages/oh-my-live2d/src/config/style.ts
Expand Up @@ -130,7 +130,7 @@ export const TIPS_DEFAULT_STYLE: CSSProperties = {
filter: 'drop-shadow(0 0 5px #999)',
border: '2px solid #fff',
color: '#fff',
padding: '15px 5px',
padding: '5px 5px',
opacity: 0,
visibility: 'hidden',
transform: 'translateX(-50%)',
Expand All @@ -141,5 +141,8 @@ export const TIPS_DEFAULT_STYLE: CSSProperties = {
animationIterationCount: '1, infinite',
width: '60%',
left: '50%',
top: 0
top: 0,
display: 'flex',
alignItems: 'center',
minHeight: '100px'
};
1 change: 1 addition & 0 deletions packages/oh-my-live2d/src/modules/tips.ts
Expand Up @@ -34,6 +34,7 @@ export class Tips {
// this.setStyle();

this.setContentStyle({
wordBreak: 'break-all',
display: '-webkit-box',
textOverflow: 'ellipsis',
WebkitBoxOrient: 'vertical',
Expand Down
4 changes: 2 additions & 2 deletions packages/oh-my-live2d/src/types/options.ts
Expand Up @@ -85,10 +85,10 @@ export interface Options {
parentElement?: HTMLElement;

/**
* 组件是否使用固定定位 <Badge type="danger" text="已弃用将在下个版本移除" />
* 组件是否使用固定定位 <Badge type="danger" text="已弃用" />
*
* > [!WARNING]
* > 注意, 关闭这个属性后舞台的定位属性将从 fixed 改为 relative, 使舞台回到文档流, 另外该属性不影响状态条定位属性, 状态条与舞台之间相互独立,样式互不干扰.
* > 该属性将在下个版本移除, 现在您可以通过模型选项的stageStyle属性为舞台元素设置定位属性
* @valueType boolean
* @default true
* @deprecated 已弃用将在下个版本移除
Expand Down
4 changes: 2 additions & 2 deletions packages/oh-my-live2d/src/types/tips.ts
Expand Up @@ -15,15 +15,15 @@ export interface TipsOptions {
messageLine?: number;
/**
*
* 定义提示框样式, 支持传入CSS对象, 提示框的默认情况下, 始终与舞台保持水平居中, 默认宽度为舞台的60%, 高度自动被内容撑开.
* 定义提示框样式, 支持传入CSS对象, 提示框的默认情况下, 始终与舞台保持水平居中, 默认宽度为舞台的60%, 最小高度为 100px, 内容默认垂直水平居中.
*
* @valueType object
*/
style?: CommonStyleType;

/**
*
* 移动端时的提示框样式, 支持传入CSS对象, 提示框的默认情况下, 始终与舞台保持水平居中, 默认宽度为舞台的60%, 高度自动被内容撑开.
* 移动端时的提示框样式, 支持传入CSS对象, 提示框的默认情况下, 始终与舞台保持水平居中, 默认宽度为舞台的60%, 最小高度为 100px, 内容默认垂直水平居中.
*/
mobileStyle?: CommonStyleType;
/**
Expand Down
8 changes: 4 additions & 4 deletions tests/vite-app/public/index.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/vite-app/src/main.ts
Expand Up @@ -24,6 +24,7 @@ void loadOml2d({
}
],
tips: {
messageLine: 2,
mobileStyle: {
padding: '0px 5px'
},
Expand Down

0 comments on commit fe2b19b

Please sign in to comment.