es6+css3+媒体查询小动画

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content = "width=device-width" initial-scale="1.0">
    <meta name="renderer" content="webkit">
    <meta name="referrer" content="always">
    <title>amin</title>
    <style>
        *{
            margin:0;
            padding:0;
            text-shadow:3px 3px 0 rgba(0,0,0,0.2);
            font-family: sans-serif,Microsoft YaHei,cursive;
        }
        .jump{
            text-transform:uppercase;
            background-color: goldenrod;
            width:100%;
            padding-bottom:1em;
            text-align: center;
        }
       span{
          display:inline-block;
           font-size:500%;
      transition:transform 0.2s;
           color:#fff;
        
        }
         
       span:hover{
            color:#532;
            z-index:999;
            transform: translateY(-20px) rotate(10deg) scale(1.3);
           -webkit-translateY(-20px) rotate(10deg) scale(1.3);
        }
        @media screen and (max-width:780px){
             span{
          display:inline-block;
           font-size:350%;      
        }
         @media screen and (max-width:530px){
             span{
          display:inline-block;
           font-size:180%;
        }   
    </style>
</head>
<body>
    <div class="jump">
    <h2>Jump!</h2>
    </div>
 <script >   
window.onload= function(){
    const jumpH2 = document.querySelector('h2')
    jumpH2.innerHTML=spanWrap(jumpH2.textContent);
     
        function spanWrap(headings){
        let jumps= [...headings];//字符串变字符数组。
        return jumps.map(jump => `<span>${jump}</span>`).join('');//map
         
    }
}
    </script>
</body>
</html>

  

posted @   Esther_Cheung  阅读(361)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示