Skip to content

Commit

Permalink
Merge pull request #5 from rarimo/fix/13inch-width
Browse files Browse the repository at this point in the history
Fix/13inch width
  • Loading branch information
napalmpapalam authored Dec 15, 2023
2 parents db94ccc + f64d415 commit e24a70d
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 100 deletions.
26 changes: 17 additions & 9 deletions src/components/AppBar/AppBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ import './AppBar.scss'

import cn from 'classnames'
import { motion, useMotionValueEvent, useScroll } from 'framer-motion'
import { useState } from 'react'
import { useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'

import { Icon } from '@/components'
import { CONFIG } from '@/config'
import { ROUTES_PATHS } from '@/const'
import { useAppContext } from '@/hooks'

const HEIGHT_APP_BAR = 150
const HEIGHT_HERO_SECTION = 800

const AppBar = () => {
const { t } = useTranslation()
const { isDesktop } = useAppContext()

const [isShown, setIsShown] = useState(true)
const [isDark, setIsDark] = useState(true)
Expand All @@ -27,6 +29,13 @@ const AppBar = () => {
setIsDark(scrollY.current < HEIGHT_HERO_SECTION)
})

const logo = useMemo(() => {
if (isDesktop) {
return isDark ? 'icon-app-logo-dark' : 'icon-app-logo-light'
}
return isDark ? 'icon-logo-mobile-light' : 'icon-logo-mobile-dark'
}, [isDark, isDesktop])

return (
<motion.header
className={cn(['app-bar', isDark ? 'app-bar__dark' : 'app-bar__light'])}
Expand All @@ -40,10 +49,7 @@ const AppBar = () => {
<div className='app-bar__container'>
<div className='app-bar__content container'>
<Link className='app-bar__logo' to={ROUTES_PATHS.home}>
<Icon
iconClass='app-bar__logo-img'
idIcon={isDark ? 'icon-app-logo-dark' : 'icon-app-logo-light'}
/>
<Icon iconClass='app-bar__logo-img' idIcon={logo} />
</Link>
<div className='app-bar__button-wrapper'>
<a
Expand All @@ -52,10 +58,10 @@ const AppBar = () => {
target='_blank'
rel='noreferrer'
>
<span className='app-bar__button-text'>{t('header.button-dashboard')}</span>
<span className='app-bar__button-text'>{t('header.button-app')}</span>
</a>
<a
className='app-bar__button'
className='app-bar__button-install'
href={CONFIG.linkToInstallSnap}
target='_blank'
rel='noreferrer'
Expand All @@ -64,9 +70,11 @@ const AppBar = () => {
iconClass='app-bar__button-icon'
height='24'
width='24'
idIcon='icon-header-button'
idIcon='icon-hero-section-button'
/>
<span className='app-bar__button-text'>{t('header.button')}</span>
<span className='app-bar__button-text'>
{isDesktop ? t('header.button-install') : t('header.button-install-mobile')}
</span>
</a>
</div>
</div>
Expand Down
28 changes: 25 additions & 3 deletions src/components/AppBar/AppBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,30 @@
align-items: center;
padding: to-rem(10) to-rem(16);
border: 1px solid var(--col-green-primary);
background: var(--col-total-black);
border-radius: to-rem(100);
color: var(--col-green-primary);
color: var(--col-total-white);
@include respond-to(medium) {
padding: to-rem(6) to-rem(12);
}
&:hover{
color: var(--col-green-hover) ;
border: 1px solid var(--col-green-hover);
}
&:active{
color: var(--col-green-press);
border: 1px solid var(--col-green-hover);
}
}

.app-bar__button-install {
display: flex;
align-items: center;
padding: to-rem(10) to-rem(16);
border: 1px solid var(--col-green-primary);
background: var(--col-green-primary);
border-radius: to-rem(100);
color: var(--col-total-white);
@include respond-to(medium) {
padding: to-rem(6) to-rem(12);
}
Expand Down Expand Up @@ -67,8 +89,8 @@
height: to-rem(48);
width: to-rem(182);
@include respond-to(medium) {
height: to-rem(32);
width: to-rem(118);
height: to-rem(36);
width: to-rem(36);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
min-height: to-rem(378);
max-width: to-rem(378);

@include respond-to(laptopL) {
@include respond-to(large) {
margin-right: 5%;
}

Expand Down
148 changes: 77 additions & 71 deletions src/components/HomeHeroSection/HomeHeroSection.jsx
Original file line number Diff line number Diff line change
@@ -1,124 +1,130 @@
import './HomeHeroSection.scss';
import './HomeHeroSection.scss'

import { gsap } from 'gsap';
import { TweenMax } from 'gsap/gsap-core';
import { TextPlugin } from 'gsap/TextPlugin';
import { useLayoutEffect, useMemo, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { gsap } from 'gsap'
import { TweenMax } from 'gsap/gsap-core'
import { TextPlugin } from 'gsap/TextPlugin'
import { useLayoutEffect, useMemo, useRef } from 'react'
import { useTranslation } from 'react-i18next'

import { HomeHeroInstallSection, Icon } from '@/components';
import { CONFIG } from '@/config';
import { COMPONENT_NODE_IDS } from '@/const';
import { HomeHeroInstallSection, Icon } from '@/components'
import { CONFIG } from '@/config'
import { COMPONENT_NODE_IDS } from '@/const'

gsap.registerPlugin(TextPlugin);
gsap.registerPlugin(TextPlugin)

const DELAY = 0.3;
const DELAY = 0.3

const HomeHeroSection = () => {
const { t } = useTranslation();
const { t } = useTranslation()

const titleContainerEl = useRef();
let firstPlay = false;
const wordsToShow = useMemo(() => ['One', 'Same'], []);
const titleContainerEl = useRef()
let firstPlay = false
const wordsToShow = useMemo(() => ['One', 'Same'], [])

const masterTl = useMemo(
() =>
gsap.timeline({
repeat: -1,
}),
[],
);
)

useLayoutEffect(() => {
gsap.to('.home-hero-section__title-part-2-container-cursor', {
opacity: 0,
ease: 'power1.inOut',
repeat: -1,
});
})

const doCoolStuff = tl => {
if (firstPlay) {
tl.pause();
tl.pause()
TweenMax.delayedCall(DELAY, function () {
tl.play();
});
tl.play()
})
} else {
firstPlay = true;
firstPlay = true
}
};
}
wordsToShow.forEach(word => {
let tl = gsap.timeline({ repeat: 1, yoyo: true, repeatDelay: 1.5 });
tl.call(doCoolStuff, [masterTl]);
let tl = gsap.timeline({ repeat: 1, yoyo: true, repeatDelay: 1.5 })
tl.call(doCoolStuff, [masterTl])
tl.to('.home-hero-section__title-part-2-word', {
duration: 0.5,
text: word,
});
masterTl.add(tl);
});
}, []);
})
masterTl.add(tl)
})
}, [])

