Comments (5)
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;
}
from draggable.
Sweet! Go @tsov :) I decided to switch to jQuery.draggable()
for the time being since it just worked out of the box – but I'd much prefer to use Draggable since it's clear you guys put some great thought and work into it – particularly the touch support. Regardless thanks for your hard work!
from draggable.
Just seconding this – would love an un-minified version of the gh-pages javascript! Thanks for a great library.
from draggable.
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!
from draggable.
Closed by #118
from draggable.
Related Issues (20)
- Manual discounts permission - Build use case scenarios for testing
- Preventing element from being added in a Sortable HOT 5
- Draggable caught errors while triggering 'drag:over' HOT 1
- Links on https://shopify.github.io/draggable/ in Chromium browsers do nothing when clicked HOT 2
- Unable to start example in Windows 10 HOT 8
- The mirror element created at the wrong place when using flexbox HOT 1
- Does it make sense to replace AbstractEvent with CustomEvent? HOT 2
- Suggestion for cross OS
- Why Sensors trigger events in source container? HOT 4
- keyboard accessibility - feature request
- shopify theme
- Sortable with fixed Layout
- Analysis: 97% of dependency updates in this repository can be merged. HOT 2
- Add Carousal effect on the UI Hero section
- [BUG] - Multiple Container Sortable Bug on touch devices
- Option to set width/height to offsetWidth/Height on drag start HOT 1
- No keyboard accessibility = please add DO NOT USE ALERT HOT 1
- Duplicate Mirror gets created on iOS Safari if the draggable element contains a link
- Swappable:swap cancel async
- Question - Sortable and Snappable
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 draggable.