<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>重力感应 &#8211; 萧邦的博客</title>
	<atom:link href="https://www.zlhlab.top/tag/%e9%87%8d%e5%8a%9b%e6%84%9f%e5%ba%94/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.zlhlab.top</link>
	<description>If not me who, If not now when</description>
	<lastBuildDate>Thu, 22 Feb 2018 13:07:41 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.6</generator>
	<item>
		<title>广汽丰田汉兰达&#8211;大汉是怎么炼成的</title>
		<link>https://www.zlhlab.top/swiper%e5%b5%8c%e5%a5%97%e5%ae%89%e5%8d%93%e6%9c%ba%e5%9e%8b%e5%8d%a1%e9%a1%bf%e9%97%ae%e9%a2%98%e6%80%bb%e7%bb%93/</link>
		
		<dc:creator><![CDATA[萧邦]]></dc:creator>
		<pubDate>Wed, 28 Jun 2017 06:35:20 +0000</pubDate>
				<category><![CDATA[H5]]></category>
		<category><![CDATA[swiper]]></category>
		<category><![CDATA[重力感应]]></category>
		<guid isPermaLink="false">https://www.zlhlab.top/?p=92</guid>

					<description><![CDATA[H5以“大汉是怎么炼成的”为主题，盘点汉兰达车型亮点。传播产品动力及综合性、省油、安全性等特点。通过简单的互动形式，深度传播产品卖点]]></description>
										<content:encoded><![CDATA[<p class="p1"><span class="s1" style="font-family: helvetica, arial, sans-serif;">H5以“大汉是怎么炼成的”为主题，盘点汉兰达车型亮点。传播产品动力及综合性、省油、安全性等特点。通过简单的互动形式，深度传播产品卖点。</span></p>
<p><span class="s1" style="font-family: helvetica, arial, sans-serif;">在广汽汉兰达项目中，使用swiper进行分页和关键点分页展示和swiper.animate.js进行动画切换。</span></p>
<h2 class="p1"><span class="s1" style="font-family: helvetica, arial, sans-serif;"><strong>项目技术元素</strong>：</span></h2>
<p class="p1"><span class="s1" style="font-family: helvetica, arial, sans-serif;">video标签、重力感应、摇一摇切屏、canvas绘制背景、swiper 3d切换，以及包含大量循环的CSS3动画(如车灯、轮胎、循环路背景)。</span></p>
<h2><span style="font-family: helvetica, arial, sans-serif;"><strong>开发难点：</strong></span></h2>
<ol>
<li><span style="font-family: helvetica, arial, sans-serif;">swiper多重嵌套；</span></li>
<li><span style="font-family: helvetica, arial, sans-serif;">视频和大量CSS3动画，出现安卓机型卡顿问题。</span></li>
</ol>
<p> </p>
<h2 class="p1"><span class="s1" style="color: #000000; font-family: helvetica, arial, sans-serif;"><strong>项目解决思路和方法如下</strong>：</span></h2>
<ol>
<li class="p1"><span class="s1" style="font-family: helvetica, arial, sans-serif;">之前阅读知道大量css3动画会导致界面渲染出现卡顿。路采用css3动画进行路的循环，由于山的背景图比较大，开始采用div进行背景循环，然后重力感应进行背景旋转，效果不太理想。于是山的背景图采用canvas方式渲染，然后旋转canvas来适应重力感应。</span></li>
<li class="p1"><span class="s1" style="font-family: helvetica, arial, sans-serif;">元素非循环动画采用ani动画，循环动画使用css3，在swiper切换的时候进行显示影藏。</span></li>
<li class="p1"><span class="s1" style="font-family: helvetica, arial, sans-serif;">进行一个个page检查，发现video标签，不在当前选择页面，还是会进行数据加载，导致界面卡顿。于是针对video标签，仅在当前选择状态，才设置其可见。</span></li>
<li class="p1"><span class="s1" style="font-family: helvetica, arial, sans-serif;">由于子项swiper主要进行卖点介绍，包含大量的图片。在项目构建时，将子项swiper直接嵌入，发现会导致长时间延时。于是将子项swiper嵌套在div当中，在切换到当前页时，动态加载子项swiper包含的内容，当切换出当前页，移除子项swiper包含的元素。</span></li>
<li class="p1"><span class="s1" style="font-family: helvetica, arial, sans-serif;">通过代码优化和细节调整，终于使得项目在安卓机型下流畅的运行。</span></li>
<li class="p1"><span class="s1" style="font-family: helvetica, arial, sans-serif;">搞定。终于可以好好休息下了~</span></li>
</ol>
<h2><span style="font-family: helvetica, arial, sans-serif;"><strong>项目UI设计与地址:</strong></span></h2>
<p><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-359" src="https://www.zlhlab.top/wp-content/uploads/2017/06/%E6%B1%89%E5%85%B0%E8%BE%BE-1.jpg" alt="" width="1228" height="3331"></p>
<p> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
