Comments (2)
@Lor-Saba That's a great idea ! I'm pretty much feeling that this would be for overidding the danceType
Like this you could use the built in danceTypes
// rythm.addRythm(elementClass, danceType, startValue, nbValue)
rythm.addRythm("myClass", "pulse", 50, 200);
and you could use you own danceType function
// rythm.addRythm(elementClass, danceType, startValue, nbValue)
rythm.addRythm("myClass", (event) => {
// Custom code using event.value
}, 50, 200);
The only negative point i find here is that people will probably do some awesome effects, and could not share them in the library :'(
I was refactoring to make PR really easy to do for effects (see #22) , woudn't it address this point ?
from rythm.js.
@Lor-Saba That's a great idea ! I'm pretty much feeling that this would be for overidding the danceType
You're right, this makes more sense than my example.
Also, an event.target
which points to the current selected element would be useful (check the import below)
The only negative point i find here is that people will probably do some awesome effects, and could not share them in the library :'(
You could try to add an "import" method so that a set of "danceTypes" can be loaded as external code.
Example:
var danceTypes = {
"blink": function(event){
event.target.style.opacity = event.value > .5 ? 1 : 0;
},
"blink-smooth": function(event){
event.target.style.opacity = event.value;
},
"bounce-right": function(event){
event.target.style.transform = "translateX(" +(event.value * 50)+ "px)";
}
};
rythm.importDanceTypes(danceTypes);
and then..
rythm.addRythm("myClass", "blink-smooth", 50, 200);
p.s.
thank you for considering my suggestion ^^
from rythm.js.
Related Issues (20)
- how to set volume for songs? HOT 2
- any way to catch the audio is finished play? HOT 4
- Does not work in iOS Safari HOT 5
- How to translate .md files into other languages HOT 1
- Integrate a new dance with wiv.js
- Need to add a nice Favicon (animated ?) HOT 2
- Cloudflare link is down HOT 6
- Lots of vulnerabilities HOT 1
- any way to make the audio loop? HOT 2
- multiple instances HOT 5
- Downloading Library HOT 4
- Rythm constructor is not recognized HOT 2
- Uncaught (in promise) DOMException: Failed to load because no supported source was found. HOT 2
- Getting past "AudioContext not allowed to start" issue on Chrome.
- Why are the dances not working besides the font-size?
- API Documentation
- Connect Rythm to an HTML audio source HOT 11
- close
- How to use Rythm.js with 0 Volume? HOT 5
- How to get rhythm data without using class attribute? 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 rythm.js.