Comments (8)
Update: I've created a Mapping system which generate a hash containing every navigation information for each floor. Eg:
floorMap[3] = {
"down": false,
"up": 3,
"right": false,
"left": 1,
"closest": {
"down": 1,
"up": false,
"right": 1,
"left": 3
},
"furthest": {
"down": false,
"up": 1,
"right": 1,
"left": false
}
};
This hash contain information about the floor aside (down/up/right/left), the closest floor, ordered by direction. The hash contain the index of the floor or false if it can't found one.
I will add a option call "jump" for ascensor next week, it will have 3 settings:
false: no jump, ascensor will only navigate to direct surroundings floor
true: jump, when navigating, if ascensor can'f found a direct surroundings floor, it will look for the closest floor in that direction.
"loop": Like true, except if there is no direct surroundings floor and no close floor, ascensor will loop and reach the furthest floor (loop).
Let me know your thinking on this system, i need to write some test for it, tidyup some logic, but it should go out this week.
from ascensor.js.
Nothing is available yet, i haven't release any new version of ascensor (it's not ready yet).
Please, when posting comment, use gist (https://gist.github.com/) system or jsfiddle (http://jsfiddle.net/) to post your code, posting here make everything messy.
@koenpopma sorry but i have to remove your comments, they are not directly related to the goal of this issue, and use way too much space (use gist/jsfiddle). Also, what you want (jump to next level when reach the end) is a very specific need for your use, and not everyone else use of Ascensor.js.
Everyone is welcome to change the code, but please use github pull request system and/or discuss only code concept. Posting trunk of code here will only break the readability of the issue.
from ascensor.js.
What about a fourth option for jump, a one called "increment" for exemple?
"increment": Like "loop", except if there is no direct surroundings floor and no close floor, ascensor will loop and reach the first floor of the next level.
from ascensor.js.
Here what i propose:
Jump: true || false
Loop: true || false || "increment" || "increment-x || "increment-y"
Jump: Let ascensor go from floor to floor even if void between them.
Loop:
true // will go opposite floor when reach the end (on all axis)
"increment" // will reach next same-axis floor level when reach end end (on all axis)
"increment-x" // will reach opposite floor on y axis, but jump to next level on x axis
"increment-y" // will reach opposite floor on x axis, but jump to next level on y axis
I've put a illustration of those behavior for loop option:
from ascensor.js.
What about when on say [1,2] and down arrow pressed and you want to go to [2,0]? Or is that shown above somewhere?
from ascensor.js.
I'm not sure to understand, could you draw a illustration of how you think it should work?
from ascensor.js.
i really like the solution you propose, kirkas. increment-x is just what i was looking for in a recent project…
from ascensor.js.
Okay, i've Added & Push this new map/loop system. There is now 6 options for the loop parameter:
true: will reach the further floor on same axis once reach the end, on all axis
"loop-x": will reach the further floor on same axis once reach the end, only on X axis
"loop-y": will reach the further floor on same axis once reach the end, only on Y axis
"increment": will reach next same-axis floor level when reach end end, on all axis
"increment-x": will reach opposite floor on y axis, but jump to next level on X axis
"increment-y": will reach opposite floor on y axis, but jump to next level on Y axis
Please note: When you reach the last floor, it wont' reach the first floor (yet), as this is a quite specific/complicated issue. I've created a new issue for that specific behavior => #28
from ascensor.js.
Related Issues (20)
- IE 9 & 10 Not Displaying Floors HOT 2
- Ascensor.js integrate a menu HOT 1
- Back button HOT 1
- Is this possible? HOT 3
- Can you explain "queued" in its description? HOT 1
- Add FadeOut Animation HOT 1
- Improve rendering HOT 1
- Scroll Top HOT 3
- Prevent Tab to kick you out of current section HOT 1
- firefox wheelNavigation don't work HOT 3
- AJAX call example?
- Set floor as home
- Scrolling with the the Mac trackpad causes the page to skip sections.
- enable inside scrolling
- Animation Sequence
- Demo & Examples do not work HOT 2
- Navigation dots
- Dynamically change queued HOT 1
- Queued coordinates problem
- Event "scrollend" with delay HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ascensor.js.