Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landing page styling + Disabled liquid gauge wave rise #1193

Draft
wants to merge 2 commits into
base: 331-staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/assets/LandingPage/footerBlob.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Suspense, useEffect, useState } from 'react';
import React, { Suspense } from 'react';
import { useSelector } from 'react-redux';
import { Tooltip as ReactTooltip } from 'react-tooltip'; // TODO: investigate using antd tooltip?
import type { LiquidConfig } from '@ant-design/plots';
Expand All @@ -16,16 +16,16 @@ const Liquid = React.lazy(() =>
);

const LiquidProgressChart = ({ completedUOC, totalUOC }: Props) => {
const [percent, setPercent] = useState(0);
const fillValue = Math.min(completedUOC / totalUOC, 1);
// const [percent, setPercent] = useState(0);
const fillValue = parseFloat(Math.min(completedUOC / totalUOC, 1).toFixed(2));

// light mode text color varies
let textColor = '';
if (percent < 0.31) {
if (fillValue < 0.31) {
textColor = lightYellow;
} else if (percent < 0.45) {
} else if (fillValue < 0.45) {
textColor = lightGrey;
} else if (percent < 0.56) {
} else if (fillValue < 0.56) {
textColor = darkGrey;
} else {
textColor = 'white';
Expand All @@ -45,7 +45,7 @@ const LiquidProgressChart = ({ completedUOC, totalUOC }: Props) => {
// title works, cant figure out how to change text size, (look mayb more textContent)
// also the filling up is too laggy now
const config: LiquidConfig = {
percent,
percent: fillValue,
width: 320,
height: 320,
autoFit: false,
Expand All @@ -55,24 +55,26 @@ const LiquidProgressChart = ({ completedUOC, totalUOC }: Props) => {
label: false,
style: {
textFill: textColor,
fill: percent > 0.45 ? purple : yellow,
stroke: percent > 0.45 ? purple : yellow
fill: fillValue > 0.45 ? purple : yellow,
stroke: fillValue > 0.45 ? purple : yellow
}
};
// config fields

// increment percentage from 0 to fillValue
useEffect(() => {
let data = 0.0;
const time = 30;
const interval = setInterval(() => {
data += 0.01;
if (fillValue && data <= fillValue + 0.01) {
setPercent(data);
} else {
clearInterval(interval);
}
}, time);
}, [fillValue]);
// useEffect(() => {
// let data = 0.0;
// const time = 10;
// const interval = setInterval(() => {
// data += 0.001;
// if (fillValue && data <= fillValue + 0.01) {
// setPercent(data);
// } else {
// clearInterval(interval);
// }
// }, time);
// return () => clearInterval(interval);
// }, [fillValue]);

return (
<>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/LandingPage/FooterSection/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import S from './styles';

const Footer = () => {
return (
<>
<div>
<S.FooterBlob src={footerBlobSrc} />
<S.FooterWrapper>
<S.FooterContentBody>
<PageContainer>
<S.FooterContentContainer>
<S.FooterLogoWrapper>
Expand Down Expand Up @@ -38,8 +38,8 @@ const Footer = () => {
</S.FooterDisclaimer>
</S.FooterContentContainer>
</PageContainer>
</S.FooterWrapper>
</>
</S.FooterContentBody>
</div>
);
};

Expand Down
6 changes: 2 additions & 4 deletions frontend/src/pages/LandingPage/FooterSection/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ const FooterBlob = styled.img`
width: 100%;
`;

const FooterWrapper = styled.div`
const FooterContentBody = styled.div`
background-color: #9154de;
/* TODO: Hack coz of pixel diff between blob and footer content */
margin-top: -1px;
`;

const FooterContentContainer = styled.div`
Expand Down Expand Up @@ -44,6 +42,6 @@ export default {
FooterContentContainer,
FooterLogoWrapper,
FooterDisclaimer,
FooterWrapper,
FooterContentBody,
DevSocLogo
};
6 changes: 3 additions & 3 deletions frontend/src/pages/LandingPage/GetInvolved/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import styled from 'styled-components';

const Title = styled.h1`
font-size: 50px;
margin-bottom: 3rem;
margin-bottom: 2.5rem;
margin-top: 2rem;
background: -webkit-linear-gradient(30deg, #9f62de, #b77eff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
Expand All @@ -13,15 +14,14 @@ const Title = styled.h1`

const ContentWrapper = styled.div`
text-align: center;
font-size: 1rem;
font-size: 1.2rem;
`;

const LinksWrapper = styled.div`
display: flex;
justify-content: center;
gap: 100px;
margin-top: 40px;
margin-bottom: 100px;
`;

export default {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/LandingPage/HowToUse/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { motion } from 'framer-motion';
import styled from 'styled-components';

const StyledWrapper = styled.div`
margin-bottom: 80px;
margin-bottom: 0px;
`;

const Title = styled.h1`
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/pages/LandingPage/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import styled from 'styled-components';
import { inDev } from 'config/constants';
import Footer from './FooterSection/Footer';
import GetInvolved from './GetInvolved';
Expand All @@ -8,16 +9,22 @@ import InteractiveViewSection from './InteractiveViewSection';
import KeyFeaturesSection from './KeyFeaturesSection';
import SponsorSection from './SponsorSection';

const LandingPageWrapper = styled.div`
display: flex;
flex-direction: column;
gap: 100px;
`;

const LandingPage = () => (
<>
<LandingPageWrapper>
<Hero />
<SponsorSection />
<KeyFeaturesSection />
{inDev && <InteractiveViewSection />}
<HowToUse />
<GetInvolved />
<Footer />
</>
</LandingPageWrapper>
);

export default LandingPage;