提交 fb2ba137 authored 作者: 王绍森's avatar 王绍森

修改css单位

上级 edcddbdd
{ {
"name": "zunyi", "name": "zunyi",
"version": "0.1.0", "version": "0.1.0",
"homepage": "/shifei",
"private": true, "private": true,
"dependencies": { "dependencies": {
"react": "^16.9.0", "react": "^16.9.0",
......
...@@ -29,44 +29,45 @@ import FertilizeEarlySelectCornLifetime from './pages/FertilizeEarly/Corn/lifeti ...@@ -29,44 +29,45 @@ import FertilizeEarlySelectCornLifetime from './pages/FertilizeEarly/Corn/lifeti
import FertilizeConcentrated from './pages/FertilizeConcentrated'; import FertilizeConcentrated from './pages/FertilizeConcentrated';
import FertilizeControl from './pages/FertilizeControl'; import FertilizeControl from './pages/FertilizeControl';
const baseUrl = process.env.PUBLIC_URL;
function App() { function App() {
return ( return (
<Router> <Router>
<Switch> <Switch>
<Route exact path="/" component={Home} /> <Route exact path={baseUrl + "/"} component={Home} />
<Route exact path="/sub-home" component={SubHome} /> <Route exact path={baseUrl + "/sub-home"} component={SubHome} />
<Route exact path="/sub-home/fertilize-by-ground" component={FertilizeByGround} /> <Route exact path={baseUrl + "/sub-home/fertilize-by-ground"} component={FertilizeByGround} />
<Route exact path="/sub-home/fertilize-by-ground/acid" component={FertilizeByAcidGround} /> <Route exact path={baseUrl + "/sub-home/fertilize-by-ground/acid"} component={FertilizeByAcidGround} />
<Route exact path="/sub-home/fertilize-by-ground/acid/add-organic" component={FertilizeByAcidGroundAddOrganic} /> <Route exact path={baseUrl + "/sub-home/fertilize-by-ground/acid/add-organic"} component={FertilizeByAcidGroundAddOrganic} />
<Route exact path="/sub-home/fertilize-by-ground/acid/add-organic/humanity" component={FertilizeHumanity} /> <Route exact path={baseUrl + "/sub-home/fertilize-by-ground/acid/add-organic/humanity"} component={FertilizeHumanity} />
<Route exact path="/sub-home/fertilize-by-ground/acid/add-organic/stable" component={FertilizeStable} /> <Route exact path={baseUrl + "/sub-home/fertilize-by-ground/acid/add-organic/stable"} component={FertilizeStable} />
<Route exact path="/sub-home/fertilize-by-ground/acid/add-organic/straw" component={FertilizeStraw} /> <Route exact path={baseUrl + "/sub-home/fertilize-by-ground/acid/add-organic/straw"} component={FertilizeStraw} />
<Route exact path="/sub-home/fertilize-by-ground/acid/add-organic/green" component={FertilizeGreen} /> <Route exact path={baseUrl + "/sub-home/fertilize-by-ground/acid/add-organic/green"} component={FertilizeGreen} />
<Route exact path="/sub-home/fertilize-by-ground/acid/add-alkaline" component={FertilizeByAcidGroundAddAlkaline} /> <Route exact path={baseUrl + "/sub-home/fertilize-by-ground/acid/add-alkaline"} component={FertilizeByAcidGroundAddAlkaline} />
<Route exact path="/sub-home/fertilize-by-ground/alkaline" component={FertilizeByAlkalineGround} /> <Route exact path={baseUrl + "/sub-home/fertilize-by-ground/alkaline"} component={FertilizeByAlkalineGround} />
<Route exact <Route exact
path="/sub-home/fertilize-by-ground/alkaline/add-organic" path={baseUrl + "/sub-home/fertilize-by-ground/alkaline/add-organic"}
render={ () => <Redirect to="/sub-home/fertilize-by-ground/acid/add-organic" /> } render={ () => <Redirect to={baseUrl + "/sub-home/fertilize-by-ground/acid/add-organic"} /> }
/> />
<Route exact path="/sub-home/fertilize-by-ground/alkaline/add-acid" component={FertilizeByAlkalineGroundAddAcid} /> <Route exact path={baseUrl + "/sub-home/fertilize-by-ground/alkaline/add-acid"} component={FertilizeByAlkalineGroundAddAcid} />
<Route exact path="/sub-home/fertilize-early" component={FertilizeEarly} /> <Route exact path={baseUrl + "/sub-home/fertilize-early"} component={FertilizeEarly} />
<Route exact path="/sub-home/fertilize-early/select" component={FertilizeEarlySelect} /> <Route exact path={baseUrl + "/sub-home/fertilize-early/select"} component={FertilizeEarlySelect} />
<Route exact path="/sub-home/fertilize-early/select/wheat" component={FertilizeEarlySelectWheat} /> <Route exact path={baseUrl + "/sub-home/fertilize-early/select/wheat"} component={FertilizeEarlySelectWheat} />
<Route exact path="/sub-home/fertilize-early/select/rape" component={FertilizeEarlySelectRape} /> <Route exact path={baseUrl + "/sub-home/fertilize-early/select/rape"} component={FertilizeEarlySelectRape} />
<Route exact path="/sub-home/fertilize-early/select/corn" component={FertilizeEarlySelectCorn} /> <Route exact path={baseUrl + "/sub-home/fertilize-early/select/corn"} component={FertilizeEarlySelectCorn} />
<Route exact path="/sub-home/fertilize-early/select/wheat/lifetime" component={FertilizeEarlySelectWheatLifetime} /> <Route exact path={baseUrl + "/sub-home/fertilize-early/select/wheat/lifetime"} component={FertilizeEarlySelectWheatLifetime} />
<Route exact path="/sub-home/fertilize-early/select/wheat/lifetime/seedling" component={FertilizeEarlySelectWheatSeedling} /> <Route exact path={baseUrl + "/sub-home/fertilize-early/select/wheat/lifetime/seedling"} component={FertilizeEarlySelectWheatSeedling} />
<Route exact path="/sub-home/fertilize-early/select/rape/lifetime" component={FertilizeEarlySelectrapeLifetime} /> <Route exact path={baseUrl + "/sub-home/fertilize-early/select/rape/lifetime"} component={FertilizeEarlySelectrapeLifetime} />
<Route exact path="/sub-home/fertilize-early/select/corn/lifetime" component={FertilizeEarlySelectCornLifetime} /> <Route exact path={baseUrl + "/sub-home/fertilize-early/select/corn/lifetime"} component={FertilizeEarlySelectCornLifetime} />
<Route exact path="/sub-home/fertilize-concentrated" component={FertilizeConcentrated} /> <Route exact path={baseUrl + "/sub-home/fertilize-concentrated"} component={FertilizeConcentrated} />
<Route exact path="/sub-home/fertilize-control" component={FertilizeControl} /> <Route exact path={baseUrl + "/sub-home/fertilize-control"} component={FertilizeControl} />
</Switch> </Switch>
</Router> </Router>
); );
......
...@@ -14,15 +14,16 @@ import GLSGActiveBg from '../../../../磷肥施用技术切图/按下状态/画 ...@@ -14,15 +14,16 @@ import GLSGActiveBg from '../../../../磷肥施用技术切图/按下状态/画
import GMLActiveBg from '../../../../磷肥施用技术切图/按下状态/画面a-3-按下-assets/钙镁磷肥.png'; import GMLActiveBg from '../../../../磷肥施用技术切图/按下状态/画面a-3-按下-assets/钙镁磷肥.png';
import CMHActiveBg from '../../../../磷肥施用技术切图/按下状态/画面a-3-按下-assets/草木灰.png'; import CMHActiveBg from '../../../../磷肥施用技术切图/按下状态/画面a-3-按下-assets/草木灰.png';
import { BackBtn, HomeBtn } from '../../../SubHome'; import { BackBtn, HomeBtn } from '../../../SubHome';
import { convertpx2vw } from '../../../../config';
const PositionedContainer = styled.div` const PositionedContainer = styled.div`
margin: 102px auto 0; margin: ${`convertpx2vw(102) auto 0`};
background-image: url(${ContainerBg}); background-image: url(${ContainerBg});
background-size: contain; background-size: contain;
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: center; background-position: center;
height: 796px; height: ${convertpx2vw(796)};
width: 633px; width: ${convertpx2vw(633)};
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -31,8 +32,8 @@ const PositionedContainer = styled.div` ...@@ -31,8 +32,8 @@ const PositionedContainer = styled.div`
`; `;
const StyledBtn = styled.a` const StyledBtn = styled.a`
display: block; display: block;
width: 589px; width: ${convertpx2vw(589)};
height: 107px; height: ${convertpx2vw(107)};
cursor: pointer; cursor: pointer;
position: relative; position: relative;
background-image: ${props => `url(${props.src})`}; background-image: ${props => `url(${props.src})`};
...@@ -42,15 +43,21 @@ const StyledBtn = styled.a` ...@@ -42,15 +43,21 @@ const StyledBtn = styled.a`
&:active { &:active {
background-image: ${props => `url(${props.activeSrc})`}; background-image: ${props => `url(${props.activeSrc})`};
} }
&:first-child {
margin-top: ${convertpx2vw(200)};
}
&:not(:first-child) {
margin-top: ${convertpx2vw(40)};
}
`; `;
const StyledCheckImg = styled.img` const StyledCheckImg = styled.img`
display: block; display: block;
width: 50px; width: ${convertpx2vw(50)};
height: 50px; height: ${convertpx2vw(50)};;
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
right: 88px; right: ${convertpx2vw(88)};
visibility: ${props => props.show ? 'visible' : 'hidden'}; visibility: ${props => props.show ? 'visible' : 'hidden'};
user-select: none; user-select: none;
`; `;
...@@ -65,16 +72,16 @@ export default function AddAlkaline () { ...@@ -65,16 +72,16 @@ export default function AddAlkaline () {
return ( return (
<GroundBg> <GroundBg>
<PositionedContainer> <PositionedContainer>
<StyledBtn src={LABg} activeSrc={LAActiveBg} style={{marginTop: '200px'}} onClick={() => setLAShow(true)}> <StyledBtn src={LABg} activeSrc={LAActiveBg} onClick={() => setLAShow(true)}>
<StyledCheckImg src={WrongBg} alt="wong" show={LAShow}/> <StyledCheckImg src={WrongBg} alt="wong" show={LAShow}/>
</StyledBtn> </StyledBtn>
<StyledBtn src={GLSGBg} activeSrc={GLSGActiveBg} style={{marginTop: '40px'}} onClick={() => setGLSGShow(true)}> <StyledBtn src={GLSGBg} activeSrc={GLSGActiveBg} onClick={() => setGLSGShow(true)}>
<StyledCheckImg src={WrongBg} alt="wong" show={GLSGShow}/> <StyledCheckImg src={WrongBg} alt="wong" show={GLSGShow}/>
</StyledBtn> </StyledBtn>
<StyledBtn src={GMLBg} activeSrc={GMLActiveBg} style={{marginTop: '40px'}} onClick={() => setGMShow(true)}> <StyledBtn src={GMLBg} activeSrc={GMLActiveBg} onClick={() => setGMShow(true)}>
<StyledCheckImg src={CorrectBg} alt="correct" show={GMShow}/> <StyledCheckImg src={CorrectBg} alt="correct" show={GMShow}/>
</StyledBtn> </StyledBtn>
<StyledBtn src={CMHBg} activeSrc={CMHActiveBg} style={{marginTop: '40px'}} onClick={() => setCMHShow(true)}> <StyledBtn src={CMHBg} activeSrc={CMHActiveBg} onClick={() => setCMHShow(true)}>
<StyledCheckImg src={CorrectBg} alt="correct" show={CMHShow}/> <StyledCheckImg src={CorrectBg} alt="correct" show={CMHShow}/>
</StyledBtn> </StyledBtn>
</PositionedContainer> </PositionedContainer>
......
...@@ -2,11 +2,12 @@ import styled from 'styled-components'; ...@@ -2,11 +2,12 @@ import styled from 'styled-components';
import bg from '../../../磷肥施用技术切图/默认状态/画面a-1-assets/施用碱性肥料.png'; import bg from '../../../磷肥施用技术切图/默认状态/画面a-1-assets/施用碱性肥料.png';
import bgActive from '../../../磷肥施用技术切图/按下状态/画面a-1-按下-assets/施用碱性肥料.png'; import bgActive from '../../../磷肥施用技术切图/按下状态/画面a-1-按下-assets/施用碱性肥料.png';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { convertpx2vw } from '../../../config';
const Btn = styled(Link)` const Btn = styled(Link)`
display: block; display: block;
width: 444px; width: ${convertpx2vw(444)};
height: 108px; height: ${convertpx2vw(108)};
background-image: url(${bg}); background-image: url(${bg});
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
......
...@@ -12,13 +12,16 @@ import JKWDImg from '../../../../磷肥施用技术切图/默认状态/画面a-2 ...@@ -12,13 +12,16 @@ import JKWDImg from '../../../../磷肥施用技术切图/默认状态/画面a-2
import YCImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-4绿肥-assets/油菜.png'; import YCImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-4绿肥-assets/油菜.png';
import QMImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-4绿肥-assets/荞麦.png'; import QMImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-4绿肥-assets/荞麦.png';
import LPImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-4绿肥-assets/绿萍.png'; import LPImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-4绿肥-assets/绿萍.png';
import { convertpx2vw } from '../../../../config';
import { BackBtn, HomeBtn } from '../../../SubHome'; import { BackBtn, HomeBtn } from '../../../SubHome';
const StyledImg = styled.img` const StyledImg = styled.img`
display: inline-block; display: inline-block;
width: 246px; width: ${convertpx2vw(246)};
height: 363px; height: ${convertpx2vw(363)};
:not(:last-child) {
margin-right: ${convertpx2vw(36)};
}
`; `;
const StyledWheatBg = styled(WheatBg)` const StyledWheatBg = styled(WheatBg)`
flex-direction: column; flex-direction: column;
...@@ -35,17 +38,17 @@ export default function Straw() { ...@@ -35,17 +38,17 @@ export default function Straw() {
return ( return (
<StyledWheatBg> <StyledWheatBg>
<Row> <Row>
<StyledImg src={ZYYImg} alt="紫云英" style={{marginRight: '36px' }} /> <StyledImg src={ZYYImg} alt="紫云英" />
<StyledImg src={CMXImg} alt="草木樨" style={{marginRight: '36px' }} /> <StyledImg src={CMXImg} alt="草木樨" />
<StyledImg src={ZHMXImg} alt="紫花苜蓿" style={{marginRight: '36px' }} /> <StyledImg src={ZHMXImg} alt="紫花苜蓿" />
<StyledImg src={GZYHSZImg} alt="光叶紫花苕子" style={{marginRight: '36px' }} /> <StyledImg src={GZYHSZImg} alt="光叶紫花苕子" />
<StyledImg src={TJImg} alt="田菁" /> <StyledImg src={TJImg} alt="田菁" />
</Row> </Row>
<Row> <Row>
<StyledImg src={JImg} alt="箭筈豌豆" style={{marginRight: '36px'}} /> <StyledImg src={JImg} alt="箭筈豌豆" />
<StyledImg src={JKWDImg} alt="蚕豆" style={{marginRight: '36px'}} /> <StyledImg src={JKWDImg} alt="蚕豆" />
<StyledImg src={YCImg} alt="油菜" style={{marginRight: '36px'}} /> <StyledImg src={YCImg} alt="油菜" />
<StyledImg src={QMImg} alt="荞麦" style={{marginRight: '36px'}} /> <StyledImg src={QMImg} alt="荞麦" />
<StyledImg src={LPImg} alt="绿萍" /> <StyledImg src={LPImg} alt="绿萍" />
</Row> </Row>
<BackBtn /> <BackBtn />
......
...@@ -4,17 +4,21 @@ import WheatBg from '../../../WheatBg'; ...@@ -4,17 +4,21 @@ import WheatBg from '../../../WheatBg';
import HumanityImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-1人畜粪尿肥-assets/人粪尿肥.png'; import HumanityImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-1人畜粪尿肥-assets/人粪尿肥.png';
import AnimalImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-1人畜粪尿肥-assets/家畜粪尿肥.png'; import AnimalImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-1人畜粪尿肥-assets/家畜粪尿肥.png';
import { BackBtn, HomeBtn } from '../../../SubHome'; import { BackBtn, HomeBtn } from '../../../SubHome';
import { convertpx2vw } from '../../../../config';
const StyledImg = styled.img` const StyledImg = styled.img`
display: block; display: block;
width: 702px; width: ${convertpx2vw(702)};
height: 552px; height: ${convertpx2vw(552)};
:first-child {
margin-right: ${convertpx2vw(80)};
}
`; `;
export default function Humanity() { export default function Humanity() {
return ( return (
<WheatBg> <WheatBg>
<StyledImg src={HumanityImg} alt="人粪尿肥" style={{marginRight: '80px'}}/> <StyledImg src={HumanityImg} alt="人粪尿肥" />
<StyledImg src={AnimalImg} alt="家畜粪尿肥" /> <StyledImg src={AnimalImg} alt="家畜粪尿肥" />
<BackBtn /> <BackBtn />
<HomeBtn /> <HomeBtn />
......
...@@ -5,18 +5,19 @@ import HeapImg from '../../../../磷肥施用技术切图/默认状态/画面a-2 ...@@ -5,18 +5,19 @@ import HeapImg from '../../../../磷肥施用技术切图/默认状态/画面a-2
import SteepImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-3秸秆肥-assets/沤肥.png'; import SteepImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-3秸秆肥-assets/沤肥.png';
import BiogasImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-3秸秆肥-assets/沼气池肥.png'; import BiogasImg from '../../../../磷肥施用技术切图/默认状态/画面a-2-3秸秆肥-assets/沼气池肥.png';
import { BackBtn, HomeBtn } from '../../../SubHome'; import { BackBtn, HomeBtn } from '../../../SubHome';
import { convertpx2vw } from '../../../../config';
const StyledImg = styled.img` const StyledImg = styled.img`
display: block; display: block;
width: 490px; width: ${convertpx2vw(490)};
height: 391px; height: ${convertpx2vw(391)};
`; `;
export default function Straw() { export default function Straw() {
return ( return (
<WheatBg> <WheatBg>
<StyledImg src={HeapImg} alt="堆肥" style={{marginRight: '20px'}}/> <StyledImg src={HeapImg} alt="堆肥" style={{marginRight: convertpx2vw(20) }}/>
<StyledImg src={SteepImg} alt="沤肥" style={{marginRight: '20px'}}/> <StyledImg src={SteepImg} alt="沤肥" style={{marginRight: convertpx2vw(20) }}/>
<StyledImg src={BiogasImg} alt="沼气池肥" /> <StyledImg src={BiogasImg} alt="沼气池肥" />
<BackBtn /> <BackBtn />
<HomeBtn /> <HomeBtn />
......
...@@ -14,15 +14,16 @@ import StrawBgActive from '../../../../磷肥施用技术切图/按下状态/画 ...@@ -14,15 +14,16 @@ import StrawBgActive from '../../../../磷肥施用技术切图/按下状态/画
import GreenBgActive from '../../../../磷肥施用技术切图/按下状态/画面a-2-按下-assets/绿肥.png'; import GreenBgActive from '../../../../磷肥施用技术切图/按下状态/画面a-2-按下-assets/绿肥.png';
import { BackBtn, HomeBtn } from '../../../SubHome'; import { BackBtn, HomeBtn } from '../../../SubHome';
import { convertpx2vw } from '../../../../config';
const PositionedContainer = styled.div` const PositionedContainer = styled.div`
margin: 102px auto 0; margin: ${`${convertpx2vw(102)} auto 0`};
background-image: url(${ContainerBg}); background-image: url(${ContainerBg});
background-size: contain; background-size: contain;
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: center; background-position: center;
height: 796px; height: ${convertpx2vw(796)};
width: 633px; width: ${convertpx2vw(633)};
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -32,36 +33,39 @@ const PositionedContainer = styled.div` ...@@ -32,36 +33,39 @@ const PositionedContainer = styled.div`
const StyledBtn = styled(Link)` const StyledBtn = styled(Link)`
background-size: contain; background-size: contain;
background-repeat: repeat-x; background-repeat: no-repeat;
background-position: center; background-position: center;
height: 107px; height: ${convertpx2vw(107)};
width: 590px; width: ${convertpx2vw(590)};
&:first-child {
margin-top: ${convertpx2vw(190)};
}
&:not(:first-child) {
margin-top: ${convertpx2vw(40)};
}
`; `;
const HumanityBtn = styled(StyledBtn)` const HumanityBtn = styled(StyledBtn)`
background-image: url(${HumanityBg}); background-image: url(${HumanityBg});
margin-top: 190px;
&:active { &:active {
background-image: url(${HumanityBgActive}); background-image: url(${HumanityBgActive});
} }
`; `;
const StableBtn = styled(StyledBtn)` const StableBtn = styled(StyledBtn)`
background-image: url(${StableBg}); background-image: url(${StableBg});
margin-top: 40px;
&:active { &:active {
background-image: url(${StableBgActive}); background-image: url(${StableBgActive});
} }
`; `;
const StrawBtn = styled(StyledBtn)` const StrawBtn = styled(StyledBtn)`
background-image: url(${StrawBg}); background-image: url(${StrawBg});
margin-top: 40px;
&:active { &:active {
background-image: url(${StrawBgActive}); background-image: url(${StrawBgActive});
} }
`; `;
const GreenBtn = styled(StyledBtn)` const GreenBtn = styled(StyledBtn)`
background-image: url(${GreenBg}); background-image: url(${GreenBg});
margin-top: 40px;
&:active { &:active {
background-image: url(${GreenBgActive}); background-image: url(${GreenBgActive});
} }
......
...@@ -2,11 +2,12 @@ import styled from 'styled-components'; ...@@ -2,11 +2,12 @@ import styled from 'styled-components';
import bg from '../../../磷肥施用技术切图/默认状态/画面a-1-assets/增施有机肥.png'; import bg from '../../../磷肥施用技术切图/默认状态/画面a-1-assets/增施有机肥.png';
import bgActive from '../../../磷肥施用技术切图/按下状态/画面a-1-按下-assets/增施有机肥.png'; import bgActive from '../../../磷肥施用技术切图/按下状态/画面a-1-按下-assets/增施有机肥.png';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { convertpx2vw } from '../../../config';
const Btn = styled(Link)` const Btn = styled(Link)`
display: block; display: block;
width: 444px; width: ${convertpx2vw(444)};
height: 108px; height: ${convertpx2vw(108)};
background-image: url(${bg}); background-image: url(${bg});
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
......
...@@ -4,9 +4,10 @@ import AddOrganicBtn from './AddOrganicBtn'; ...@@ -4,9 +4,10 @@ import AddOrganicBtn from './AddOrganicBtn';
import AddAlkalineBtn from './AddAlkalineBtn'; import AddAlkalineBtn from './AddAlkalineBtn';
import styled from 'styled-components'; import styled from 'styled-components';
import { BackBtn, HomeBtn } from '../../SubHome'; import { BackBtn, HomeBtn } from '../../SubHome';
import { convertpx2vw } from '../../../config';
const PositionedAddOrganicBtn = styled(AddOrganicBtn)` const PositionedAddOrganicBtn = styled(AddOrganicBtn)`
margin-right: 240px; margin-right: ${convertpx2vw(240)};
`; `;
export default function({ match }) { export default function({ match }) {
......
...@@ -14,15 +14,16 @@ import GLSGActiveBg from '../../../../磷肥施用技术切图/按下状态/画 ...@@ -14,15 +14,16 @@ import GLSGActiveBg from '../../../../磷肥施用技术切图/按下状态/画
import GMLActiveBg from '../../../../磷肥施用技术切图/按下状态/画面a-3-按下-assets/钙镁磷肥.png'; import GMLActiveBg from '../../../../磷肥施用技术切图/按下状态/画面a-3-按下-assets/钙镁磷肥.png';
import CMHActiveBg from '../../../../磷肥施用技术切图/按下状态/画面a-3-按下-assets/草木灰.png'; import CMHActiveBg from '../../../../磷肥施用技术切图/按下状态/画面a-3-按下-assets/草木灰.png';
import { BackBtn, HomeBtn } from '../../../SubHome'; import { BackBtn, HomeBtn } from '../../../SubHome';
import { convertpx2vw } from '../../../../config';
const PositionedContainer = styled.div` const PositionedContainer = styled.div`
margin: 102px auto 0; margin: ${`${convertpx2vw(102)} auto 0`};
background-image: url(${ContainerBg}); background-image: url(${ContainerBg});
background-size: contain; background-size: contain;
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: center; background-position: center;
height: 796px; height: ${convertpx2vw(796)};
width: 633px; width: ${convertpx2vw(633)};
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -31,8 +32,8 @@ const PositionedContainer = styled.div` ...@@ -31,8 +32,8 @@ const PositionedContainer = styled.div`
`; `;
const StyledBtn = styled.a` const StyledBtn = styled.a`
display: block; display: block;
width: 589px; width: ${convertpx2vw(589)};
height: 107px; height: ${convertpx2vw(107)};
cursor: pointer; cursor: pointer;
position: relative; position: relative;
background-image: ${props => `url(${props.src})`}; background-image: ${props => `url(${props.src})`};
...@@ -42,15 +43,21 @@ const StyledBtn = styled.a` ...@@ -42,15 +43,21 @@ const StyledBtn = styled.a`
&:active { &:active {
background-image: ${props => `url(${props.activeSrc})`}; background-image: ${props => `url(${props.activeSrc})`};
} }
&:first-child {
margin-top: ${convertpx2vw(200)};
}
&:not(:first-child) {
margin-top: ${convertpx2vw(40)};
}
`; `;
const StyledCheckImg = styled.img` const StyledCheckImg = styled.img`
display: block; display: block;
width: 50px; width: ${convertpx2vw(50)};
height: 50px; height: ${convertpx2vw(50)};
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
right: 88px; right: ${convertpx2vw(88)};
visibility: ${props => props.show ? 'visible' : 'hidden'}; visibility: ${props => props.show ? 'visible' : 'hidden'};
user-select: none; user-select: none;
`; `;
...@@ -65,16 +72,16 @@ export default function AddAcid () { ...@@ -65,16 +72,16 @@ export default function AddAcid () {
return ( return (
<GroundBg> <GroundBg>
<PositionedContainer> <PositionedContainer>
<StyledBtn src={LABg} activeSrc={LAActiveBg} style={{marginTop: '200px'}} onClick={() => setLAShow(true)}> <StyledBtn src={LABg} activeSrc={LAActiveBg} onClick={() => setLAShow(true)}>
<StyledCheckImg src={CorrectBg} alt="correct" show={LAShow}/> <StyledCheckImg src={CorrectBg} alt="correct" show={LAShow}/>
</StyledBtn> </StyledBtn>
<StyledBtn src={GLSGBg} activeSrc={GLSGActiveBg} style={{marginTop: '40px'}} onClick={() => setGLSGShow(true)}> <StyledBtn src={GLSGBg} activeSrc={GLSGActiveBg} onClick={() => setGLSGShow(true)}>
<StyledCheckImg src={CorrectBg} alt="correct" show={GLSGShow}/> <StyledCheckImg src={CorrectBg} alt="correct" show={GLSGShow}/>
</StyledBtn> </StyledBtn>
<StyledBtn src={GMLBg} activeSrc={GMLActiveBg} style={{marginTop: '40px'}} onClick={() => setGMShow(true)}> <StyledBtn src={GMLBg} activeSrc={GMLActiveBg} onClick={() => setGMShow(true)}>
<StyledCheckImg src={WrongBg} alt="wong" show={GMShow}/> <StyledCheckImg src={WrongBg} alt="wong" show={GMShow}/>
</StyledBtn> </StyledBtn>
<StyledBtn src={CMHBg} activeSrc={CMHActiveBg} style={{marginTop: '40px'}} onClick={() => setCMHShow(true)}> <StyledBtn src={CMHBg} activeSrc={CMHActiveBg} onClick={() => setCMHShow(true)}>
<StyledCheckImg src={WrongBg} alt="wong" show={CMHShow}/> <StyledCheckImg src={WrongBg} alt="wong" show={CMHShow}/>
</StyledBtn> </StyledBtn>
</PositionedContainer> </PositionedContainer>
......
...@@ -2,11 +2,12 @@ import styled from 'styled-components'; ...@@ -2,11 +2,12 @@ import styled from 'styled-components';
import bg from '../../../磷肥施用技术切图/默认状态/画面c-1-assets/施用酸性肥料.png'; import bg from '../../../磷肥施用技术切图/默认状态/画面c-1-assets/施用酸性肥料.png';
import bgActive from '../../../磷肥施用技术切图/按下状态/画面c-1-按下-assets/施用酸性肥料.png'; import bgActive from '../../../磷肥施用技术切图/按下状态/画面c-1-按下-assets/施用酸性肥料.png';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { convertpx2vw } from '../../../config';
const Btn = styled(Link)` const Btn = styled(Link)`
display: block; display: block;
width: 444px; width: ${convertpx2vw(444)};
height: 108px; height: ${convertpx2vw(108)};
background-image: url(${bg}); background-image: url(${bg});
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
......
...@@ -5,9 +5,10 @@ import AddOrganicBtn from '../Acid/AddOrganicBtn'; ...@@ -5,9 +5,10 @@ import AddOrganicBtn from '../Acid/AddOrganicBtn';
import AddAcidBtn from './AddAcidBtn' import AddAcidBtn from './AddAcidBtn'
import styled from 'styled-components'; import styled from 'styled-components';
import { BackBtn, HomeBtn } from '../../SubHome'; import { BackBtn, HomeBtn } from '../../SubHome';
import { convertpx2vw } from '../../../config';
const PositionedAddOrganicBtn = styled(AddOrganicBtn)` const PositionedAddOrganicBtn = styled(AddOrganicBtn)`
margin-right: 240px; margin-right: ${convertpx2vw(240)};
`; `;
export default function Alkaline({ match }) { export default function Alkaline({ match }) {
......
...@@ -10,6 +10,7 @@ import AcidVideoSrc from '../../动画/因土施肥/画面a酸性土壤.mp4'; ...@@ -10,6 +10,7 @@ import AcidVideoSrc from '../../动画/因土施肥/画面a酸性土壤.mp4';
import NeutralVideoSrc from '../../动画/因土施肥/画面b中性土壤.mp4'; import NeutralVideoSrc from '../../动画/因土施肥/画面b中性土壤.mp4';
import AlkalineVideoSrc from '../../动画/因土施肥/画面c石灰性土壤.mp4'; import AlkalineVideoSrc from '../../动画/因土施肥/画面c石灰性土壤.mp4';
import VideoDiy from '../Video'; import VideoDiy from '../Video';
import { convertpx2vw } from '../../config'
const Container = styled(WheatBg)` const Container = styled(WheatBg)`
display: flex; display: flex;
...@@ -17,23 +18,24 @@ const Container = styled(WheatBg)` ...@@ -17,23 +18,24 @@ const Container = styled(WheatBg)`
justify-content: flex-start; justify-content: flex-start;
`; `;
const PositionedFertilizeByGround = styled(FertilizeByGroundBtn)` const PositionedFertilizeByGround = styled(FertilizeByGroundBtn)`
margin: 120px auto 0; margin: ${`${convertpx2vw(120)} auto 0`};
`; `;
const GroundBtn = styled(Link)` const GroundBtn = styled(Link)`
display: block; display: block;
width: 300px; width: ${convertpx2vw(300)};
height: 90px; height: ${convertpx2vw(90)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
:not(:last-child) {
margin-right: ${convertpx2vw(120)};
}
`; `;
const AcidGroundBtn = styled(GroundBtn)` const AcidGroundBtn = styled(GroundBtn)`
background-image: url(${AcidGroundBg}); background-image: url(${AcidGroundBg});
margin-right: 120px;
`; `;
const NeutralGroundBtn = styled(GroundBtn)` const NeutralGroundBtn = styled(GroundBtn)`
background-image: url(${NeutralGroundBg}); background-image: url(${NeutralGroundBg});
margin-right: 120px;
`; `;
const AlkalineGroundBtn = styled(GroundBtn)` const AlkalineGroundBtn = styled(GroundBtn)`
background-image: url(${AlkalineGroundBg}); background-image: url(${AlkalineGroundBg});
...@@ -41,20 +43,7 @@ const AlkalineGroundBtn = styled(GroundBtn)` ...@@ -41,20 +43,7 @@ const AlkalineGroundBtn = styled(GroundBtn)`
const RowBtn = styled.div` const RowBtn = styled.div`
display: flex; display: flex;
margin-top: 120px; margin-top: ${convertpx2vw(120)};
`;
const VideoWrapper = styled.div`
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: black;
text-align: center;
visibility: ${props => props.show ? 'visible' : 'hidden'};
`;
const StyledVideo = styled.video`
height: 100%;
`; `;
const videoSrcs = { const videoSrcs = {
......
...@@ -31,9 +31,9 @@ const StyledWheatBg = styled(WheatBg)` ...@@ -31,9 +31,9 @@ const StyledWheatBg = styled(WheatBg)`
const StyledTitle = styled.img` const StyledTitle = styled.img`
flex-shrink: 0; flex-shrink: 0;
width: 256px; width: ${convertpx2vw(256)};
height: 256px; height: ${convertpx2vw(256)};
margin: 120px 0 80px; margin: ${`${convertpx2vw(120)} 0 ${convertpx2vw(80)}`};
`; `;
const StyledBtn = styled.button` const StyledBtn = styled.button`
background-color: transparent; background-color: transparent;
...@@ -54,7 +54,7 @@ const StyledBtn = styled.button` ...@@ -54,7 +54,7 @@ const StyledBtn = styled.button`
} }
`; `;
const Container = styled.div` const Container = styled.div`
padding: 0 110px; padding: ${`0 ${convertpx2vw(110)}`};
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
`; `;
......
...@@ -14,7 +14,7 @@ import FiftyBgActive from '../磷肥施用技术切图/按下状态/控制施用 ...@@ -14,7 +14,7 @@ import FiftyBgActive from '../磷肥施用技术切图/按下状态/控制施用
import TenVideoSrc from '../动画/控制施用量/(点击进入“10kg667m2 ”按钮后)出现画面.mp4'; import TenVideoSrc from '../动画/控制施用量/(点击进入“10kg667m2 ”按钮后)出现画面.mp4';
import TwentyVideoSrc from '../动画/控制施用量/(点击进入“20-30kg667m2”按钮后)出现画面.mp4'; import TwentyVideoSrc from '../动画/控制施用量/(点击进入“20-30kg667m2”按钮后)出现画面.mp4';
import FiftyVideoSrc from '../动画/控制施用量/(点击进入“大于30kg667m2”按钮后)出现画面.mp4'; import FiftyVideoSrc from '../动画/控制施用量/(点击进入“大于30kg667m2”按钮后)出现画面.mp4';
import { convertpx2vw } from '../config';
import Video from './Video'; import Video from './Video';
import { BackBtn, HomeBtn } from './SubHome'; import { BackBtn, HomeBtn } from './SubHome';
...@@ -25,9 +25,9 @@ const StyledWheatBg = styled(WheatBg)` ...@@ -25,9 +25,9 @@ const StyledWheatBg = styled(WheatBg)`
`; `;
const StyledTitle = styled.img` const StyledTitle = styled.img`
width: 256px; width: ${convertpx2vw(256)};
height: 256px; height: ${convertpx2vw(256)};
margin: 120px 0 80px; margin: ${`${convertpx2vw(120)} 0 ${convertpx2vw(80)}`};
`; `;
const StyledBtn = styled.button` const StyledBtn = styled.button`
background-color: transparent; background-color: transparent;
...@@ -36,8 +36,8 @@ const StyledBtn = styled.button` ...@@ -36,8 +36,8 @@ const StyledBtn = styled.button`
outline: none; outline: none;
} }
cursor: pointer; cursor: pointer;
width: 300px; width: ${convertpx2vw(300)};
height: 90px; height: ${convertpx2vw(90)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
...@@ -46,7 +46,7 @@ const StyledBtn = styled.button` ...@@ -46,7 +46,7 @@ const StyledBtn = styled.button`
background-image: ${props => `url(${props.activeBg})`}; background-image: ${props => `url(${props.activeBg})`};
} }
&:not(:first-child) { &:not(:first-child) {
margin-left: 120px; margin-left: ${convertpx2vw(120)};
} }
`; `;
const Container = styled.div` const Container = styled.div`
......
...@@ -5,11 +5,12 @@ import WheatBg from '../../WheatBg'; ...@@ -5,11 +5,12 @@ import WheatBg from '../../WheatBg';
import SelectBg from '../../../磷肥施用技术切图/默认状态/玉米01-assets/玉米生长周期.png'; import SelectBg from '../../../磷肥施用技术切图/默认状态/玉米01-assets/玉米生长周期.png';
import SelectBgActive from '../../../磷肥施用技术切图/按下状态/玉米01-按下-assets/玉米生长周期.png'; import SelectBgActive from '../../../磷肥施用技术切图/按下状态/玉米01-按下-assets/玉米生长周期.png';
import { BackBtn, HomeBtn } from '../../SubHome'; import { BackBtn, HomeBtn } from '../../SubHome';
import { convertpx2vw } from '../../../config';
const SelectBtn = styled(Link)` const SelectBtn = styled(Link)`
display: block; display: block;
width: 594px; width: ${convertpx2vw(594)};
height: 98px; height:${convertpx2vw(98)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
......
...@@ -22,12 +22,13 @@ import JointingVideoSrcs from '../../../动画/玉米/玉米拔节期.mp4' ...@@ -22,12 +22,13 @@ import JointingVideoSrcs from '../../../动画/玉米/玉米拔节期.mp4'
import HornVideoSrcs from '../../../动画/玉米/玉米大喇叭口期.mp4' import HornVideoSrcs from '../../../动画/玉米/玉米大喇叭口期.mp4'
import TasselVideoSrcs from '../../../动画/玉米/玉米抽穗期.mp4' import TasselVideoSrcs from '../../../动画/玉米/玉米抽穗期.mp4'
import MaturityVideoSrcs from '../../../动画/玉米/玉米成熟期.mp4' import MaturityVideoSrcs from '../../../动画/玉米/玉米成熟期.mp4'
import { convertpx2vw } from '../../../config';
const Container = styled.div` const Container = styled.div`
margin-top: 67px; margin-top: ${convertpx2vw(67)};
display: block; display: block;
width: 444px; width: ${convertpx2vw(444)};
height: 591px; height: ${convertpx2vw(591)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
...@@ -40,14 +41,14 @@ const Btn = styled.button` ...@@ -40,14 +41,14 @@ const Btn = styled.button`
&:focus { &:focus {
outline: none; outline: none;
} }
width: 392px; width: ${convertpx2vw(392)};
height: 62px; height: ${convertpx2vw(62)};
cursor: pointer; cursor: pointer;
&:first-child { &:first-child {
margin-top: 133px; margin-top: ${convertpx2vw(133)};
} }
&:not(:first-child) { &:not(:first-child) {
margin-top: 20px; margin-top: ${convertpx2vw(20)};
} }
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
......
...@@ -5,11 +5,12 @@ import WheatBg from '../../WheatBg'; ...@@ -5,11 +5,12 @@ import WheatBg from '../../WheatBg';
import SelectBg from '../../../磷肥施用技术切图/默认状态/油菜01-assets/油菜生长周期.png'; import SelectBg from '../../../磷肥施用技术切图/默认状态/油菜01-assets/油菜生长周期.png';
import SelectBgActive from '../../../磷肥施用技术切图/按下状态/油菜01-按下-assets/油菜生长周期.png'; import SelectBgActive from '../../../磷肥施用技术切图/按下状态/油菜01-按下-assets/油菜生长周期.png';
import { BackBtn, HomeBtn } from '../../SubHome'; import { BackBtn, HomeBtn } from '../../SubHome';
import { convertpx2vw } from '../../../config';
const SelectBtn = styled(Link)` const SelectBtn = styled(Link)`
display: block; display: block;
width: 594px; width: ${convertpx2vw(594)};
height: 98px; height: ${convertpx2vw(98)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
......
...@@ -19,12 +19,13 @@ import MaturityBgActive from '../../../磷肥施用技术切图/按下状态/油 ...@@ -19,12 +19,13 @@ import MaturityBgActive from '../../../磷肥施用技术切图/按下状态/油
import SeedlingVideoSrcs from '../../../动画/油菜/油菜苗期.mp4' import SeedlingVideoSrcs from '../../../动画/油菜/油菜苗期.mp4'
import LaceVideoSrcs from '../../../动画/油菜/油菜蕾薹期.mp4' import LaceVideoSrcs from '../../../动画/油菜/油菜蕾薹期.mp4'
import MaturityVideoSrcs from '../../../动画/油菜/油菜角果成熟期.mp4' import MaturityVideoSrcs from '../../../动画/油菜/油菜角果成熟期.mp4'
import { convertpx2vw } from '../../../config';
const Container = styled.div` const Container = styled.div`
margin-top: 67px; margin-top: ${convertpx2vw(67)};
display: block; display: block;
width: 444px; width: ${convertpx2vw(444)};
height: 500px; height: ${convertpx2vw(500)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
...@@ -34,17 +35,17 @@ const Container = styled.div` ...@@ -34,17 +35,17 @@ const Container = styled.div`
const Btn = styled.button` const Btn = styled.button`
background-color: transparent; background-color: transparent;
border: none; border: none;
width: 392px; width: ${convertpx2vw(392)};
height: 72px; height: ${convertpx2vw(72)};
cursor: pointer; cursor: pointer;
&:focus { &:focus {
outline: none; outline: none;
} }
&:first-child { &:first-child {
margin-top: 120px; margin-top: ${convertpx2vw(120)};
} }
&:not(:first-child) { &:not(:first-child) {
margin-top: 20px; margin-top: ${convertpx2vw(20)};
} }
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
......
...@@ -2,13 +2,13 @@ import React from 'react'; ...@@ -2,13 +2,13 @@ import React from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import WheatBg from '../../WheatBg'; import WheatBg from '../../WheatBg';
import img from '../../../磷肥施用技术切图/默认状态/冬小麦苗期-assets/苗期.png'; import img from '../../../磷肥施用技术切图/默认状态/冬小麦苗期-assets/苗期.png';
import { convertpx2vw } from '../../../config';
import { BackBtn, HomeBtn } from '../../SubHome'; import { BackBtn, HomeBtn } from '../../SubHome';
const StyledImg = styled.img` const StyledImg = styled.img`
display: block; display: block;
width: 702px; width: ${convertpx2vw(702)};
height: 552px; height: ${convertpx2vw(552)};
`; `;
export default function Seedling() { export default function Seedling() {
return ( return (
......
...@@ -5,11 +5,12 @@ import WheatBg from '../../WheatBg'; ...@@ -5,11 +5,12 @@ import WheatBg from '../../WheatBg';
import SelectBg from '../../../磷肥施用技术切图/默认状态/冬小麦01-assets/冬小麦生长周期.png'; import SelectBg from '../../../磷肥施用技术切图/默认状态/冬小麦01-assets/冬小麦生长周期.png';
import SelectBgActive from '../../../磷肥施用技术切图/按下状态/冬小麦01-按下-assets/冬小麦生长周期.png'; import SelectBgActive from '../../../磷肥施用技术切图/按下状态/冬小麦01-按下-assets/冬小麦生长周期.png';
import { BackBtn, HomeBtn } from '../../SubHome'; import { BackBtn, HomeBtn } from '../../SubHome';
import { convertpx2vw } from '../../../config';
const SelectBtn = styled(Link)` const SelectBtn = styled(Link)`
display: block; display: block;
width: 594px; width: ${convertpx2vw(594)};
height: 98px; height: ${convertpx2vw(98)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
......
...@@ -32,13 +32,13 @@ import JointingVideoSrcs from '../../../动画/冬小麦/冬小麦拔节期.mp4' ...@@ -32,13 +32,13 @@ import JointingVideoSrcs from '../../../动画/冬小麦/冬小麦拔节期.mp4'
import BootingVideoSrcs from '../../../动画/冬小麦/冬小麦孕穗期.mp4' import BootingVideoSrcs from '../../../动画/冬小麦/冬小麦孕穗期.mp4'
import FillingVideoSrcs from '../../../动画/冬小麦/冬小麦灌浆期.mp4' import FillingVideoSrcs from '../../../动画/冬小麦/冬小麦灌浆期.mp4'
import MaturityVideoSrcs from '../../../动画/冬小麦/冬小麦成熟期.mp4' import MaturityVideoSrcs from '../../../动画/冬小麦/冬小麦成熟期.mp4'
import { convertpx2vw } from '../../../config';
const Container = styled.div` const Container = styled.div`
margin-top: 67px; margin-top: ${convertpx2vw(67)};
display: block; display: block;
width: 444px; width: ${convertpx2vw(444)};
height: 867px; height: ${convertpx2vw(867)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
...@@ -48,17 +48,17 @@ const Container = styled.div` ...@@ -48,17 +48,17 @@ const Container = styled.div`
const Btn = styled.button` const Btn = styled.button`
background-color: transparent; background-color: transparent;
border: none; border: none;
width: 392px; width: ${convertpx2vw(392)};
height: 72px; height: ${convertpx2vw(72)};
cursor: pointer; cursor: pointer;
&:focus { &:focus {
outline: none; outline: none;
} }
&:first-child { &:first-child {
margin-top: 120px; margin-top: ${convertpx2vw(120)};
} }
&:not(:first-child) { &:not(:first-child) {
margin-top: 20px; margin-top: ${convertpx2vw(20)};
} }
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
......
...@@ -5,11 +5,12 @@ import WheatBg from '../WheatBg'; ...@@ -5,11 +5,12 @@ import WheatBg from '../WheatBg';
import SelectBg from '../../磷肥施用技术切图/默认状态/早施01.1-assets/选择作物.png'; import SelectBg from '../../磷肥施用技术切图/默认状态/早施01.1-assets/选择作物.png';
import SelectBgActive from '../../磷肥施用技术切图/按下状态/早施01.1-按下-assets/选择作物.png'; import SelectBgActive from '../../磷肥施用技术切图/按下状态/早施01.1-按下-assets/选择作物.png';
import { BackBtn, HomeBtn } from '../SubHome'; import { BackBtn, HomeBtn } from '../SubHome';
import { convertpx2vw } from '../../config';
const SelectBtn = styled(Link)` const SelectBtn = styled(Link)`
display: block; display: block;
width: 384px; width: ${convertpx2vw(384)};
height: 98px; height: ${convertpx2vw(98)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
......
...@@ -11,18 +11,18 @@ import RapeBtnBgActive from '../../磷肥施用技术切图/按下状态/早施0 ...@@ -11,18 +11,18 @@ import RapeBtnBgActive from '../../磷肥施用技术切图/按下状态/早施0
import Corn from '../../磷肥施用技术切图/默认状态/早施02.1-assets/玉米.png' import Corn from '../../磷肥施用技术切图/默认状态/早施02.1-assets/玉米.png'
import CornBtnBg from '../../磷肥施用技术切图/默认状态/早施02.1-assets/玉米(文字).png' import CornBtnBg from '../../磷肥施用技术切图/默认状态/早施02.1-assets/玉米(文字).png'
import CornBtnBgActive from '../../磷肥施用技术切图/按下状态/早施02.1-按下-assets/玉米(文字).png' import CornBtnBgActive from '../../磷肥施用技术切图/按下状态/早施02.1-按下-assets/玉米(文字).png'
import { convertpx2vw } from '../../config';
import { BackBtn, HomeBtn } from '../SubHome'; import { BackBtn, HomeBtn } from '../SubHome';
const Icon = styled.img` const Icon = styled.img`
width: 256px; width: ${convertpx2vw(256)};
height: 256px; height: ${convertpx2vw(256)};
`; `;
const Btn = styled(Link)` const Btn = styled(Link)`
display: block; display: block;
width: 308px; width: ${convertpx2vw(308)};
height: 108px; height: ${convertpx2vw(108)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
...@@ -34,7 +34,7 @@ const bgs = { ...@@ -34,7 +34,7 @@ const bgs = {
['Wheat', 'Rape', 'Corn'].forEach(name => { ['Wheat', 'Rape', 'Corn'].forEach(name => {
Btns[name] = styled(Btn)` Btns[name] = styled(Btn)`
margin-top: 79px; margin-top: ${convertpx2vw(79)};
background-image: url(${bgs[name+'BtnBg']}); background-image: url(${bgs[name+'BtnBg']});
&:active { &:active {
background-image: url(${bgs[name+'BtnBgActive']}); background-image: url(${bgs[name+'BtnBgActive']});
...@@ -45,7 +45,7 @@ const Col = styled.div` ...@@ -45,7 +45,7 @@ const Col = styled.div`
display: inline-block; display: inline-block;
text-align: center; text-align: center;
&:not(:last-child) { &:not(:last-child) {
margin-right: 160px; margin-right: ${convertpx2vw(160)};
} }
`; `;
......
...@@ -2,9 +2,9 @@ import React from 'react'; ...@@ -2,9 +2,9 @@ import React from 'react';
import bg from '../磷肥施用技术切图/默认状态/画面一-assets/磷肥施用技术仿真软件.png'; import bg from '../磷肥施用技术切图/默认状态/画面一-assets/磷肥施用技术仿真软件.png';
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
export default function Home() { export default function Home({ match }) {
return ( return (
<Link to="/sub-home"> <Link to={match.url + 'sub-home'}>
<img src={bg} alt="logo" style={{width: '100%'}} /> <img src={bg} alt="logo" style={{width: '100%'}} />
</Link> </Link>
); );
......
...@@ -9,13 +9,15 @@ import FertilizeEarlyBg from '../磷肥施用技术切图/默认状态/画面二 ...@@ -9,13 +9,15 @@ import FertilizeEarlyBg from '../磷肥施用技术切图/默认状态/画面二
import FertilizeConcentratedBg from '../磷肥施用技术切图/默认状态/画面二-assets/集中施肥.png'; import FertilizeConcentratedBg from '../磷肥施用技术切图/默认状态/画面二-assets/集中施肥.png';
import FertilizeControlBg from '../磷肥施用技术切图/默认状态/画面二-assets/控制施用量.png'; import FertilizeControlBg from '../磷肥施用技术切图/默认状态/画面二-assets/控制施用量.png';
import WheatBg from './WheatBg'; import WheatBg from './WheatBg';
import { convertpx2vw } from '../config';
const baseUrl = process.env.PUBLIC_URL;
const NavBtn = styled(Link)` const NavBtn = styled(Link)`
display: block; display: block;
width: 76px; width: ${convertpx2vw(76)};
height: 76px; height: ${convertpx2vw(76)};
position: absolute; position: absolute;
bottom: 47px; bottom: ${convertpx2vw(47)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
...@@ -23,21 +25,21 @@ const NavBtn = styled(Link)` ...@@ -23,21 +25,21 @@ const NavBtn = styled(Link)`
export const StyledBackBtn = styled(NavBtn)` export const StyledBackBtn = styled(NavBtn)`
background-image: url(${BackBtnBg}); background-image: url(${BackBtnBg});
right: 195px; right: ${convertpx2vw(195)};
`; `;
export const StyledHomeBtn = styled(NavBtn)` export const StyledHomeBtn = styled(NavBtn)`
background-image: url(${HomeBtnBg}); background-image: url(${HomeBtnBg});
right: 80px; right: ${convertpx2vw(80)};
`; `;
const FertilizeBtn = styled(Link)` const FertilizeBtn = styled(Link)`
display: block; display: block;
width: 256px; width: ${convertpx2vw(256)};
height: 256px; height: ${convertpx2vw(256)};
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: contain; background-size: contain;
margin-right: 80px; margin-right: ${convertpx2vw(80)};
`; `;
export const FertilizeByGroundBtn = styled(FertilizeBtn)` export const FertilizeByGroundBtn = styled(FertilizeBtn)`
background-image: url(${FertilizeByGroundBg}); background-image: url(${FertilizeByGroundBg});
...@@ -61,7 +63,7 @@ export const BackBtn = withRouter(({ onClick, history }) => { ...@@ -61,7 +63,7 @@ export const BackBtn = withRouter(({ onClick, history }) => {
}); });
export function HomeBtn() { export function HomeBtn() {
return <StyledHomeBtn to="/" />; return <StyledHomeBtn to={baseUrl+'/'} />;
} }
export default function SubHome({ match }) { export default function SubHome({ match }) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论