-
Notifications
You must be signed in to change notification settings - Fork 10.3k
feat(www): tagline on plugin library landing page #12530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ab80b4d
tagline on plugins page
calcsam2 b79520a
slightly more lightweight design
calcsam2 705137a
Format, fix `cursor: pointer`
fk 38bf8c7
Format moar
fk 7b6f61d
Replace `<`/`>` with icons
fk c856b8a
Basic a11y for control buttons, consolidate styles
fk b502cc5
Animate width of alternating text
fk d710c49
Simpler UI, tidy margins
fk 387dd49
Merge branch 'master' into tagline-on-plugins-page
fk bbbb411
Adjust to latest changes from master
fk 079e9e0
Adjust border color
fk c320e25
Fix issues on smaller screens
fk c73b55f
Bring back the „well“
fk 49c3773
Revert "Bring back the „well“"
fk 1abfbc3
Make „control button“ hover more visible, add :active styles
fk d41c169
Rename Rotater -> Rotator
fk 395f794
Fix review - cleanup some code
wardpeet f1eb9b9
update accessbility
wardpeet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| import React, { Component } from "react"; | ||
| import Slider from "./Slider"; | ||
| import { rhythm, options } from "../utils/typography" | ||
| import presets, { colors, space } from "../utils/presets" | ||
| import Link from "gatsby-link" | ||
|
|
||
| class Search extends Component { | ||
| constructor(props, context) { | ||
| super(props, context) | ||
| this.state = { item: 0 } | ||
| } | ||
|
|
||
| decrementItem() { | ||
| clearInterval(this.state.intervalId); | ||
| this.setState({ | ||
| intervalId: -1, | ||
| item: ((this.state.item + this.props.items.length - 1) % this.props.items.length) | ||
| }) | ||
| } | ||
| incrementItemAndClearInterval() { | ||
| clearInterval(this.state.intervalId); | ||
| this.incrementItem() | ||
| this.setState({ | ||
| intervalId: -1, | ||
| }) | ||
| } | ||
|
|
||
| incrementItem() { | ||
wardpeet marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| this.setState({ | ||
| item: ((this.state.item + 1) % this.props.items.length) | ||
| }) | ||
| } | ||
| componentDidMount() { | ||
| const intervalId = setInterval(() => this.incrementItem(), 5000); | ||
|
||
| this.setState({ intervalId }) | ||
| } | ||
|
|
||
| componentWillUnmount() { | ||
| clearInterval(this.state.intervalId); | ||
| } | ||
| render() { | ||
| const { text, pluginName } = this.props.items[this.state.item] | ||
| return ( | ||
| <> | ||
| <p | ||
| css={{ | ||
| color: colors.gray.calm, | ||
| marginLeft: rhythm(space[9]), | ||
| marginRight: rhythm(space[9]), | ||
| fontSize: presets.scale[5], | ||
| fontFamily: options.headerFontFamily.join(`,`), | ||
| textAlign: `center`, | ||
| }} | ||
| > | ||
| <span | ||
| css={{ | ||
| [presets.Tablet]: { | ||
| marginRight: rhythm(1 / 8), | ||
| }, | ||
| }} | ||
| > | ||
| Need | ||
| </span> | ||
| <span | ||
| css={{ | ||
| fontWeight: 600 | ||
| }}> | ||
| { | ||
| this.state.intervalId == -1 ? | ||
| <span css={{ | ||
| }}>{text}</span> : | ||
| <span> | ||
| <Slider | ||
| items={[text]} | ||
| color={colors.gray.calm} | ||
| /> | ||
| </span> | ||
| } | ||
| </span> | ||
| <br/> | ||
| <span | ||
| css={{ | ||
| fontWeight: 700, | ||
| "&:hover": { | ||
| cusor: "pointer" | ||
| } | ||
| }} | ||
| onClick={this.decrementItem.bind(this)}>< | ||
| </span> | ||
| There's {pluginName ? | ||
| <Link | ||
| to={"/packages/"+pluginName} | ||
| >a plugin</Link> :`a plugin`} for that. | ||
| <span> | ||
| <span | ||
| css={{ | ||
| fontWeight: 700, | ||
| "&:hover": { | ||
| cusor: "pointer" | ||
| } | ||
| }} | ||
| onClick={this.incrementItemAndClearInterval.bind(this)}> | ||
| > | ||
| </span> | ||
| </span> | ||
| </p> | ||
| </> | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| export default Search; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import React from "react" | ||
| import { keyframes } from "@emotion/core" | ||
|
|
||
| export default ({ items, color }) => ( | ||
| <span | ||
| css={{ | ||
| "& span": { | ||
| animation: `${topToBottom} 5s linear infinite 0s`, | ||
| opacity: 0, | ||
| }, | ||
| }} | ||
| > | ||
| {items.map(item => ( | ||
| <span key={item} css={{ color }}> | ||
| {item} | ||
| </span> | ||
| ))} | ||
| </span> | ||
| ) | ||
|
|
||
| const topToBottom = keyframes({ | ||
| "0%": { | ||
| opacity: 0, | ||
| }, | ||
| "6%": { | ||
| opacity: 0, | ||
| }, | ||
| "21%": { | ||
| opacity: 1, | ||
| }, | ||
| "69%": { | ||
| opacity: 1, | ||
| }, | ||
| "84%": { | ||
| opacity: 0, | ||
| }, | ||
| "90%": { | ||
| opacity: 0, | ||
| }, | ||
| "100%": { | ||
| opacity: 0, | ||
| }, | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.