]> cat aescling's git repositories - mastodon.git/commitdiff
Media styling
authorkibigo! <marrus-sh@users.noreply.github.com>
Sat, 18 Nov 2017 19:05:23 +0000 (11:05 -0800)
committerkibigo! <marrus-sh@users.noreply.github.com>
Sat, 18 Nov 2017 19:05:23 +0000 (11:05 -0800)
app/javascript/themes/glitch/components/media_gallery.js
app/javascript/themes/glitch/components/status.js
app/javascript/themes/glitch/styles/_mixins.scss
app/javascript/themes/glitch/styles/components.scss
app/javascript/themes/glitch/styles/index.scss

index 05390c82fd4416d7b552637dcbb3db1edeb546de..b6b40c5855aae7ba4b66bac033eb7c6b83f26738 100644 (file)
@@ -214,6 +214,7 @@ export default class MediaGallery extends React.PureComponent {
   render () {
     const { media, intl, sensitive, letterbox, fullwidth } = this.props;
     const { visible } = this.state;
+    const size = media.take(4).size;
 
     let children;
 
@@ -233,8 +234,6 @@ export default class MediaGallery extends React.PureComponent {
         </button>
       );
     } else {
-      const size = media.take(4).size;
-
       if (this.isStandaloneEligible()) {
         children = <Item standalone onClick={this.handleClick} attachment={media.get(0)} />;
       } else {
@@ -243,7 +242,7 @@ export default class MediaGallery extends React.PureComponent {
     }
 
     return (
-      <div className={`media-gallery ${fullwidth ? 'full-width' : ''}`}>
+      <div className={`media-gallery size-${size} ${fullwidth ? 'full-width' : ''}`}>
         <div className={classNames('spoiler-button', { 'spoiler-button--visible': visible })}>
           <IconButton title={intl.formatMessage(messages.toggle_visible)} icon={visible ? 'eye' : 'eye-slash'} overlay onClick={this.handleOpen} />
         </div>
index cf2fbe21e1deb6847d518b4659fa8d835df467cf..e2ef47f5f17203e3d6cdbfbb23db39f051129ec5 100644 (file)
@@ -228,6 +228,10 @@ export default class Status extends ImmutablePureComponent {
     this.props.onMoveDown(this.props.status.get('id'));
   }
 
+  handleRef = c => {
+    this.node = c;
+  }
+
   renderLoadingMediaGallery () {
     return <div className='media_gallery' style={{ height: '110px' }} />;
   }
@@ -238,6 +242,7 @@ export default class Status extends ImmutablePureComponent {
 
   render () {
     const {
+      handleRef,
       parseClick,
       setExpansion,
     } = this;
@@ -389,6 +394,7 @@ export default class Status extends ImmutablePureComponent {
             ),
           }}
           {...selectorAttribs}
+          ref={handleRef}
         >
           {prepend && account ? (
             <StatusPrepend
index 7412991b8be236cb0545453e0ed385d1c5d7383c..79a8149fd04b79fa2c302a2ed245fe0c17f1de63 100644 (file)
     @content;
   }
 }
+
+@mixin fullwidth-gallery {
+  &.full-width {
+    margin-left: -22px;
+    margin-right: -22px;
+    width: inherit;
+    height: 250px;
+  }
+}
index fbee5610aa1b7d8583a6e00b63a33f9237c261bb..3be8db4b4ba67d7ff454f117fea54cd80d25364d 100644 (file)
@@ -1,13 +1,5 @@
 @import 'variables';
 
-@mixin fullwidth-gallery {
-  &.full-width {
-    margin-left: -22px;
-    margin-right: -22px;
-    width: inherit;
-  }
-}
-
 .app-body {
   -webkit-overflow-scrolling: touch;
   -ms-overflow-style: -ms-autohiding-scrollbar;
 .getting-started {
   box-sizing: border-box;
   padding-bottom: 235px;
-  background: url('../images/mastodon-getting-started.png') no-repeat 0 100%;
+  background: url('~images/mastodon-getting-started.png') no-repeat 0 100%;
   flex: 1 0 auto;
 
   p {
@@ -2491,7 +2483,7 @@ button.icon-button.active i.fa-retweet {
   justify-content: center;
 
   & > div {
-    background: url('../images/mastodon-not-found.png') no-repeat center -50px;
+    background: url('~images/mastodon-not-found.png') no-repeat center -50px;
     padding-top: 210px;
     width: 100%;
   }
@@ -2828,6 +2820,7 @@ button.icon-button.active i.fa-retweet {
   z-index: 100;
   display: flex;
   flex-direction: column;
+  align-items: stretch;
 
   .status__content > & {
     margin-top: 15px; // Add margin when used bare for NSFW video player
@@ -3539,7 +3532,7 @@ button.icon-button.active i.fa-retweet {
   img,
   canvas {
     display: block;
-    background: url('../images/void.png') repeat;
+    background: url('~images/void.png') repeat;
     object-fit: contain;
   }
 
@@ -3786,7 +3779,7 @@ button.icon-button.active i.fa-retweet {
 }
 
 .onboarding-modal__page-one__elephant-friend {
-  background: url('../images/elephant-friend-1.png') no-repeat center center / contain;
+  background: url('~images/elephant-friend-1.png') no-repeat center center / contain;
   width: 155px;
   height: 193px;
   margin-right: 15px;
@@ -4196,10 +4189,12 @@ button.icon-button.active i.fa-retweet {
   position: relative;
   background: $base-shadow-color;
   width: 100%;
+  height: 110px;
 
   .detailed-status & {
-    margin-left:-10px;
-    width: calc(100% + 22px);
+    margin-left: -12px;
+    width: calc(100% + 24px);
+    height: 250px;
   }
 
   @include fullwidth-gallery;
@@ -4331,7 +4326,17 @@ button.icon-button.active i.fa-retweet {
   overflow: hidden;
   position: relative;
   background: $base-shadow-color;
+  width: 100%;
   max-width: 100%;
+  height: 110px;
+
+  .detailed-status & {
+    margin-left: -12px;
+    width: calc(100% + 24px);
+    height: 250px;
+  }
+
+  @include fullwidth-gallery;
 
   video {
     height: 100%;
index 0eb6ac6d853bfa0b3286f13ba4534f65e4af3998..c962a1f629a0f3349c978577cf514bc5a7bdb3e5 100644 (file)
@@ -1,8 +1,8 @@
 @import 'mixins';
 @import 'variables';
-@import 'fonts/roboto';
-@import 'fonts/roboto-mono';
-@import 'fonts/montserrat';
+@import 'styles/fonts/roboto';
+@import 'styles/fonts/roboto-mono';
+@import 'styles/fonts/montserrat';
 
 @import 'reset';
 @import 'basics';