Skip to content

Instantly share code, notes, and snippets.

Marcell Monteiro Cruz 0000marcell

Block or report user

Report or block 0000marcell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@0000marcell
0000marcell / is-any-part-of-element-in-viewport.js
Created Oct 27, 2019
any part of the element is in the viewport
View is-any-part-of-element-in-viewport.js
function isAnyPartOfElementInViewport(el) {
const rect = el.getBoundingClientRect();
const windowHeight = (window.innerHeight || document.documentElement.clientHeight);
const windowWidth = (window.innerWidth || document.documentElement.clientWidth);
const vertInView = (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0);
const horInView = (rect.left <= windowWidth) && ((rect.left + rect.width) >= 0);
return (vertInView && horInView);
}
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
showModal: Ember.computed.alias('model.showModal')
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
queryParam: ['category'],
category: false,
actions {
filter(){
}
}
View components.pie-chart.js
import Ember from 'ember';
import Component from 'ember-component';
import {arc, pie} from 'd3-shape';
import { select } from 'd3-selection';
import { scaleOrdinal } from 'd3-scale';
export default Component.extend({
didInsertElement() {
this.pieChart();
View components.d3-graph-test.js
import Ember from 'ember';
export default Ember.Component.extend({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
steps: [{text: [10, 10, 'oh no, im blank']}],
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Test'
});
You can’t perform that action at this time.