Skip to content

Commit

Permalink
refactor article content into sep components
Browse files Browse the repository at this point in the history
  • Loading branch information
karkir0003 committed Dec 25, 2023
1 parent dc0ecd1 commit 0e4c742
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 44 deletions.
52 changes: 8 additions & 44 deletions components/Main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import React from "react";
import PropTypes from 'prop-types';
import Intro from './articles/Intro';
import About from "./articles/About";
import Work from "./articles/Work";
import Contact from "./articles/Contact";
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
import {faTwitter, faFacebook, faInstagram, faGithub} from '@fortawesome/fontawesome-free-brands';

Expand All @@ -10,62 +14,22 @@ const Main = (props) => {
<div id="main" style={props.timeout ? {display: 'flex'} : {display: 'none'}}>

<article id="intro" className={`${props.article === 'intro' ? 'active' : ''} ${props.articleTimeout ? 'timeout' : ''}`} style={{display:'none'}}>
<h2 className="major">Intro</h2>
<span className="image main"><img src="/static/images/pic01.jpg" alt="" /></span>
<p>Aenean ornare velit lacus, ac varius enim ullamcorper eu. Proin aliquam facilisis ante interdum congue. Integer mollis, nisl amet convallis, porttitor magna ullamcorper, amet egestas mauris. Ut magna finibus nisi nec lacinia. Nam maximus erat id euismod egestas. By the way, check out my <a href="#work">awesome work</a>.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis dapibus rutrum facilisis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam tristique libero eu nibh porttitor fermentum. Nullam venenatis erat id vehicula viverra. Nunc ultrices eros ut ultricies condimentum. Mauris risus lacus, blandit sit amet venenatis non, bibendum vitae dolor. Nunc lorem mauris, fringilla in aliquam at, euismod in lectus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In non lorem sit amet elit placerat maximus. Pellentesque aliquam maximus risus, vel sed vehicula.</p>
<Intro/>
{close}
</article>

<article id="work" className={`${props.article === 'work' ? 'active' : ''} ${props.articleTimeout ? 'timeout' : ''}`} style={{display:'none'}}>
<h2 className="major">Work</h2>
<span className="image main"><img src="/static/images/pic02.jpg" alt="" /></span>
<p>Adipiscing magna sed dolor elit. Praesent eleifend dignissim arcu, at eleifend sapien imperdiet ac. Aliquam erat volutpat. Praesent urna nisi, fringila lorem et vehicula lacinia quam. Integer sollicitudin mauris nec lorem luctus ultrices.</p>
<p>Nullam et orci eu lorem consequat tincidunt vivamus et sagittis libero. Mauris aliquet magna magna sed nunc rhoncus pharetra. Pellentesque condimentum sem. In efficitur ligula tate urna. Maecenas laoreet massa vel lacinia pellentesque lorem ipsum dolor. Nullam et orci eu lorem consequat tincidunt. Vivamus et sagittis libero. Mauris aliquet magna magna sed nunc rhoncus amet feugiat tempus.</p>
<Work/>
{close}
</article>

<article id="about" className={`${props.article === 'about' ? 'active' : ''} ${props.articleTimeout ? 'timeout' : ''}`} style={{display:'none'}}>
<h2 className="major">About</h2>
<span className="image main"><img src="/static/images/pic03.jpg" alt="" /></span>
<p>Lorem ipsum dolor sit amet, consectetur et adipiscing elit. Praesent eleifend dignissim arcu, at eleifend sapien imperdiet ac. Aliquam erat volutpat. Praesent urna nisi, fringila lorem et vehicula lacinia quam. Integer sollicitudin mauris nec lorem luctus ultrices. Aliquam libero et malesuada fames ac ante ipsum primis in faucibus. Cras viverra ligula sit amet ex mollis mattis lorem ipsum dolor sit amet.</p>
<About/>
{close}
</article>

<article id="contact" className={`${props.article === 'contact' ? 'active' : ''} ${props.articleTimeout ? 'timeout' : ''}`} style={{display:'none'}}>
<h2 className="major">Contact</h2>
<form method="post" action="#">
<div className="field half first">
<label htmlFor="name">Name</label>
<input type="text" name="name" id="name" />
</div>
<div className="field half">
<label htmlFor="email">Email</label>
<input type="text" name="email" id="email" />
</div>
<div className="field">
<label htmlFor="message">Message</label>
<textarea name="message" id="message" rows="4"></textarea>
</div>
<ul className="actions">
<li><input type="submit" value="Send Message" className="special" /></li>
<li><input type="reset" value="Reset" /></li>
</ul>
</form>
<ul className="icons">
<li><a href="#">
<FontAwesomeIcon icon={faTwitter} />
</a></li>
<li><a href="#">
<FontAwesomeIcon icon={faFacebook} />
</a></li>
<li><a href="#">
<FontAwesomeIcon icon={faInstagram} />
</a></li>
<li><a href="#">
<FontAwesomeIcon icon={faGithub} />
</a></li>
</ul>
<Contact/>
{close}
</article>
</div>
Expand Down
13 changes: 13 additions & 0 deletions components/articles/About.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";

const About = () => {
return (
<>
<h2 className="major">About</h2>
<span className="image main"><img src="/static/images/pic03.jpg" alt="" /></span>
<p>Lorem ipsum dolor sit amet, consectetur et adipiscing elit. Praesent eleifend dignissim arcu, at eleifend sapien imperdiet ac. Aliquam erat volutpat. Praesent urna nisi, fringila lorem et vehicula lacinia quam. Integer sollicitudin mauris nec lorem luctus ultrices. Aliquam libero et malesuada fames ac ante ipsum primis in faucibus. Cras viverra ligula sit amet ex mollis mattis lorem ipsum dolor sit amet.</p>
</>
)
}

export default About;
45 changes: 45 additions & 0 deletions components/articles/Contact.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from "react";
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
import {faTwitter, faFacebook, faInstagram, faGithub} from '@fortawesome/fontawesome-free-brands';

const Contact = () => {
return (
<>
<h2 className="major">Contact</h2>
<form method="post" action="#">
<div className="field half first">
<label htmlFor="name">Name</label>
<input type="text" name="name" id="name" />
</div>
<div className="field half">
<label htmlFor="email">Email</label>
<input type="text" name="email" id="email" />
</div>
<div className="field">
<label htmlFor="message">Message</label>
<textarea name="message" id="message" rows="4"></textarea>
</div>
<ul className="actions">
<li><input type="submit" value="Send Message" className="special" /></li>
<li><input type="reset" value="Reset" /></li>
</ul>
</form>
<ul className="icons">
<li><a href="#">
<FontAwesomeIcon icon={faTwitter} />
</a></li>
<li><a href="#">
<FontAwesomeIcon icon={faFacebook} />
</a></li>
<li><a href="#">
<FontAwesomeIcon icon={faInstagram} />
</a></li>
<li><a href="#">
<FontAwesomeIcon icon={faGithub} />
</a></li>
</ul>
</>
)
}

export default Contact;
14 changes: 14 additions & 0 deletions components/articles/Intro.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";

const Intro = () => {
return (
<>
<h2 className="major">Intro</h2>
<span className="image main"><img src="/static/images/pic01.jpg" alt="" /></span>
<p>Aenean ornare velit lacus, ac varius enim ullamcorper eu. Proin aliquam facilisis ante interdum congue. Integer mollis, nisl amet convallis, porttitor magna ullamcorper, amet egestas mauris. Ut magna finibus nisi nec lacinia. Nam maximus erat id euismod egestas. By the way, check out my <a href="#work">awesome work</a>.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis dapibus rutrum facilisis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam tristique libero eu nibh porttitor fermentum. Nullam venenatis erat id vehicula viverra. Nunc ultrices eros ut ultricies condimentum. Mauris risus lacus, blandit sit amet venenatis non, bibendum vitae dolor. Nunc lorem mauris, fringilla in aliquam at, euismod in lectus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In non lorem sit amet elit placerat maximus. Pellentesque aliquam maximus risus, vel sed vehicula.</p>
</>
)
}

export default Intro;
14 changes: 14 additions & 0 deletions components/articles/Work.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";

const Work = () => {
return (
<>
<h2 className="major">Work</h2>
<span className="image main"><img src="/static/images/pic02.jpg" alt="" /></span>
<p>Adipiscing magna sed dolor elit. Praesent eleifend dignissim arcu, at eleifend sapien imperdiet ac. Aliquam erat volutpat. Praesent urna nisi, fringila lorem et vehicula lacinia quam. Integer sollicitudin mauris nec lorem luctus ultrices.</p>
<p>Nullam et orci eu lorem consequat tincidunt vivamus et sagittis libero. Mauris aliquet magna magna sed nunc rhoncus pharetra. Pellentesque condimentum sem. In efficitur ligula tate urna. Maecenas laoreet massa vel lacinia pellentesque lorem ipsum dolor. Nullam et orci eu lorem consequat tincidunt. Vivamus et sagittis libero. Mauris aliquet magna magna sed nunc rhoncus amet feugiat tempus.</p>
</>
)
}

export default Work;

0 comments on commit 0e4c742

Please sign in to comment.