簡體   English   中英

IE11,Edge和Safari上的框陰影動畫

[英]box-shadow animation on IE11, Edge, and Safari

我有這個小動畫。 它適用於Chrome,Firefox,但不適用於IE11和Edge。 最近,我在朋友的ios 11上的iPhone 6s上試用了它,但是它也無法正常工作。 我使之“起作用”的唯一原因是在動畫開始之前設置了盒子陰影。 順便說一句變換工作正常

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;
}

我想知道為什么要這樣才能避免將來發生這種情況

那似乎是一個錯誤。 您已經解決了。

只需設置box-shadow: none最初box-shadow: none設置,並且IE11可以為box-shadow設置動畫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM