小编use*_*197的帖子

具有内联样式的关键帧ReactJS

我正在尝试在ReactJS中设置脉动动画的关键帧.我尝试在内联样式中设置关键帧,但这不起作用.

我的代码

const NewRelpyheButton = ({style = {}, open, handleOPenSettings}) => {

    var bar = {
    color: '#000',
    padding: '1em 0',
    fontSize: '20px',
    textAlign: 'center',
    cursor: 'pointer',
    position: 'fixed',
    bottom: '0',
    width: '100%',
    zIndex: '10',
    animation: 'pulse 1.2s ease-in-out',
    animationIterationCount: 'infinite',
    }

    Object.assign(style, {});
    let openModal;
    if (open) {
        openModal = <Modal><NewRelpyhe/></Modal>
    }

    return (
        <div>
        {openModal}
        <Bar color='purple' style={bar} onClick={handleOpenSettings}>
            create a new relphye site
        </Bar></div>
    )
}
Run Code Online (Sandbox Code Playgroud)

我试图在css中模仿这个:

.element {
  width: 100%;
  height: 100%;
  animation: pulse …
Run Code Online (Sandbox Code Playgroud)

html css reactjs

11
推荐指数
2
解决办法
7779
查看次数

标签 统计

css ×1

html ×1

reactjs ×1