Various Changes
Added Support for Background Images, Inverted Buttons, More Color Options
This commit is contained in:
parent
97acd1c5fe
commit
884d28a317
4 changed files with 85 additions and 26 deletions
|
@ -12,17 +12,23 @@ interface OnlinePropType {
|
||||||
// replaces .title
|
// replaces .title
|
||||||
export const PageTitle = styled.h1`
|
export const PageTitle = styled.h1`
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
padding: 0.25rem 1rem;
|
||||||
line-height: 1.15;
|
line-height: 1.15;
|
||||||
font-size: 4rem;
|
font-size: 4rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
background-color: ${({ theme }) => theme.colors.background ? theme.colors.background : ""};
|
||||||
|
border-radius: 15px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// replaces .description
|
// replaces .description
|
||||||
export const PageDescription = styled.p`
|
export const PageDescription = styled.p`
|
||||||
|
background-color: ${({ theme }) => theme.colors.background ? theme.colors.background : ""};
|
||||||
|
padding: 0.25rem 0.5rem;
|
||||||
margin: 4rem 0;
|
margin: 4rem 0;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
border-radius: 10px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// replaces .grid
|
// replaces .grid
|
||||||
|
@ -54,14 +60,15 @@ const CardStyleWrap = styled.div`
|
||||||
// replaces .card & .contentcard
|
// replaces .card & .contentcard
|
||||||
export const PageCard = styled.div`
|
export const PageCard = styled.div`
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
padding: 1.5rem 0.7rem 1.5rem 0.7rem;
|
padding: 23px 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: ${({ theme }) => theme.colors.primary};
|
color: ${({ theme }) => theme.colors.primary};
|
||||||
|
background-color: ${({ theme }) => theme.colors.background};
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border: 1px solid;
|
border: 2px solid;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
border-color: ${({ theme }) => theme.colors.primary};
|
border-color: ${({ theme }) => theme.colors.primary};
|
||||||
transition: color 0.15s ease, border-color 0.15s ease;
|
transition: all 0.1s linear;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -82,11 +89,15 @@ export const PageCard = styled.div`
|
||||||
${CardStyleWrap}:focus,${CardStyleWrap}:active,${CardStyleWrap}:hover & {
|
${CardStyleWrap}:focus,${CardStyleWrap}:active,${CardStyleWrap}:hover & {
|
||||||
color: ${({ theme }) => theme.colors.secondary};
|
color: ${({ theme }) => theme.colors.secondary};
|
||||||
border-color: ${({ theme }) => theme.colors.secondary};
|
border-color: ${({ theme }) => theme.colors.secondary};
|
||||||
|
background-color: ${({ theme }) => theme.invertButtons ?
|
||||||
|
theme.colors.backgroundAlt ? theme.colors.backgroundAlt : theme.colors.background : theme.colors.background};
|
||||||
}
|
}
|
||||||
|
|
||||||
${CardLink}:focus,${CardLink}:active,${CardLink}:hover & {
|
${CardLink}:focus,${CardLink}:active,${CardLink}:hover & {
|
||||||
color: ${({ theme }) => theme.colors.secondary};
|
color: ${({ theme }) => theme.colors.secondary};
|
||||||
border-color: ${({ theme }) => theme.colors.secondary};
|
border-color: ${({ theme }) => theme.colors.secondary};
|
||||||
|
background-color: ${({ theme }) => theme.invertButtons ?
|
||||||
|
theme.colors.backgroundAlt ? theme.colors.backgroundAlt : theme.colors.background : theme.colors.background};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -110,7 +121,6 @@ const OnlineStatus = styled.p<OnlinePropType>`
|
||||||
return ret;
|
return ret;
|
||||||
}};
|
}};
|
||||||
padding: 0.2rem;
|
padding: 0.2rem;
|
||||||
background-color: ${({ theme }) => theme.colors.background};
|
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
border-color: ${({ theme }) => theme.colors.primary};
|
border-color: ${({ theme }) => theme.colors.primary};
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
@ -119,13 +129,25 @@ const OnlineStatus = styled.p<OnlinePropType>`
|
||||||
top: 100; right: 50; bottom: 0; left: 50;
|
top: 100; right: 50; bottom: 0; left: 50;
|
||||||
offset-position: bottom 10px;
|
offset-position: bottom 10px;
|
||||||
transition: color 0.15s ease, border-color 0.15s ease;
|
transition: color 0.15s ease, border-color 0.15s ease;
|
||||||
|
background-color: ${({ theme }) => theme.colors.background};
|
||||||
|
background-image: ${({ theme }) => theme.backgroundImage ?
|
||||||
|
"linear-gradient("
|
||||||
|
+ theme.colors.background + "," + theme.colors.background +
|
||||||
|
"), url(" + theme.backgroundImage + ")" : ""};
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-attachment: fixed;
|
||||||
|
background-size: cover;
|
||||||
|
|
||||||
${CardStyleWrap}:focus,${CardStyleWrap}:active,${CardStyleWrap}:hover & {
|
${CardStyleWrap}:focus,${CardStyleWrap}:active,${CardStyleWrap}:hover & {
|
||||||
border-color: ${({ theme }) => theme.colors.secondary};
|
border-color: ${({ theme }) => theme.colors.secondary};
|
||||||
|
background-color: ${({ theme }) => theme.invertButtons ?
|
||||||
|
theme.colors.backgroundAlt ? theme.colors.backgroundAlt : theme.colors.background : theme.colors.background};
|
||||||
}
|
}
|
||||||
|
|
||||||
${CardLink}:focus,${CardLink}:active,${CardLink}:hover & {
|
${CardLink}:focus,${CardLink}:active,${CardLink}:hover & {
|
||||||
border-color: ${({ theme }) => theme.colors.secondary};
|
border-color: ${({ theme }) => theme.colors.secondary};
|
||||||
|
background-color: ${({ theme }) => theme.invertButtons ?
|
||||||
|
theme.colors.backgroundAlt ? theme.colors.backgroundAlt : theme.colors.background : theme.colors.background};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -136,16 +158,16 @@ const CardContentWarning = styled.p`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// replaces .contentIcon
|
// replaces .contentIcon
|
||||||
const CardContentTitleIcon = styled.div`
|
const CardContentTitleIcon = styled(Image)`
|
||||||
object-fit: "contain";
|
object-fit: "contain";
|
||||||
margin-right: 0.4rem;
|
margin-right: 8px;
|
||||||
position: relative;
|
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
height: 1.5rem;
|
height: 28px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// replaces .contentTitle
|
// replaces .contentTitle
|
||||||
const CardContentTitleWrap = styled.div`
|
const CardContentTitleWrap = styled.div`
|
||||||
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
@ -163,9 +185,7 @@ const CardContentTitle = ({ content }: { content: Service | Game }) => {
|
||||||
<CardContentTitleWrap>
|
<CardContentTitleWrap>
|
||||||
{
|
{
|
||||||
content.icon ? (
|
content.icon ? (
|
||||||
<CardContentTitleIcon>
|
<CardContentTitleIcon alt="icon" src={content.icon} width="28" height="28" sizes='10vw'/>
|
||||||
<Image alt="icon" src={content.icon} fill sizes='10vw'></Image>
|
|
||||||
</CardContentTitleIcon>
|
|
||||||
) : (<></>)
|
) : (<></>)
|
||||||
}
|
}
|
||||||
<h2>{content.name}</h2>
|
<h2>{content.name}</h2>
|
||||||
|
|
|
@ -10,6 +10,10 @@ export const StyledBody = styled.body`
|
||||||
export const Page = styled.div`
|
export const Page = styled.div`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: ${({ theme }) => theme.colors.background};
|
background-color: ${({ theme }) => theme.colors.background};
|
||||||
|
background-image: ${({ theme }) => theme.backgroundImage ? "url(" + theme.backgroundImage + ")" : ""};
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-attachment: fixed;
|
||||||
|
background-size: cover;
|
||||||
`
|
`
|
||||||
|
|
||||||
export const Main = styled.main`
|
export const Main = styled.main`
|
||||||
|
|
|
@ -24,18 +24,33 @@ export const NavBar = styled.nav`
|
||||||
`
|
`
|
||||||
|
|
||||||
export const NavLink = styled(Link) <ActivePropType>`
|
export const NavLink = styled(Link) <ActivePropType>`
|
||||||
color: ${props => props.active ? ({ theme }) => theme.colors.secondary : ({ theme }) => theme.colors.primary};
|
color: ${props => props.active ?
|
||||||
|
({ theme }) => theme.invertButtons ?
|
||||||
|
theme.colors.text ? theme.colors.text : theme.colors.secondary : theme.colors.secondary :
|
||||||
|
({ theme }) => theme.colors.primary};
|
||||||
|
|
||||||
|
background-color: ${props => props.active ?
|
||||||
|
({ theme }) => theme.invertButtons ?
|
||||||
|
theme.colors.secondary : theme.colors.background :
|
||||||
|
({ theme }) => theme.colors.background};
|
||||||
|
|
||||||
|
padding: 2px 6px;
|
||||||
|
border: 2px solid;
|
||||||
|
|
||||||
margin: 0.2rem;
|
margin: 0.2rem;
|
||||||
border: 1px solid;
|
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 0.2rem 0.5rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
transition: color 0.15s ease, border-color 0.15s ease;
|
transition: all 0.1s ease;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: ${({ theme }) => theme.colors.secondary};
|
color: ${({ theme }) => theme.invertButtons ?
|
||||||
}
|
theme.colors.text ? theme.colors.text : theme.colors.primary :
|
||||||
|
theme.colors.secondary};
|
||||||
|
|
||||||
|
background-color: ${({ theme }) => theme.invertButtons ?
|
||||||
|
theme.colors.secondary :
|
||||||
|
theme.colors.background};
|
||||||
|
}
|
||||||
`
|
`
|
|
@ -1,6 +1,7 @@
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
interface DisplayPropType {
|
interface DisplayPropType {
|
||||||
|
focus?: number,
|
||||||
show?: number;
|
show?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,20 +19,30 @@ export const ThemeDropDown = styled.div`
|
||||||
|
|
||||||
export const ThemeDropDownButton = styled.button<DisplayPropType>`
|
export const ThemeDropDownButton = styled.button<DisplayPropType>`
|
||||||
width: 160px;
|
width: 160px;
|
||||||
border: 1px solid;
|
border: 2px solid;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background-color: ${({ theme }) => theme.colors.background};
|
background-color: ${props => props.focus ?
|
||||||
padding: 0.2rem 0.5rem;
|
({ theme }) => theme.invertButtons ? theme.colors.secondary : theme.colors.background :
|
||||||
|
({ theme }) => theme.colors.background};
|
||||||
|
padding: 2px 6px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: ${({ theme }) => theme.colors.primary};
|
color: ${props => props.focus ? ({ theme }) => theme.invertButtons ?
|
||||||
|
theme.colors.text ? theme.colors.text : theme.colors.primary : theme.colors.secondary :
|
||||||
|
({ theme }) => theme.colors.primary};
|
||||||
|
|
||||||
transition-property: color, border-bottom-left-radius, border-bottom-right-radius;
|
transition-property: color, border-bottom-left-radius, border-bottom-right-radius, background;
|
||||||
transition-timing-function: ease;
|
transition-timing-function: ease;
|
||||||
transition-duration: 0.15s;
|
transition-duration: 0.15s;
|
||||||
transition-delay: 0s, ${ props => props.show ? "0s, 0s" : "0.6s, 0.6s" };
|
transition-delay: 0s, ${ props => props.show ? "0s, 0s" : "0.6s, 0.6s" }, 0s;
|
||||||
|
|
||||||
&:focus,:hover {
|
&:focus,:hover {
|
||||||
color: ${({ theme }) => theme.colors.secondary};
|
color: ${({ theme }) => theme.invertButtons ?
|
||||||
|
theme.colors.text ? theme.colors.text : theme.colors.primary :
|
||||||
|
theme.colors.secondary};
|
||||||
|
|
||||||
|
background-color: ${({ theme }) => theme.invertButtons ?
|
||||||
|
theme.colors.secondary :
|
||||||
|
theme.colors.background};
|
||||||
}
|
}
|
||||||
|
|
||||||
border-bottom-left-radius: ${ props => props.show ? "0" : "" };
|
border-bottom-left-radius: ${ props => props.show ? "0" : "" };
|
||||||
|
@ -41,7 +52,16 @@ export const ThemeDropDownButton = styled.button<DisplayPropType>`
|
||||||
export const ThemeDropDownOptions = styled.div<DisplayPropType>`
|
export const ThemeDropDownOptions = styled.div<DisplayPropType>`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
color: ${({ theme }) => theme.colors.primary};
|
color: ${({ theme }) => theme.colors.primary};
|
||||||
|
|
||||||
background-color: ${({ theme }) => theme.colors.background};
|
background-color: ${({ theme }) => theme.colors.background};
|
||||||
|
background-image: ${({ theme }) => theme.backgroundImage ?
|
||||||
|
"linear-gradient("
|
||||||
|
+ theme.colors.background + "," + theme.colors.background +
|
||||||
|
"), url(" + theme.backgroundImage + ")" : ""};
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-attachment: fixed;
|
||||||
|
background-size: cover;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-width: 160px;
|
min-width: 160px;
|
||||||
|
@ -62,7 +82,7 @@ export const ThemeDropDownOptions = styled.div<DisplayPropType>`
|
||||||
|
|
||||||
export const ThemeDropDownOption = styled.button<ActivePropType>`
|
export const ThemeDropDownOption = styled.button<ActivePropType>`
|
||||||
color: ${ props => props.active ? ({ theme }) => theme.colors.secondary : ({ theme }) => theme.colors.primary };
|
color: ${ props => props.active ? ({ theme }) => theme.colors.secondary : ({ theme }) => theme.colors.primary };
|
||||||
background-color: ${({ theme }) => theme.colors.background};
|
background-color: transparent;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
border: 0px solid;
|
border: 0px solid;
|
||||||
|
|
Loading…
Reference in a new issue