相关文章推荐
追风的作业本  ·  使用層疊樣式表(CSS)設計應用程式的樣式 ...·  2 月前    · 
气宇轩昂的春卷  ·  WPF ListView关闭选择开发者社区·  1 月前    · 
逼格高的李子  ·  Customize focused ...·  5 天前    · 
单身的人字拖  ·  FPGA手撕代码——CRC校验码的多种Ver ...·  1 年前    · 
不开心的皮带  ·  如何新建数据字典的操作步骤_云原生数据仓库A ...·  1 年前    · 
侠义非凡的脆皮肠  ·  iOS视图控制器编程指南-Part ...·  2 年前    · 
玩命的青蛙  ·  sql error 1062 ...·  2 年前    · 
没有腹肌的地瓜  ·  解决报错 We‘re sorry but ...·  2 年前    · 
Code  ›  SVG黑科技互动排版『弹性布局,点击展开,隐藏其它』模板代码 | 微信开放社区
科技 transform svg background
https://developers.weixin.qq.com/community/develop/article/doc/00080259e74638204a5c8997c51413
沉着的水桶
2 年前

交流专区
服务市场
微信学堂
文档
小程序
  • 常用主页

    小程序

    小游戏

    企业微信

    微信支付

  • 服务市场
    微信学堂
    文档
登录
评论

置顶 SVG黑科技互动排版『弹性布局,点击展开,隐藏其它』模板代码 精选 热门

梦幻雪冰 2021-06-21
1029 浏览
0 评论

SVG黑科技互动排版『弹性布局,点击展开,隐藏其它』模板代码

模板效果

点击查看效果

模板代码

<section style="line-height: 0;">
    <!-- 抵消touchstart事件 -->
    <section style="height: 0;transform: scale(1);">
        <svg style="display: inline-block;isolation: isolate;transform: translateZ(1px);-webkit-tap-highlight-color: transparent;user-select: none;vertical-align: top;pointer-events: none;" viewBox="0 0 1200 400" width="100%" opacity="0" xmlns="http://www.w3.org/2000/svg">
            <g data-info="懂点君">
                <rect x="0" y="0" fill="#000" width="400" height="400" pointer-events="visible">
                    <set attributeName="visibility" from="visible" to="hidden" begin="touchstart" dur="0.25s" fill="remove" restart="always"></set>
                </rect>
                <rect x="400" y="0" fill="#000" width="400" height="400" pointer-events="visible">
                    <set attributeName="visibility" from="visible" to="hidden" begin="touchstart" dur="0.25s" fill="remove" restart="always"></set>
                </rect>
                <rect x="800" y="0" fill="#000" width="400" height="400" pointer-events="visible">
                    <set attributeName="visibility" from="visible" to="hidden" begin="touchstart" dur="0.25s" fill="remove" restart="always"></set>
                </rect>
        </svg>
    </section>
    <section style




    
