HTML5+svg手机图标菜单动画切换特效
XML/HTML Code
- <div class="container">
- <div class="content">
- <div class="device">
- <div class="device__screen">
- <div id="menu-icon-wrapper" class="menu-icon-wrapper" style="visibility: visible;">
- <svg width="1000px" height="1000px">
- <path id="pathA" d="M 300 400 L 700 400 C 900 400 900 750 600 850 A 400 400 0 0 1 200 200 L 800 800" style="stroke-dashoffset: 5803.15; stroke-dasharray: 2901.57, 2981.57, 240;"></path>
- <path id="pathB" d="M 300 500 L 700 500" style="stroke-dashoffset: 800; stroke-dasharray: 400, 480, 240;"></path>
- <path id="pathC" d="M 700 600 L 300 600 C 100 600 100 200 400 150 A 400 380 0 1 1 200 800 L 800 200" style="stroke-dashoffset: 6993.11; stroke-dasharray: 3496.56, 3576.56, 240;"></path>
- </svg>
- <button id="menu-icon-trigger" class="menu-icon-trigger"></button>
- </div><!-- menu-icon-wrapper -->
- <div id="dummy" class="dummy">
- <div class="dummy__item"></div>
- <div class="dummy__item"></div>
- <div class="dummy__item"></div>
- <div class="dummy__item"></div>
- </div><!-- /dummy -->
- </div><!-- /device-content -->
- </div><!-- /device -->
- </div><!-- /content -->
- <div class="content">
- <div class="device device--alt">
- <div class="device__screen">
- <div id="menu-icon-wrapper2" class="menu-icon-wrapper" style="visibility: visible;">
- <svg width="1000px" height="1000px">
- <path id="pathD" d="M 300 400 L 700 400 C 900 400 900 750 600 850 A 400 400 0 0 1 200 200 L 800 800" style="stroke-dashoffset: 5803.15; stroke-dasharray: 2901.57, 2981.57, 240;"></path>
- <path id="pathE" d="M 300 500 L 700 500" style="stroke-dashoffset: 800; stroke-dasharray: 400, 480, 240;"></path>
- <path id="pathF" d="M 700 600 L 300 600 C 100 600 100 200 400 150 A 400 380 0 1 1 200 800 L 800 200" style="stroke-dashoffset: 6993.11; stroke-dasharray: 3496.56, 3576.56, 240;"></path>
- </svg>
- <button id="menu-icon-trigger2" class="menu-icon-trigger"></button>
- </div><!-- menu-icon-wrapper -->
- <div id="dummy2" class="dummy">
- <div class="dummy__item"></div>
- <div class="dummy__item"></div>
- <div class="dummy__item"></div>
- <div class="dummy__item"></div>
- </div><!-- /dummy -->
- </div><!-- /device-content -->
- </div><!-- /device -->
- </div><!-- /content -->
- </div><!-- /container -->
原文地址:http://www.freejs.net/article_daohangcaidan_682.html