Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Selikoff samselikoff

View GitHub Profile
@samselikoff
samselikoff / example.js
Created Nov 23, 2019
React spring example
View example.js
import React from "react";
import ReactDOM from "react-dom";
import "@reach/dialog/styles.css";
import { animated, useTransition, useChain } from "react-spring";
import { DialogOverlay, DialogContent } from "@reach/dialog";
const AnimatedDialogOverlay = animated(DialogOverlay);
function App() {
const [isOpen, setIsOpen] = React.useState(false);
@samselikoff
samselikoff / mirage-config.js
Created Nov 20, 2019
mirage-graphql-example
View mirage-config.js
import { buildSchema, graphql } from "graphql";
// Construct a schema, using GraphQL schema language
let graphqlSchema = buildSchema(`
type Query {
recipes: [Recipe]
recipes_by_pk(id: Int!): Recipe
}
type Recipe {
id: ID!
View across-route-animation.diff
diff --git a/app/pods/components/animate/component.js b/app/pods/components/animate/component.js
new file mode 100644
index 00000000..c959f943
--- /dev/null
+++ b/app/pods/components/animate/component.js
@@ -0,0 +1,21 @@
+import Component from "@ember/component";
+import { fadeIn } from "ember-animated/motions/opacity";
+import { wait } from "ember-animated";
+import { easeExpOut } from "d3-ease";
View controllers.application.js
import Ember from 'ember';
import fade from 'ember-animated/transitions/fade';
export default Ember.Controller.extend({
fade
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
updateFirstName() {
console.log('hi')
}
}
@samselikoff
samselikoff / controllers.application.js
Created Jul 1, 2019
Actions - Closures with events, DDAU
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
isAdmin: true,
actions: {
handleChange(e) {
this.set('isAdmin', e.target.checked);
}
}
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
isAdmin: true,
actions: {
handleChange() {
this.toggleProperty('isAdmin');
}
}
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@samselikoff
samselikoff / controllers.application.js
Created May 16, 2019
Ember Animated #109 - duration mismatch with fade transition and `<AnimatedContainer>`
View controllers.application.js
import Ember from 'ember';
import fade from 'ember-animated/transitions/fade';
export default Ember.Controller.extend({
fade
});
@samselikoff
samselikoff / controllers.application.js
Last active Oct 15, 2020
Ember Animated boilerplate
View controllers.application.js
import Ember from 'ember';
import fade from 'ember-animated/transitions/fade';
export default Ember.Controller.extend({
fade
});