="display: flex;width: 100%;">
        <!-- 模块 -->
        <section style="line-height: 0;">
            <section style="height: 0;">
                <!-- 放大状态显示的图片 -->
                <svg style="display: inline-block;background-position: 0 0;background-repeat: no-repeat;background-size: 100% 100%;background-image: url(https://mmbiz.qpic.cn/mmbiz_jpg/JpraGu7eGqTw3a7MicXl0icIu4yBQ4KKF8nzm0kDRHDWvNEg9ykauD9LR1XjVbFWKGWFNvwcdQKHY2Zicpmdia0Rjg/0?wx_fmt=jpeg);width: 100%;vertical-align: top;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;" viewBox="0 0 750 750" x="0" y="0"></svg>
            </section>
            <svg width="100%" viewBox="0 0 400 400" style="margin-bottom: -1px;pointer-events: none;background-position: 0 0;background-size: 100% 100%;background-repeat: no-repeat;-webkit-tap-highlight-color: transparent;user-select: none;vertical-align: top;max-width: 100% !important;min-width: 100% !important;">
                <g style="pointer-events: none;" data-info="懂点君">
                    <!-- 缩小状态显示的图片 -->
                    <foreignObject opacity="1" width="100%" height="100%">
                        <svg style="display: inline-block;background-image: url(https://mmbiz.qpic.cn/mmbiz_jpg/JpraGu7eGqTw3a7MicXl0icIu4yBQ4KKF8NicseVHianr1eR9zxs4LZxac52LdwUz8knHicQZhCiaNLtUP8zK4rsKLvA/0?wx_fmt=jpeg);background-position: 0 0;background-size: 100% 100%;background-repeat: no-repeat;-webkit-tap-highlight-color: transparent;user-select: none;vertical-align: top;max-width: 100% !important;min-width: 100% !important;pointer-events: none;" viewBox="0 0 400 400" width="100%"></svg>
                    </foreignObject>
                    <g opacity="0" style="pointer-events: none;" transform="translate(0 0)">
                        <!-- 接收click事件,向左移动svg的宽度 -->
                        <animateTransform attributeName="transform" type="translate" values="-800 0;-400 0;-400 0" begin="click" dur="999s" restart="always" fill="remove" keyTimes="0;0.001;1"></animateTransform>
                        <!-- 接收touchstart事件,向右移动svg的宽度 -->
                        <animateTransform attributeName="transform" type="translate" values="-800 0;0 0;0 0" begin="touchstart+0.3s" dur="999s" restart="always" fill="remove" keyTimes="0;0.001;1"></animateTransform>
                        <g style="opacity: 0.5;">
                            <animateTransform attributeName="transform" type="translate" values="0 9999;0 9999;" begin="touchstart" dur="1s" restart="always" fill="remove"></animateTransform>
                            <rect xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="100%" height="100%" style="pointer-events: visible;">
                                <set attributeName="visibility" from="visible" to="hidden" begin="click" dur="1.2s" fill="remove" restart="always"></set>
                            </rect>
                            <rect xmlns="http://www.w3.org/2000/svg" x="100%" y="34%" width="100%" height="66%" style="pointer-events: visible;" fill="#000000">
                                <animateTransform attributeName="transform" type="translate" values="9999 -9999;9999 -9999" begin="touchstart" dur="1.2s" fill="remove" restart="always" calcMode="discrete"></animateTransform>
                            </rect>
                <!-- 接收click事件,透明度隐藏 -->
                <animate fill="freeze" dur="999s" attributeName="opacity" begin="click" restart="always" values="1;0;0" keyTimes="0;0.0003;1"></animate>
                <!-- 接收touchstart事件,透明度 -->
                <animate fill="freeze" dur="999s" attributeName="opacity" begin="touchstart+0.3s" restart="always" values="0;1;1" keyTimes="0;0.0005;1"></animate>
                <!-- 接收click事件,宽度变大 -->
                <animate attributeName="width" fill="remove" restart="always" calcMode="spline" keySplines="1 0 1 0;0.12 0 0.88 1.0" keyTimes="0;0.001;1" values="0;999999;999999" dur="999s" begin="click" attributeType="CSS"></animate>
                <!-- 接收touchstart事件,宽度变为100% -->
                <animate attributeName="width" fill="remove" restart="always" calcMode="spline" keySplines="0 1 0 1; 0 1 0 1; 0.62 0 0.38 1.0" keyTimes="0;0.0001;0.0008;1" values="999999;999999;0;100%" dur="999s" begin="touchstart+0.3s" attributeType="CSS"></animate>
            </svg>
        </section>
        <!-- 模块 -->
        <section style="line-height: 0;">
            <section style="height: 0;">
                <!-- 放大状态显示的图片 -->
                <svg style="display: inline-block;background-position: 0 0;background-repeat: no-repeat;background-size: 100% 100%;background-image: url(https://mmbiz.qpic.cn/mmbiz_jpg/JpraGu7eGqTw3a7MicXl0icIu4yBQ4KKF85QpmMbtUECt7b6RDQ7js8Yia7XYQNLAGZ780HXSlrLs8XTkFp1KA1Gw/0?wx_fmt=jpeg);width: 100%;vertical-align: top;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;" viewBox="0 0 750 750" x="0" y="0"></svg>
            </section>
            <svg width="100%" viewBox="0 0 400 400" style="margin-bottom: -1px;pointer-events: none;background-position: 0 0;background-size: 100% 100%;background-repeat: no-repeat;-webkit-tap-highlight-color: transparent;user-select: none;vertical-align: top;max-width: 100% !important;min-width: 100% !important;">
                <g style="pointer-events: none;" data-info="懂点君">
                    <!-- 缩小状态显示的图片 -->
                    <foreignObject opacity="1" width="100%" height="100%">
                        <svg style="display: inline-block;background-image: url(https://mmbiz.qpic.cn/mmbiz_jpg/JpraGu7eGqTw3a7MicXl0icIu4yBQ4KKF88iafjsbCfTQsRNDrKIx7BBQG4DfWE6Mo05ERf519rKkCB8k5XF4QWPQ/0?wx_fmt=jpeg);background-position: 0 0;background-size: 100% 100%;background-repeat: no-repeat;-webkit-tap-highlight-color: transparent;user-select: none;vertical-align: top;max-width: 100% !important;min-width: 100% !important;pointer-events: none;" viewBox="0 0 400 400" width="100%"></svg>
                    </foreignObject>
                    <g opacity="0" style="pointer-events: none;" transform="translate(0 0)">
                        <!-- 接收click事件,向左移动svg的宽度 -->
                        <animateTransform attributeName="transform" type="translate" values="-800 0;-400 0;-400 0" begin="click" dur="999s" restart="always" fill="remove" keyTimes="0;0.001;1"></animateTransform>
                        <!-- 接收touchstart事件,向右移动svg的宽度 -->
                        <animateTransform attributeName="transform" type="translate" values="-800 0;0 0;0 0"




    
 begin="touchstart+0.3s" dur="999s" restart="always" fill="remove" keyTimes="0;0.001;1"></animateTransform>
                        <g style="opacity: 0.5;">
                            <animateTransform attributeName="transform" type="translate" values="0 9999;0 9999;" begin="touchstart" dur="1s" restart="always" fill="remove"></animateTransform>
                            <rect xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="100%" height="100%" style="pointer-events: visible;">
                                <set attributeName="visibility" from="visible" to="hidden" begin="click" dur="1.2s" fill="remove" restart="always"></set>
                            </rect>
                            <rect xmlns="http://www.w3.org/2000/svg" x="100%" y="34%" width="100%" height="66%" style="pointer-events: visible;" fill="#000000">
                                <animateTransform attributeName="transform" type="translate" values="9999 -9999;9999 -9999" begin="touchstart" dur="1.2s" fill="remove" restart="always" calcMode="discrete"></animateTransform>
                            </rect>
                <!-- 接收click事件,透明度隐藏 -->
                <animate fill="freeze" dur="999s" attributeName="opacity" begin="click" restart="always" values="1;0;0" keyTimes="0;0.0003;1"></animate>
                <!-- 接收touchstart事件,透明度 -->
                <animate fill="freeze" dur="999s" attributeName="opacity" begin="touchstart+0.3s" restart="always" values="0;1;1" keyTimes="0;0.0005;1"></animate>
                <!-- 接收click事件,宽度变大 -->
                <animate attributeName="width" fill="remove" restart="always" calcMode="spline" keySplines="1 0 1 0;0.12 0 0.88 1.0" keyTimes="0;0.001;1" values="0;999999;999999" dur="999s" begin="click" attributeType="CSS"></animate>
                <!-- 接收touchstart事件,宽度变为100% -->
                <animate attributeName="width" fill="remove" restart="always" calcMode="spline" keySplines="0 1 0 1; 0 1 0 1; 0.62 0 0.38 1.0" keyTimes="0;0.0001;0.0008;1" values="999999;999999;0;100%" dur="999s" begin="touchstart+0.3s" attributeType="CSS"></animate>
            </svg>
        </section>
        <!-- 模块 -->
        <section style="line-height: 0;">
            <section style="height: 0;">
                <!-- 放大状态显示的图片 -->
                <svg style="display: inline-block;background-position: 0 0;background-repeat: no-repeat;background-size: 100% 100%;background-image: url(https://mmbiz.qpic.cn/mmbiz_jpg/JpraGu7eGqTw3a7MicXl0icIu4yBQ4KKF8dPfM9KYGtKeX19kyics6J3E3DjCDu0cK2RTtK4J3GJHU5cZE1IetTqA/0?wx_fmt=jpeg);width: 100%;vertical-align: top;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;" viewBox="0 0 750 750" x="0" y="0"></svg>
            </section>
            <svg width="100%" viewBox="0 0 400 400" style="margin-bottom: -1px;pointer-events: none;background-position: 0 0;background-size: 100% 100%;background-repeat: no-repeat;-webkit-tap-highlight-color: transparent;user-select: none;vertical-align: top;max-width: 100% !important;min-width: 100% !important;">
                <g style="pointer-events: none;" data-info="懂点君">
                    <!-- 缩小状态显示的图片 -->
                    <foreignObject opacity="1" width="100%" height="100%">
                        <svg style="display: inline-block;background-image: url(https://mmbiz.qpic.cn/mmbiz_jpg/JpraGu7eGqTw3a7MicXl0icIu4yBQ4KKF8xIhVp0qIYPMV59xy0yrZgrEMwiaSFicQkIjbbq6iaN8IU5QKyPuQ6UnDg/0?wx_fmt=jpeg);background-position: 0 0;background-size: 100% 100%;background-repeat: no-repeat;-webkit-tap-highlight-color: transparent;user-select: none;vertical-align: top;max-width: 100% !important;min-width: 100% !important;pointer-events: none;" viewBox="0 0 400 400" width="100%"></svg>
                    </foreignObject>
                    <g opacity="0" style="pointer-events: none;" transform="translate(0 0)">
                        <!-- 接收click事件,向左移动svg的宽度 -->
                        <animateTransform attributeName="transform" type="translate" values="-800 0;-400 0;-400 0" begin="click" dur="999s" restart="always" fill="remove" keyTimes="0;0.001;1"></animateTransform>
                        <!-- 接收touchstart事件,向右移动svg的宽度 -->
                        <animateTransform attributeName="transform" type="translate" values="-800 0;0 0;0 0" begin="touchstart+0.3s" dur="999s" restart="always" fill="remove" keyTimes="0;0.001;1"></animateTransform>
                        <g style="opacity: 0.5;">
                            <animateTransform attributeName="transform" type="translate" values="0 9999;0 9999;" begin="touchstart" dur="1s" restart="always" fill="remove"></animateTransform>
                            <rect xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="100%" height="100%" style="pointer-events: visible;">
                                <set attributeName="visibility" from="visible" to="hidden" begin="click" dur="1.2s" fill="remove" restart="always"></set>
                            </rect>
                            <rect xmlns="http://www.w3.org/2000/svg" x="100%" y="34%" width="100%" height="66%" style="pointer-events: visible;" fill="#000000">
                                <animateTransform attributeName="transform" type="translate" values="9999 -9999;9999 -9999" begin="touchstart" dur="1.2s" fill="remove" restart="always" calcMode="discrete"></animateTransform>
                            </rect>
                <!-- 接收click事件,透明度隐藏 -->
                <animate fill="freeze" dur="999s" attributeName="opacity" begin="click" restart="always" values="1;0;0" keyTimes="0;0.0003;1"></animate>
                <!-- 接收touchstart事件,透明度 -->
                <animate fill="freeze" dur="999s" attributeName="opacity" begin="touchstart+0.3s" restart="always" values="0;1;1" keyTimes="0;0.0005;1"></animate>
                <!-- 接收click事件,宽度变大 -->
                <animate attributeName="width" fill="remove" restart="always" calcMode="spline" keySplines="1 0 1 0;0.12 0 0.88 1.0" keyTimes="0;0.001;1" values="0;999999;999999" dur="999s" begin="click" attributeType="CSS"></animate>
                <!-- 接收touchstart事件,宽度变为100% -->
                <animate attributeName="width" fill="remove" restart="always" calcMode="spline" keySplines="0 1 0 1; 0 1 0 1; 0.62 0 0.38 1.0" keyTimes="0;0.0001;0.0008;1" values="999999;999999;0;100%" dur="999s" begin="touchstart+0.3s" attributeType="CSS"></animate>
            </svg>
        </section>
    </section>
