Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Add 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
dominic-chang committed May 17, 2018
1 parent f0ca526 commit 96510a2
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class NavigationBar extends Component{
<span className="navbar-toggler-icon"></span>
</button>

<h4 className="text-white" style={{marginBottom:'0em'}}>Phys Blog</h4>
<h4 style={{marginBottom:'0em', color:'#AC2B37' }}>PH</h4>
<div className="collapse navbar-collapse" id="navbarTogglerDemo03">
<ul className="navbar-nav mr-auto mt-2 mt-lg-0">
<li className="nav-item">
Expand Down
2 changes: 2 additions & 0 deletions src/css/blog.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ img {
}

.box-title-2 {
padding-left: 0.5em;
padding-right: 0.5em;
border-left-style: solid;
border-right-style: solid;
border-left-width: 10px;
Expand Down
2 changes: 1 addition & 1 deletion src/scenes/Home/components/Banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class Banner extends Component{
this.style.opacity = style.opacity?style.opacity:'0.8';
this.style.height = style.height?style.height:'18em';
this.style.backgroundPosition = style.backgroundPosition?style.backgroundPosition:'50% 50%';
this.style.backgroundColor=style.backgroundColor?style.backgroundColor:'#ee0000';
this.style.backgroundColor=style.backgroundColor?style.backgroundColor:'#AC2B37';
}
render(){
if (this.props.children){
Expand Down
2 changes: 1 addition & 1 deletion src/scenes/Home/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import brands from '@fortawesome/fontawesome-free-brands';

export default function Footer(){
return(
<footer id="my-footer" className="container-fluid ">
<footer id="my-footer" className="container-fluid " style={{backgroundColor:'#212529', color:'white', borderStyle:'hidden'}}>
<div className="row card-footer justify-content-between" style={{height:'10em'}}>
<div className="col-sm-2" >
<FontAwesomeIcon id="git" icon={brands.faGithub} style={{height:"2em",width:"3.5em"}}/>
Expand Down
12 changes: 6 additions & 6 deletions src/scenes/Home/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ class BlogCard extends Component {
<Link to={`/post/${this.props.slug}`} >
<div style={{height:'20em',backgroundSize:'70em',backgroundPosition:'50% 50%', backgroundRepeat:'no-repeat', textAlign:'center', backgroundImage:`url(${this.props.image})`}}>
</div>
<h2 style={{paddingTop:'0.5em'}}>
<h2 style={{paddingTop:'0.5em', textAlign:'center'}}>
{this.props.title}
</h2>
<hr/>
<h3>
{this.props.summary}
</h3>
<p style={{textAlign:"right"}}>{this.date[1] + ' ' + this.date[2] +' ' + this.date[0]}</p>
<p style={{textAlign:"right"}}>{this.date[1] + ' ' + this.date[2] + ', ' + this.date[0]}</p>
</Link>
</div>
);
Expand Down Expand Up @@ -103,16 +103,16 @@ class Home extends Component {
<div className="container-fluid" >
<Banner image={FeynmanDiagram}>Physics Blog</Banner>
<div className="row" style={{boxShadow:'0px 0px 10em 10em rgba(0,0,0,0.4)',zIndex:'2', minHeight:'50em'}}>
<div className='col-sm-2' style={{backgroundColor:'#eeeeee'}}/>
<div className='col-sm-8' style={{backgroundColor:'#eeeeee'}}>
<div className='col-sm-3' style={{backgroundColor:'#eeeeee'}}/>
<div className='col-sm-6' style={{backgroundColor:'#eeeeee'}}>
{this.state.resp.data.map((post) => {
return(<div key={post.slug}>
<BlogCard title={post.title} summary={post.summary} image={post.featured_image} slug={post.slug} published={post.published}/>
</div>);
})}
</div>
<div className='col-sm-2' style={{backgroundColor:'#eeeeee'}}/>
<div className="col-sm-12 page-link">
<div className='col-sm-3' style={{backgroundColor:'#eeeeee'}}/>
<div className="col-sm-12" style={{backgroundColor:'#eeeeee', textAlign:'center'}}>
{n_page}
{p_page}
</div>
Expand Down
21 changes: 21 additions & 0 deletions src/scenes/Home/components/Posts/BlogPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class BlogPost extends Component {
this.state = {
loaded: false
};

}

componentWillMount() {
Expand Down Expand Up @@ -74,6 +75,25 @@ class BlogPost extends Component {
key += 1;
}
}
let date = [];
//fix date
let months = {
'01':'January',
'02':'February',
'03':'March',
'04':'April',
'05':'May',
'06':'June',
'07':'July',
'08':'August',
'09':'September',
'10':'October',
'11':'November',
'12':'December'
}
date = post.published.split("-");
date[2] = date[2].slice(0,2);
date[1] = months[date[1]];

return (
<div style={{backgroundColor:'#FFFEF4'}} stye={{minHeight:'50em'}}>
Expand All @@ -85,6 +105,7 @@ class BlogPost extends Component {
<div className="container-fluid" style={{minHeight:'50em'}} >
<div style={{textAlign:'center', padding:'7em'}}>
<h1 className="box-title-2" style={{color:'#333333', display: 'inline'}}>{post.title}</h1>
<p style={{textAlign:'center'}}>{'Posted on ' + date[1] + ' ' + date[2] + ', ' + date[0]}</p>
</div>
<Banner style={{
backgroundSize:'100em',
Expand Down
4 changes: 2 additions & 2 deletions src/scenes/hydrogenAtom/components/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export default class Model extends React.Component{
waveFunc += 'Neg';
waveFunc += Math.abs(this.props.m);

this.range = 3 + 2 * this.props.n * this.props.n + 6 * this.props.l
this.resolution = 42 + 3 * this.props.n * this.props.n;
this.range = 3 + 2.5 * this.props.n * this.props.n + 6 * this.props.l
this.resolution = 42 + 2.5 * this.props.n * this.props.n;


let posArr = WaveFunctions.simpsonIntegrate(WaveFunctions.getFunc(waveFunc)/*eval(waveFunc)*/, -this.range, this.range, -this.range, this.range, -this.range, this.range, this.resolution);
Expand Down

0 comments on commit 96510a2

Please sign in to comment.