-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cnyet
committed
Nov 30, 2018
1 parent
3d09e51
commit acf977b
Showing
12 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
* { | ||
-webkit-tap-highlight-color: transparent; | ||
outline: 0; | ||
margin: 0; | ||
padding: 0; | ||
vertical-align: baseline; | ||
} | ||
|
||
body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td { | ||
margin: 0; | ||
padding: 0; | ||
vertical-align: baseline; | ||
} | ||
|
||
img { | ||
border: 0 none; | ||
vertical-align: top; | ||
} | ||
|
||
i, em { | ||
font-style: normal; | ||
} | ||
|
||
ol, ul { | ||
list-style: none; | ||
} | ||
|
||
input, select, button, h1, h2, h3, h4, h5, h6 { | ||
font-size: 100%; | ||
font-family: inherit; | ||
} | ||
|
||
table { | ||
border-collapse: collapse; | ||
border-spacing: 0; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
color: #666; | ||
} | ||
|
||
body { | ||
margin: 0 auto; | ||
min-width: 320px; | ||
max-width: 768px; | ||
width: 100%; | ||
height: 100%; | ||
font-size: 14px; | ||
font-family: -apple-system, Helvetica, "Microsoft YaHei", Arial, sans-serif; | ||
line-height: 1.5; | ||
color: #666; | ||
text-size-adjust: 100% !important; | ||
user-select: none; | ||
} | ||
|
||
input[type="text"], textarea { | ||
appearance: none; | ||
} | ||
|
||
html { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
/** | ||
* 状态类 | ||
*/ | ||
.hide { | ||
display: none !important; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.container{ | ||
width: 100%; | ||
height: 100vh; | ||
overflow: hidden; | ||
} | ||
.wrapper{ | ||
overflow: auto; | ||
transition: transform .2s; | ||
} | ||
.wrapper-item{ | ||
width: 100%; | ||
height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #fff; | ||
font-size: 18px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>滑屏效果</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" type="text/css" href="../../css/main.css"> | ||
<link rel="stylesheet" type="text/css" media="screen" href="swiper.css" /> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="wrapper" id="swiper"> | ||
<div class="wrapper-item">swiper01</div> | ||
<div class="wrapper-item">swiper02</div> | ||
<div class="wrapper-item">swiper03</div> | ||
</div> | ||
</div> | ||
<script src="../../js/hammer.min.js"></script> | ||
<script src="swiper.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var intervalTime = 200; | ||
var intervalDistance = 100; | ||
var currentIndex = 0; | ||
var drag = false; | ||
var pageY = 0; | ||
var distanceY = 0; | ||
var startTime = 0; | ||
|
||
var swiper = document.getElementById('swiper'); | ||
swiper.addEventListener('touchstart', function(event){ | ||
drag = swiper; | ||
pageY = event.touches[0].pageY; | ||
startTime = new Date(); | ||
console.log('touchstart'); | ||
}); | ||
|
||
swiper.addEventListener('touchmove', function(event){ | ||
if (drag) { | ||
distanceY = event.touches[0].pageY - pageY; | ||
} | ||
}); | ||
|
||
swiper.addEventListener('touchend', function(event){ | ||
var interval = new Date() - startTime; | ||
var asbDistance = Math.abs(distanceY); | ||
drag = false; | ||
if (interval > intervalTime) { | ||
|
||
} | ||
if (distanceY > asbDistance) { | ||
swiper.style.transform = ''; | ||
} | ||
console.log('touchend', interval); | ||
}); | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.