Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- this.state = {
- index: 0,
- right: true,
- prevMouseX: 0,
- now: 0
- }
- function Fancy() {
- setTimeout(function()
- {
- var wave = ['\u4DEB', '\u4DCC', '\u4DC9', '\u4DC8', '\u4DCD',
- '\u4DC8', '\u4DC9', '\u4DCC'];
- var hash = '';
- for (var i=0; i < 64; ++i) {
- hash += wave[(i+state.index) % wave.length];
- }
- var currentMouseX = window.mouseX;
- if (currentMouseX > state.prevMouseX) {
- state.right = true;
- } else if (currentMouseX < state.prevMouseX) {
- state.right = false;
- } else {
- state.right = state.right;
- }
- if (state.right) {
- window.location.replace('#'+hash.split("").reverse().join(""));
- state.right = true;
- } else {
- window.location.replace('#'+hash.split("").reverse().join(""));
- state.right = false;
- }
- state.index = (state.index == wave.length-1) ? 0 : state.index+1;
- state.prevMouseX = currentMouseX;
- }, 50);
- }
- this.Fancy();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement