From 835eec8a4cbf8fa340241fc0bd83e07e8c19ef5d Mon Sep 17 00:00:00 2001 From: David Yip Date: Mon, 8 Jan 2018 10:40:34 -0600 Subject: Prototype out glitchy elephant friend. #294. Glitched elephant friends kindly provided by @ncls7615. --- app/javascript/flavours/glitch/features/drawer/index.js | 9 ++++++++- app/javascript/flavours/glitch/images/mbstobon-ui-1.png | Bin 0 -> 39646 bytes app/javascript/flavours/glitch/images/mbstobon-ui-2.png | Bin 0 -> 43609 bytes app/javascript/flavours/glitch/images/mbstobon-ui-3.png | Bin 0 -> 40376 bytes .../flavours/glitch/styles/components/drawer.scss | 6 ++++++ 5 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 app/javascript/flavours/glitch/images/mbstobon-ui-1.png create mode 100644 app/javascript/flavours/glitch/images/mbstobon-ui-2.png create mode 100644 app/javascript/flavours/glitch/images/mbstobon-ui-3.png (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js index 9ade1f87a..c8eabb4f3 100644 --- a/app/javascript/flavours/glitch/features/drawer/index.js +++ b/app/javascript/flavours/glitch/features/drawer/index.js @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; +import classNames from 'classnames'; // Actions. import { openModal } from 'flavours/glitch/actions/modal'; @@ -68,6 +69,12 @@ class Drawer extends React.Component { submitted, } = this.props; + let choices = ['mbstobon-bg-1', 'mbstobon-bg-2', 'mbstobon-bg-3']; + let glitchyFriendDecision = choices[Math.floor(Math.random() * choices.length)]; + let drawerAttrs = { + className: classNames('contents', glitchyFriendDecision) + }; + // The result. return (
@@ -87,7 +94,7 @@ class Drawer extends React.Component { submitted={submitted} value={searchValue} /> -
+
Date: Sat, 13 Jan 2018 11:41:06 -0600 Subject: Add the shrinking glitchy elefriend. #294. --- .../flavours/glitch/features/drawer/index.js | 7 +++++-- .../flavours/glitch/styles/components/drawer.scss | 24 +++++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js index c8eabb4f3..ba56f1a30 100644 --- a/app/javascript/flavours/glitch/features/drawer/index.js +++ b/app/javascript/flavours/glitch/features/drawer/index.js @@ -94,9 +94,12 @@ class Drawer extends React.Component { submitted={submitted} value={searchValue} /> -
+
- +
+ + {multiColumn &&
} +
Date: Sat, 13 Jan 2018 21:22:37 -0600 Subject: Set glitchy elephant friend variant in initial state. #294. Also lay some groundwork needed to interactively change the glitchfriend. The codebase uses "elefriend" because it's shorter and didn't require me to realign the actions in actions/compose.js. Same idea, though. --- app/javascript/flavours/glitch/actions/compose.js | 7 +++++++ .../flavours/glitch/features/drawer/index.js | 11 ++++++----- .../flavours/glitch/images/mbstobon-ui-0.png | Bin 0 -> 39646 bytes .../flavours/glitch/images/mbstobon-ui-1.png | Bin 39646 -> 43609 bytes .../flavours/glitch/images/mbstobon-ui-2.png | Bin 43609 -> 40376 bytes .../flavours/glitch/images/mbstobon-ui-3.png | Bin 40376 -> 0 bytes app/javascript/flavours/glitch/reducers/compose.js | 7 +++++++ .../flavours/glitch/styles/components/drawer.scss | 4 ++-- 8 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 app/javascript/flavours/glitch/images/mbstobon-ui-0.png delete mode 100644 app/javascript/flavours/glitch/images/mbstobon-ui-3.png (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index a88dba1b1..c46387104 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -12,6 +12,7 @@ import { } from './timelines'; export const COMPOSE_CHANGE = 'COMPOSE_CHANGE'; +export const COMPOSE_CYCLE_ELEFRIEND = 'COMPOSE_CYCLE_ELEFRIEND'; export const COMPOSE_SUBMIT_REQUEST = 'COMPOSE_SUBMIT_REQUEST'; export const COMPOSE_SUBMIT_SUCCESS = 'COMPOSE_SUBMIT_SUCCESS'; export const COMPOSE_SUBMIT_FAIL = 'COMPOSE_SUBMIT_FAIL'; @@ -54,6 +55,12 @@ export function changeCompose(text) { }; }; +export function cycleElefriendCompose() { + return { + type: COMPOSE_CYCLE_ELEFRIEND, + }; +}; + export function replyCompose(status, router) { return (dispatch, getState) => { dispatch({ diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js index ba56f1a30..8f9719096 100644 --- a/app/javascript/flavours/glitch/features/drawer/index.js +++ b/app/javascript/flavours/glitch/features/drawer/index.js @@ -28,6 +28,7 @@ import { wrap } from 'flavours/glitch/util/redux_helpers'; const mapStateToProps = state => ({ account: state.getIn(['accounts', me]), columns: state.getIn(['settings', 'columns']), + elefriend: state.getIn(['compose', 'elefriend']), results: state.getIn(['search', 'results']), searchHidden: state.getIn(['search', 'hidden']), searchValue: state.getIn(['search', 'value']), @@ -56,6 +57,7 @@ class Drawer extends React.Component { const { account, columns, + elefriend, intl, multiColumn, onChange, @@ -69,10 +71,8 @@ class Drawer extends React.Component { submitted, } = this.props; - let choices = ['mbstobon-bg-1', 'mbstobon-bg-2', 'mbstobon-bg-3']; - let glitchyFriendDecision = choices[Math.floor(Math.random() * choices.length)]; - let drawerAttrs = { - className: classNames('contents', glitchyFriendDecision) + let elefriendAttrs = { + className: classNames('mastodon', 'mbstobon-' + elefriend), }; // The result. @@ -98,7 +98,7 @@ class Drawer extends React.Component {
- {multiColumn &&
} + {multiColumn &&
}
{ map.set('in_reply_to', action.status.get('id')); diff --git a/app/javascript/flavours/glitch/styles/components/drawer.scss b/app/javascript/flavours/glitch/styles/components/drawer.scss index 75b5d6b04..8526003bf 100644 --- a/app/javascript/flavours/glitch/styles/components/drawer.scss +++ b/app/javascript/flavours/glitch/styles/components/drawer.scss @@ -66,8 +66,8 @@ .mastodon { flex: 1; - @for $i from 1 through 3 { - &.mbstobon-bg-#{$i} { + @for $i from 0 through 2 { + &.mbstobon-#{$i} { background: url("~flavours/glitch/images/mbstobon-ui-#{$i}.png") no-repeat left bottom / contain; } } -- cgit From cd1377de7f870462265ade5d8ad7052ef480dd90 Mon Sep 17 00:00:00 2001 From: David Yip Date: Sun, 14 Jan 2018 03:35:25 -0600 Subject: Bind click event to elefriend cycling. #294. --- app/javascript/flavours/glitch/features/drawer/index.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js index 8f9719096..832b16e6f 100644 --- a/app/javascript/flavours/glitch/features/drawer/index.js +++ b/app/javascript/flavours/glitch/features/drawer/index.js @@ -12,6 +12,7 @@ import { showSearch, submitSearch, } from 'flavours/glitch/actions/search'; +import { cycleElefriendCompose } from 'flavours/glitch/actions/compose'; // Components. import Composer from 'flavours/glitch/features/composer'; @@ -39,6 +40,7 @@ const mapStateToProps = state => ({ const mapDispatchToProps = { onChange: changeSearch, onClear: clearSearch, + onClickElefriend: cycleElefriendCompose, onShow: showSearch, onSubmit: submitSearch, onOpenSettings: openModal.bind(null, 'SETTINGS', {}), @@ -62,6 +64,7 @@ class Drawer extends React.Component { multiColumn, onChange, onClear, + onClickElefriend, onOpenSettings, onShow, onSubmit, @@ -73,6 +76,7 @@ class Drawer extends React.Component { let elefriendAttrs = { className: classNames('mastodon', 'mbstobon-' + elefriend), + onClick: onClickElefriend, }; // The result. @@ -128,6 +132,7 @@ Drawer.propTypes = { // Dispatch props. onChange: PropTypes.func, onClear: PropTypes.func, + onClickElefriend: PropTypes.func, onShow: PropTypes.func, onSubmit: PropTypes.func, onOpenSettings: PropTypes.func, -- cgit From 53cbc9933eaaf7f57067dc897520d0be69c519a8 Mon Sep 17 00:00:00 2001 From: David Yip Date: Sun, 14 Jan 2018 04:00:21 -0600 Subject: Add wave background; blend elefriend in a bit more. #294. --- app/javascript/flavours/glitch/styles/components/drawer.scss | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/styles/components/drawer.scss b/app/javascript/flavours/glitch/styles/components/drawer.scss index 8526003bf..c7581fb4f 100644 --- a/app/javascript/flavours/glitch/styles/components/drawer.scss +++ b/app/javascript/flavours/glitch/styles/components/drawer.scss @@ -52,6 +52,7 @@ .drawer__inner { position: absolute; + background: lighten($ui-base-color, 13%) url('~flavours/glitch/images/wave-drawer.png') no-repeat bottom / 100% auto; top: 0; left: 0; box-sizing: border-box; @@ -69,6 +70,7 @@ @for $i from 0 through 2 { &.mbstobon-#{$i} { background: url("~flavours/glitch/images/mbstobon-ui-#{$i}.png") no-repeat left bottom / contain; + filter: saturate(80%) contrast(50%) brightness(50%); } } } -- cgit From e64cc311dd8db5d56b6299e9d40e7060d0c25b7e Mon Sep 17 00:00:00 2001 From: David Yip Date: Sun, 14 Jan 2018 04:19:29 -0600 Subject: Introduce a bit of luck into the elefriend selection. #294. --- .../flavours/glitch/features/drawer/index.js | 9 ++++----- .../flavours/glitch/images/mbstobon-ui-3.png | Bin 0 -> 32449 bytes .../glitch/images/wave-drawer-glitched.png | Bin 0 -> 3544 bytes .../flavours/glitch/images/wave-drawer.png | Bin 0 -> 3269 bytes app/javascript/flavours/glitch/reducers/compose.js | 6 +++++- .../flavours/glitch/styles/components/drawer.scss | 22 +++++++++++++++------ 6 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 app/javascript/flavours/glitch/images/mbstobon-ui-3.png create mode 100644 app/javascript/flavours/glitch/images/wave-drawer-glitched.png create mode 100644 app/javascript/flavours/glitch/images/wave-drawer.png (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js index 832b16e6f..93457ad31 100644 --- a/app/javascript/flavours/glitch/features/drawer/index.js +++ b/app/javascript/flavours/glitch/features/drawer/index.js @@ -74,9 +74,8 @@ class Drawer extends React.Component { submitted, } = this.props; - let elefriendAttrs = { - className: classNames('mastodon', 'mbstobon-' + elefriend), - onClick: onClickElefriend, + let innerDrawerAttrs = { + className: classNames('drawer--inner', 'mbstobon-' + elefriend), }; // The result. @@ -100,9 +99,9 @@ class Drawer extends React.Component { />
-
+
- {multiColumn &&
} + {multiColumn &&
}
Date: Sun, 14 Jan 2018 05:07:08 -0600 Subject: Run slightly less afoul of accessibility checks. #294. This makes the clickable element an interactive element, but doesn't add alt text and makes it not-obvious that you can click the elefriend. On one hand, this goes against good practice; on the other hand, it's not *supposed* to be obvious that you can click the elefriend. --- app/javascript/flavours/glitch/features/drawer/index.js | 2 +- app/javascript/flavours/glitch/styles/components/drawer.scss | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js index 93457ad31..ac72bfa90 100644 --- a/app/javascript/flavours/glitch/features/drawer/index.js +++ b/app/javascript/flavours/glitch/features/drawer/index.js @@ -101,7 +101,7 @@ class Drawer extends React.Component {
- {multiColumn &&
} + {multiColumn &&
Date: Sun, 14 Jan 2018 05:56:43 -0600 Subject: Fix eslint errors. #294. --- app/javascript/flavours/glitch/features/drawer/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js index ac72bfa90..375954cb6 100644 --- a/app/javascript/flavours/glitch/features/drawer/index.js +++ b/app/javascript/flavours/glitch/features/drawer/index.js @@ -101,7 +101,7 @@ class Drawer extends React.Component {
- {multiColumn &&