Skip to content

Commit

Permalink
Lots of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
“Jim” committed Aug 9, 2022
1 parent 2235aab commit 03bf5e9
Show file tree
Hide file tree
Showing 25 changed files with 31 additions and 11 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"daisyui": "^2.18.0",
"file-loader": "^6.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.4.0",
Expand Down
Binary file added public/FoldAdir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldArrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldBWFRLT25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldBWFRLT33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldBWLT25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldBWLT33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldBakers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldDiaPP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldFRCFly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldFRLT25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldFRLT33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldFRLT50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldHexD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldHolden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldLT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldMiners.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldSWAF25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldSWAF33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/FoldSWLT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 11 additions & 6 deletions src/components/ConfigLT.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import TarpContext from "../TarpContext";
import { FaTimes, FaCheck } from "react-icons/fa";

import LEANTOImg from "../assets/images/LeanTo.png";
import ltfold0 from "../assets/images/FoldLT.png";
import BWLT25Img from "../assets/images/BWLT25.png";
import ltfold5 from "../assets/images/FoldBWLT25.png";
import BWLT33Img from "../assets/images/BWLT33.png";
import ltfold6 from "../assets/images/FoldBWLT33.png";

function ConfigLT() {
const state = useContext(TarpContext);
Expand All @@ -23,13 +26,14 @@ function ConfigLT() {
const userTarp = [state.tarpLength, state.tarpWidth];

class Config_LT {
constructor(configName, len, width, mult1, mult2, img) {
constructor(configName, len, width, mult1, mult2, img, foldImg) {
this.configName = configName;
this.len = len;
this.width = width;
this.mult1 = mult1;
this.mult2 = mult2;
this.img = img;
this.foldImg = foldImg;
}

alpha = 30;
Expand All @@ -41,6 +45,7 @@ function ConfigLT() {
const tarpSize = [this.len, this.width];
const sleepClear = l - state.height;
const configImg = this.img;
const configFoldImg = this.foldImg;

for (let i = this.beta; i >= this.alpha; i--) {
const ridgeHt = Math.round(Math.sin(i * deg2Rad) * (w * this.mult1) + w * this.mult2);
Expand All @@ -65,7 +70,7 @@ function ConfigLT() {
const chairTarpHtClear = chairTarpHt - state.chairHeight;
const chairCheck = ridgeHeight - chairTarpHtClear;

outputObj = tarpSize.concat({ sleepClear, cover, coverClear, ridgeHeight, sitTarpHtClear, chairTarpHtClear, angle: i, configName: this.configName, ridgeHt, sleepDiagClr, configImg, chairCheck, chairTarpHt });
outputObj = tarpSize.concat({ sleepClear, cover, coverClear, ridgeHeight, sitTarpHtClear, chairTarpHtClear, angle: i, configName: this.configName, ridgeHt, sleepDiagClr, configImg, chairCheck, chairTarpHt, configFoldImg });

if (sitTarpHtClear < 4 || chairTarpHtClear < 1) {
break;
Expand All @@ -75,16 +80,16 @@ function ConfigLT() {
}
}

const Lean_To = new Config_LT("Lean-To", userTarp[0], userTarp[1], 1, 0, LEANTOImg);
const Lean_To = new Config_LT("Lean-To", userTarp[0], userTarp[1], 1, 0, LEANTOImg, ltfold0);
Lean_To.calcs();

const BWLT_25 = new Config_LT("Back-Wall LT 25", userTarp[0], userTarp[1], 0.75, 0.25, BWLT25Img);
const BWLT_25 = new Config_LT("Back-Wall LT 25", userTarp[0], userTarp[1], 0.75, 0.25, BWLT25Img, ltfold5);
BWLT_25.calcs();

const BWLT_33 = new Config_LT("Back-Wall LT 33", userTarp[0], userTarp[1], 0.667, 0.333, BWLT33Img);
const BWLT_33 = new Config_LT("Back-Wall LT 33", userTarp[0], userTarp[1], 0.667, 0.333, BWLT33Img, ltfold6);
BWLT_33.calcs();

// console.log(finalObj);
console.log(finalObj);

// Old jsx at bottom of NOTES.md but this is good
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfigMiners.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function Config_Miners() {
Miners_tent.calcs();
}

console.log(finalObj);
// console.log(finalObj);

if (finalObj.length === 0) {
return (
Expand Down
1 change: 1 addition & 0 deletions src/data/AllConfigs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// import ltfold0 from "../assets/images/FoldLT.png";
import ltfold0 from "../assets/images/FoldLT.png";
import ltfold1 from "../assets/images/FoldFRLT50.png";
import ltfold2 from "../assets/images/FoldFRLT33.png";
Expand Down
20 changes: 16 additions & 4 deletions src/pages/Configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import AllConfigs from "../data/AllConfigs";
import ConfigTypes from "../data/ConfigTypes";
import ScrollToTop from "../components/ScrollToTop";

const leantoimages = ["FoldLT.png", "FoldFRLT50.png", "FoldFRLT33.png", "FoldFRLT25.png", "FoldFRCFly.png", "FoldBWLT25.png", "FoldBWLT33.png", "FoldBWFRLT25.png", "FoldBWFRLT33.png"];

const aframeimages = ["FoldFRLT50.png", "FoldFRLT33.png", "FoldFRLT25.png", "FoldSWAF25.png", "FoldSWAF33.png", "FoldFRCFly.png", "FoldFRCFly.png", "FoldFRCFly.png"];

const diagonalimages = ["FoldDiaPP.png", "FoldDiaPP.png", "FoldAdir.png", "FoldHexD.png", "FoldArrow.png"];

const tentimages = ["FoldSWLT.png", "FoldSWLT.png", "FoldSWLT.png", "FoldHolden.png", "FoldHolden.png", "FoldHolden.png", "FoldHolden.png", "FoldHolden.png", "FoldMiners.png", "FoldBakers.png", "FoldFRCFly.png"];

function Configs() {
const categories = ["Lean-To", " A-Frame", " Diagonal", " Tent"];

Expand Down Expand Up @@ -126,8 +134,9 @@ function Configs() {
{AllConfigs[0].map((config, i) => (
<div key={i} className="flex flex-col justify-center items-center border border-solid border-slate-400 bg-slate-100 p-4 shadow-md shadow-slate-500 md:flex-row xl:items-start">
<div className="w-3/4 sm:w-5/8 xl:w-1/2 self-center mb-8 xl:mb-0 xl:self-start">
<img src={config.imgUrl} alt={config.name} className="w-full m-0 p-0" />
{/* <img src={config.imgUrl} alt={config.name + ` tarp folds`} className="w-full m-0 p-0" /> */}
{/* <img src={leantoimages[i]} alt={config.name} className="w-full m-0 p-0" /> */}
<img src={process.env.PUBLIC_URL + leantoimages[i]} alt={config.name} className="w-full m-0 p-0" />
</div>
<div className="w-full px-4 ml-4 xl:w-1/2 border-l border-gray-400">
<h4 id="lean-to" className="text-2xl font-semibold mt-0 mb-2 text-teal-600">
Expand Down Expand Up @@ -185,7 +194,8 @@ function Configs() {
{AllConfigs[1].map((config, i) => (
<div key={i} className="flex flex-col justify-center items-center border border-solid border-slate-400 bg-slate-100 p-4 shadow-md shadow-slate-500 md:flex-row xl:items-start">
<div className="w-3/4 sm:w-5/8 xl:w-1/2 mb-8 xl:mb-0 xl:self-start">
<img src={config.imgUrl} alt={config.name} className="w-full m-0 p-0" />
{/* <img src={config.imgUrl} alt={config.name} className="w-full m-0 p-0" /> */}
<img src={process.env.PUBLIC_URL + aframeimages[i]} alt={config.name} className="w-full m-0 p-0" />
</div>
<div className="w-full px-4 ml-4 xl:w-1/2 border-l border-gray-400">
<h4 id="a-frame" className="text-2xl font-semibold mt-0 mb-2 text-teal-600">
Expand Down Expand Up @@ -236,7 +246,8 @@ function Configs() {
{AllConfigs[2].map((config, i) => (
<div key={i} className="flex flex-col justify-center items-center border border-solid border-slate-400 bg-slate-100 p-4 shadow-md shadow-slate-500 md:flex-row xl:items-start">
<div className="w-3/4 sm:w-5/8 xl:w-1/2 self-center mb-8 xl:mb-0 xl:self-start">
<img src={config.imgUrl} alt={config.name} className="w-full m-0 p-0" />
{/* <img src={config.imgUrl} alt={config.name} className="w-full m-0 p-0" /> */}
<img src={process.env.PUBLIC_URL + diagonalimages[i]} alt={config.name} className="w-full m-0 p-0" />
</div>
<div className="w-full px-4 ml-4 xl:w-1/2 border-l border-gray-400">
<h4 id="lean-to" className="text-2xl font-semibold mt-0 mb-2 text-teal-600">
Expand Down Expand Up @@ -284,7 +295,8 @@ function Configs() {
{AllConfigs[3].map((config, i) => (
<div key={i} className="flex flex-col justify-center items-center border border-solid border-slate-400 bg-slate-100 p-4 shadow-md shadow-slate-500 md:flex-row xl:items-start">
<div className="w-3/4 sm:w-5/8 xl:w-1/2 self-center mb-8 xl:mb-0 xl:self-start">
<img src={config.imgUrl} alt={config.name} className="w-full m-0 p-0" />
{/* <img src={config.imgUrl} alt={config.name} className="w-full m-0 p-0" /> */}
<img src={process.env.PUBLIC_URL + tentimages[i]} alt={config.name} className="w-full m-0 p-0" />
</div>
<div className="w-full px-4 ml-4 xl:w-1/2 border-l border-gray-400">
<h4 id="lean-to" className="text-2xl font-semibold mt-0 mb-2 text-teal-600">
Expand Down

0 comments on commit 03bf5e9

Please sign in to comment.