diff --git a/meitu/.idea/.name b/meitu/.idea/.name new file mode 100644 index 0000000..485a428 --- /dev/null +++ b/meitu/.idea/.name @@ -0,0 +1 @@ +meitu \ No newline at end of file diff --git a/meitu/.idea/dictionaries/lihua.xml b/meitu/.idea/dictionaries/lihua.xml new file mode 100644 index 0000000..ef77aee --- /dev/null +++ b/meitu/.idea/dictionaries/lihua.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/meitu/.idea/meitu.iml b/meitu/.idea/meitu.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/meitu/.idea/meitu.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/meitu/.idea/misc.xml b/meitu/.idea/misc.xml new file mode 100644 index 0000000..9b198b6 --- /dev/null +++ b/meitu/.idea/misc.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + CoffeeScript + + + + + + + + + + + + + + + + + + $USER_HOME$/.subversion + + + + + + + + + + + + + \ No newline at end of file diff --git a/meitu/.idea/modules.xml b/meitu/.idea/modules.xml new file mode 100644 index 0000000..9c61fa0 --- /dev/null +++ b/meitu/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/meitu/.idea/vcs.xml b/meitu/.idea/vcs.xml new file mode 100644 index 0000000..6564d52 --- /dev/null +++ b/meitu/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/meitu/.idea/workspace.xml b/meitu/.idea/workspace.xml new file mode 100644 index 0000000..78820d2 --- /dev/null +++ b/meitu/.idea/workspace.xml @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1438912084296 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/meitu/css/main.css b/meitu/css/main.css index c39e639..49c9ad9 100644 --- a/meitu/css/main.css +++ b/meitu/css/main.css @@ -113,7 +113,7 @@ html body { right: 5px; top: 60px; width: 50px; - min-height: 100px; + min-height: 50px; } .tools>div { width: 40px; @@ -225,8 +225,11 @@ html body { } .SN_info_wrapper{ + height:130px; -webkit-transform: translate3d(0px, 0px, 0px); transform: translate3d(0px, 0px, 0px); + opacity: 0.8; + -webkit-opacity:0.8; } @@ -234,3 +237,4 @@ html body { + diff --git a/meitu/index.html b/meitu/index.html index 59567bf..0fe38e1 100644 --- a/meitu/index.html +++ b/meitu/index.html @@ -36,61 +36,61 @@
-
-
- -
-
-
-
- -
-
吐槽
-
-
-
- -
-
活动
-
-
-
- -
-
上报
-
-
-
- -
-
分享
-
-
-
- -
-
刷新
-
+
+
+ +
+
+
+
+ +
+
吐槽
+
+
+
+ +
+
活动
+
+
+
+ +
+
上报
+
+
+
+ +
+
分享
+
+
+
+ +
+
刷新
+
-
-
-
0
-
120
-
+
+
+
0
+
120
+
@@ -98,7 +98,15 @@
-
+ +
diff --git a/meitu/js/home/info.js b/meitu/js/home/info.js new file mode 100644 index 0000000..088c30a --- /dev/null +++ b/meitu/js/home/info.js @@ -0,0 +1,92 @@ + + +define('home/info', function(require, exports, module){ + var _ = require('lib/underscore'); + var $ = require('lib/zepto_pj'); + + //渲染数据 + var width = document.body.clientWidth; + var wrapper = $('.SN_info_wrapper'); + var tpl = $('#tpl').html(); + var data = { + width: width, + list:[ + { + name: 'ss' + }, + { + name: 'ss' + }, + { + name: 'ss' + } + ] + }; + + var html = _.template(tpl)(data); + wrapper.html(html); + + //动画特效 + var wholeLength = width * data.list.length; + wrapper.css('width', wholeLength); + + //记录初始位置 + var startX = 0; + wrapper.on('touchstart', function(e){ + startX = e.changedTouches[0].clientX; + }); + + wrapper.on('touchend', function(e){ + var dis = e.changedTouches[0].clientX - startX; + //获取当前translate3d的位置 + var transform = wrapper.css('transform') || wrapper.css('-webkit-transform'); + var currentPos = parseInt(transform.split(',')[0].split('(')[1]); + + //移动 + if(Math.abs(dis) > 30){ + //左移 + if(dis < -30){ + var w = 0; + var handle = setInterval(function(){ + if(w <= width && Math.abs(currentPos) < (wholeLength - width - 10)){ + var newX = (currentPos - w); + wrapper.css('transform', 'translate3d(' + newX + 'px, 0px, 0px)'); + wrapper.css('-webkit-transform', 'translate3d(' + newX + 'px, 0px, 0px)'); + }else{ + clearInterval(handle); + } + w += 80; + }, 70); + } + + //右移 + if(dis > 30){ + var w = 0; + var handle = setInterval(function(){ + if(w <= width && Math.abs(currentPos) > 10){ + var newX = (currentPos + w); + wrapper.css('transform', 'translate3d(' + newX + 'px, 0px, 0px)'); + wrapper.css('-webkit-transform', 'translate3d(' + newX + 'px, 0px, 0px)'); + }else{ + clearInterval(handle); + } + w += 80; + }, 70); + } + } + + + + }); + + +}); + + + + + + + + + diff --git a/meitu/js/home/router.js b/meitu/js/home/router.js index bc42897..0179c0e 100644 --- a/meitu/js/home/router.js +++ b/meitu/js/home/router.js @@ -26,7 +26,7 @@ define('home/router', function(require, exports, module) { //circle for(var i = 0; i < router.length; i++){ ctx.beginPath(); - ctx.fillStyle = '#0091FF'; + ctx.fillStyle = '#159AFE'; ctx.arc(35, 25 + i * 25, 5, 0, Math.PI*2, true); ctx.closePath(); ctx.fill(); diff --git a/meitu/js/home/tools.js b/meitu/js/home/tools.js index 813f494..028d02c 100644 --- a/meitu/js/home/tools.js +++ b/meitu/js/home/tools.js @@ -2,4 +2,38 @@ define('home/tools', function(require, exports, module){ + var $ = require('lib/zepto_pj'); + var tools = $('.tools'); + var tools_list = $('#tools_list'); + + //显示隐藏工具集 + tools_list.on('click', function(){ + tools.css('overflow', 'hidden'); + + var height = parseInt($('.tools').css('height')); + if(height > 50){ + var hideHandle = setInterval(function(){ + height -= 50; + if(height < 10){ + tools_list.css('border', '1px solid #0091FF'); + clearInterval(hideHandle); + }else { + tools.css('height', height + 'px'); + } + }, 40); + }else { + var showHandle = setInterval(function(){ + height += 50; + if(height > 320){ + clearInterval(showHandle); + tools_list.css('border', '1px solid #A3A3A3'); + }else { + tools.css('height', height + 'px'); + } + }, 40); + } + }); + + + }); \ No newline at end of file diff --git a/meitu/js/main.js b/meitu/js/main.js index a6d1e0b..d1ec5a6 100644 --- a/meitu/js/main.js +++ b/meitu/js/main.js @@ -8,7 +8,9 @@ requirejs([ 'home/map', 'lib/underscore', 'home/dashboard', - 'home/router' + 'home/router', + 'home/info', + 'home/tools' ], function(zepto_pj, map, underscore, router) {