</section>
 
推荐文章
追风的作业本  ·  使用層疊樣式表(CSS)設計應用程式的樣式 - .NET MAUI | Microsoft Learn
2 月前
气宇轩昂的春卷  ·  WPF ListView关闭选择开发者社区
1 月前
逼格高的李子  ·  Customize focused state appearance on tab item in Xamarin Forms app, Android implementation - Micros
5 天前
单身的人字拖  ·  FPGA手撕代码——CRC校验码的多种Verilog实现方式-腾讯云开发者社区-腾讯云
1 年前
不开心的皮带  ·  如何新建数据字典的操作步骤_云原生数据仓库AnalyticDB MySQL版(AnalyticDB for MySQL)-阿里云帮助中心
1 年前
侠义非凡的脆皮肠  ·  iOS视图控制器编程指南-Part 4:自适应和尺寸变化 - 简书
2 年前
玩命的青蛙  ·  sql error 1062 sqlstate 23000 duplicate entry spring boot-掘金
2 年前
没有腹肌的地瓜  ·  解决报错 We‘re sorry but doesn‘t work properly without JavaScript enabled. Please enable it to continue._codernmx的博客-CSDN博客
2 年前
今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
删除内容请联系邮箱 2879853325@qq.com
Code - 代码工具平台
© 2024 ~ 沪ICP备11025650号