Fixed footer with social icons and made it responsive + misc
This commit is contained in:
129
src/components/history/history.css
Normal file
129
src/components/history/history.css
Normal file
@@ -0,0 +1,129 @@
|
||||
* {
|
||||
box-sizing: border-box !important;
|
||||
}
|
||||
|
||||
/* The actual timeline (the vertical ruler) */
|
||||
.timeline {
|
||||
position: relative;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
/* The actual timeline (the vertical ruler) */
|
||||
.timeline::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 6px;
|
||||
background-color: #eff1f4;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
margin-left: -3px;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
/* Container around content */
|
||||
.timeline-container {
|
||||
padding: 10px 40px;
|
||||
position: relative;
|
||||
background-color: inherit;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
/* The circles on the timeline */
|
||||
.timeline-container::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
right: -13px;
|
||||
background-color: white;
|
||||
border: 4px solid #2780E3;
|
||||
top: 15px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/* Place the container to the left */
|
||||
.timeline-left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/* Place the container to the right */
|
||||
.timeline-right {
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
/* Add arrows to the left container (pointing right) */
|
||||
.timeline-left::before {
|
||||
content: " ";
|
||||
height: 0;
|
||||
position: absolute;
|
||||
top: 22px;
|
||||
width: 0;
|
||||
z-index: 1;
|
||||
right: 30px;
|
||||
border: medium solid #eff1f4;
|
||||
border-width: 10px 0 10px 10px;
|
||||
border-color: transparent transparent transparent #eff1f4;
|
||||
}
|
||||
|
||||
/* Add arrows to the right container (pointing left) */
|
||||
.timeline-right::before {
|
||||
content: " ";
|
||||
height: 0;
|
||||
position: absolute;
|
||||
top: 22px;
|
||||
width: 0;
|
||||
z-index: 1;
|
||||
left: 30px;
|
||||
border: medium solid #eff1f4;
|
||||
border-width: 10px 10px 10px 0;
|
||||
border-color: transparent #eff1f4 transparent transparent;
|
||||
}
|
||||
|
||||
/* Fix the circle for containers on the right side */
|
||||
.timeline-right::after {
|
||||
left: -13px;
|
||||
}
|
||||
|
||||
/* The actual content */
|
||||
.timeline-content {
|
||||
padding: 20px 30px;
|
||||
background-color: #eff1f4;
|
||||
position: relative;
|
||||
border-radius: none;
|
||||
}
|
||||
|
||||
/* Media queries - Responsive timeline on screens less than 600px wide */
|
||||
@media screen and (max-width: 600px) {
|
||||
/* Place the timelime to the left */
|
||||
.timeline::after {
|
||||
left: 31px;
|
||||
}
|
||||
|
||||
/* Full-width containers */
|
||||
.timeline-container {
|
||||
width: 100%;
|
||||
padding-left: 70px;
|
||||
padding-right: 25px;
|
||||
}
|
||||
|
||||
/* Make sure that all arrows are pointing leftwards */
|
||||
.timeline-container::before {
|
||||
left: 60px;
|
||||
border: medium solid #eff1f4;
|
||||
border-width: 10px 10px 10px 0;
|
||||
border-color: transparent #eff1f4 transparent transparent;
|
||||
}
|
||||
|
||||
/* Make sure all circles are at the same spot */
|
||||
.timeline-left::after, .timeline-right::after {
|
||||
left: 18px;
|
||||
}
|
||||
|
||||
/* Make all right containers behave like the left ones */
|
||||
.timeline-right {
|
||||
left: 0%;
|
||||
}
|
||||
}
|
||||
122
src/components/history/history.js
Normal file
122
src/components/history/history.js
Normal file
@@ -0,0 +1,122 @@
|
||||
import React, {Component} from 'react';
|
||||
import './history.css';
|
||||
|
||||
class History extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
wasTimelineConatinerInView: [false, false, false, false]
|
||||
};
|
||||
|
||||
this.timelineContainers = [
|
||||
{
|
||||
ref: React.createRef(),
|
||||
heading: 'Miami Dade College - 2014',
|
||||
content: `I studied at MDC as a Computer Engineering major. I consistently took more programming and computer science
|
||||
courses than my major required. These included courses like VB, C, C++, Java among other high rigour courses.`,
|
||||
position: 'left'
|
||||
},
|
||||
{
|
||||
ref: React.createRef(),
|
||||
heading: 'EnTec - 2015',
|
||||
content: `I graduated from MDC and was offered a position as a teaching assistant at MDC's school of engineering
|
||||
technology. My goal was to inpire students and help them excel in the area of IT.`,
|
||||
position: 'right'
|
||||
},
|
||||
{
|
||||
ref: React.createRef(),
|
||||
heading: 'CS50x Miami - 2016',
|
||||
content: `I completed Harvard's largest MOOC course called CS50 offered at MDC's Idea Center. Was invited to Boston to
|
||||
present my project to CS50's professor David Malan. I later volunteered myself as a teaching fellow for others taking
|
||||
the CS50x Miami course.`,
|
||||
position: 'left'
|
||||
},
|
||||
{
|
||||
ref: React.createRef(),
|
||||
heading: 'InsTech - 2017',
|
||||
content: `After many internships and job applications I was hired by Insurance Technologies. A software company focused on
|
||||
bringing comprehensive solutions to clients in the insurance industry. I'm currently the lead developer in charge
|
||||
of a system that is used by 300+ employees.`,
|
||||
position: 'right'
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
timelineContainers = [];
|
||||
|
||||
isElementInView = (elementRef, offset = 0) => {
|
||||
if (!elementRef) {
|
||||
return false;
|
||||
}
|
||||
const top = elementRef.getBoundingClientRect().top;
|
||||
return (top + offset) >= 0 && (top - offset) <= window.innerHeight;
|
||||
}
|
||||
|
||||
checkTimelimeContainersInView = () => {
|
||||
let wasTimelineConatinerInView = this.state.wasTimelineConatinerInView;
|
||||
|
||||
for (var i = 0; i < this.timelineContainers.length; i++) {
|
||||
let timelineContainerRef = this.timelineContainers[i].ref;
|
||||
if (this.isElementInView(timelineContainerRef)) {
|
||||
wasTimelineConatinerInView[i] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (wasTimelineConatinerInView.every(x => x)) {
|
||||
window.removeEventListener('scroll', this.checkTimelimeContainersInView);
|
||||
}
|
||||
|
||||
this.setState({
|
||||
wasTimelineConatinerInView: wasTimelineConatinerInView
|
||||
});
|
||||
}
|
||||
|
||||
getTimelineContainerClasses = (timelineContainer, i) => {
|
||||
let defaultClasses = 'timeline-container';
|
||||
let isLeft = timelineContainer.position === 'left';
|
||||
|
||||
if (isLeft) {
|
||||
defaultClasses += ' timeline-left';
|
||||
} else {
|
||||
defaultClasses += ' timeline-right';
|
||||
}
|
||||
|
||||
if (this.state.wasTimelineConatinerInView[i]) {
|
||||
defaultClasses += ` ${isLeft ? 'slideInLeft' : 'slideInRight'} animated faster`;
|
||||
}
|
||||
|
||||
if (i === (this.timelineContainers.length - 1)) {
|
||||
defaultClasses += 'mb-3';
|
||||
} else {
|
||||
defaultClasses += 'mb-5';
|
||||
}
|
||||
|
||||
return defaultClasses;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="container-fluid" id="history">
|
||||
<div className="section-height"></div>
|
||||
<div className="timeline">
|
||||
{this.timelineContainers.map((timelineContainer, i) => {
|
||||
return (
|
||||
<div className={this.getTimelineContainerClasses(timelineContainer, i)} ref={(el) => timelineContainer.ref = el} key={i}>
|
||||
<div className="timeline-content">
|
||||
<h1>{timelineContainer.heading}</h1>
|
||||
<h5>{timelineContainer.content}</h5>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener('scroll', this.checkTimelimeContainersInView);
|
||||
}
|
||||
}
|
||||
|
||||
export default History;
|
||||
Reference in New Issue
Block a user