-
Notifications
You must be signed in to change notification settings - Fork 394
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
WIP: Aghs Tooltip on Hero Page #2753
Open
skitttt
wants to merge
9
commits into
odota:master
Choose a base branch
from
skitttt:aghs_descriptions_hero_page
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9882269
add Aghs icon to hero page
skitttt aa31c52
aghs backend stuff
skitttt 4acf678
some update idk. skeleton of aghs tooltip in place
skitttt 2dea027
update aghs tooltip
skitttt 10973ac
get data to tooltip
skitttt 4a7afcc
split out tooltips, but broken :(
skitttt c6b6d79
fix tooltips showing up
skitttt 1fbb020
make ability upgrade text. need to flex whitespace of text for longer…
skitttt 55034c4
fix ability upgrade background color bleed
skitttt 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 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
This file contains 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,149 @@ | ||
import React from 'react'; | ||
import propTypes from 'prop-types'; | ||
import styled from 'styled-components'; | ||
import constants from '../constants'; | ||
|
||
|
||
const Wrapper = styled.div` | ||
position: relative; | ||
width: 300px; | ||
background: #131519; | ||
background: linear-gradient(135deg, #131519, #1f2228); | ||
overflow: hidden; | ||
border: 2px solid #27292b; | ||
|
||
& > div:nth-child(2) { | ||
position: relative; | ||
border-top: 1px solid #080D15; | ||
} | ||
`; | ||
|
||
const InnerWrapper = styled.div` | ||
overflow: hidden; | ||
`; | ||
|
||
const Header = styled.div` | ||
background: linear-gradient(to right, #51565F , #303338); | ||
position: relative; | ||
`; | ||
|
||
const HeaderContent = styled.div` | ||
position: relative; | ||
height: 50px; | ||
padding: 13px; | ||
white-space: nowrap; | ||
|
||
& img { | ||
display: inline-block; | ||
height: 100%; | ||
border: 1px solid #080D15; | ||
} | ||
|
||
& .name { | ||
display: inline-block; | ||
position: relative; | ||
left: 15px; | ||
bottom: 1px; | ||
height: 50px; | ||
width: 220px; | ||
font-size: ${constants.fontSizeCommon}; | ||
text-transform: uppercase; | ||
color: ${constants.primaryTextColor}; | ||
font-weight: bold; | ||
text-shadow: 1px 1px black; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
line-height: 50px; | ||
letter-spacing: 1px; | ||
} | ||
`; | ||
|
||
const HeaderBgImg = styled.div` | ||
position: absolute; | ||
left: -20px; | ||
height: 100%; | ||
width: 20%; | ||
background: ${({ img }) => `linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('${process.env.REACT_APP_IMAGE_CDN}${img}')`}; | ||
background-color: transparent; | ||
background-repeat: no-repeat; | ||
transform: scale(4); | ||
filter: blur(15px); | ||
`; | ||
|
||
const HeaderBgImg2 = styled.div` | ||
position: absolute; | ||
left: -20px; | ||
height: 100%; | ||
width: 20%; | ||
background: ${({ img }) => `linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('${process.env.REACT_APP_IMAGE_CDN}${img}')`}; | ||
background-color: transparent; | ||
background-repeat: no-repeat; | ||
transform: scale(4); | ||
filter: blur(15px); | ||
`; | ||
|
||
|
||
const Description = styled.div` | ||
position: relative; | ||
padding: 13px; | ||
color: #95a5a6; | ||
text-shadow: 1px 1px black; | ||
`; | ||
|
||
|
||
const Break = styled.div` | ||
margin-left: 13px; | ||
margin-right: 13px; | ||
height: 1px; | ||
background-color: #080D15; | ||
`; | ||
|
||
const AghsTooltip = ({aghs: props}) => ( | ||
<Wrapper> | ||
<InnerWrapper> | ||
<Header> | ||
<HeaderBgImg img={props.img} /> | ||
<HeaderContent> | ||
<img id="ability-img" src={`${process.env.REACT_APP_IMAGE_CDN}${props.img}`} alt="" /> | ||
<div className="name">Scepter</div> | ||
{/* {props.heroAghs.scepter.new_skill ? | ||
<span className="upgrade_type">New Ability</span> : | ||
<span className="upgrade_type">Upgrade</span> | ||
} */} | ||
<div className="header2"></div> | ||
</HeaderContent> | ||
</Header> | ||
<Description> | ||
hero: {props.hero_npc_name}<br/> | ||
aghinism: | ||
<Break /> | ||
2nd desc (after break) | ||
</Description> | ||
</InnerWrapper> | ||
<InnerWrapper> | ||
<Header> | ||
<HeaderBgImg img={props.img} /> | ||
<HeaderContent> | ||
<img id="ability-img" src={`${process.env.REACT_APP_IMAGE_CDN}${props.img}`} alt="" /> | ||
<div className="name">Shard</div> | ||
{/* {props.shard.new_skill ? | ||
<span className="upgrade_type">New Ability</span> : | ||
<span className="upgrade_type">Upgrade</span> | ||
} */} | ||
</HeaderContent> | ||
</Header> | ||
<Description> | ||
this is a description... | ||
<Break /> | ||
2nd desc (after break) | ||
</Description> | ||
</InnerWrapper> | ||
</Wrapper> | ||
); | ||
|
||
AghsTooltip.propTypes = { | ||
aghs: propTypes.shape({}).isRequired, | ||
}; | ||
|
||
export default AghsTooltip; |
This file contains 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
This file contains 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
This file contains 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,85 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import styled from 'styled-components'; | ||
import nanoid from 'nanoid'; | ||
import propTypes from 'prop-types'; | ||
import ReactTooltip from 'react-tooltip'; | ||
|
||
import constants from '../constants'; | ||
import AghsTooltip from '../AghsTooltip'; | ||
|
||
const Wrapper = styled.div` | ||
background: linear-gradient(to bottom, ${constants.colorBlueMuted}, ${constants.primarySurfaceColor}); | ||
border-radius: 4px; | ||
box-shadow: 0 2px 2px rgba(0, 0, 0, .3); | ||
position: relative; | ||
|
||
.__react_component_tooltip { | ||
opacity: 1 !important; | ||
padding: 0px !important; | ||
`; | ||
|
||
const AghsSlot = styled.div` | ||
border-radius: 4px; | ||
display: flex; | ||
flex-direction: column; | ||
height: auto; | ||
opacity: 1; | ||
overflow: hidden; | ||
transition: opacity .2s, box-shadow .4s, transform .2s; | ||
width: 100%; | ||
|
||
&:hover { | ||
opacity: 1; | ||
box-shadow: 0 0 150px rgba(255, 255, 255, .4); | ||
transform: scale(1.1); | ||
} | ||
`; | ||
|
||
const ScepterIcon = styled.img` | ||
display: block; | ||
overflow: hidden; | ||
margin-right: auto; | ||
margin-left: auto; | ||
width: 66%; | ||
height: 66%; | ||
`; | ||
|
||
const ShardIcon = styled.img` | ||
display: block; | ||
overflow: hidden; | ||
margin-right: auto; | ||
margin-left: auto; | ||
width: 66%; | ||
height: 66%; | ||
`; | ||
|
||
|
||
const Aghs = (props) => { | ||
const ttId = nanoid(); | ||
|
||
return ( | ||
<Wrapper data-tip data-for={ttId}> | ||
<AghsSlot alt="aghs"> | ||
<ScepterIcon src="/assets/images/dota2/scepter_1.png"/> | ||
<ShardIcon src="/assets/images/dota2/shard_1.png"/> | ||
</AghsSlot> | ||
<ReactTooltip id={ttId} effect="solid" place="bottom"> | ||
<AghsTooltip place="right" aghs={props}/> | ||
</ReactTooltip> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
Aghs.propTypes = { | ||
heroAghs: propTypes.shape({}).isRequired, | ||
skills: propTypes.array.isRequired, | ||
hero_npc_name: propTypes.string.isRequired, | ||
img: propTypes.string.isRequired, | ||
}; | ||
|
||
const mapStateToProps = state => ({ | ||
heroAghs: state.app.heroAghs, | ||
}); | ||
|
||
export default connect(mapStateToProps)(Aghs); |
This file contains 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
This file contains 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed subtle problem with rounded corners of mana consumption icons.