return (
<section
id={COMPONENT_NODE_IDS.heroSection}
className="home-hero-section"
data-aos="fade-up"
>
<div className="home-hero-section__content container">
<div className="home-hero-section__hero-wrapper">
<div className="home-hero-section__text-wrapper">
<h2 className="home-hero-section__title">
<div className="home-hero-section__title-part-1">
<div className="home-hero-section__title-part-2-wrapper">
<div
ref={titleContainerEl}
className="home-hero-section__title-part-2-container"
>
<div className="home-hero-section__title-part-2-word"></div>
<section id={COMPONENT_NODE_IDS.heroSection} className='home-hero-section' data-aos='fade-up'>
<div className='home-hero-section__content container'>
<div className='home-hero-section__hero-wrapper'>
<div className='home-hero-section__text-wrapper'>
<h2 className='home-hero-section__title'>
<div className='home-hero-section__title-part-1'>
<div className='home-hero-section__title-part-2-wrapper'>
<div ref={titleContainerEl} className='home-hero-section__title-part-2-container'>
<div className='home-hero-section__title-part-2-word'></div>

<div className="home-hero-section__title-part-2-container-cursor" />
<div className='home-hero-section__title-part-2-container-cursor' />
</div>
</div>

<span className="home-hero-section__title-part-3">
<span className='home-hero-section__title-part-3'>
{t('home-hero-section.title-part-2')}
</span>
</div>
<div className="home-hero-section__title-part">
<div className='home-hero-section__title-part'>
<span>{t('home-hero-section.title-part-3')}</span>
</div>
</h2>

<h5 className="home-hero-section__subtitle" data-aos="fade-up">
<h5 className='home-hero-section__subtitle' data-aos='fade-up'>
{t('home-hero-section.subtitle')}
</h5>

<button>
<a
className="home-hero-section__install-button"
href={CONFIG.linkToInstallSnap}
target="_blank"
rel="noreferrer"
>
<Icon
iconClass="home-hero-section__install-button-icon"
height="24"
width="24"
idIcon="icon-hero-section-button"
/>
<span className="home-hero-section__install-button-text">
{t('header.button')}
</span>
</a>
</button>
<p className="home-hero-section__description" data-aos="fade-up">
<div className='home-hero-section__button-wrapper'>
<button>
<a
className='home-hero-section__install-button'
href={CONFIG.linkToInstallSnap}
target='_blank'
rel='noreferrer'
>
<Icon
iconClass='home-hero-section__install-button-icon'
height='24'
width='24'
idIcon='icon-hero-section-button'
/>
<span className='home-hero-section__install-button-text'>
{t('header.button-install')}
</span>
</a>
</button>
<button>
<a
className='home-hero-section__app-button'
href={CONFIG.dashboardLink}
target='_blank'
rel='noreferrer'
>
<span className='home-hero-section__app-button-text'>
{t('header.button-app')}
</span>
</a>
</button>
</div>
<p className='home-hero-section__description' data-aos='fade-up'>
{t('home-hero-section.description')}
</p>
</div>
<HomeHeroInstallSection />
</div>
</div>
</section>
);
};
)
}

export default HomeHeroSection;
export default HomeHeroSection
Loading

0 comments on commit e24a70d

Please sign in to comment.