Skip to content

Commit

Permalink
added tinder view for image moderation
Browse files Browse the repository at this point in the history
  • Loading branch information
shubsengupta committed Jan 18, 2015
1 parent 27a3c1a commit c7c6831
Show file tree
Hide file tree
Showing 70 changed files with 209 additions and 123,780 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ plugins/

www/js/main.*
www/css/ionic.app.*
www/js/lib/*
5 changes: 4 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"private": "true",
"devDependencies": {
"ionic": "driftyco/ionic-bower#1.0.0-beta.14"
},
"dependencies": {
"ionic-contrib-tinder-cards": "*"
}
}
}
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ function buildScript(file) {
var bundler = browserify({
entries: [
'./www/js/app.js',
'./www/js/controllers.js'
'./www/js/controllers.js',
'./www/lib/ionic-contrib-tinder-cards/ionic.tdcards.js'
],
cache: {},
packageCache: {},
Expand Down
72 changes: 72 additions & 0 deletions npm-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli 'ionic-contrib-tinder-cards' ]
2 info using npm@1.4.3
3 info using node@v0.10.26
4 warn package.json mobileturk@1.0.0 No repository field.
5 warn package.json mobileturk@1.0.0 No README data
6 verbose readDependencies using package.json deps
7 verbose cache add [ 'ionic-contrib-tinder-cards', null ]
8 verbose cache add name=undefined spec="ionic-contrib-tinder-cards" args=["ionic-contrib-tinder-cards",null]
9 verbose parsed url { protocol: null,
9 verbose parsed url slashes: null,
9 verbose parsed url auth: null,
9 verbose parsed url host: null,
9 verbose parsed url port: null,
9 verbose parsed url hostname: null,
9 verbose parsed url hash: null,
9 verbose parsed url search: null,
9 verbose parsed url query: null,
9 verbose parsed url pathname: 'ionic-contrib-tinder-cards',
9 verbose parsed url path: 'ionic-contrib-tinder-cards',
9 verbose parsed url href: 'ionic-contrib-tinder-cards' }
10 silly lockFile e3236b5e-ionic-contrib-tinder-cards ionic-contrib-tinder-cards
11 verbose lock ionic-contrib-tinder-cards /Users/Shub/.npm/e3236b5e-ionic-contrib-tinder-cards.lock
12 silly lockFile e3236b5e-ionic-contrib-tinder-cards ionic-contrib-tinder-cards
13 silly lockFile e3236b5e-ionic-contrib-tinder-cards ionic-contrib-tinder-cards
14 verbose addNamed [ 'ionic-contrib-tinder-cards', '' ]
15 verbose addNamed [ null, '*' ]
16 silly lockFile 979a9de0-ionic-contrib-tinder-cards ionic-contrib-tinder-cards@
17 verbose lock ionic-contrib-tinder-cards@ /Users/Shub/.npm/979a9de0-ionic-contrib-tinder-cards.lock
18 silly addNameRange { name: 'ionic-contrib-tinder-cards',
18 silly addNameRange range: '*',
18 silly addNameRange hasData: false }
19 verbose url raw ionic-contrib-tinder-cards
20 verbose url resolving [ 'https://registry.npmjs.org/',
20 verbose url resolving './ionic-contrib-tinder-cards' ]
21 verbose url resolved https://registry.npmjs.org/ionic-contrib-tinder-cards
22 info trying registry request attempt 1 at 19:59:31
23 http GET https://registry.npmjs.org/ionic-contrib-tinder-cards
24 http 404 https://registry.npmjs.org/ionic-contrib-tinder-cards
25 silly registry.get cb [ 404,
25 silly registry.get { date: 'Sun, 18 Jan 2015 00:59:31 GMT',
25 silly registry.get server: 'CouchDB/1.5.0 (Erlang OTP/R16B03)',
25 silly registry.get 'content-type': 'application/json',
25 silly registry.get 'cache-control': 'max-age=0',
25 silly registry.get 'content-length': '52',
25 silly registry.get 'accept-ranges': 'bytes',
25 silly registry.get via: '1.1 varnish',
25 silly registry.get age: '0',
25 silly registry.get 'x-served-by': 'cache-ord1725-ORD',
25 silly registry.get 'x-cache': 'MISS',
25 silly registry.get 'x-cache-hits': '0',
25 silly registry.get 'x-timer': 'S1421542771.805506,VS0,VE65',
25 silly registry.get 'keep-alive': 'timeout=10, max=50',
25 silly registry.get connection: 'Keep-Alive' } ]
26 silly lockFile 979a9de0-ionic-contrib-tinder-cards ionic-contrib-tinder-cards@
27 silly lockFile 979a9de0-ionic-contrib-tinder-cards ionic-contrib-tinder-cards@
28 error 404 'ionic-contrib-tinder-cards' is not in the npm registry.
28 error 404 You should bug the author to publish it
28 error 404 It was specified as a dependency of 'mobileturk'
28 error 404
28 error 404 Note that you can also install from a
28 error 404 tarball, folder, or http url, or git url.
29 error System Darwin 14.0.0
30 error command "node" "/usr/local/bin/npm" "install" "ionic-contrib-tinder-cards"
31 error cwd /Users/Shub/MobileTurk
32 error node -v v0.10.26
33 error npm -v 1.4.3
34 error code E404
35 verbose exit [ 1, true ]
67 changes: 67 additions & 0 deletions scss/application/tinder.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
td-cards {
display: block;
}

td-card {
position: absolute;
left: 50%;
margin-top: 20px;
margin-bottom: 40px;
margin-left: -150px;
width: 300px;
height: 300px;

border: 1px solid #999;
box-shadow: 0px 1px 3px rgba(0,0,0,0.2);
border-radius: 6px;
}
/*
td-card.card-0 {
-webkit-transform: translate3d(0, 0px, 0);
transform: translate3d(0, 0px, 0);
top: 0px;
z-index: 10;
}
td-card.card-1 {
-webkit-transform: translate3d(0, 4px, 0);
transform: translate3d(0, 4px, 0);
z-index: 9;
}
td-card.card-2 {
-webkit-transform: translate3d(0, 8px, 0);
transform: translate3d(0, 8px, 0);
z-index: 8;
}
*/

