From f185c76c6ed159613082616001fcce5267756b94 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 24 May 2020 23:58:09 +0200 Subject: [PATCH] unclutter the intro page (#64) * removed cover.scss * uncluttered intro Signed-off-by: Philip Molares --- .../landing/layout/style/cover.scss | 398 ------------------ .../landing/layout/style/index.scss | 1 - .../intro/cover-buttons/cover-buttons.scss | 3 + .../intro/cover-buttons/cover-buttons.tsx | 46 ++ .../landing/pages/intro/feature-links.tsx | 37 ++ src/components/landing/pages/intro/intro.tsx | 91 +--- 6 files changed, 100 insertions(+), 476 deletions(-) delete mode 100644 src/components/landing/layout/style/cover.scss create mode 100644 src/components/landing/pages/intro/cover-buttons/cover-buttons.scss create mode 100644 src/components/landing/pages/intro/cover-buttons/cover-buttons.tsx create mode 100644 src/components/landing/pages/intro/feature-links.tsx diff --git a/src/components/landing/layout/style/cover.scss b/src/components/landing/layout/style/cover.scss deleted file mode 100644 index 8fdf3dd0f..000000000 --- a/src/components/landing/layout/style/cover.scss +++ /dev/null @@ -1,398 +0,0 @@ -/* - * Globals - */ - -/* Links */ - -a, -a:focus, -a:hover { - color: #fff; -} -/* Custom default button */ - -.btn-default, -.btn-default:hover, -.btn-default:focus { - color: #333; - text-shadow: none; - /* Prevent inheritence from `body` */ - background-color: #fff; - border: 1px solid #fff; -} -/* - * Base structure - */ -html { - height: 100%; -} -html, -body { - background-color: #333; -} -body { - min-height: 100%; - color: #fff; - text-align: center; - text-shadow: 0 1px 3px rgba(0, 0, 0, .5); -} -/* Extra markup and styles for table-esque vertical and horizontal centering */ - -.site-wrapper { - padding: 10px; - display: table; - width: 100%; - height: 100vh; - /* For at least Firefox */ - min-height: 100%; - -webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .5); - box-shadow: inset 0 0 100px rgba(0, 0, 0, .5); -} -.site-wrapper-inner { - display: table-cell; - vertical-align: middle; -} -.cover-container { - width: 100%; - padding-top: 80px; - margin-right: auto; - margin-left: auto; -} -/* Padding for spacing */ - -.inner { - padding: 10px; -} -/* - * Header - */ - -.masthead { - position: absolute; - top: 0; - left: 0; - width: 100%; -} - -.masthead-brand { - margin-top: 10px; - margin-bottom: 10px; -} -.masthead-nav { - text-align: left; - max-width: 1000px; - margin: 0 auto; - padding-left: 10px; - padding-right: 10px; -} -.masthead-nav > li { - display: inline-block; -} -.masthead-nav > li + li { - margin-left: 20px; -} -.masthead-nav > li > a { - padding-right: 0; - padding-left: 0; - font-size: 16px; - font-weight: bold; - color: #fff; - /* IE8 proofing */ - color: rgba(255, 255, 255, .75); - border-bottom: 2px solid transparent; -} -.masthead-nav > li > a:hover, -.masthead-nav > li > a:focus { - background-color: transparent; - border-bottom-color: #a9a9a9; - border-bottom-color: rgba(255, 255, 255, .25); -} -.masthead-nav > .active > a, -.masthead-nav > .active > a:hover, -.masthead-nav > .active > a:focus { - color: #fff; - border-bottom-color: #fff; -} -@media (min-width: 768px) { - .masthead-brand { - float: left; - } - .masthead-nav { - float: none; - } - .inner { - padding: 30px 25px; - } -} -/* - * Cover - */ - -.cover { - padding: 0 20px; -} -.cover .btn-lg { - padding: 10px 20px; - font-weight: bold; -} -/* - * Footer - */ - -.mastfoot { - color: #999; - /* IE8 proofing */ - color: rgba(255, 255, 255, .5); -} -/* - * Affix and center - */ - -@media (min-width: 768px) { - /* Pull out the header and footer */ - .masthead { - position: absolute; - top: 0; - left: 0; - width: 100% !important; - } - .mastfoot { - position: fixed; - bottom: 0; - } - /* Start the vertical centering */ - .site-wrapper-inner { - vertical-align: middle; - } - /* Handle the widths */ - .masthead, - .mastfoot, - .cover-container { - width: 100%; - /* Must be percentage or pixels for horizontal alignment */ - } -} -@media (min-width: 992px) { - .masthead, - .mastfoot, - .cover-container { - width: 1000px; - } -} -.section ul { - list-style: none; -} -/* custom */ - -html, -body { - overflow-x: hidden; -} -input { - color: black; -} -.mastfoot { - position: relative; -} -.select2-container-multi .select2-choices .select2-search-field input { - font-family: inherit; - padding: 5px 12px; -} -.select2-container { - margin: 0 auto !important; -} -.list { - width: 100%; - padding-left: 0; - display: -webkit-inline-flex; - display: -moz-inline-flex; - display: -ms-inline-flex; - display: -o-inline-flex; - display: inline-flex; - -webkit-flex-direction: row; - -moz-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-flex-flow: row wrap; - -moz-flex-flow: row wrap; - -ms-flex-flow: row wrap; - flex-flow: row wrap; - -webkit-justify-content: flex-start; - -moz-justify-content: flex-start; - -ms-justify-content: flex-start; - justify-content: flex-start; -} -.list { - margin: 20px 0; -} -.list li { - padding: 0 10px; -} -.list li * { - word-break: break-word; - word-wrap: break-word; -} -.list li a { - text-decoration: none; -} -.list li p { - color: gray; -} -.list li .item { - padding: 5px 25px; - margin: 10px 0; - background: white; - border-radius: 5px; - color: black; - text-shadow: none; - min-height: 134px; - display: table; - min-width: 100%; -} -.list li .item .content { - display: table-cell; - vertical-align: middle; -} -.list li .item .content .tags { - line-height: 25px; -} -.list li .item .content .tags span { - display: inline-block; - line-height: 15px; -} -.form-inline { - padding: 0 10px; -} -.sort.asc { - text-decoration: overline; -} -.sort.desc { - text-decoration: underline; -} -.ui-avatar { - display: inline-block; - overflow: hidden; - line-height: 1; - vertical-align: middle; - border-radius: 3px; -} -.ui-avatar.circle { - border-radius: 50%; -} -.ui-history-close { - position: absolute; - right: 14px; - top: 15px; - font-size: 16px; - opacity: 0.5; -} -.ui-history-close:hover { - opacity: 1; -} -.ui-history-pin { - position: absolute; - left: 14px; - top: 15px; - font-size: 16px; - opacity: 0.2; - transition: opacity 0.2s ease-in-out; - -webkit-transition: opacity 0.2s ease-in-out; -} -.item:hover .ui-history-pin:hover { - opacity: 1; -} -.item .ui-history-pin.active { - opacity: 1; - color: #d43f3a; -} -.ui-or { - margin: 5px; -} -.ui-use-tags { - min-width: 172px; - max-width: 344px; -} - -.modal-title { - text-align: left; - color: black; -} -.modal-body { - color: black; -} - -.btn-file { - position: relative; - overflow: hidden; -} -.btn-file input[type=file] { - position: absolute; - top: 0; - right: 0; - min-width: 100%; - min-height: 100%; - font-size: 100px; - text-align: right; - filter: alpha(opacity=0); - opacity: 0; - outline: none; - background: white; - cursor: inherit; - display: block; -} - -.social-foot { - line-height: 30px; -} -.social-foot > * { - line-height: 20px; - vertical-align: middle !important; - display: inline-block !important; -} - -.btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active { - color: white; -} - -.screenshot { - margin: 30px auto; - width: 100%; - border-radius: 3px; -} - -select { - color: black; -} - -@media (max-width: 768px) { - span.ui-or { - display: block; - } - .ui-use-tags { - max-width: 100%; - } -} -/* for all pages should include this */ -body { - font-smoothing: subpixel-antialiased !important; - -webkit-font-smoothing: subpixel-antialiased !important; - -moz-osx-font-smoothing: auto !important; - text-shadow: 0 0 1em transparent, 1px 1px 1.2px rgba(0, 0, 0, 0.004); - /*text-rendering: optimizeLegibility;*/ - -webkit-overflow-scrolling: touch; - font-family: "Source Sans Pro", Helvetica, Arial, sans-serif; - letter-spacing: 0.025em; -} -:focus, .focus { - outline: none !important; -} -::-moz-focus-inner { - border: 0 !important; -} - -/* manual fix for bootstrap issue 14040, there is an unnecessary padding-right on modal open */ -body.modal-open { - overflow-y: auto; - padding-right: 0 !important; -} - diff --git a/src/components/landing/layout/style/index.scss b/src/components/landing/layout/style/index.scss index 30289bd95..4d4e65566 100644 --- a/src/components/landing/layout/style/index.scss +++ b/src/components/landing/layout/style/index.scss @@ -1,7 +1,6 @@ @import "../../../../../node_modules/bootstrap/scss/bootstrap"; @import '../../../../../node_modules/react-bootstrap-typeahead/css/Typeahead'; @import "font-pack"; -//@import "cover.scss"; html { height: 100%; diff --git a/src/components/landing/pages/intro/cover-buttons/cover-buttons.scss b/src/components/landing/pages/intro/cover-buttons/cover-buttons.scss new file mode 100644 index 000000000..8723c63b0 --- /dev/null +++ b/src/components/landing/pages/intro/cover-buttons/cover-buttons.scss @@ -0,0 +1,3 @@ +.cover-button { + min-width: 200px; +} diff --git a/src/components/landing/pages/intro/cover-buttons/cover-buttons.tsx b/src/components/landing/pages/intro/cover-buttons/cover-buttons.tsx new file mode 100644 index 000000000..27775430e --- /dev/null +++ b/src/components/landing/pages/intro/cover-buttons/cover-buttons.tsx @@ -0,0 +1,46 @@ +import {LoginStatus} from "../../../../../redux/user/types"; +import {Link} from "react-router-dom"; +import {Button} from "react-bootstrap"; +import {Trans, useTranslation} from "react-i18next"; +import React from "react"; +import {useSelector} from "react-redux"; +import {ApplicationState} from "../../../../../redux"; +import "./cover-buttons.scss"; + +export const CoverButtons: React.FC = () => { + useTranslation(); + const user = useSelector((state: ApplicationState) => state.user); + + if (user.status === LoginStatus.ok) { + return null; + } + + return ( +
+ + + + + + + + + + + +
+ ); + +} diff --git a/src/components/landing/pages/intro/feature-links.tsx b/src/components/landing/pages/intro/feature-links.tsx new file mode 100644 index 000000000..9b50c9310 --- /dev/null +++ b/src/components/landing/pages/intro/feature-links.tsx @@ -0,0 +1,37 @@ +import {Col, Row} from "react-bootstrap"; +import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; +import {Trans, useTranslation} from "react-i18next"; +import React from "react"; +import { Link } from "react-router-dom"; + +export const FeatureLinks: React.FC = () => { + useTranslation(); + return ( + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+ + +
+ ); +} diff --git a/src/components/landing/pages/intro/intro.tsx b/src/components/landing/pages/intro/intro.tsx index 737b49dbb..ad0154c6a 100644 --- a/src/components/landing/pages/intro/intro.tsx +++ b/src/components/landing/pages/intro/intro.tsx @@ -1,90 +1,27 @@ -import React, { Fragment } from 'react' +import React from 'react' import screenshot from './img/screenshot.png'; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; -import {Button} from 'react-bootstrap'; import {Trans, useTranslation} from "react-i18next"; -import {Link} from "react-router-dom"; -import {useSelector} from "react-redux"; -import {ApplicationState} from "../../../../redux"; +import {FeatureLinks} from "./feature-links"; +import {CoverButtons} from "./cover-buttons/cover-buttons"; const Intro: React.FC = () => { - // ToDo replace this with comment - const url = "http://localhost:3000";//useServerUrl(); useTranslation(); - const user = useSelector((state: ApplicationState) => state.user); + return ( -
-
-

- CodiMD -

-

- -

+
+

+ CodiMD +

+

+ +

- { - user.status === "forbidden" ? - -
- - - + - - - - - - -
- - CodiMD Screenshot -
- : - null - } - - -
+ CodiMD Screenshot +
) }