diff --git a/src/components/Carousel/Carousel.tsx b/src/components/Carousel/Carousel.tsx index d080d6a3f..cde7f6718 100644 --- a/src/components/Carousel/Carousel.tsx +++ b/src/components/Carousel/Carousel.tsx @@ -25,6 +25,7 @@ type CarouselProps = { displaySlide?: number; color?: Color; noAnimation?: boolean; + onChange: (index: number) => void; }; function Carousel({ diff --git a/src/components/actionBar/Discord/Discord.tsx b/src/components/actionBar/Discord/Discord.tsx deleted file mode 100644 index 961ca1fc9..000000000 --- a/src/components/actionBar/Discord/Discord.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { LinkWindow } from 'src/components/link/link'; -import discordIcon from './discord.png'; - -import styles from './Discord.module.scss'; - -function Discord() { - return ( -
- - Cyber Discord - -
- ); -} - -export default Discord; diff --git a/src/components/actionBar/Telegram.tsx b/src/components/actionBar/Telegram.tsx deleted file mode 100644 index c95f680a3..000000000 --- a/src/components/actionBar/Telegram.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import Tooltip from '../tooltip/tooltip'; -import share from '../../image/share.svg'; -import telegram from '../../image/telegram.png'; -import { LinkWindow } from '../link/link'; -import useMediaQuery from '../../hooks/useMediaQuery'; -import React from 'react'; - -export function Telegram() { - const mediaQuery = useMediaQuery('(min-width: 768px)'); - - if (!mediaQuery) { - return ( -
- -
- telegram -
-
-
- ); - } - - return ( -
- - -
- feedback{' '} - share -
-
- -
- join movement{' '} - share -
-
-
- } - > - -
- telegram -
-
- - - ); -} diff --git a/src/components/actionBar/Twitter/Twitter.module.scss b/src/components/actionBar/Twitter/Twitter.module.scss deleted file mode 100644 index 633ddd81a..000000000 --- a/src/components/actionBar/Twitter/Twitter.module.scss +++ /dev/null @@ -1,14 +0,0 @@ -.wrapper { - position: fixed; - bottom: 25px; - left: 100px; - z-index: 2; -} - -.icon { - height: 36px; - - &:hover { - opacity: 0.7; - } -} diff --git a/src/components/containerGradient/DisplayTitle/DisplayTitle.module.scss b/src/components/containerGradient/DisplayTitle/DisplayTitle.module.scss index 174e6ad9f..925872d3c 100644 --- a/src/components/containerGradient/DisplayTitle/DisplayTitle.module.scss +++ b/src/components/containerGradient/DisplayTitle/DisplayTitle.module.scss @@ -12,7 +12,7 @@ .displayTitle { min-height: 70px; padding: 10px 0; - font-size: 18px; + font-size: 20px; display: flex; align-items: center; diff --git a/src/containers/application/AppMenu.tsx b/src/containers/application/AppMenu.tsx index 8613ddc5e..17bc8c236 100644 --- a/src/containers/application/AppMenu.tsx +++ b/src/containers/application/AppMenu.tsx @@ -13,6 +13,8 @@ import portal from '../../image/space-pussy.svg'; import oracle from '../../image/temple/oracle.png'; import warp from '../../image/temple/warp.png'; import hub from '../../image/temple/hub.png'; +import congress from './images/congress.png'; + import { routes } from '../../routes'; const itemsMenu = () => { @@ -78,6 +80,7 @@ const itemsMenu = () => { ], }, { name: 'Senate', icon: senate, to: '/senate', subItems: [] }, + { name: 'About', icon: congress, to: routes.social.path, subItems: [] }, // { // name: 'Help', // icon: zhdun, diff --git a/src/containers/application/Header/Commander/Commander.tsx b/src/containers/application/Header/Commander/Commander.tsx index bb95c6b03..ded81fa9e 100644 --- a/src/containers/application/Header/Commander/Commander.tsx +++ b/src/containers/application/Header/Commander/Commander.tsx @@ -58,7 +58,10 @@ function Commander() { e.relatedTarget.click(); } - dispatch(setFocus(false)); + // timeout for mobile focus, working different + setTimeout(() => { + dispatch(setFocus(false)); + }, 1); } commanderRef.current.addEventListener('focus', onFocus); diff --git a/src/containers/application/images/congress.png b/src/containers/application/images/congress.png new file mode 100644 index 000000000..8c14f7e76 Binary files /dev/null and b/src/containers/application/images/congress.png differ diff --git a/src/containers/application/styles.scss b/src/containers/application/styles.scss index 023f09aca..ad3bc1775 100644 --- a/src/containers/application/styles.scss +++ b/src/containers/application/styles.scss @@ -6,7 +6,7 @@ background: #000000; color: #fff; transition: 0.3s; - z-index: 3; + z-index: 4; opacity: 0.9; box-shadow: 1px 0 20px 2px #000; } diff --git a/src/containers/temple/hooks/useGetGraphStats.js b/src/containers/temple/hooks/useGetGraphStats.ts similarity index 96% rename from src/containers/temple/hooks/useGetGraphStats.js rename to src/containers/temple/hooks/useGetGraphStats.ts index b9408144f..f0c7192fc 100644 --- a/src/containers/temple/hooks/useGetGraphStats.js +++ b/src/containers/temple/hooks/useGetGraphStats.ts @@ -4,7 +4,8 @@ import BigNumber from 'bignumber.js'; import { useQueryClient } from 'src/contexts/queryClient'; const keyQuery = 'graphStats'; -function useGetGraphStats() { + +function useGetGraphStats(refetchInterval: number | undefined = 1000 * 60 * 3) { const queryClient = useQueryClient(); const [changeTimeAmount, setChangeTimeAmount] = useState({ particles: 0, @@ -54,7 +55,7 @@ function useGetGraphStats() { return response; }, enabled: Boolean(queryClient), - refetchInterval: 1000 * 60 * 3, + refetchInterval, }); useEffect(() => { diff --git a/src/containers/temple/hooks/useGetNegentropy.ts b/src/containers/temple/hooks/useGetNegentropy.ts index 12c2ba596..29cc018cb 100644 --- a/src/containers/temple/hooks/useGetNegentropy.ts +++ b/src/containers/temple/hooks/useGetNegentropy.ts @@ -19,7 +19,7 @@ const getNegentropy = async () => { const keyQuery = 'negentropy'; -function useGetNegentropy() { +function useGetNegentropy(refetchInterval: number | undefined = 1000 * 60 * 3) { const [changeTimeAmount, setChangeTimeAmount] = useState({ amount: 0, time: 0, @@ -43,7 +43,7 @@ function useGetNegentropy() { return response; }, - refetchInterval: 1000 * 60 * 3, + refetchInterval, }); useEffect(() => { diff --git a/src/image/enlarge.svg b/src/image/enlarge.svg new file mode 100644 index 000000000..d799389d4 --- /dev/null +++ b/src/image/enlarge.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/index.tsx b/src/index.tsx index 5a70c25e2..abed78d96 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -129,7 +129,7 @@ root.render( cyb: your immortal robot for the great web - + ); diff --git a/src/layouts/Main.module.scss b/src/layouts/Main.module.scss index cb193f315..ccbcf6a41 100644 --- a/src/layouts/Main.module.scss +++ b/src/layouts/Main.module.scss @@ -1,7 +1,12 @@ .wrapper { - @media (max-width: 480px) { - footer { - display: none; + footer { + a { + position: fixed; + z-index: 2; + right: 5vw; + bottom: 35px; + display: flex; + align-items: center; } } } diff --git a/src/layouts/Main.tsx b/src/layouts/Main.tsx index a4f41b826..9848cdd32 100644 --- a/src/layouts/Main.tsx +++ b/src/layouts/Main.tsx @@ -1,15 +1,14 @@ import { useEffect, useMemo, useState } from 'react'; -import { Telegram } from 'src/components/actionBar/Telegram'; -import { GitHub } from 'src/components/actionBar/GitHub'; + import { localStorageKeys } from 'src/constants/localStorageKeys'; import AppMenu from 'src/containers/application/AppMenu'; import AppSideBar from 'src/containers/application/AppSideBar'; import Header from 'src/containers/application/Header/Header'; import useSetActiveAddress from 'src/hooks/useSetActiveAddress'; -import Discord from 'src/components/actionBar/Discord/Discord'; -import Twitter from 'src/components/actionBar/Twitter/Twitter'; import { useAppSelector } from 'src/redux/hooks'; import styles from './Main.module.scss'; +import { routes } from 'src/routes'; +import { Link } from 'react-router-dom'; function MainLayout({ children }: { children: JSX.Element }) { const pocket = useAppSelector(({ pocket }) => pocket); @@ -64,10 +63,7 @@ function MainLayout({ children }: { children: JSX.Element }) { {children}
- - - - + contacts
); diff --git a/src/pages/Brain/Brain.module.scss b/src/pages/Brain/Brain.module.scss new file mode 100644 index 000000000..80b319bec --- /dev/null +++ b/src/pages/Brain/Brain.module.scss @@ -0,0 +1,11 @@ +.wrapper { + padding: 0 50px; + display: flex; + justify-content: center; +} + +.link { + z-index: 1; + font-size: 30px; + position: relative; +} diff --git a/src/pages/Brain/Brain.tsx b/src/pages/Brain/Brain.tsx new file mode 100644 index 000000000..6e3645320 --- /dev/null +++ b/src/pages/Brain/Brain.tsx @@ -0,0 +1,19 @@ +import CyberlinksGraphContainer from 'src/features/cyberlinks/CyberlinksGraph/CyberlinksGraphContainer'; +import { LinkWindow } from 'src/components/link/link'; +import styles from './Brain.module.scss'; + +function Brain() { + return ( +
+ + Full Graph 🔗 + + +
+ ); +} + +export default Brain; diff --git a/src/pages/Search/Search.module.scss b/src/pages/Search/Search.module.scss deleted file mode 100644 index 36ea971c7..000000000 --- a/src/pages/Search/Search.module.scss +++ /dev/null @@ -1,331 +0,0 @@ -$mobile-breakpoint: 480px; - -:export { - mobileBreakpoint: $mobile-breakpoint; -} - -.wrapper { - display: flex; - flex-direction: column; - justify-content: space-between; - // header, footer widths, TODO: use variables - min-height: calc(100vh - 120px - 60px - 60px); - - padding: 0 10px; - - // not good, need fix wrapper - margin-bottom: 100px; - - @media (width <= $mobile-breakpoint) { - // for graph out screen position - overflow-x: hidden; - // padding: 0 50px; - - .actionBarBtn { - min-width: 107px; - } - } - - --graph-size: 33vw; -} - -.starsWrapper { - z-index: -1; - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; -} - -.header { - gap: 40px; - display: flex; - justify-content: center; - flex-wrap: wrap; - - @media (width <= $mobile-breakpoint) { - display: grid; - gap: 15px; - grid-template-columns: repeat(2, 1fr); - - > :nth-child(2) { - order: 1; - grid-column: span 2; - } - } -} - -.infoText { - font-weight: 400; - font-size: clamp(20px, 3vw, 36px); - text-shadow: 0px 0px 15px var(--blue-light); - - * { - font-weight: inherit; - } -} - -.info { - margin-top: 40px; - display: flex; - justify-content: center; - position: relative; - - &::before { - content: ''; - position: absolute; - - margin-top: auto; - height: 50%; - z-index: -1; - filter: blur(20px); - - background: linear-gradient( - 90deg, - rgba(0, 0, 0, 0) 3.92%, - rgba(31, 203, 255, 0.2) 40.95%, - rgba(31, 203, 255, 0.2) 68.97%, - rgba(0, 0, 0, 0) 100% - ); - - @keyframes slide { - from { - left: 0; - right: 0; - } - - to { - left: 150px; - right: 150px; - } - } - - animation: slide 6s infinite alternate; - } - - display: grid; - grid-template-columns: 1fr auto 1fr; - align-items: center; - gap: 0 3vw; - - position: relative; - - .title { - text-align: right; - - .keyword { - color: var(--blue-light); - } - - .lastTextBlock { - width: 100%; - display: inline-block; - } - - @media ($mobile-breakpoint <= width <= 680px) { - .keyword { - display: inline-block; - // to wrap to new line - width: 50%; - } - - .lastTextBlock { - display: inline; - } - } - } - - .graphWrapper { - position: relative; - - width: var(--graph-size); - height: var(--graph-size); - background-color: black; - - overflow: hidden; - box-shadow: 0px 0px 5px 1px rgba(31, 203, 255, 0.3), - 0px 0px 42px 0px rgba(31, 203, 255, 0.42); - - &, - &::after { - border-radius: 50%; - } - - &::after { - content: ''; - position: absolute; - pointer-events: none; - left: 0; - right: 0; - top: 0; - bottom: 0; - box-shadow: inset 0 0 50px 20px black; - } - } - - @media (width <= $mobile-breakpoint) { - display: unset; - - .title { - &, - > * { - font-size: 26px !important; - } - - .lastTextBlock { - width: 100%; - display: inline-block; - } - - min-width: unset; - } - - .graphWrapper { - position: absolute; - - left: calc(-50px + 100vw - (330px * 0.44)); - top: 60px; - } - } -} - -.advantages { - display: grid; - margin: -40px auto 0; - gap: 0px 5vw; - - grid-template-columns: repeat(3, minmax(0, 33%)); - grid-template-rows: repeat(2, 1fr); - text-align: center; - justify-items: center; - - li { - width: 188px; - min-height: 70px; - - animation: appear 3s; - - @keyframes appear { - from { - opacity: 0; - } - - to { - opacity: 1; - } - } - } - - li:nth-child(1) { - grid-column: 1 / 2; - grid-row: 1; - } - - li:nth-child(2) { - margin-top: -30px; - grid-column: 2 /3; - grid-row: 2; - } - - li:nth-child(3) { - grid-column: 3 / 4; - grid-row: 1; - } - - @media (width <= $mobile-breakpoint) { - margin: 20px 0 0 !important; - - display: flex; - flex-direction: column; - gap: 20px 0; - - li:nth-child(2) { - margin-top: unset; - } - } -} - -.header { - margin: 10px auto; - width: 420px; - - @media (width <= $mobile-breakpoint) { - width: unset; - - > div { - width: 100vw; - } - } -} - -.footer { - display: flex; - gap: 0 clamp(10px, 2.6vw, 40px); - justify-content: center; -} - -.info2 { - text-align: center; - margin-top: -5%; - - * { - font-weight: 400; - margin: 0; - } - - > :last-child { - margin-top: 70px; - } - - strong { - color: #74ff00; - } - - $animation-duration: 2s; - - h2 { - font-size: clamp(26px, 3.3vw, 50px); - color: rgba(255, 255, 255, 0.78); - animation: anim $animation-duration 0.3s forwards; - opacity: 0; - } - - h3 { - font-size: clamp(40px, 4.7vw, 72px); - animation: anim $animation-duration; - } - - h4 { - margin-top: 17px; - font-size: clamp(20px, 2.1vw, 32px); - color: rgba(255, 255, 255, 0.5); - animation: anim $animation-duration 0.6s forwards; - opacity: 0; - } - - i { - text-decoration: line-through; - } -} - -@keyframes anim { - 0% { - transform: scale(5); - opacity: 0; - } - - 20% { - transform: scale(1.1); - opacity: 1; - } - - 100% { - transform: scale(1); - opacity: 1; - } - - // 100% { - // transform: scale(0); - // } -} diff --git a/src/pages/Search/Stats/Stats.tsx b/src/pages/Search/Stats/Stats.tsx deleted file mode 100644 index 536fdb2e8..000000000 --- a/src/pages/Search/Stats/Stats.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { - useGetGraphStats, - useGetNegentropy, -} from 'src/containers/temple/hooks'; -import { TypingText } from 'src/containers/temple/pages/play/PlayBanerContent'; -import cx from 'classnames'; -import { useQuery } from 'react-apollo'; -import gql from 'graphql-tag'; -import landingStyles from '../Search.module.scss'; -import styles from './Stats.module.scss'; -import { TitleType } from '../Search'; - -type Props = { - type: TitleType; -}; - -const twentyFourHoursAgo = new Date( - new Date().getTime() - 24 * 60 * 60 * 1000 -).toISOString(); - -function generateQuery(type: string) { - return gql` - query Query { - ${type}(where: {timestamp: {_gte: "${twentyFourHoursAgo}"}}) { - aggregate { - count - } - } - } - `; -} - -function Stats({ type }: Props) { - const dataGetGraphStats = useGetGraphStats(); - const negentropy = useGetNegentropy(); - - // const cyberlinksQuery = useQuery(generateQuery('cyberlinks_aggregate')); - // const particlesQuery = useQuery(generateQuery('particles_aggregate')); - - let value: number | undefined; - let text: string; - let change: number | undefined; - - switch (type) { - case TitleType.search: - value = dataGetGraphStats.data?.particles; - text = 'particles'; - - // if (!(particlesQuery.loading || particlesQuery.error)) { - // change = particlesQuery.data?.particles_aggregate.aggregate.count; - // } - break; - - case TitleType.learning: - value = dataGetGraphStats.data?.cyberlinks; - text = 'cyberlinks'; - // if (!(cyberlinksQuery.loading || cyberlinksQuery.error)) { - // change = cyberlinksQuery.data?.cyberlinks_aggregate.aggregate.count; - // } - break; - - case TitleType.ai: - value = negentropy.data?.negentropy; - text = 'syntropy bits'; - break; - - default: - } - - return ( -
- {value && ( - <> - {' '} - {text} and growing - - )} -
- ); -} - -export default Stats; diff --git a/src/pages/Search/components/KeywordButton/KeywordButton.tsx b/src/pages/Search/components/KeywordButton/KeywordButton.tsx deleted file mode 100644 index 9be067f98..000000000 --- a/src/pages/Search/components/KeywordButton/KeywordButton.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Link } from 'react-router-dom'; -import styles from './KeywordButton.module.scss'; -import { routes } from 'src/routes'; - -function KeywordButton({ keyword }: { keyword: string }) { - return ( - - {keyword} - - ); -} - -export default KeywordButton; diff --git a/src/components/actionBar/Discord/Discord.module.scss b/src/pages/Social/Discord/Discord.module.scss similarity index 73% rename from src/components/actionBar/Discord/Discord.module.scss rename to src/pages/Social/Discord/Discord.module.scss index 6126a4c99..0d2858f63 100644 --- a/src/components/actionBar/Discord/Discord.module.scss +++ b/src/pages/Social/Discord/Discord.module.scss @@ -1,12 +1,12 @@ .wrapper { - position: fixed; + // position: fixed; bottom: 28px; left: 60px; z-index: 2; } .icon { - height: 30px; + height: 32px; &:hover { opacity: 0.7; diff --git a/src/pages/Social/Discord/Discord.tsx b/src/pages/Social/Discord/Discord.tsx new file mode 100644 index 000000000..8155dcd54 --- /dev/null +++ b/src/pages/Social/Discord/Discord.tsx @@ -0,0 +1,16 @@ +import { LinkWindow } from 'src/components/link/link'; +import discordIcon from './discord.png'; + +import styles from './Discord.module.scss'; + +function Discord() { + return ( + //
+ + Cyber Discord + + //
+ ); +} + +export default Discord; diff --git a/src/components/actionBar/Discord/discord-icon.svg b/src/pages/Social/Discord/discord-icon.svg similarity index 100% rename from src/components/actionBar/Discord/discord-icon.svg rename to src/pages/Social/Discord/discord-icon.svg diff --git a/src/components/actionBar/Discord/discord.png b/src/pages/Social/Discord/discord.png similarity index 100% rename from src/components/actionBar/Discord/discord.png rename to src/pages/Social/Discord/discord.png diff --git a/src/pages/Social/GitHub/GitHub.module.scss b/src/pages/Social/GitHub/GitHub.module.scss new file mode 100644 index 000000000..ffdde017c --- /dev/null +++ b/src/pages/Social/GitHub/GitHub.module.scss @@ -0,0 +1,25 @@ +@import '../../../style/mixins.scss'; + +.wrapper { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 0 10px; + + a { + text-align: center; + display: flex; + flex-direction: column; + align-items: center; + gap: 5px 0; + + &:hover { + img { + opacity: 0.7; + } + } + + span { + @include withShareIcon; + } + } +} diff --git a/src/components/actionBar/GitHub.tsx b/src/pages/Social/GitHub/GitHub.tsx similarity index 83% rename from src/components/actionBar/GitHub.tsx rename to src/pages/Social/GitHub/GitHub.tsx index 5d2fdf5db..292dc2900 100644 --- a/src/components/actionBar/GitHub.tsx +++ b/src/pages/Social/GitHub/GitHub.tsx @@ -1,13 +1,15 @@ -import Tooltip from '../tooltip/tooltip'; -import github from '../../image/github-mark-white.svg'; -import star from '../../image/star-reg.svg'; -import share from '../../image/share.svg'; -import { LinkWindow } from '../link/link'; -import useMediaQuery from '../../hooks/useMediaQuery'; +import github from '../../../image/github-mark-white.svg'; +import star from '../../../image/star-reg.svg'; +import share from '../../../image/share.svg'; + +import useMediaQuery from '../../../hooks/useMediaQuery'; import React from 'react'; import axios from 'axios'; import { formatNumber } from 'src/utils/utils'; import { useQuery } from '@tanstack/react-query'; +import { LinkWindow, Tooltip } from 'src/components'; +import styles from './GitHub.module.scss'; +import { wrap } from 'comlink'; const getStargazersGitHub = async () => { try { @@ -46,24 +48,30 @@ export function StargazersCountGH() { export function GitHub() { const mediaQuery = useMediaQuery('(min-width: 768px)'); - if (!mediaQuery) { + if (true) { return (
+ + github + app + + -
- github -
+ github + + congress
); diff --git a/src/pages/Social/Social.module.scss b/src/pages/Social/Social.module.scss new file mode 100644 index 000000000..1c2b50ecb --- /dev/null +++ b/src/pages/Social/Social.module.scss @@ -0,0 +1,14 @@ +.wrapper { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + + gap: 30px 0; +} + +.main { + display: flex; + gap: 0 10px; + margin-bottom: -10px; +} diff --git a/src/pages/Social/Social.tsx b/src/pages/Social/Social.tsx new file mode 100644 index 000000000..6c1a233ec --- /dev/null +++ b/src/pages/Social/Social.tsx @@ -0,0 +1,38 @@ +import { MainContainer } from 'src/components'; +import Discord from 'src/pages/Social/Discord/Discord'; +import { GitHub } from 'src/pages/Social/GitHub/GitHub'; +import { Telegram } from 'src/pages/Social/Telegram/Telegram'; +import Twitter from './Twitter/Twitter'; +import Display from 'src/components/containerGradient/Display/Display'; +import DisplayTitle from 'src/components/containerGradient/DisplayTitle/DisplayTitle'; +import styles from './Social.module.scss'; +import { useAdviser } from 'src/features/adviser/context'; +import { useEffect } from 'react'; + +// TODO: folder is dirty, can be refactored +function Social() { + const { setAdviser } = useAdviser(); + + useEffect(() => { + setAdviser('join our community'); + }, [setAdviser]); + + return ( + + }> +
+
+ + +
+ + + + +
+
+
+ ); +} + +export default Social; diff --git a/src/pages/Social/Telegram/Telegram.module.scss b/src/pages/Social/Telegram/Telegram.module.scss new file mode 100644 index 000000000..e11bc6b2c --- /dev/null +++ b/src/pages/Social/Telegram/Telegram.module.scss @@ -0,0 +1,21 @@ +@import '../../../style/mixins.scss'; + +.wrapper { + display: flex; + flex-wrap: wrap; + gap: 0 10px; + + a { + text-align: center; + + &:hover { + img { + opacity: 0.7; + } + } + + span { + @include withShareIcon; + } + } +} diff --git a/src/pages/Social/Telegram/Telegram.tsx b/src/pages/Social/Telegram/Telegram.tsx new file mode 100644 index 000000000..1f9175f0f --- /dev/null +++ b/src/pages/Social/Telegram/Telegram.tsx @@ -0,0 +1,136 @@ +import Tooltip from '../../../components/tooltip/tooltip'; +import share from '../../../image/share.svg'; +import telegram from '../../../image/telegram.png'; +import { LinkWindow } from '../../../components/link/link'; +import useMediaQuery from '../../../hooks/useMediaQuery'; +import React from 'react'; +import styles from './Telegram.module.scss'; + +export function Telegram() { + // const mediaQuery = useMediaQuery('(min-width: 768px)'); + + if (true) { + return ( +
+ +
+ telegram +
+ eng +
+ + +
+ telegram +
+ ru +
+ + +
+ telegram +
+ news +
+
+ ); + } + + return ( + //
+ + +
+ feedback{' '} + share +
+
+ +
+ join movement{' '} + share +
+
+
+ } + > + +
+ telegram +
+
+ + // {/* */} + ); +} diff --git a/src/pages/Social/Twitter/Twitter.module.scss b/src/pages/Social/Twitter/Twitter.module.scss new file mode 100644 index 000000000..35a7c4283 --- /dev/null +++ b/src/pages/Social/Twitter/Twitter.module.scss @@ -0,0 +1,16 @@ +.wrapper { + // position: fixed; + // bottom: 25px; + // left: 100px; + position: relative; + top: -2px; + // z-index: 2; +} + +.icon { + height: 38px; + + &:hover { + opacity: 0.7; + } +} diff --git a/src/components/actionBar/Twitter/Twitter.tsx b/src/pages/Social/Twitter/Twitter.tsx similarity index 100% rename from src/components/actionBar/Twitter/Twitter.tsx rename to src/pages/Social/Twitter/Twitter.tsx diff --git a/src/components/actionBar/Twitter/twitter.png b/src/pages/Social/Twitter/twitter.png similarity index 100% rename from src/components/actionBar/Twitter/twitter.png rename to src/pages/Social/Twitter/twitter.png diff --git a/src/pages/Learn/Learn.module.scss b/src/pages/oracle/Learn/Learn.module.scss similarity index 100% rename from src/pages/Learn/Learn.module.scss rename to src/pages/oracle/Learn/Learn.module.scss diff --git a/src/pages/Learn/Learn.tsx b/src/pages/oracle/Learn/Learn.tsx similarity index 97% rename from src/pages/Learn/Learn.tsx rename to src/pages/oracle/Learn/Learn.tsx index 9a5722350..367aa6689 100644 --- a/src/pages/Learn/Learn.tsx +++ b/src/pages/oracle/Learn/Learn.tsx @@ -19,11 +19,10 @@ import { selectCurrentPassport } from 'src/features/passport/passports.redux'; import { Networks } from 'src/types/networks'; import useGetSlots from 'src/containers/mint/useGetSlots'; import { AdviserColors } from 'src/features/adviser/Adviser/Adviser'; -import KeywordButton from '../Search/components/KeywordButton/KeywordButton'; +import KeywordButton from '../landing/components/KeywordButton/KeywordButton'; import styles from './Learn.module.scss'; import { useBackend } from 'src/contexts/backend'; -import TitleText from '../Search/components/TitleText/TitleText'; -// import { learningListConfig } from '../Search/Search'; +import TitleText from '../landing/components/TitleText/TitleText'; const learningListConfig = [ { diff --git a/src/pages/oracle/landing/OracleLanding.module.scss b/src/pages/oracle/landing/OracleLanding.module.scss new file mode 100644 index 000000000..e02fe88dc --- /dev/null +++ b/src/pages/oracle/landing/OracleLanding.module.scss @@ -0,0 +1,185 @@ +$mobile-breakpoint: 480px; + +:export { + mobileBreakpoint: $mobile-breakpoint; +} + +.wrapper { + display: flex; + flex-direction: column; + justify-content: space-between; + // header, footer widths, TODO: use variables + min-height: calc(100vh - 120px - 60px - 45px); + + padding: 0 10px; + + // not good, need fix wrapper + margin-bottom: 100px; + margin-top: -15px; + + @media (width <= $mobile-breakpoint) { + // padding: 0 50px; + + .actionBarBtn { + min-width: 107px; + } + } + + --graph-size: 220px; +} + +.starsWrapper { + z-index: -1; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +.header { + margin: 0px auto; + width: 420px; + + @media (width <= $mobile-breakpoint) { + width: unset; + + > div { + width: 100vw; + } + } +} + +.info { + text-align: center; + margin-top: -5%; + + * { + font-weight: 400; + margin: 0; + } + + > :last-child { + margin-top: 70px; + } + + strong, + a { + color: #74ff00; + } + + a { + &:hover { + opacity: 0.8; + } + } + + @keyframes scaleInFadeIn { + 0% { + transform: scale(5); + opacity: 0; + } + + 20% { + transform: scale(1.1); + opacity: 1; + } + + 100% { + transform: scale(1); + opacity: 1; + } + + // 100% { + // transform: scale(0); + // } + } + + h2, + h3, + h4 { + $animation-duration: 2s; + animation-name: scaleInFadeIn; + animation-duration: $animation-duration; + } + + h2 { + font-size: clamp(26px, 3.3vw, 50px); + color: rgba(255, 255, 255, 0.78); + animation-delay: 0.3s; + animation-fill-mode: forwards; + opacity: 0; + } + + h3 { + font-size: clamp(40px, 4.7vw, 72px); + } + + h4 { + margin-top: 17px; + font-size: clamp(20px, 2.1vw, 32px); + color: rgba(255, 255, 255, 0.5); + animation-delay: 0.6s; + animation-fill-mode: forwards; + opacity: 0; + } + + i { + text-decoration: line-through; + } +} + +.footer { + display: flex; + gap: 0 clamp(10px, 2.6vw, 40px); + justify-content: center; +} + +.graphWrapper { + position: fixed; + left: 10px; + bottom: 10px; + z-index: 3; + + width: var(--graph-size); + height: var(--graph-size); + background-color: black; + + overflow: hidden; + + border-radius: 10px; + border: 1px solid rgba(118, 255, 3, 0.1); + + .enlargeBtn { + float: right; + position: relative; + top: 2px; + right: 2px; + + z-index: 1; + + width: 22px; + height: 22px; + + background-image: url('images/enlarge.svg'); + background-size: contain; + background-repeat: no-repeat; + + font-size: 0; + + &:hover { + opacity: 0.8; + } + } + + &::after { + content: ''; + position: absolute; + pointer-events: none; + left: 0; + right: 0; + top: 0; + bottom: 0; + box-shadow: inset 0 0 50px 20px black; + } +} diff --git a/src/pages/Search/Search.tsx b/src/pages/oracle/landing/OracleLanding.tsx similarity index 53% rename from src/pages/Search/Search.tsx rename to src/pages/oracle/landing/OracleLanding.tsx index 462abcf7d..1acd966eb 100644 --- a/src/pages/Search/Search.tsx +++ b/src/pages/oracle/landing/OracleLanding.tsx @@ -3,21 +3,22 @@ import { routes } from 'src/routes'; import { useEffect, useMemo, useRef, useState } from 'react'; import CyberlinksGraphContainer from 'src/features/cyberlinks/CyberlinksGraph/CyberlinksGraphContainer'; import { Stars } from 'src/containers/portal/components'; -import { TypingText } from 'src/containers/temple/pages/play/PlayBanerContent'; + import { useDevice } from 'src/contexts/device'; -import cx from 'classnames'; -import { useAppDispatch, useAppSelector } from 'src/redux/hooks'; + +import { useAppDispatch } from 'src/redux/hooks'; import { setFocus } from 'src/containers/application/Header/Commander/commander.redux'; -import styles from './Search.module.scss'; +import Carousel from 'src/components/Carousel/Carousel'; +import { Link, useNavigate, useSearchParams } from 'react-router-dom'; +import styles from './OracleLanding.module.scss'; import KeywordButton from './components/KeywordButton/KeywordButton'; -import TitleText from './components/TitleText/TitleText'; + import Stats from './Stats/Stats'; import graphDataPrepared from './graphDataPrepared.json'; -import Carousel from 'src/components/Carousel/Carousel'; export enum TitleType { search, - ai, + ai, // ask learning, } @@ -35,9 +36,11 @@ const listConfig = { find and deliver content ), - text2: ( + description: ( <> - decentralized search is just one cyber app aip + decentralized search is just one{' '} + cyber app{' '} + aip ), }, @@ -45,10 +48,10 @@ const listConfig = { title: 'empower everyone', text: ( <> - learn yourself + learn yourself ), - text2: ( + description: ( <> decentralized learning as simple as creating a link @@ -58,43 +61,44 @@ const listConfig = { title: 'decentralized ai is alive', text: ( <> - behold the new truth medium + behold the new{' '} + truth medium ), - text2: ( + description: ( <> - cyber is the protocol for unified, provable, collective - learning + cyber is the + protocol for unified, provable, collective learning ), }, }; -export const learningListConfig = listConfig[TitleType.learning]; +const QUERY_KEY = 'type'; + +function OracleLanding() { + const [searchParams] = useSearchParams(); + const type = searchParams.get(QUERY_KEY); -function Search() { - const [titleType, setTitleType] = useState(TitleType.ai); + const [titleType, setTitleType] = useState( + Number( + Object.entries(mapTitleTypeToTitle).find( + ([, value]) => value === type + )?.[0] + ) || TitleType.search + ); const [isRenderGraph, setIsRenderGraph] = useState(false); const { viewportWidth } = useDevice(); + const navigate = useNavigate(); const ref = useRef(null); - const dispatch = useAppDispatch(); - let graphSize = Math.min(viewportWidth / 3, 330); - - const isCommanderFocused = useAppSelector( - (state) => state.commander.isFocused - ); - + const graphSize = 220; const isMobile = viewportWidth <= Number(styles.mobileBreakpoint.replace('px', '')); - if (isMobile) { - graphSize = 330; - } - useEffect(() => { dispatch(setFocus(true)); @@ -115,34 +119,7 @@ function Search() { ref.current.style.setProperty('--graph-size', `${graphSize}px`); }, [ref, graphSize]); - // useEffect(() => { - // const interval = setInterval(() => { - // setTitleType((prev) => { - // // refactor maybe, generated - // switch (prev) { - // case TitleType.search: - // return TitleType.learning; - - // case TitleType.learning: - // return TitleType.ai; - - // case TitleType.ai: - // return TitleType.search; - - // default: - // return TitleType.search; - // } - // }); - // }, 10 * 1000); - - // return () => { - // clearInterval(interval); - // }; - // }, [titleType]); - - const { title, text2, text } = listConfig[titleType]; - - // console.log(styles); + const { title, description, text } = listConfig[titleType]; const listSlides = useMemo(() => { return [TitleType.search, TitleType.ai, TitleType.learning].map((type) => { @@ -162,85 +139,58 @@ function Search() {
{ + activeStep={titleType} + onChange={(index: TitleType) => { setTitleType(index); + navigate(`?${QUERY_KEY}=${mapTitleTypeToTitle[index]}`, { + replace: true, + }); }} slides={listSlides} />
-
-

{ - return; - debugger; - console.log(styles); - - ref?.animate(styles.anim); - }} - > - {title} -

+
+

{title}

{text}

-

{text2}

+

{description}

- {/*
-

- decentralized{' '} - - { - switch (titleType) { - case TitleType.search: - return 'search'; - - case TitleType.learning: - return 'learning'; + {!isMobile && ( +
+ - case TitleType.ai: - return 'ai'; - - default: - return ''; - } - })()} - delay={40} - /> - {' '} - is here -

*/} - - {/*
*/} - {/* {isRenderGraph && ( + {isRenderGraph && ( - )} */} - {/*
*/} - - {/* not render to prevent requests */} - {/* {!isMobile && } */} - {/*
*/} - - {/*
    - {listConfig[titleType].map(({ title, text }) => { - return ( -
  • - -
  • - ); - })} */} - - {/*
*/} + )} +
+ )}
- {['cyber', 'donut of knowledge', 'help'].map((keyword) => { - return ; + {[ + { + query: 'cyber', + author: 'bostrom1d8754xqa9245pctlfcyv8eah468neqzn3a0y0t', + }, + { + query: 'donut of knowledge', + author: 'bostrom1k7nssnnvxezpp4una7lvk6j53895vadpqe6jh6', + }, + { + query: 'help', + author: 'bostrom1hmkqhy8ygl6tnl5g8tc503rwrmmrkjcq3lduwj', + }, + ].map(({ query, author }) => { + return ; })}
@@ -283,4 +233,4 @@ function Search() { ); } -export default Search; +export default OracleLanding; diff --git a/src/pages/Search/Stats/Stats.module.scss b/src/pages/oracle/landing/Stats/Stats.module.scss similarity index 100% rename from src/pages/Search/Stats/Stats.module.scss rename to src/pages/oracle/landing/Stats/Stats.module.scss diff --git a/src/pages/oracle/landing/Stats/Stats.tsx b/src/pages/oracle/landing/Stats/Stats.tsx new file mode 100644 index 000000000..8b9cd6fda --- /dev/null +++ b/src/pages/oracle/landing/Stats/Stats.tsx @@ -0,0 +1,63 @@ +import { + useGetGraphStats, + useGetNegentropy, +} from 'src/containers/temple/hooks'; +import { TypingText } from 'src/containers/temple/pages/play/PlayBanerContent'; +import cx from 'classnames'; +import styles from './Stats.module.scss'; +import { TitleType } from '../OracleLanding'; +import { routes } from 'src/routes'; +import { Link } from 'react-router-dom'; + +type Props = { + type: TitleType; +}; + +const REFETCH_INTERVAL = 1000 * 7; + +function Stats({ type }: Props) { + const dataGetGraphStats = useGetGraphStats(REFETCH_INTERVAL); + const negentropy = useGetNegentropy(REFETCH_INTERVAL); + + let value: number | undefined; + let text: string | JSX.Element; + + switch (type) { + case TitleType.search: + value = dataGetGraphStats.data?.particles; + text = particles; + break; + + case TitleType.learning: + value = dataGetGraphStats.data?.cyberlinks; + text = ( + cyberlinks + ); + break; + + case TitleType.ai: + value = negentropy.data?.negentropy; + text = ( + syntropy bits + ); + break; + + default: + } + + return ( +
+ {value && ( + <> + {' '} + {text} and growing + + )} +
+ ); +} + +export default Stats; diff --git a/src/pages/Search/components/KeywordButton/KeywordButton.module.scss b/src/pages/oracle/landing/components/KeywordButton/KeywordButton.module.scss similarity index 100% rename from src/pages/Search/components/KeywordButton/KeywordButton.module.scss rename to src/pages/oracle/landing/components/KeywordButton/KeywordButton.module.scss diff --git a/src/pages/Search/components/KeywordButton/KeywordButton.stories.tsx b/src/pages/oracle/landing/components/KeywordButton/KeywordButton.stories.tsx similarity index 100% rename from src/pages/Search/components/KeywordButton/KeywordButton.stories.tsx rename to src/pages/oracle/landing/components/KeywordButton/KeywordButton.stories.tsx diff --git a/src/pages/oracle/landing/components/KeywordButton/KeywordButton.tsx b/src/pages/oracle/landing/components/KeywordButton/KeywordButton.tsx new file mode 100644 index 000000000..c1d446377 --- /dev/null +++ b/src/pages/oracle/landing/components/KeywordButton/KeywordButton.tsx @@ -0,0 +1,21 @@ +import { Link } from 'react-router-dom'; +import styles from './KeywordButton.module.scss'; +import { routes } from 'src/routes'; +import { Account, Tooltip } from 'src/components'; +import Pill from 'src/components/Pill/Pill'; + +function KeywordButton({ keyword, author }: { keyword: string }) { + return ( + }> + + {keyword} + + + ); +} + +export default KeywordButton; diff --git a/src/pages/Search/components/TitleText/TitleText.module.scss b/src/pages/oracle/landing/components/TitleText/TitleText.module.scss similarity index 100% rename from src/pages/Search/components/TitleText/TitleText.module.scss rename to src/pages/oracle/landing/components/TitleText/TitleText.module.scss diff --git a/src/pages/Search/components/TitleText/TitleText.stories.tsx b/src/pages/oracle/landing/components/TitleText/TitleText.stories.tsx similarity index 100% rename from src/pages/Search/components/TitleText/TitleText.stories.tsx rename to src/pages/oracle/landing/components/TitleText/TitleText.stories.tsx diff --git a/src/pages/Search/components/TitleText/TitleText.tsx b/src/pages/oracle/landing/components/TitleText/TitleText.tsx similarity index 100% rename from src/pages/Search/components/TitleText/TitleText.tsx rename to src/pages/oracle/landing/components/TitleText/TitleText.tsx diff --git a/src/pages/Search/graphDataPrepared.json b/src/pages/oracle/landing/graphDataPrepared.json similarity index 100% rename from src/pages/Search/graphDataPrepared.json rename to src/pages/oracle/landing/graphDataPrepared.json diff --git a/src/router.tsx b/src/router.tsx index 94d0635f1..e24c9a79c 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -55,10 +55,11 @@ import Robot from './pages/robot/Robot'; import SigmaWrapper from './containers/sigma/SigmaWrapper'; import Keys from './pages/Keys/Keys'; import Teleport from './containers/teleport/pages/Teleport'; -import Search from './pages/Search/Search'; -import Learn from './pages/Learn/Learn'; -import CyberlinksGraphContainer from './features/cyberlinks/CyberlinksGraph/CyberlinksGraphContainer'; +import OracleLanding from './pages/oracle/landing/OracleLanding'; +import Learn from './pages/oracle/Learn/Learn'; import ToOracleAsk from './pages/redirects/ToOracleAsk'; +import Social from './pages/Social/Social'; +import Brain from './pages/Brain/Brain'; type WrappedRouterProps = { children: React.ReactNode; @@ -116,7 +117,7 @@ function AppRouter() { }> - } /> + } /> } /> } /> @@ -161,11 +162,7 @@ function AppRouter() { } /> {['/graph', '/brain'].map((path) => ( - } - /> + } /> ))} } /> @@ -228,6 +225,8 @@ function AppRouter() { } /> + } /> + {/* works as 404 also */} } /> } /> diff --git a/src/routes.ts b/src/routes.ts index 13be20af7..404cb11b3 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -75,4 +75,10 @@ export const routes = { getLink: (query: string) => `/oracle/ask/${query}`, }, }, + social: { + path: '/social', + }, + brain: { + path: '/brain', + }, }; diff --git a/src/style/mixins.scss b/src/style/mixins.scss index 4797de3bb..407202d6b 100644 --- a/src/style/mixins.scss +++ b/src/style/mixins.scss @@ -7,3 +7,11 @@ rgba(54, 214, 174, 0.15) 100% ); } + +@mixin withShareIcon { + background-image: url('images/share.svg'); + background-repeat: no-repeat; + background-position: right 1.5px; + background-size: 20px; + padding-right: 20px; +}