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

fix: links and projects and squad interaction #47

Merged
merged 9 commits into from
Jul 3, 2023
2 changes: 2 additions & 0 deletions src/pages/Creations/ProjectsList/ProjectsList.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ export const Name = styled.strong`
z-index: -1;
color: white;
text-align: start;
padding-right: 2rem;

@media screen and (max-width: ${MOBILE_MAX_WIDTH}) {
padding-left: 1.6rem;
padding-right: 1rem;
}
`;

Expand Down
21 changes: 10 additions & 11 deletions src/pages/Creations/ProjectsList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ export function ProjectsList({ projects }: ProjectListProps) {

const handleClick = (project: Project, target: Element) => {
if (!projectMap[project.name]) {
target.classList.add('active');
target.classList.add('gradient');
target.parentElement?.classList.add('active');
target.parentElement?.classList.add('gradient');
} else {
target.classList.remove('active');
target.classList.remove('gradient');
target.parentElement?.classList.remove('active');
target.parentElement?.classList.remove('gradient');
}

projectMap[project.name] = !projectMap[project.name];
Expand All @@ -53,13 +53,12 @@ export function ProjectsList({ projects }: ProjectListProps) {
return (
<List>
{projects.map((project) => (
<ProjectContainer
key={project.name}
onClick={(e) => {
handleClick(project, e.currentTarget);
}}
>
<ProjectHeader>
<ProjectContainer key={project.name}>
<ProjectHeader
onClick={(e) => {
handleClick(project, e.currentTarget);
}}
>
<Name>{project.name}</Name>
<Circle src={circle} alt='circle icon' />
<HLine />
Expand Down
16 changes: 14 additions & 2 deletions src/pages/Insights/Insights.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const BlogsContainer = styled.div`

@media screen and (max-width: ${MOBILE_MAX_WIDTH}) {
justify-content: center;
width: 100%;
}
`;

Expand All @@ -78,7 +79,7 @@ export const BlogPost = styled.div`
}

@media screen and (max-width: ${MOBILE_MAX_WIDTH}) {
width: calc(100% - 3rem);
width: 95vw;
}
`;

Expand All @@ -89,7 +90,8 @@ export const Image = styled.img`
min-height: 31rem;

@media screen and (max-width: ${MOBILE_MAX_WIDTH}) {
height: 65%;
min-height: unset;
height: 55%;
}
`;

Expand Down Expand Up @@ -127,11 +129,13 @@ export const TitleContainer = styled.div`

@media screen and (max-width: ${MOBILE_MAX_WIDTH}) {
padding: 1.6rem;
gap: 1rem;

& h1 {
white-space: unset;
text-overflow: unset;
overflow: unset;
font-size: 1.8rem;
}
}
`;
Expand All @@ -148,6 +152,10 @@ export const DescriptionContainer = styled.div`

@media screen and (max-width: ${MOBILE_MAX_WIDTH}) {
padding: 2rem 2rem 0;

& p {
font-size: 1.8rem;
}
}
`;

Expand All @@ -163,6 +171,10 @@ export const TagsContainer = styled.div`

@media screen and (max-width: ${MOBILE_MAX_WIDTH}) {
padding: 1.6rem 2rem;

& div strong {
font-size: 1.8rem;
}
}
`;

Expand Down
8 changes: 8 additions & 0 deletions src/pages/Insights/Insights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,21 @@ import {
import VIDEO_CHROME from '~/assets/videos/insights.webm';
import VIDEO_SAFARI from '~/assets/videos/insights.mp4';
import { TitleContainer } from '../Landing/HeroSection';
import { MOBILE_MAX_WIDTH } from '~/components/common';
import StarIcon from '/img/footer/star-icon.svg';
import styled from 'styled-components';

const BlogTitleContainer = styled(TitleContainer)`
& video {
max-width: 450px;
}

@media screen and (max-width: ${MOBILE_MAX_WIDTH}) {
padding-top: 5rem;
& video {
max-width: 300px;
}
}
`;

export const Star = styled.img.attrs({ loading: 'lazy' })`
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Landing/IntroMask/Intro.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const IntroContainer = styled.div`
flex-direction: column;
align-items: center;
width: 100%;
height: 100%;
height: 100vh;
justify-content: space-between;

@media screen and (max-width: ${MOBILE_MAX_WIDTH}) {
Expand Down Expand Up @@ -84,6 +84,7 @@ export const Text = styled.span<StyledContainerProps>`
user-select: none;
opacity: ${(props) => 1 - props.backgroundEffect * 3};
z-index: 100;
text-align: center;

@media screen and (max-width: ${MOBILE_MAX_WIDTH}) {
font-size: 2rem;
Expand Down
7 changes: 7 additions & 0 deletions src/pages/Landing/IntroMask/Intro.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect, useRef, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import Draggable from 'react-draggable';

import { StyledNavbar } from '~/containers/Navbar/Navbar.styles';
Expand Down Expand Up @@ -28,10 +29,16 @@ export function Intro({ showBackground, setShowBackground, ...props }: IntroProp
const [activateDragEffect, setDragEffect] = useState(false);
const [backgroundEffect, setBackgroundEffect] = useState(0);
const nodeRef = useRef(null);
const navigate = useNavigate();

useEffect(() => {
if (activateDragEffect) {
setShowBackground(true);

// wait until animation is done to navigate to landing
setTimeout(() => {
navigate('/landing');
}, 1400);
}
}, [activateDragEffect]);

Expand Down
10 changes: 9 additions & 1 deletion src/pages/Landing/SquadSection/SquadSection.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useState } from 'react';
import 'react-responsive-carousel/lib/styles/carousel.min.css';

import {
Expand All @@ -16,6 +17,7 @@ import Key from '~/assets/key.png';
import members from '~/data/squad.json';

export function Squad() {
const [selectedItem, setSelectedItem] = useState(0);
return (
<>
<TeamContainer>
Expand All @@ -28,7 +30,13 @@ export function Squad() {
showStatus={false}
showThumbs={false}
showIndicators={false}
selectedItem={0}
selectedItem={selectedItem}
onClickItem={(index: number) => {
setSelectedItem(index);
}}
onChange={(index: number) => {
setSelectedItem(index);
}}
>
{members.map((member) => (
<NameContainer key={member.name}>
Expand Down