From e19eefe219c46ea9f763d0279029f03c5cf4554f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 11 Jul 2017 15:27:59 +0200 Subject: Redesign the landing page, mount public timeline on it (#4122) * Redesign the landing page, mount public timeline on it * Adjust the standalone mounted component to the lacking of router * Adjust auth layout pages to new design * Fix tests * Standalone public timeline polling every 5 seconds * Remove now obsolete translations * Add responsive design for new landing page * Address reviews * Add floating clouds behind frontpage form * Use access token from public page when available * Fix mentions and hashtags links, cursor on status content in standalone mode * Add footer link to source code * Fix errors on pages that don't embed the component, use classnames * Fix tests * Change anonymous autoPlayGif default to false * When gif autoplay is disabled, hover to play * Add option to hide the timeline preview * Slightly improve alt layout * Add elephant friend to new frontpage * Display "back to mastodon" in place of "login" when logged in on frontpage * Change polling time to 3s --- app/javascript/styles/about.scss | 448 +++++++++++++++++++++++++--- app/javascript/styles/basics.scss | 7 +- app/javascript/styles/boost.scss | 4 + app/javascript/styles/components.scss | 32 +- app/javascript/styles/containers.scss | 48 +-- app/javascript/styles/fonts/montserrat.scss | 8 + app/javascript/styles/forms.scss | 39 ++- 7 files changed, 502 insertions(+), 84 deletions(-) (limited to 'app/javascript/styles') diff --git a/app/javascript/styles/about.scss b/app/javascript/styles/about.scss index 3512bdcb4..b9c018391 100644 --- a/app/javascript/styles/about.scss +++ b/app/javascript/styles/about.scss @@ -116,10 +116,6 @@ .wrapper { padding: 20px; } - - .features-list { - display: block; - } } } @@ -301,80 +297,438 @@ } } -.features-list { +.features-list__row { display: flex; - margin-bottom: 20px; + padding: 10px 0; + justify-content: space-between; + + &:first-child { + padding-top: 0; + } - .features-list__column { - flex: 1 1 0; + .visual { + flex: 0 0 auto; + display: flex; + align-items: center; + margin-left: 15px; - ul { - list-style: none; + .fa { + display: block; + color: $ui-primary-color; + font-size: 48px; } + } - li { - margin: 0; + .text { + font-size: 16px; + line-height: 30px; + color: lighten($ui-base-color, 26%); + + h6 { + font-weight: 500; + color: $ui-primary-color; } } } -.screenshot-with-signup { - display: flex; - margin-bottom: 20px; - - .mascot { - flex: 1 1 auto; - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; +.landing-page { + .header-wrapper { + padding-top: 15px; + background: $ui-base-color; + background: linear-gradient(150deg, lighten($ui-base-color, 8%), $ui-base-color); + position: relative; - img { - display: block; + .mascot-container { + max-width: 800px; margin: 0 auto; - max-width: 100%; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 100%; + } + + .mascot { + position: absolute; + bottom: -14px; + width: auto; height: auto; + left: 60px; + z-index: 3; + } + } + + p, + li { + font: inherit; + font-weight: inherit; + margin-bottom: 0; + } + + .header { + line-height: 30px; + overflow: hidden; + + .container { + display: flex; + justify-content: space-between; + } + + .hero { + margin-top: 50px; + align-items: center; + position: relative; + + .floats { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + + img { + position: absolute; + transition: all 0.1s linear; + animation-name: floating; + animation-duration: 1.7s; + animation-iteration-count: infinite; + animation-direction: alternate; + animation-timing-function: linear; + z-index: 2; + } + + .float-1 { + height: 170px; + right: -120px; + bottom: 0; + } + + .float-2 { + height: 100px; + right: 210px; + bottom: 0; + animation-delay: 0.2s; + } + + .float-3 { + height: 140px; + right: 110px; + top: -30px; + animation-delay: 0.1s; + } + } + + .simple_form, + .closed-registrations-message { + background: darken($ui-base-color, 4%); + width: 280px; + padding: 15px 20px; + border-radius: 4px 4px 0 0; + line-height: initial; + position: relative; + z-index: 4; + + .actions { + margin-bottom: 0; + + button, + .button, + .block-button { + margin-bottom: 0; + } + } + } + + .heading { + position: relative; + z-index: 4; + padding-bottom: 150px; + } + + .closed-registrations-message { + min-height: 330px; + display: flex; + flex-direction: column; + justify-content: space-between; + } + } + + ul { + list-style: none; + margin: 0; + + li { + display: inline-block; + vertical-align: bottom; + margin: 0; + + &:first-child a { + padding-left: 0; + } + + &:last-child a { + padding-right: 0; + } + } + } + + .links { + position: relative; + z-index: 4; + + a { + display: flex; + justify-content: center; + align-items: center; + color: $ui-primary-color; + text-decoration: none; + padding: 12px 16px; + line-height: 32px; + font-family: 'mastodon-font-display', sans-serif; + font-weight: 500; + font-size: 14px; + + &:hover { + color: $ui-secondary-color; + } + } + + .brand { + a { + padding-left: 0; + color: $white; + } + + img { + width: 32px; + height: 32px; + margin-right: 10px; + } + } + } + } + + .container { + width: 100%; + box-sizing: border-box; + max-width: 800px; + margin: 0 auto; + } + + .wrapper { + max-width: 800px; + margin: 0 auto; + padding: 0; + } + + .learn-more-cta { + background: darken($ui-base-color, 4%); + padding: 50px 0; + } + + h3 { + font-family: 'mastodon-font-display', sans-serif; + font-size: 16px; + line-height: 24px; + font-weight: 500; + margin-bottom: 20px; + color: $ui-primary-color; + } + + p { + font-size: 16px; + line-height: 30px; + color: lighten($ui-base-color, 26%); + } + + .features { + padding: 50px 0; + + .container { + display: flex; } } - .simple_form, - .closed-registrations-message { - width: 300px; + #mastodon-timeline { + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + font-family: 'mastodon-font-sans-serif', sans-serif; + font-size: 13px; + line-height: 18px; + font-weight: 400; + color: $primary-text-color; + width: 330px; + margin-right: 30px; flex: 0 0 auto; - background: rgba(darken($ui-base-color, 7%), 0.5); - padding: 14px; - border-radius: 4px; - box-shadow: 0 0 15px rgba($base-shadow-color, 0.4); + background: $ui-base-color; + overflow: hidden; + box-shadow: 0 0 6px rgba($black, 0.1); - .actions { - margin-bottom: 0; + .column { + padding: 0; + border-radius: 4px; + overflow: hidden; + height: 100%; } - .info { - text-align: center; + .scrollable { + height: 400px; + } + + p { + font-size: inherit; + line-height: inherit; + font-weight: inherit; + color: $primary-text-color; a { color: $ui-secondary-color; + text-decoration: none; } } } - @media screen and (max-width: 625px) { - .mascot { + .about-mastodon { + max-width: 675px; + + p { + margin-bottom: 20px; + } + + .features-list { + margin-top: 20px; + } + } + + em { + display: inline; + margin: 0; + padding: 0; + font-weight: 500; + background: transparent; + font-family: inherit; + font-size: inherit; + line-height: inherit; + color: $ui-primary-color; + } + + h1 { + font-family: 'mastodon-font-display', sans-serif; + font-size: 26px; + line-height: 30px; + margin-bottom: 0; + font-weight: 500; + color: $ui-secondary-color; + + small { + font-family: 'mastodon-font-sans-serif', sans-serif; + display: block; + font-size: 18px; + font-weight: 400; + color: lighten($ui-base-color, 26%); + } + } + + .footer-links { + padding-bottom: 50px; + text-align: right; + color: lighten($ui-base-color, 26%); + + p { + font-size: 14px; + } + + a { + color: inherit; + text-decoration: underline; + } + } + + @media screen and (max-width: 800px) { + .container { + padding: 0 20px; + } + + .header-wrapper .mascot { + left: 20px; + } + } + + @media screen and (max-width: 689px) { + .header-wrapper .mascot { display: none; } + } - .simple_form, - .closed-registrations-message { - flex: auto; + @media screen and (max-width: 675px) { + .header-wrapper { + padding-top: 0; + } + + .header .container, + .features .container { + display: block; + } + + .links { + padding-top: 15px; + background: darken($ui-base-color, 4%); + } + + .header { + padding-top: 0; + + .hero { + margin-top: 30px; + padding: 0; + + .heading { + padding-bottom: 20px; + } + } + + .floats { + display: none; + } + + .heading, + .nav { + text-align: center; + } + + .heading h1 { + padding: 30px 0; + } + + .hero { + .simple_form, + .closed-registrations-message { + background: darken($ui-base-color, 8%); + width: 100%; + border-radius: 0; + box-sizing: border-box; + } + } + } + + #mastodon-timeline { + height: 70vh; + width: 100%; + margin-bottom: 50px; } } } -.closed-registrations-message { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - text-align: center; +@keyframes floating { + from { + transform: translate(0, 0); + } + + 65% { + transform: translate(0, 4px); + } + + to { + transform: translate(0, -0); + } } diff --git a/app/javascript/styles/basics.scss b/app/javascript/styles/basics.scss index 4da698e81..182ea36a4 100644 --- a/app/javascript/styles/basics.scss +++ b/app/javascript/styles/basics.scss @@ -1,6 +1,6 @@ body { font-family: 'mastodon-font-sans-serif', sans-serif; - background: $ui-base-color url('../images/background-photo.jpg'); + background: $ui-base-color; background-size: cover; background-attachment: fixed; font-size: 13px; @@ -22,6 +22,11 @@ body { background: $ui-base-color; } + &.about-body { + background: darken($ui-base-color, 8%); + padding-bottom: 0; + } + &.embed { background: transparent; margin: 0; diff --git a/app/javascript/styles/boost.scss b/app/javascript/styles/boost.scss index 8d6478e10..5eb3149ef 100644 --- a/app/javascript/styles/boost.scss +++ b/app/javascript/styles/boost.scss @@ -12,3 +12,7 @@ button.icon-button i.fa-retweet { background-image: url("data:image/svg+xml;utf8,"); } } + +button.icon-button.disabled i.fa-retweet { + background-image: url("data:image/svg+xml;utf8,"); +} diff --git a/app/javascript/styles/components.scss b/app/javascript/styles/components.scss index def69d250..8d0350eb6 100644 --- a/app/javascript/styles/components.scss +++ b/app/javascript/styles/components.scss @@ -42,8 +42,38 @@ cursor: default; } + &.button-alternative { + font-size: 16px; + line-height: 36px; + height: auto; + color: $ui-base-color; + background: $ui-primary-color; + text-transform: none; + padding: 4px 16px; + + &:active, + &:focus, + &:hover { + background-color: lighten($ui-primary-color, 4%); + } + } + &.button-secondary { - // + font-size: 16px; + line-height: 36px; + height: auto; + color: $ui-primary-color; + text-transform: none; + background: transparent; + padding: 3px 15px; + border: 1px solid $ui-primary-color; + + &:active, + &:focus, + &:hover { + border-color: lighten($ui-primary-color, 4%); + color: lighten($ui-primary-color, 4%); + } } &.button--block { diff --git a/app/javascript/styles/containers.scss b/app/javascript/styles/containers.scss index 68f73e0c0..44d4c1118 100644 --- a/app/javascript/styles/containers.scss +++ b/app/javascript/styles/containers.scss @@ -10,52 +10,36 @@ } .logo-container { - max-width: 400px; margin: 100px auto; - margin-bottom: 0; - cursor: default; + margin-bottom: 50px; @media screen and (max-width: 360px) { margin: 30px auto; } h1 { - display: block; - text-align: center; - color: $primary-text-color; - font-size: 48px; - font-weight: 500; + display: flex; + justify-content: center; + align-items: center; img { - display: block; - margin: 20px auto; - width: 180px; - height: 180px; + width: 32px; + height: 32px; + margin-right: 10px; } a { - color: inherit; + display: flex; + justify-content: center; + align-items: center; + color: $primary-text-color; text-decoration: none; outline: 0; - - img { - opacity: 0.8; - transition: opacity 0.8s ease; - } - - &:hover { - img { - opacity: 1; - transition-duration: 0.2s; - } - } - } - - small { - display: block; - font-size: 12px; - font-weight: 400; - font-family: 'mastodon-font-monospace', monospace; + padding: 12px 16px; + line-height: 32px; + font-family: 'mastodon-font-display', sans-serif; + font-weight: 500; + font-size: 14px; } } } diff --git a/app/javascript/styles/fonts/montserrat.scss b/app/javascript/styles/fonts/montserrat.scss index e4012ab02..206f1865e 100644 --- a/app/javascript/styles/fonts/montserrat.scss +++ b/app/javascript/styles/fonts/montserrat.scss @@ -7,3 +7,11 @@ font-weight: 400; font-style: normal; } + +@font-face { + font-family: 'mastodon-font-display'; + src: local('Montserrat'), + url('../fonts/montserrat/Montserrat-Medium.ttf') format('truetype'); + font-weight: 500; + font-style: normal; +} diff --git a/app/javascript/styles/forms.scss b/app/javascript/styles/forms.scss index 414dc4fe8..e723b50ff 100644 --- a/app/javascript/styles/forms.scss +++ b/app/javascript/styles/forms.scss @@ -24,6 +24,20 @@ code { p.hint { margin-bottom: 15px; + color: lighten($ui-base-color, 32%); + + &.subtle-hint { + text-align: center; + font-size: 12px; + line-height: 18px; + margin-top: 15px; + margin-bottom: 0; + color: lighten($ui-base-color, 26%); + + a { + color: $ui-primary-color; + } + } } strong { @@ -197,8 +211,6 @@ code { &:active, &:focus { - position: relative; - top: 1px; background-color: darken($ui-highlight-color, 5%); } @@ -219,6 +231,27 @@ code { select { font-size: 16px; } + + .input-with-append { + position: relative; + + .input input { + padding-right: 127px; + } + + .append { + position: absolute; + right: 0; + top: 0; + padding: 7px 4px; + padding-bottom: 9px; + font-size: 16px; + color: lighten($ui-base-color, 26%); + font-family: inherit; + pointer-events: none; + cursor: default; + } + } } .flash-message { @@ -240,7 +273,7 @@ code { text-align: center; a { - color: $primary-text-color; + color: $ui-primary-color; text-decoration: none; &:hover { -- cgit