td-card .image {
position: relative;
}

td-card img {
max-width: 100%;
border-radius: 6px;
}

.yes-text {
position: absolute;
top: 10px;
left: 10px;
font-size: 30px;
color: rgb(111, 250, 111);
opacity: 0;
}
.no-text {
position: absolute;
top: 10px;
right: 10px;
font-size: 30px;
color: rgb(255, 115, 115);
opacity: 0;
}

.fade {
-webkit-transition: 0.2s opacity linear;
transition: 0.2s opacity linear;
opacity: 0;
}
1 change: 1 addition & 0 deletions scss/ionic.app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ $ionicons-font-path: "../lib/ionic/fonts" !default;
// Include all of Ionic
@import "www/lib/ionic/scss/ionic";
@import "scss/application/header";
@import "scss/application/tinder";
17 changes: 15 additions & 2 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
firebase = require('firebase');
angularfire = require('angularfire');

angular.module('starter', ['ionic', 'starter.controllers', 'firebase'])
angular.module('starter', ['ionic', 'starter.controllers', 'firebase','ionic.contrib.ui.tinderCards'])

.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
Expand All @@ -24,6 +24,19 @@ angular.module('starter', ['ionic', 'starter.controllers', 'firebase'])
});
})

.directive('noScroll', function() {

return {
restrict: 'A',
link: function($scope, $element, $attr) {

$element.on('touchmove', function(e) {
e.preventDefault();
});
}
}
})

.config(function($stateProvider, $urlRouterProvider) {
$stateProvider

Expand Down Expand Up @@ -75,7 +88,7 @@ angular.module('starter', ['ionic', 'starter.controllers', 'firebase'])
views: {
'menuContent': {
templateUrl: "templates/types/filtering.html",
controller: 'FilterCtrl'
controller: 'CardsCtrl'
}
}
})
Expand Down
34 changes: 29 additions & 5 deletions www/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,36 @@ angular.module('starter.controllers', ['firebase'])

.controller('AppCtrl', function($scope, $timeout) {
// Perform the login action when the user submits the login form
})

.controller('CardsCtrl', function($scope,$stateParams, $ionicModal, TDCardDelegate) {
console.log('CARDS CTRL');
var cardTypes = [
{ image: 'https://pbs.twimg.com/profile_images/546942133496995840/k7JAxvgq.jpeg' },
{ image: 'https://pbs.twimg.com/profile_images/514549811765211136/9SgAuHeY.png' },
{ image: 'https://pbs.twimg.com/profile_images/491995398135767040/ie2Z_V6e.jpeg' },
];

$scope.cards = Array.prototype.slice.call(cardTypes, 0);

$scope.cardDestroyed = function(index) {
$scope.cards.splice(index, 1);
};

$scope.addCard = function() {
var newCard = cardTypes[Math.floor(Math.random() * cardTypes.length)];
newCard.id = Math.random();
$scope.cards.push(angular.extend({}, newCard));
}
})

.controller('CardCtrl', function($scope, TDCardDelegate) {
$scope.cardSwipedLeft = function(index) {
$scope.addCard();
};
$scope.cardSwipedRight = function(index) {
$scope.addCard();
};
})

.controller('TypesCtrl', function($scope, $firebase) {
Expand Down Expand Up @@ -70,11 +99,6 @@ angular.module('starter.controllers', ['firebase'])
};
})

.controller('FilterCtrl', function($scope, $stateParams, $ionicModal) {
$scope.modal_text = "Select the category that most appropriately suits the image. If you cannot determine a suitable category, you may skip this task."
popupModal($scope, $ionicModal);
})

.controller('EmotionCtrl', function($scope, $stateParams, $ionicModal) {
$scope.modal_text = "Pick the best sentiment based on the provided. Ranges from Strongly Negative, Negative, Neutral, Positive, and Strongly Positive from left to right."
popupModal($scope, $ionicModal);
Expand Down
7,013 changes: 0 additions & 7,013 deletions www/lib/ionic/css/ionic.css

This file was deleted.

18 changes: 0 additions & 18 deletions www/lib/ionic/css/ionic.min.css

This file was deleted.

Binary file removed www/lib/ionic/fonts/ionicons.eot
Binary file not shown.
Loading

0 comments on commit c7c6831

Please sign in to comment.