New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish source code for project homepage? #62
Comments
I am hoping to get some examples in by the time we do our first stable release. Apologies for the delay! Code is pretty straight forward - here is an example of the Collidable section: import {Droppable, Collidable} from 'draggable';
import SoundFx from '../../SoundFx';
export default function CollidableSection() {
const containers = document.querySelectorAll('.CubesFrame--idCollidable');
const droppable = new Droppable(containers, {
draggable: '.draggable-source',
droppable: '.Cube--typeDroppable',
appendTo: '.CubesFrame--idCollidable',
collidables: '.CubesFrame--idCollidable .CollisionWall',
classes: {
body: 'draggable-container--is-dragging',
},
plugins: [Collidable],
});
// --- Drag states --- //
let canPlayOverSound = false;
droppable.on('drag:start', () => {
SoundFx.Single.play('cubeUp');
});
droppable.on('drag:over', () => {
if (!canPlayOverSound) {
return;
}
SoundFx.Single.play('cubeOver');
});
droppable.on('drag:out', () => {
canPlayOverSound = true;
});
droppable.on('drag:stop', () => {
SoundFx.Single.play('cubeDown');
canPlayOverSound = false;
});
droppable.on('collidable:in', ({collidingElement}) => {
SoundFx.Single.play('cubeCollide');
collidingElement.classList.add('isColliding');
});
droppable.on('collidable:out', ({collidingElement}) => {
collidingElement.classList.remove('isColliding');
});
return droppable;
} |
Just seconding this – would love an un-minified version of the gh-pages javascript! Thanks for a great library. |
Getting very close to finishing our Examples site - which will be open sourced in this repo. Just need @tsov to finish up some things on Draggable so we can do a full release. Apologies for the delay everyone! |
Sweet! Go @tsov :) I decided to switch to |
Closed by #118 |
It looks like the
index.html
and other assets in thegh-pages
branch are minified/built files, generated from some other source. In the absence of an official set of examples, it'd be great to be able to view source for the home page as a live example of how Draggable works.The text was updated successfully, but these errors were encountered: