mirror of
https://github.com/AmanTahiliani/Portfolio.git
synced 2026-08-07 19:56:16 -04:00
Added slider to publications
This commit is contained in:
@@ -16,10 +16,10 @@ class Header extends Component {
|
||||
<a href="./">Home</a>
|
||||
</Col>
|
||||
<Col>
|
||||
<a>About</a>
|
||||
<a href="#About">About</a>
|
||||
</Col>
|
||||
<Col>
|
||||
<a>Publications</a>
|
||||
<a href="#Publications">Publications</a>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
width: 75%;
|
||||
margin-top: 80px;
|
||||
margin-left: 12.5%;
|
||||
padding-top: 4%;
|
||||
padding-top: 5.5%;
|
||||
padding-bottom: 4%;
|
||||
}
|
||||
|
||||
|
||||
43
src/components/publicationSlider.js
Normal file
43
src/components/publicationSlider.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import React, { Component } from "react";
|
||||
import Slider from "react-slick";
|
||||
import publicationData from "./publications.json"
|
||||
import Publication from "./Publication";
|
||||
import "slick-carousel/slick/slick.css";
|
||||
import "slick-carousel/slick/slick-theme.css";
|
||||
import {FaArrowAltCircleRight,FaArrowAltCircleLeft} from "react-icons/fa"
|
||||
export default class SimpleSlider extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.next = this.next.bind(this);
|
||||
this.previous = this.previous.bind(this);
|
||||
}
|
||||
next() {
|
||||
this.slider.slickNext();
|
||||
}
|
||||
previous() {
|
||||
this.slider.slickPrev();
|
||||
}
|
||||
render() {
|
||||
const settings = {
|
||||
dots: true,
|
||||
infinite: true,
|
||||
speed: 500,
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<Slider ref={c => (this.slider = c)} {...settings}>
|
||||
{publicationData.map(({title,authors, publish_date, abstract,link}) =>(
|
||||
<Publication title={title} authors={authors} publish_date={publish_date} abstract={abstract} link={link}/>
|
||||
))}
|
||||
</Slider>
|
||||
<div style={{ textAlign: "center"}}>
|
||||
<FaArrowAltCircleLeft onClick={this.previous} style={{marginTop:"40px",marginBottom:"40px",borderRadius:"3em" ,fontSize:"40px", color:"aquamarine"}}/>
|
||||
|
||||
<FaArrowAltCircleRight onClick={this.next} style={{marginTop:"40px", marginBottom:"40px", borderRadius:"3em",fontSize:"40px",marginLeft:"30px", color:"salmon"}}/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user