From 43e28788d7763de61d5190e8cca406077b8bdd9a Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Fri, 19 Aug 2016 14:47:49 -0700 Subject: Create replacement logo for non-webgl --- ui/app/components/mascot.js | 10 ++++++++-- ui/app/unlock.js | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/app/components/mascot.js b/ui/app/components/mascot.js index ddd51f8ba..e99720e1b 100644 --- a/ui/app/components/mascot.js +++ b/ui/app/components/mascot.js @@ -34,10 +34,16 @@ Mascot.prototype.render = function () { } Mascot.prototype.componentDidMount = function () { - if (!this.logo) return var targetDivId = 'metamask-mascot-container' var container = document.getElementById(targetDivId) - container.appendChild(this.logo.canvas) + if (!this.logo) { + var staticLogo = document.createElement('img') + staticLogo.src = 'images/icon-128.png' + staticLogo.style.marginBottom = '20px' + container.appendChild(staticLogo) + } else { + container.appendChild(this.logo.canvas) + } } Mascot.prototype.componentWillUnmount = function () { diff --git a/ui/app/unlock.js b/ui/app/unlock.js index a7896d640..7cc1699c3 100644 --- a/ui/app/unlock.js +++ b/ui/app/unlock.js @@ -3,10 +3,11 @@ const Component = require('react').Component const h = require('react-hyperscript') const connect = require('react-redux').connect const actions = require('./actions') -const Mascot = require('./components/mascot') const getCaretCoordinates = require('textarea-caret') const EventEmitter = require('events').EventEmitter +const Mascot = require('./components/mascot') + module.exports = connect(mapStateToProps)(UnlockScreen) inherits(UnlockScreen, Component) -- cgit v1.2.3 From 7a466697d30019a4a1703a19b60ecc78fd063f5d Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Fri, 19 Aug 2016 16:59:04 -0700 Subject: Modify logic for component update. --- ui/app/components/mascot.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/app/components/mascot.js b/ui/app/components/mascot.js index e99720e1b..b13e130c2 100644 --- a/ui/app/components/mascot.js +++ b/ui/app/components/mascot.js @@ -15,7 +15,7 @@ function Mascot () { width: 200, height: 200, }) - if (!this.logo) return + if (!this.logo.webGLSupport) return this.refollowMouse = debounce(this.logo.setFollowMouse.bind(this.logo, true), 1000) this.unfollowMouse = this.logo.setFollowMouse.bind(this.logo, false) } @@ -36,10 +36,9 @@ Mascot.prototype.render = function () { Mascot.prototype.componentDidMount = function () { var targetDivId = 'metamask-mascot-container' var container = document.getElementById(targetDivId) - if (!this.logo) { - var staticLogo = document.createElement('img') - staticLogo.src = 'images/icon-128.png' - staticLogo.style.marginBottom = '20px' + if (!this.logo.webGLSupport) { + var staticLogo = this.logo.staticLogo + staticLogo.style.marginBottom = '40px' container.appendChild(staticLogo) } else { container.appendChild(this.logo.canvas) -- cgit v1.2.3 From 5168232481849019d00756139b3cfc7b6a93a1f3 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 23 Aug 2016 14:11:25 -0700 Subject: Created option to pass in static file for fallback for logo. --- app/images/icon-512.png | Bin 0 -> 42078 bytes ui/app/components/mascot.js | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 app/images/icon-512.png diff --git a/app/images/icon-512.png b/app/images/icon-512.png new file mode 100644 index 000000000..9c0d1384d Binary files /dev/null and b/app/images/icon-512.png differ diff --git a/ui/app/components/mascot.js b/ui/app/components/mascot.js index b13e130c2..28a6e735f 100644 --- a/ui/app/components/mascot.js +++ b/ui/app/components/mascot.js @@ -14,7 +14,9 @@ function Mascot () { pxNotRatio: true, width: 200, height: 200, + staticImage: './images/icon-512.png' }) + debugger; if (!this.logo.webGLSupport) return this.refollowMouse = debounce(this.logo.setFollowMouse.bind(this.logo, true), 1000) this.unfollowMouse = this.logo.setFollowMouse.bind(this.logo, false) @@ -46,12 +48,12 @@ Mascot.prototype.componentDidMount = function () { } Mascot.prototype.componentWillUnmount = function () { - if (!this.logo) return + if (!this.logo.webGLSupport) return this.logo.canvas.remove() } Mascot.prototype.handleAnimationEvents = function () { - if (!this.logo) return + if (!this.logo.webGLSupport) return // only setup listeners once if (this.animations) return this.animations = this.props.animationEventEmitter @@ -60,7 +62,7 @@ Mascot.prototype.handleAnimationEvents = function () { } Mascot.prototype.lookAt = function (target) { - if (!this.logo) return + if (!this.logo.webGLSupport) return this.unfollowMouse() this.logo.lookAt(target) this.refollowMouse() -- cgit v1.2.3 From 6363a80b49fc9ae7ba168bbd8416fddf0ac75557 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 23 Aug 2016 14:32:12 -0700 Subject: Linting. --- ui/app/components/mascot.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/app/components/mascot.js b/ui/app/components/mascot.js index 28a6e735f..f2b00262b 100644 --- a/ui/app/components/mascot.js +++ b/ui/app/components/mascot.js @@ -14,9 +14,8 @@ function Mascot () { pxNotRatio: true, width: 200, height: 200, - staticImage: './images/icon-512.png' + staticImage: './images/icon-512.png', }) - debugger; if (!this.logo.webGLSupport) return this.refollowMouse = debounce(this.logo.setFollowMouse.bind(this.logo, true), 1000) this.unfollowMouse = this.logo.setFollowMouse.bind(this.logo, false) -- cgit v1.2.3 From 050d0aecc688845330542905194000746d96a9d7 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 23 Aug 2016 14:32:47 -0700 Subject: Changelog. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf5255497..e2193342c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Master +- Added static image as fallback for when WebGL isn't supported. + ## 2.9.0 2016-08-22 - Added ShapeShift to the transaction history -- cgit v1.2.3 From 00e8db31cebaf7af42660e828cc912b2b6af5b5d Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 23 Aug 2016 14:47:37 -0700 Subject: Update package.json --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4093751b6..963831029 100644 --- a/package.json +++ b/package.json @@ -42,13 +42,14 @@ "eth-store": "^1.1.0", "ethereumjs-tx": "^1.0.0", "ethereumjs-util": "^4.4.0", + "gulp": "github:gulpjs/gulp#4.0", "gulp-eslint": "^2.0.0", "hat": "0.0.3", "identicon.js": "^1.2.1", "inject-css": "^0.1.1", "jazzicon": "^1.1.3", "menu-droppo": "^1.1.0", - "metamask-logo": "^1.1.5", + "metamask-logo": "^1.3.1", "mississippi": "^1.2.0", "multiplex": "^6.7.0", "once": "^1.3.3", @@ -73,7 +74,7 @@ "three.js": "^0.73.2", "through2": "^2.0.1", "vreme": "^3.0.2", - "web3": "ethereum/web3.js#0.16.0", + "web3": "github:ethereum/web3.js#0.16.0", "web3-provider-engine": "^7.8.3", "web3-stream-provider": "^2.0.6", "xtend": "^4.0.1" -- cgit v1.2.3 From d2c4227a31d0cce1edf0c0c98d1789db42503d87 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 23 Aug 2016 15:43:16 -0700 Subject: Modify package.json. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7df61a2bb..cf62e1907 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "three.js": "^0.73.2", "through2": "^2.0.1", "vreme": "^3.0.2", - "web3": "github:ethereum/web3.js#0.16.0", + "web3": "^0.17.0-alpha", "web3-provider-engine": "^7.8.3", "web3-stream-provider": "^2.0.6", "xtend": "^4.0.1" -- cgit v1.2.3 From 304b5b0b2097cb296473e575bbb22798e2a4a035 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 23 Aug 2016 15:56:17 -0700 Subject: Remove gulp dependency. --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index cf62e1907..57d71e865 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "eth-store": "^1.1.0", "ethereumjs-tx": "^1.0.0", "ethereumjs-util": "^4.4.0", - "gulp": "github:gulpjs/gulp#4.0", "gulp-eslint": "^2.0.0", "hat": "0.0.3", "identicon.js": "^1.2.1", -- cgit v1.2.3