Browse Source

Introduce a bit of luck into the elefriend selection. #294.

closed-social-glitch-2
David Yip 6 years ago
parent
commit
e64cc311dd
No known key found for this signature in database GPG Key ID: 7DA0036508FCC0CC
6 changed files with 25 additions and 12 deletions
  1. +4
    -5
      app/javascript/flavours/glitch/features/drawer/index.js
  2. BIN
     
  3. BIN
     
  4. BIN
     
  5. +5
    -1
      app/javascript/flavours/glitch/reducers/compose.js
  6. +16
    -6
      app/javascript/flavours/glitch/styles/components/drawer.scss

+ 4
- 5
app/javascript/flavours/glitch/features/drawer/index.js View File

@ -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 {
/>
<div className='contents'>
<DrawerAccount account={account} />
<div className='drawer__inner'>
<div {...innerDrawerAttrs}>
<Composer />
{multiColumn && <div {...elefriendAttrs} />}
{multiColumn && <div className='mastodon' onClick={onClickElefriend} role='button' />}
</div>
<DrawerResults
results={results}

BIN
View File


BIN
View File


BIN
View File


+ 5
- 1
app/javascript/flavours/glitch/reducers/compose.js View File

@ -38,6 +38,10 @@ import { overwrite } from 'flavours/glitch/util/js_helpers';
const totalElefriends = 3;
// ~4% chance you'll end up with an unexpected friend
// glitch-soc/mastodon repo created_at date: 2017-04-20T21:55:28Z
const glitchProbability = 1 - 0.0420215528;
const initialState = ImmutableMap({
mounted: false,
advanced_options: ImmutableMap({
@ -45,7 +49,7 @@ const initialState = ImmutableMap({
threaded_mode: false,
}),
sensitive: false,
elefriend: Math.floor(Math.random() * totalElefriends),
elefriend: Math.random() < glitchProbability ? Math.floor(Math.random() * totalElefriends) : totalElefriends,
spoiler: false,
spoiler_text: '',
privacy: null,

+ 16
- 6
app/javascript/flavours/glitch/styles/components/drawer.scss View File

@ -50,9 +50,8 @@
contain: strict;
}
.drawer__inner {
.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;
@ -66,11 +65,22 @@
.mastodon {
flex: 1;
}
}
@for $i from 0 through 3 {
.drawer--inner.mbstobon-#{$i} {
@if $i == 3 {
background: lighten($ui-base-color, 13%) url('~flavours/glitch/images/wave-drawer.png') no-repeat bottom / 100% auto;
} @else {
background: lighten($ui-base-color, 13%) url('~flavours/glitch/images/wave-drawer-glitched.png') no-repeat bottom / 100% auto;
}
.mastodon {
background: url("~flavours/glitch/images/mbstobon-ui-#{$i}.png") no-repeat left bottom / contain;
@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%);
@if $i != 3 {
filter: contrast(50%) brightness(50%);
}
}
}

Loading…
Cancel
Save