From 0d408599211bd8f19831e2566807a431ddc8f643 Mon Sep 17 00:00:00 2001 From: Andrew Silluron Date: Thu, 1 Oct 2015 01:22:06 -0700 Subject: [PATCH] Initial alpha release - preview. --- .editorconfig | 9 + .esformatter | 24 ++ .eslintrc | 19 ++ .gitignore | 6 +- .jsfmtrc | 1 + README.md | 5 + app/app.js | 549 +++++++++++++++++++++++++++++++++ app/bootstrap.js | 62 ++++ app/giphy.gif | Bin 0 -> 818 bytes app/giphy.png | Bin 0 -> 19687 bytes app/index.html | 54 ++++ app/loader.gif | Bin 0 -> 496 bytes app/logo.icns | Bin 0 -> 16359 bytes app/package.json | 49 +++ app/tray.png | Bin 0 -> 16985 bytes gulpfile.js | 33 ++ package.json | 45 +++ src/app/giphy.png | Bin 0 -> 19687 bytes src/app/index.js | 24 ++ src/app/resources/index.js | 6 + src/app/resources/translate.js | 9 + src/app/search/index.js | 93 ++++++ src/app/style.scss | 73 +++++ webpack.config.js | 23 ++ 24 files changed, 1083 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100644 .esformatter create mode 100644 .eslintrc create mode 120000 .jsfmtrc create mode 100644 app/app.js create mode 100644 app/bootstrap.js create mode 100644 app/giphy.gif create mode 100644 app/giphy.png create mode 100644 app/index.html create mode 100644 app/loader.gif create mode 100644 app/logo.icns create mode 100644 app/package.json create mode 100644 app/tray.png create mode 100644 gulpfile.js create mode 100644 package.json create mode 100644 src/app/giphy.png create mode 100644 src/app/index.js create mode 100644 src/app/resources/index.js create mode 100644 src/app/resources/translate.js create mode 100644 src/app/search/index.js create mode 100644 src/app/style.scss create mode 100644 webpack.config.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9d08a1a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.esformatter b/.esformatter new file mode 100644 index 0000000..77ea8fc --- /dev/null +++ b/.esformatter @@ -0,0 +1,24 @@ +{ + "preset": "default", + "indent": { + "value": " ", + "FunctionExpression": 1, + "ArrayExpression": 1, + "ObjectExpression": 1 + }, + "whiteSpace": { + "after": { + "FunctionReservedWord": 1 + } + }, + "plugins": [ + "esformatter-quotes", + "esformatter-braces", + "esformatter-semicolons", + "esformatter-dot-notation" + ], + "quotes": { + "type": "single", + "avoidEscape": true + } +} diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..f1d4999 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,19 @@ +parser: babel-eslint +rules: + strict: + - 0 + quotes: + - 2 + - single + linebreak-style: + - 2 + - unix + semi: + - 2 + - always + no-underscore-dangle: 0 +env: + es6: true + browser: true +globals: + require: true diff --git a/.gitignore b/.gitignore index 123ae94..f86bb86 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,12 @@ coverage .lock-wscript # Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release +build # Dependency directory # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git node_modules + +# nwjs builder +cache + diff --git a/.jsfmtrc b/.jsfmtrc new file mode 120000 index 0000000..2c67f79 --- /dev/null +++ b/.jsfmtrc @@ -0,0 +1 @@ +.esformatter \ No newline at end of file diff --git a/README.md b/README.md index 382da10..2797094 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # gif-cake Super fast gifs powered by Giphy. Filter lists, favorites and more. + +# Development +It is recommended that you use Node ^v4.1.0 when building the project. + +* ``` gulp ``` diff --git a/app/app.js b/app/app.js new file mode 100644 index 0000000..927f66a --- /dev/null +++ b/app/app.js @@ -0,0 +1,549 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + __webpack_require__(1); + + __webpack_require__(3); + + __webpack_require__(4); + + var app = angular.module('pi', ['pi.search', 'pi.resources']); + + app.directive('drFocus', function ($timeout) { + return { + scope: { + trigger: '@browsing' + }, + link: function link(scope, element) { + scope.$watch('trigger', function (value) { + if (value === 'false') { + $timeout(function () { + element[0].focus(); + }); + } + }); + } + }; + }); + + exports['default'] = app; + module.exports = exports['default']; + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _translate = __webpack_require__(2); + + var _translate2 = _interopRequireDefault(_translate); + + var resources = angular.module('pi.resources', ['ngResource']); + resources.service('translateResource', _translate2['default']); + + exports['default'] = resources; + module.exports = exports['default']; + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + var translateResource = function translateResource($resource, API_KEY, API_URL) { + return $resource(API_URL + '/translate', { + api_key: API_KEY + }); + }; + + translateResource.$inject = ['$resource', 'API_KEY', 'API_URL']; + + exports['default'] = translateResource; + module.exports = exports['default']; + +/***/ }, +/* 3 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + var piApp = angular.module('pi.search', []); + + piApp.controller('SearchCtrl', function (translateResource, $q) { + var _this = this; + + var _self = this; + var gifMap = new Map(); + this.browsing = false; + this.loading = true; + this.term = ''; + this.gifs = []; + this.lastTerm = ''; + this.noresults = false; //No Results flag + + var clipboard = typeof gui !== 'undefined' ? gui.Clipboard.get() : { + set: function set(n) {} + }; + + this.keydown = function (e) { + + switch (e.keyCode) { + case 27: + win.hide(); + reset(); + break; + case 9: + //We got a tab + if (_this.browsing) { + //Skip to next image + if (_self.noresults === false) { + //Don't allow a new search if know it's a dud + search(_this.lastTerm); + } + } + break; + case 13: + if (!_this.browsing) { + //Begin the search ! + _this.browsing = true; + search(_this.term); + _this.lastTerm = _this.term; + _this.term = ''; + } + break; + default: + if (_this.browsing === true) { + reset(); + } + } + }; + + this.setClipboard = function (urlSmall) { + var originalUrl = gifMap.get(urlSmall); + clipboard.set(originalUrl, 'text'); + //TODO: Make this test safe + win.hide(); + reset(); + }; + + function reset() { + _self.browsing = false; + _self.gifs = []; + _self.noresults = false; + } + + function search(term) { + _self.loading = true; + var translatePromises = []; + for (var i = 6; i > 0; i--) { + translatePromises.push(translateResource.get({ + s: term + }).$promise); + } + + $q.all(translatePromises).then(function (responses) { + var newGifs = []; + responses.forEach(function (resp) { + if (resp.data.images) { + _self.noresults = false; + //TODO: check for dupes + newGifs.push(resp.data.images.fixed_height_small.url); + gifMap.set(resp.data.images.fixed_height_small.url, resp.data.images.original.url); + } else { + _self.noresults = true; + } + }); + _self.loading = false; + _self.gifs = newGifs; + }); + } + }); + + exports['default'] = piApp; + module.exports = exports['default']; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + // style-loader: Adds some css to the DOM by adding a + + + + + + + +
+ +
+ +
+
+ +
+
+ +
+

