diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2018-01-04 11:21:22 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2018-01-04 11:21:22 +0100 |
| commit | 1671ca0d8bb22fead9dfd7b839aa495b1cb69bf5 (patch) | |
| tree | fc6fde023e19113b7f4cd473a40066b40b60ac02 | |
| parent | d19f790931beca0dcc62ae84f16d45b74d69a9c8 (diff) | |
| parent | 5284829ea740133d949224270ef21fa3fb614bc8 (diff) | |
| download | mullvadvpn-1671ca0d8bb22fead9dfd7b839aa495b1cb69bf5.tar.xz mullvadvpn-1671ca0d8bb22fead9dfd7b839aa495b1cb69bf5.zip | |
Merge branch 'blocking-indicator'
| -rw-r--r-- | CHANGELOG.md | 6 | ||||
| -rw-r--r-- | app/assets/images/menubar icons/lock-10.png | bin | 0 -> 166 bytes | |||
| -rw-r--r-- | app/assets/images/menubar icons/lock-10@2x.png | bin | 0 -> 212 bytes | |||
| -rw-r--r-- | app/components/Connect.css | 52 | ||||
| -rw-r--r-- | app/components/Connect.js | 17 | ||||
| -rw-r--r-- | app/lib/tray-icon-manager.js | 16 |
6 files changed, 84 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index dbc53884df..cb101535f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - "Allow LAN" setting that configures if the app should allow communication to the LAN (private networks: 10/8, 192.168/16 and 172.16/12) while the app is in the secured state. +### Changed +- The tray icon now indicates wether the app is allowing traffic outside the tunnel or not. If the + app blocks traffic because the tunnel is not connected the tray icon will indicate this with a + green lock with a red dot. +- While connecting, a message telling the user that internet accesss is blocked is shown. + ## [2017.1-beta7] - 2017-12-13 ### Added diff --git a/app/assets/images/menubar icons/lock-10.png b/app/assets/images/menubar icons/lock-10.png Binary files differnew file mode 100644 index 0000000000..530e756c56 --- /dev/null +++ b/app/assets/images/menubar icons/lock-10.png diff --git a/app/assets/images/menubar icons/lock-10@2x.png b/app/assets/images/menubar icons/lock-10@2x.png Binary files differnew file mode 100644 index 0000000000..af73aa8c7b --- /dev/null +++ b/app/assets/images/menubar icons/lock-10@2x.png diff --git a/app/components/Connect.css b/app/components/Connect.css index 41c3c61894..592e824ea2 100644 --- a/app/components/Connect.css +++ b/app/components/Connect.css @@ -30,6 +30,58 @@ margin-top: 16px; } +.connect__blocking-container { + color: rgba(255,255,255,0.8); + max-height: 0px; + height: 100%; + width: 100%; + overflow: hidden; + + text-transform: uppercase; + + position: absolute; + border-bottom: 1px solid rgba(255,255,255,0.8); + transition: max-height 0.5s; +} +.connect__blocking-container.show { + max-height: 36px; +} +.connect__blocking-container.hide { + max-height: 0px; + border-bottom: 0px solid rgb(208, 2, 27); + transition: max-height 0.5s, border-bottom 0.1s 0.4s; +} + +.connect__blocking-message { + display: flex; + flex-direction: row; + margin: 8px 20px; + font-family: "Open Sans"; + font-size: 12px; + font-weight: 800; + line-height: 17px; +} + +.connect__blocking-icon { + width: 10px; + height: 10px; + border-radius: 5px; + margin-top: 4px; + margin-right: 8px; + + background-color: rgb(208, 2, 27); +} + +.connect__server { + padding: 7px 12px 9px; + background-color: rgba(255,255,255,0.2); + border-radius: 4px; + display: flex; + flex-direction: row; + align-items: center; + backdrop-filter: blur(4px); +} + .connect__server-label { flex: 1 1 auto; text-align: center; diff --git a/app/components/Connect.js b/app/components/Connect.js index 93ac19a4eb..2412a35872 100644 --- a/app/components/Connect.js +++ b/app/components/Connect.js @@ -175,6 +175,7 @@ export default class Connect extends Component { </div> <div className="connect__container"> + { this._renderIsBlockingInternetMessage() } <div className="connect__status"> { /* show spinner when connecting */ } <div className={ this.spinnerClass() }> @@ -295,6 +296,20 @@ export default class Connect extends Component { ); } + _renderIsBlockingInternetMessage() { + let animationClass = 'hide'; + if (this.props.connection.status === 'connecting') { + animationClass = 'show'; + } + + return <div className={`connect__blocking-container ${animationClass}`}> + <div className="connect__blocking-message"> + <div className="connect__blocking-icon"> </div> + blocking internet + </div> + </div>; + } + // Handlers onExternalLink(type: string) { @@ -312,9 +327,9 @@ export default class Connect extends Component { headerStyle(): HeaderBarStyle { switch(this.props.connection.status) { - case 'connecting': case 'disconnected': return 'error'; + case 'connecting': case 'connected': return 'success'; } diff --git a/app/lib/tray-icon-manager.js b/app/lib/tray-icon-manager.js index 73424cb7ef..0669c0994a 100644 --- a/app/lib/tray-icon-manager.js +++ b/app/lib/tray-icon-manager.js @@ -31,14 +31,13 @@ export default class TrayIconManager { _createAnimation(): KeyframeAnimation { const basePath = path.join(path.resolve(__dirname, '..'), 'assets/images/menubar icons'); const filePath = path.join(basePath, 'lock-{}.png'); - const animation = KeyframeAnimation.fromFilePattern(filePath, [1, 9]); + const animation = KeyframeAnimation.fromFilePattern(filePath, [1, 10]); animation.speed = 100; return animation; } _isReverseAnimation(type: TrayIconType): bool { - // unsecured & securing are treated as one - return type !== 'secured'; + return type === 'unsecured'; } get iconType(): TrayIconType { @@ -49,10 +48,15 @@ export default class TrayIconManager { if(this._iconType === type || !this._animation) { return; } const animation = this._animation; - animation.reverse = this._isReverseAnimation(type); - animation.play({ beginFromCurrentState: true }); + if (type === 'secured') { + animation.reverse = true; + animation.play({ beginFromCurrentState: true, startFrame: 8, endFrame: 9 }); + + } else { + animation.reverse = this._isReverseAnimation(type); + animation.play({ beginFromCurrentState: true }); + } this._iconType = type; } - } |
