Shapes Background #164
Merged
a258wang
merged 33 commits from feat/shapes-background
into main
1 year ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feat/shapes-background'
Deleting a branch is permanent. It CANNOT be undone. Continue?
EDIT: We have decided to use randomly-generated shapes for most of the pages, instead of hard-coding the shapes backgrounds. The old to-do list of hard-coded backgrounds is retained for reference.
Closes #25
OLD TODO:
return <div className={styles.page}>{props.children}</div>;
};
Home.getShapesConfig = (() => {
This does not seem scalable at all :'( Can we try to make it less hardcoded? I think 200 lines of code just to define shapes is not worth it.
if (window.innerWidth <= 768) {
return mobileShapesConfig;
}
return aboutShapesConfig;
return window.innerWidth <= 768 ? mobileShapesConfig : aboutShapesConfig
minAngle: 15,
maxAngle: 26,
},
triangleBig: {
Why is it not just
triangle
? Same for waves.triangleBig
is a different SVG file from the smallertriangle
. Scalingtriangle.svg
up to be really big caused the lines to be too thick, sotriangleBig.svg
has thinner lines which allow it to be scaled up without looking out of place. Same withwaves
/wavesBig
.const colour = getRandomColour();
const opacity = getRandomOpacity(colour);
defaultConfig[shape]?.push({
nitpick:
and then you can remove
shapeTypes.forEach((shape) => (defaultConfig[shape] = []));
on 189WIP: Shapes Backgroundto Shapes Background 1 year ago}
function getRandomOpacity(colour: "blue" | "teal"): number {
if (colour == "blue") {
===
0b05915342
into main 1 year agoReviewers
0b05915342
.