IE11,Edge和Safari上的盒子阴影动画

时间:2018-04-30 08:19:30

标签: html css-animations

我有这个小动画。它适用于Chrome,Firefox但不适用于IE11和Edge。最近我在ios 11的朋友的iphone 6s上尝试了它,但它也没有用。我做的唯一原因"工作"是通过在动画开始之前设置框阴影。 btw转换正常工作

import React from 'react';
const LoadingPage = () => (
  <div className="page">
    <div className="centered" id="loading-page">
      <div className="wrapper">
        <div className="loading-container">
          <span className="loading">
            <span>L</span>
            <span>o</span>
            <span>a</span>
            <span>d</span>
            <span>i</span>
            <span>n</span>
            <span>g</span>
          </span>
        </div>
      </div>
    </div>
  </div>
);

export default LoadingPage;


*, :after, :before{
    box-sizing: border-box;
    padding:0;
    margin:0;
}

html{
    font-size: 62.5%;
    height: 100vh;
    width: 100vw;
}

body{
    background: #282c34
    color: #8A8A8A;
    font-family: 'lato',sans-serif;
    font-size: 16px;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}
.page{
    background: #282c34;
    position: absolute;
    top:0;
    left:0;
    text-align: center;
    overflow-x: auto;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}
.centered{
    padding: 5% 0 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.wrapper{
    max-width: 33.5rem;
    margin: 0 auto;
    @media (min-width: 36em){
        max-width: 50rem;
    }
    @media (min-width: 62em){
        max-width: 60rem;
    }
    @media (min-width: 75em{
        max-width: 80rem;
    }
    @media (min-width: 87.5em){
        max-width: 101rem;
    }
}
#loading-page{
    height: 100%;
    justify-content: center;
}

.loading-container{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.loading {
    margin: 1em auto;
    font-family: 'Montserrat',sans-serif;
}
.loading span {
    font-size:3rem;
    color:#61afef;
    background:#262B37;
    display: table-cell;
    padding: 0 1.5rem;
    line-height: 10rem;
    animation: jumb 2s infinite;
}

@keyframes jumb {
    0% {
        transform:translateY(0);
    }
    50% {
        transform:translateY(-3rem);
        box-shadow:0 1.5rem 0 #61afef;

    }
    100% {
        transform:translateY(0);
    }
}
.loading span:nth-child(1) {
    animation-delay:0s;
}
.loading span:nth-child(2) {
    animation-delay:.1s;    
}
.loading span:nth-child(3) {
    animation-delay:.2s;
}
.loading span:nth-child(4) {
    animation-delay:.3s;    
}
.loading span:nth-child(5) {
    animation-delay:.4s;
}
.loading span:nth-child(6) {
    animation-delay:.5s;    
}
.loading span:nth-child(7) {
    animation-delay:.6s;
}

我想知道为什么会发生这种情况以避免将来发生这种情况

1 个答案:

答案 0 :(得分:0)

这似乎是一个错误。 您已经修复了。

只需在开始时设置box-shadow: none,IE11就可以为盒子阴影设置动画。