No Results Found

+
+ +
Press enter to preview.
+
Press tab to skip. Click to copy. Any key to search again.
+ + + + + + + + + + + + diff --git a/app/loader.gif b/app/lo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K88OsHR;Vx<+OK)V?qr{sQrDVEuHKhFq^J4@S0Yl+c|+UE>j|Y%E@HPz(UWy#;#f(=R{Iu^P}lwoobqpL9UT}iDmMr2 z5Q6hGu<`LWL!GqJ(iv%}mwtStN3tw z{sE29Ew}}ECyRm%M78sHQ$StDpgxj=45p|Feq}T1MNq#HTwI4!`Zt(#OPc|2zIAZs%Z}*XOQB zC`^)BJTRNJ6oZrrxlgMX2vm?yVHft{2A@hXYlZ-ZAX)u{DyGhvyn6VaL4$3_hHK@< zxhf)-;H{vw$G10WCA_WHZal#oDvi;?xNmVTe{b&(-JwFNP;XMxDtFA{U2>Z^}5M ziC5s2mP>?nN1h^3Wyb^<7)+}bO@mt?iV}|a9TSGx58WWs^Dum2>Ghz_4SfpdFhq;X zTIIEc>BqQHF7L@&H%u&NoW~JAywwS^`G`>Tw?m8M3fxmmD!ez7#~#a?OhvIfe-X{o zbZBd+7FH!uu8~N6>w#Sx!dSAuG<*0Z>utE{&F^=Ke{#xWf|3T&fG*gjW|!)3m_P)s zVSGWfRL5;FaGk^n`#{um5Kl4F=s2NT43UrXh5u~4&NaHY+R7KLQQ^slsQ7!T?e^+~ zC{nQ?zOuqG7<(V|3rIJIkE~?FRH0Rr+#y%KuQlNhrkNw*~;e{i>cygO7u2Ee&B(OY?m<^Xt_Ppk@A>g s^q literal 0 HcmV?d00001 diff --git a/app/package.json b/app/package.json new file mode 100644 index 0000000..49faff2 --- /dev/null +++ b/app/package.json @@ -0,0 +1,49 @@ +{ + "name": "gif-cake", + "version": "0.0.0", + "description": "Fast gifs now powered by Giphy. Favorites list, custom filters and more.", + "main": "index.html", + "window": { + "title": "Gif Cake", + "frame": false, + "toolbar": false, + "width": 600, + "height": 300, + "resizable": false, + "always-on-top": true, + "position": "center", + "show_in_taskbar": false + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/asilluron/gif-cake.git" + }, + "keywords": [ + "Gifs", + "gif", + "cake", + "pie", + "pi", + "giphy", + "hot", + "api", + "favorites", + "custom", + "filters" + ], + "author": "Andrew Silluron", + "license": "MIT", + "bugs": { + "url": "https://github.com/asilluron/gif-cake/issues" + }, + "homepage": "https://github.com/asilluron/gif-cake#readme", + "devDependencies": { + "gulp": "^3.9.0", + "gulp-gzip": "^1.2.0", + "gulp-tar": "^1.4.0", + "nw-builder": "^2.0.2" + } +} diff --git a/app/tray.png b/app/tray.png new file mode 100644 index 0000000000000000000000000000000000000000..60d87a5ae0fcdadad9242bd301562324d835975a GIT binary patch literal 16985 zcmeI4UyKt)7{C_{7dgQoU{DOYDQGmX-Q8}ty{^5&-4(b?=y^E~yh})6x;yQyw7bjh z-nDnW5PVS|FhL%OAu;-Z4<^KSObjtbpF{%TK@($Q2%?GLgE2ga&hECe+jb8Jk6=uu zNw43{e1B$sGv9pEedt>g<9pZkZ|-LpX6@K$aT0w#j^67Y?L&WGI6bbQkJZ-bjKeUG zZSdYJnD@>;#V|v=^{Huhy0lMG&3Y1OW*H`%bqi@TOnzt60_sudvSnD+jlsmN3!f!e zT^mfiDwl+kH3Db#(M22XUmTxO7munrEwQuEpKmJ2K^?k)ZPsgsqcjH-zF!5&UNfIy zeHHiUU}DG%$WE6g*b&o)tenhnsvxG>Y%VFvnQSh*gH56Td0~K037n8qWJwWHZ0nUM z^dl*6YZYa(xTh5k{WqAHbzMv0`9`CWY)DDduJU3om*a&LpGt8^gL4)P7c@D;*%~-$ z`zb<4wROwYO@sCPg0ea14ki*_ApC00t8U>yhSOq)DDq8U@nTZo0x0a|u)2 zy`%$8#X+q(yXMbLQ+Zf}b!fN_vJ+ziqctg&uxadg>-AVm$K5@T5VVlSS~^n;7UU

t&^?DA1UX`}%cbbCpOisU6o)JunMw;xl}D+@$kLd}Q|yj_(Mvu4^QQ-cL5 z&&M^#T1~;GyALct+lf#|?ERD;2G!2ic1KP3Q_}*r1HFwmm}u`joXa>>J)3Yieynj& zhXr3^#pqbW&Ty>QPq!0qAf96`|`(q>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AUf;N}#yDGCdHc}zi9VNGIRD4czVgyfuYdpH zwQc7%AG_K2Z27h4nj5ZM|LFRm(KCHFs+ZK$o>YqQLkuhVt$BXBOkDT}$Q@MQW literal 0 HcmV?d00001 diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..42c7c25 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,33 @@ +var gulp = require('gulp'); +var NwBuilder = require('nw-builder'); +var pkg = require('./package'); +var tar = require('gulp-tar'); +var gzip = require('gulp-gzip'); + +var nw = new NwBuilder({ + appName: pkg.name, + macIcns: './app/logo.icns', + version: '0.12.3', + files: './app/**/**', // use the glob format + platforms: ['osx32', 'osx64', 'win32', 'win64'] +}); + +nw.on('log', console.log); + + +gulp.task('compress-tar', function () { + gulp.src('./build/gif-cake/osx64/**') + .pipe(tar('GifCake.tar')) + .pipe(gzip()) + .pipe(gulp.dest('./build')); +}); + + +gulp.task('default', function () { + // Build returns a promise + nw.build().then(function () { + console.log('all done!'); + }).catch(function (error) { + console.error(error); + }); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..5bbfbf8 --- /dev/null +++ b/package.json @@ -0,0 +1,45 @@ +{ + "name": "gif-cake", + "version": "0.0.0", + "description": "Fast gifs now powered by Giphy. Favorites list, custom filters and more.", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/asilluron/gif-cake.git" + }, + "keywords": [ + "Gifs", + "gif", + "cake", + "pie", + "pi", + "giphy", + "hot", + "api", + "favorites", + "custom", + "filters" + ], + "author": "Andrew Silluron", + "license": "MIT", + "bugs": { + "url": "https://github.com/asilluron/gif-cake/issues" + }, + "homepage": "https://github.com/asilluron/gif-cake#readme", + "devDependencies": { + "babel-core": "^5.8.25", + "babel-loader": "^5.3.2", + "css-loader": "^0.19.0", + "gulp": "^3.9.0", + "gulp-gzip": "^1.2.0", + "gulp-tar": "^1.4.0", + "node-sass": "^3.3.3", + "nw-builder": "^2.0.2", + "sass-loader": "^3.0.0", + "style-loader": "^0.12.4", + "webpack": "^1.12.2" + }, + "dependencies": {} +} diff --git a/src/app/giphy.png b/src/app/giphy.png new file mode 100644 index 0000000000000000000000000000000000000000..664b2cf6b8e3e3518afddc3d3b8d4bcdc1b3a21a GIT binary patch literal 19687 zcmeI4c|4SB-@s>x5J{3yr%7nhnB6S)P=-cAWvQ6u9>y{=%?!p;XVmFQs-sjSIyzDm zMUj+f>XepaDJ@cx>PU-lT8I|!J(ioK^Um{}=Y8ML^M2<3e9Zh@*KfJ6?{!_j>o@lw z_ZAQL#abGM8Za14i|XR!34_5w5oV&M3VyOlf4l*|)cG#HLKtj zpkyszu_>NTiw47i|JfJ^i$r`13KbOQDYgg zn2-%WLJ-z}Yb+)T2m`_au1E;lVaBurk6qcd!^gA~iku_C5eyO;(^BXi%?D7P zfRGm*j?bPhc3X9Iin1F&*)Pc_N-LnD-rkQ1^E+ia6}=+=#5_yJmox z^Bpr;&wyF~ni`mDYmhp{Q2@|IJb^cl7iK%KTs?;F9^vTNzdR9hX>=xsD;v^0Yt(3? z;iWU|4{)N309)D8Mq;o?4B8umqhLuCECGooP|)ZRP6jkb`JjQ@h(#CChrEDhWF!vs zLZ;xb6f7QzCPH4m(jD!G$KtS~2vNn!H@;dGHLC!8Jxp!nP%Yt(S#2+jWW zOQCXwB084|P@QbS1`7^{MZw}oSRw%+A?W~w#>;;xR$@&{CqXEg1|Z4x~*d5kce_A{Y{DNkGyWYz7$vuyFtZ z7z#AP**Aff3OHagq=${rk&T4~215fFfPuvmkpwn?1xLUnBk5=|8OdN12zUlyX-U8k zheC|u=9^G193i;!qDQPqa9#GNJ1=1E*R4YxVVwT7#it8|fNWRW7!Pf0D9=G@OlH%c z9Vm3BEaBNQWlJ4kS);yc9lkBda?p(P?R3hAV8H(f^Y6!q3I@1;wNVCK^=p0KiIB$@ zMbQO-LlC$^5jOg4rIrkTGt5jZpjOkjf<>;G~hhF3B(n9dCXShlF4u?;o+C(Rv+geHJ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j9f!Hnn2ZnCpD<%bc^-mfExJ6(TMDh$+cSZ^$_}?{-%GAK6;=>t+=Mv)?DLLEOJaSW%b9ow6->yXgZ{}Ik4~>+M>i12pFiRFHvCQ5_us`R2mX|u?-A>; zQ1zki?yS7UwsT@~ZEen!%u+6Ie0t^ii=K(WmwTQ@N(`jh*qUzTUv`L=Pm1 z($M_I)T{-)3!9^H{*49!?z>hh^}f5~opon*>R}6>ncuxPT-6|72mGE79U^guYG5e* z^7D=#KhDkDyw~@0{;qdZZk~P3bBn>ADu{KeDLL*=H{i$)aum6eLSGEY{sj{ z>nV0veIL;z14-+ayIWbvymCz+vlnZcopZvBT~!0@i>H(l(AZk9s7Mnn=_RFE&VFZB zP!MztH@YR~sBYW^V$Xel6`2tjsQHMhBw zX!p6`IS)TZANLF%)LXH$W0EOz^OHxxZ3(G-loA`hG~Kr;t~Vp&t?w(U*&n+f-mAJ2 zGq*Kv7V}h|eL16BvgBIy7Zq8t73J7z*y;Dl*K=u>UUGy}dSPPqovL|(<4y)&jTfi* zcOP`u;)miotW2F?@OIq92PzetvyPw3aHdq4rU!I~x@sT!dA<0OcVpNx-SKZDvz*!R zW1NJik2ELPO}u~Mgv)Y#_Z5e&S41_1HyxhO&_B_%*(A_j>aZ;kEIO4`)WA!}-X3h& c)Ta%b)#9>Ea5nCc>{Vn`XLqOL3j;U&7b4cPp#T5? literal 0 HcmV?d00001 diff --git a/src/app/index.js b/src/app/index.js new file mode 100644 index 0000000..c24b0ce --- /dev/null +++ b/src/app/index.js @@ -0,0 +1,24 @@ +import './resources'; +import './search'; +import './style.scss'; + +var app = angular.module('pi', ['pi.search', 'pi.resources']); + +app.directive('drFocus', function ($timeout) { + return { + scope: { + trigger: '@browsing' + }, + link: function (scope, element) { + scope.$watch('trigger', function (value) { + if (value === 'false') { + $timeout(function () { + element[0].focus(); + }); + } + }); + } + }; +}); + +export default app; diff --git a/src/app/resources/index.js b/src/app/resources/index.js new file mode 100644 index 0000000..475118f --- /dev/null +++ b/src/app/resources/index.js @@ -0,0 +1,6 @@ +import translateResource from './translate'; + +var resources = angular.module('pi.resources', ['ngResource']); +resources.service('translateResource', translateResource); + +export default resources; diff --git a/src/app/resources/translate.js b/src/app/resources/translate.js new file mode 100644 index 0000000..8cf3591 --- /dev/null +++ b/src/app/resources/translate.js @@ -0,0 +1,9 @@ +var translateResource = function ($resource, API_KEY, API_URL) { + return $resource(API_URL + '/translate', { + api_key: API_KEY + }); +}; + +translateResource.$inject = ['$resource', 'API_KEY', 'API_URL']; + +export default translateResource; diff --git a/src/app/search/index.js b/src/app/search/index.js new file mode 100644 index 0000000..cafa636 --- /dev/null +++ b/src/app/search/index.js @@ -0,0 +1,93 @@ +var piApp = angular.module('pi.search', []); + +piApp.controller('SearchCtrl', function (translateResource, $q) { + var _self = this; + var gifMap = new Map(); + this.browsing = false; + this.loading = true; + this.term = ''; + this.gifs = []; + this.lastTerm = ''; + this.noresults = false; //No Results flag + + var clipboard = typeof gui !== 'undefined' ? gui.Clipboard.get() : { + set: n => { + } + }; + + this.keydown = e => { + + switch (e.keyCode) { + case 27: + win.hide(); + reset(); + break; + case 9: + //We got a tab + if (this.browsing) { + //Skip to next image + if (_self.noresults === false) { + //Don't allow a new search if know it's a dud + search(this.lastTerm); + } + } + break; + case 13: + if (!this.browsing) { + //Begin the search ! + this.browsing = true; + search(this.term); + this.lastTerm = this.term; + this.term = ''; + } + break; + default: + if (this.browsing === true) { + reset(); + } + } + }; + + this.setClipboard = function (urlSmall) { + var originalUrl = gifMap.get(urlSmall); + clipboard.set(originalUrl, 'text'); + //TODO: Make this test safe + win.hide(); + reset(); + }; + + function reset() { + _self.browsing = false; + _self.gifs = []; + _self.noresults = false; + } + + function search(term) { + _self.loading = true; + let translatePromises = []; + for (let i = 6; i > 0; i--) { + translatePromises.push(translateResource.get({ + s: term + }).$promise); + } + + $q.all(translatePromises).then(responses => { + let newGifs = []; + responses.forEach(resp => { + if (resp.data.images) { + _self.noresults = false; + //TODO: check for dupes + newGifs.push(resp.data.images.fixed_height_small.url); + gifMap.set(resp.data.images.fixed_height_small.url, resp.data.images.original.url); + } else { + _self.noresults = true; + } + }); + _self.loading = false; + _self.gifs = newGifs; + }); + } + +}); + +export default piApp; diff --git a/src/app/style.scss b/src/app/style.scss new file mode 100644 index 0000000..00ac8f3 --- /dev/null +++ b/src/app/style.scss @@ -0,0 +1,73 @@ +body { + font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; + -webkit-app-region: drag; + background-color: #343838; + color: #FFF; + margin: 0px; + padding: 0px; + overflow:hidden; +} + +input { + border: 0; + color: #FFF; + font-size:48px; + width: 550px; + text-align:center; + outline: none; + background-size: 125px; +} + +.notice { + text-align: center; + position: relative; +} + +.image-wrapper { + width: 200px; + height: 150px; + float: left; + overflow: hidden; +} +img { + display:block; + margin: 0 auto; + max-width: 200px; + height: 100%; +} + +.scene { + height: 200px; + width: 100%; +} + +.loader { + height: 400px; + text-align: center; + vertical-align: middle; + width: 600px; +} + +.loader img { + display:block; + margin: 0 auto; + max-width: 25px; + height: 25px; +} + + +.help--browsing{ + position: fixed; + left: 0px; + top: 0px; + font-size: 12px; + opacity: 0.6; +} + +.help { + position: fixed; + left: 20px; + top: 45px; + font-size: 12px; + opacity: 0.5; +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..19e7987 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,23 @@ +module.exports = { + context: __dirname + '/src/app', + entry: './index', + output: { + path: __dirname + '/app', + filename: 'app.js' + }, + module: { + preLoaders: [ + { + test: /\.jsx?$/, + exclude: /(node_modules|bower_components)/, + loader: 'babel' + } + ], + loaders: [ + { + test: /\.scss$/, + loader: 'style!css!sass' + } + ] + } +};