Giter VIP home page Giter VIP logo

ife-2018-css's Introduction

2018 IFE CSS动画学习总结

ife-2018-css's People

Contributors

shirley5li avatar

Watchers

 avatar

ife-2018-css's Issues

🚸表单的问题

  1. 先说 js 实现「当填入内容再删掉后,label还是上移缩小状态,不能恢复到最初输入框未填写的状态」,这个是因为你没有写 else 啊
// 邮箱输入框失去焦点时,根据输入框中是否内容设置label的样式
email_input.onblur = function() {
    var form_label_content = email_input.nextElementSibling.children[0];
    if (email_input.value) {   
        form_label_content.style.transform = 'translateY(-15px)';
        form_label_content.style.fontSize = '0.9em';
    } else {
        // reset
    }
};
  1. 再说 css 实现,看看 :valid 这个伪类,搭配 input 的验证(html 中的表单校验)。
    表单校验通过(有内容) => :valid 生效
    以后尽量不给你源码了 先自己想 有问题再问

:zap:CSS3 制作绕中轴旋转的立方体 的 景深问题

因为你把景深和透视属性放到一个元素中了,把景深比作镜头、透视比作一个苹果,你本来只是想转动苹果,但你现在带着镜头一起转了。

所以再加一层 DOM 把景深和透视分开就行了

<div class="container">
    <div class="cube-box"> <!-- 加一层 -->
        <div class="cubic">
            <div class="front">font</div>
            <div class="back">back</div>
            <div class="left">left</div>
            <div class="right">right</div>
            <div class="top">top</div>
            <div class="bottom">bottom</div>
        </div>
    </div>
</div>
.container .cube-box {
    /* 景深效果 */
    perspective: 1000px;
    -moz-perspective: 1000px;
    -ms-perspective: 1000px;
    -webkit-perspective: 1000px;
    -moz-perspective: 1000px;

    /* 更改下透视点的位置 */
    perspective-origin: 50% 50%;
}

.container .cubic {
    width: 500px;
    height: 500px;
    position: relative;
    display: flex;
    /* 使cubic中的6个div水平、垂直居中*/
    justify-content: center;
    align-items: center;

    /* 子元素保持3D效果 */
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    -o-transform-style: preserve-3d;
    -ms-transform-style: preserve-3d;
}

🐛slider 的问题

没发现你通过 :target 实现中,translateY(350px) 导致的原因是什么。

但是这两个组合在一起才会出现问题。推测可能是浏览器 🐛 。

给你两个解决方法:

  1. 移除 :target,通过 js 给 img 标签添加 class,通过 class 来启动动画。
  2. 替换 img 上的 absolute,使用 fixed。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.