About - Added Page Print Formatting

This commit is contained in:
Camerin Figueroa 2023-03-04 20:03:20 -05:00
parent 66ae0d908b
commit 4ebe33c557
7 changed files with 1278 additions and 11598 deletions

12732
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,23 +3,23 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@reduxjs/toolkit": "^1.9.0", "@reduxjs/toolkit": "^1.9.3",
"@tensorflow/tfjs": "^4.0.0", "@tensorflow/tfjs": "^4.2.0",
"@tensorflow/tfjs-converter": "^4.0.0", "@tensorflow/tfjs-converter": "^4.0.0",
"axios": "^1.1.3", "axios": "^1.3.4",
"history": "^5.3.0", "history": "^5.3.0",
"memoize": "^0.1.1", "memoize": "^0.1.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-bootstrap-icons": "^1.9.1", "react-bootstrap-icons": "^1.10.2",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-redux": "^8.0.5", "react-redux": "^8.0.5",
"react-router": "^6.4.3", "react-router": "^6.4.3",
"react-router-dom": "^6.4.3", "react-router-dom": "^6.8.2",
"react-scripts": "^5.0.1", "react-scripts": "^5.0.1",
"redux": "^4.2.0", "redux": "^4.2.1",
"redux-thunk": "^2.4.2", "redux-thunk": "^2.4.2",
"tfjs": "^0.6.0", "tfjs": "^0.6.0",
"web-vitals": "^3.0.4" "web-vitals": "^3.1.1"
}, },
"scripts": { "scripts": {
"start": "react-scripts start", "start": "react-scripts start",

View File

@ -10,15 +10,42 @@ class About extends React.Component {
* This component doesn't require any props to be passed down. * This component doesn't require any props to be passed down.
* Using different components, about is a page that displays about information. * Using different components, about is a page that displays about information.
*/ */
printRef = null;
constructor(props) {
super(props);
this.printRef = React.createRef();
}
componentDidMount () { componentDidMount () {
document.title = "About"; document.title = "About";
} }
printDiv(event) {
let printContents = this.printRef.current.innerHTML;
let originalContents = document.body.innerHTML;
document.body.classList = ["Print", ...document.body.classList];
document.body.innerHTML = printContents;
window.print();
document.body.classList.remove("Print");
document.body.innerHTML = originalContents;
}
render() { render() {
return ( return (
<div className="About"> <div ref={this.printRef} className="About">
<Theater title="About" description="This page has information about me and about this site." extraClasses="h-50v" background="/img/sunset.webp"/> <div className="printShow center">
<h1>Camerin Figueroa Portfolio</h1>
<div>Contact Me: <a href="mailto:cam@camscode.com">cam@camscode.com</a></div>
</div>
<Theater title="About" description="This page has information about me and about this site." extraClasses="h-50v printHide" background="/img/sunset.webp"/>
<Card title="Build with React" image="/img/react.webp"> <Card title="Build with React" image="/img/react.webp">
This website is created with <a href="https://reactjs.org/">React</a>, a javascript library for creating user interfaces and webapps. This website is created with <a href="https://reactjs.org/">React</a>, a javascript library for creating user interfaces and webapps.
@ -106,26 +133,28 @@ class About extends React.Component {
</div> </div>
<div className="links"> <div className="links">
<a href="https://github.com/RaspberryProgramming" target="_blank" rel="noreferrer" className="link bg-white"> <a href="https://github.com/RaspberryProgramming" target="_blank" rel="noreferrer" className="link bg-white">
<img src="/img/github.webp" alt="Github"/> <img src="/img/github.webp" alt="Github"/>
</a> </a>
<a href="https://www.linkedin.com/in/camerin-figueroa-2662bb157/" target="_blank" rel="noreferrer" className="link bg-white"> <a href="https://www.linkedin.com/in/camerin-figueroa-2662bb157/" target="_blank" rel="noreferrer" className="link bg-white">
<img src="/img/linkedin.webp" alt="LinkedIn"/> <img className="printHide" src="/img/linkedin.webp" alt="LinkedIn"/>
</a> </a>
<a href="https://www.hackerrank.com/figueroa0609" target="_blank" rel="noreferrer" className="link bg-hackerrank "> <a href="https://www.hackerrank.com/figueroa0609" target="_blank" rel="noreferrer" className="link bg-hackerrank">
<img src="/img/hackerrank.webp" alt="Hacker Rank"/> <img className="printHide" src="/img/hackerrank.webp" alt="Hacker Rank"/>
</a> </a>
<a href="https://app.hackthebox.eu/profile/734741" target="_blank" rel="noreferrer" className="link bg-white"> <a href="https://app.hackthebox.eu/profile/734741" target="_blank" rel="noreferrer" className="link bg-white">
<img src="/img/hackthebox.webp" alt="Hack The Box"/> <img className="printHide" src="/img/hackthebox.webp" alt="Hack The Box"/>
</a> </a>
<a href="https://www.udemy.com/user/camerin-figueroa/" target="_blank" rel="noreferrer" className="link bg-white"> <a href="https://www.udemy.com/user/camerin-figueroa/" target="_blank" rel="noreferrer" className="link bg-white">
<img src="/img/udemy.webp" alt="Udemy"/> <img className="printHide" src="/img/udemy.webp" alt="Udemy"/>
</a> </a>
<a href="https://leetcode.com/RaspberryProgramming/" target="_blank" rel="noreferrer" className="link bg-black"> <a href="https://leetcode.com/RaspberryProgramming/" target="_blank" rel="noreferrer" className="link bg-black">
<img src="/img/leetcode_logo.webp" alt="leet code"/> <img className="printHide" src="/img/leetcode_logo.webp" alt="leet code"/>
</a> </a>
</div> </div>

View File

@ -1,3 +1,4 @@
.About { .About {
background-color: #3F3F4A; background-color: #3F3F4A;
color: #AA9AA0; color: #AA9AA0;
@ -69,6 +70,60 @@
background-color: rgb(14, 20, 25); background-color: rgb(14, 20, 25);
} }
.printShow {
display:none;
}
@media print{
.printHide {
display:none;
}
.printShow {
display:block;
}
* {
opacity: 100% !important;
}
.About .center {
margin-left:auto;
margin-right:auto;
}
.About .social {
flex-direction: column;
align-items: center;
}
.About .social .title {
break-before: page;
}
.About .links {
flex-direction: column;
flex-wrap: nowrap;
}
.About .links .link img {
display:none !important;
}
.About .links .link::after{
content: attr(href);
}
.About .links .link {
background-color: initial !important;
border-radius: default;
height: auto;
padding: none;
margin: none;
}
}
@media only screen and (max-width: 600px) { @media only screen and (max-width: 600px) {
.About .links .link img { .About .links .link img {
width: 100%; width: 100%;

View File

@ -69,6 +69,21 @@
font-size: medium; font-size: medium;
} }
@media print {
.card {
page-break-after: page;
}
.card img {
display:none !important;
}
.card .content-box {
width:100%;
}
}
@media only screen and (max-width: 600px) { @media only screen and (max-width: 600px) {
.card { .card {

View File

@ -53,6 +53,17 @@
width: 24px; width: 24px;
} }
@media print {
.Navigation .end {
background-color: transparent;
}
.Navigation, .Navigation a, .Navigation .button {
border-bottom: 1px black solid;
border-radius: 0;
}
}
@media only screen and (max-width: 600px) { @media only screen and (max-width: 600px) {
.Navigation { .Navigation {
position:fixed; position:fixed;

View File

@ -40,7 +40,7 @@ const Card = (props) => {
</div> </div>
} }
</div> </div>
<img className={props.image ? "show" : ""} src={props.image} alt={props.title}/> <img className={props.image ? "show printHide" : ""} src={props.image} alt={props.title}/>
</div> </div>
); );
}; };