Skip to content

Commit

Permalink
Merge branch 'master' into 'master'
Browse files Browse the repository at this point in the history
Master

See merge request osssc/summer-2020/homepage!198
  • Loading branch information
Jianmin committed Mar 21, 2021
2 parents 8f90be6 + 23a17f5 commit 08ef3d1
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 56 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@typescript-eslint/parser": "^2.10.0",
"antd": "^4.2.2",
"apexcharts": "^3.19.2",
"axios": "^0.19.2",
"axios": "^0.21.1",
"babel-eslint": "10.1.0",
"babel-jest": "^24.9.0",
"babel-loader": "8.1.0",
Expand Down
3 changes: 3 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

<meta http-equiv="Content-type" name="viewport" content="initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0 , width=device-width">
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<div id='wx_logo' style='margin:0 auto;display:none;'>
<img src='./share.jpg' />
</div>

<!--
manifest.json provides metadata used when your web app is installed on a
Expand Down
89 changes: 67 additions & 22 deletions src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ export default class Header extends React.Component{
},5)

}

gohash(url){
window.location.hash = "/"+url
}
getLink(title){
window.location.hash = "/"+title
this.gohash(title)
this.closeHeaderList()
}

Expand All @@ -78,12 +82,30 @@ export default class Header extends React.Component{
})
}

getActive(title){
if(title === 'index'){
return 'active'
goHashUrl(item){
const title = item.title
this.setState({
pageflag:title
})

if(title === 'summer2021'){
window.open(item.link)
return
}
if(title !== 'acall'){
this.gohash(title)
}
}

goAcLink(title){
this.setState({
pageflag:'acall'
})
this.gohash(title)
}



render(){
return(
<div className="osscHeader">
Expand All @@ -98,16 +120,28 @@ export default class Header extends React.Component{
{
this.state.listLinks.map((item,index)=>{
return (
<NavLink key={index} to={'/'+item.title} >
<div

className={["osscListItem",item.title,this.state.pageflag===item.title?'left0':''].join(" ")}>

<span> {item.name} </span>



<div className="osscLItem" key={index}>
<div
className={["osscListItem",item.title,this.state.pageflag===item.title?'left0':''].join(" ")}
onClick={()=>{this.goHashUrl(item)}}>
<span > {item.name} </span>
</div>
{
item.content?
<div className="osscListLine">
{
item.content.map((sitem,sindex)=>{
return(
<div className="osscListLineItem" key={sindex} onClick={()=>{this.goAcLink(sitem.title)}}>{sitem.name}</div>
)
})
}

</div>:""
}
</div>
</NavLink>

)

})
Expand All @@ -119,16 +153,27 @@ export default class Header extends React.Component{
{
this.state.listLinks.map((item,index)=>{
return (
//<NavLink key={index} to={'/'+item.title}>
item.content?'':
<div key={index}
onClick={()=>this.getLink(item.title)}
className={["osscListItem",item.title,this.state.pageflag===item.title?'left0':''].join(" ")}>

<span> {item.name}</span>


</div>
//</NavLink>
onClick={()=>this.goHashUrl(item)}
className={["osscListItem",item.title].join(" ")}>

<span> {item.name}</span>
</div>
)
})
}
{
this.state.listLinks[5].content.map((sitem,sindex)=>{
return (

<div key={sindex}
onClick={()=>this.goAcLink(sitem.title)}
className="acall osscListItem">

<span> {sitem.name}</span>
</div>

)

})
Expand Down
92 changes: 68 additions & 24 deletions src/components/header/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
width: 390px;
height: 64px;
background-size: cover;
// margin-left: -10px;
background-position: center;
background-repeat: no-repeat;
}
Expand All @@ -46,6 +45,58 @@
justify-content: space-between;
align-items: center;
}

.osscLItem{
margin-left: 20px;
position: relative;
}

.osscListLine{
position: absolute;
background: #fff;
width: calc(~'100% + 16px');
padding: 0 6px;
left: -8px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
opacity: 0;
}
.osscListItem::after{
content: "";
background-color: #b11aff;
bottom: 0;
height: 4px;
left: -80px;
transition: all 0.3s;
width: 0;
display: block;
position: absolute;
}
.osscLItem:hover{
.osscListLine{
opacity: 1;
}

.osscListItem::after{
left:0;
width: 100%;
}
}

.osscListItem.left0::after{
left:0;
width: 100%;
}




.osscListLineItem{
line-height: 40px;
font-size: 18px;
position: relative;
cursor: pointer;
}
.osscHeaderList{
position: relative;
display: flex;
Expand All @@ -59,39 +110,32 @@
color:rgba(0,0,0,.54);
position: relative;
}
a .osscListItem::after{
content: "";
background-color: #b11aff;
bottom: 0;
height: 4px;
left: -80px;
transition: all 0.3s;
width: 0;
display: block;
position: absolute;
}




a:hover .osscListItem::after,
a.active .osscListItem::after{
left:0;
width: 100%;
}
a.active .osscListItem,
.osscListItem:hover{
color: #b11aff;
color: #b11aff;
}



.osscListItem{
margin-left: 20px;
.osscListItem{
position: relative;
overflow: hidden;
cursor: pointer;
transition: all 0.3s;
color: #666;
}
.osscListItem.summer2021{
width: 108%;

}
.osscListItem.summitmeeting{
width: 90%;
.osscListItem.acall{

cursor: default;
}
.osscListItem.summitmeeting::before{
.osscListItem.summer2021::before{
content:url(./../../img/fire.png);
position: absolute;
right: -1px;
Expand Down
5 changes: 4 additions & 1 deletion src/components/header/ipad.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
background-size: contain;
}
.osscHeaderList{
.osscListItem{
.osscLItem{
margin-left: 1vw;
font-size: 12px;
}
.osscListLineItem{
font-size: 13px;
}
.osscListItem.summitmeeting{
Expand Down
22 changes: 17 additions & 5 deletions src/components/header/listLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const listLinks = [
name:'首页',
title:'index',
},
{
name:'2021活动主页',
title:'summer2021',
link:'https://summer.iscas.ac.cn/',
},
{
name:'开源社区',
title:'organisations',
Expand All @@ -28,12 +33,19 @@ const listLinks = [
},
{
name:'活动规划',
title:'howitworks',
},
{
name:'活动进程',
title:'started',
title:'acall',
content:[
{
name:'活动进程',
title:'started',
},
{
name:'活动详情',
title:'howitworks',
}
]
},

{
name:'大咖说开源',
title:'liveshow',
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/mobile.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
top: 0;
left: -3vw;
background-color: #187ef2;
padding: 30vh 0;
padding: 12vh 0;
.osscClose{
position: absolute;
width: 35px;
Expand Down Expand Up @@ -69,7 +69,7 @@
position: relative;
}

.osscListItem.summitmeeting>span::after{
.osscListItem.summer2021>span::after{
content:url(./../../img/fire.png);
position: relative;
right: -4px;
Expand Down
3 changes: 3 additions & 0 deletions src/pages/announcement/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
* See the Mulan PSL v2 for more details.
*/
.Announcement{
.ant-input-group-wrapper{
width: auto;
}
.AnnouncementBanner{
width: 100%;
height: 280px;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/organisation/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
position: relative;
background-color: white;
width: 1200px;
height: 100%;
// height: 100%;
border-radius: 0.25em;
justify-content: left;
flex-direction: column;
Expand Down

0 comments on commit 08ef3d1

Please sign in to comment.