Add vertical prop to FitCenter. Add OxygenToolbox to home page. Add Indicator to home. #20
@@ -1,7 +1,4 @@
|
|||||||
$main-color: #00D4FF;
|
@use '@/assets/css/constants.scss' as constants;
|
||||||
$background-color: #F5F5F5;
|
|
||||||
$font-main-color: #4D4D4D;
|
|
||||||
$font-secondary-color: #9E9E9E;
|
|
||||||
|
|
||||||
#root {
|
#root {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
@@ -9,7 +6,7 @@ $font-secondary-color: #9E9E9E;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.body {
|
.body {
|
||||||
color: $font-main-color;
|
color: constants.$font-main-color;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
min-width: 900px;
|
min-width: 900px;
|
||||||
min-height: 400px;
|
min-height: 400px;
|
||||||
@@ -108,3 +105,11 @@ $font-secondary-color: #9E9E9E;
|
|||||||
height: 23px;
|
height: 23px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.flex-horizontal {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-vertical {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
@@ -5,11 +5,3 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.direction-horizontal {
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
|
|
||||||
.direction-vertical {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
28
src/assets/css/components/common/indicator.scss
Normal file
28
src/assets/css/components/common/indicator.scss
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
@use '@/assets/css/constants.scss' as constants;
|
||||||
|
|
||||||
|
.dot-list {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
flex: auto;
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: {
|
||||||
|
width: 2px;
|
||||||
|
color: constants.$font-secondary-color;
|
||||||
|
style: solid;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.active>* {
|
||||||
|
background-color: constants.$font-secondary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,5 +8,4 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
background-color: #00D4FF;
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@use "../../mixins" as mixins;
|
@use "@/assets/css/mixins" as mixins;
|
||||||
|
|
||||||
.center-box {
|
.center-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
4
src/assets/css/constants.scss
Normal file
4
src/assets/css/constants.scss
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
$main-color: #00D4FF;
|
||||||
|
$background-color: #F5F5F5;
|
||||||
|
$font-main-color: #4D4D4D;
|
||||||
|
$font-secondary-color: #9E9E9E;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@use "../mixins" as mixins;
|
@use "@/assets/css/mixins" as mixins;
|
||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const FitCenter: React.FC<FitCenterProps> = (props) => {
|
|||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={`fit-center${className ? ' ' + className : ''}${
|
className={`fit-center${className ? ' ' + className : ''}${
|
||||||
vertical ? ' direction-vertical' : ' direction-horizontal'
|
vertical ? ' flex-vertical' : ' flex-horizontal'
|
||||||
}`}
|
}`}
|
||||||
{..._props}
|
{..._props}
|
||||||
></div>
|
></div>
|
||||||
|
|||||||
@@ -1,7 +1,39 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import _ from 'lodash'
|
||||||
|
import '@/assets/css/components/common/indicator.scss'
|
||||||
|
|
||||||
const Indicator: React.FC = () => {
|
interface IndicatorProps {
|
||||||
return <></>
|
total: number
|
||||||
|
current: number
|
||||||
|
onSwitch?: (index: number) => void
|
||||||
|
}
|
||||||
|
|
||||||
|
const Indicator: React.FC<IndicatorProps> = (props) => {
|
||||||
|
const { total, current, onSwitch } = props
|
||||||
|
|
||||||
|
const handleClick = (index: number) => {
|
||||||
|
return () => {
|
||||||
|
onSwitch && onSwitch(index)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ul className={'dot-list flex-vertical'}>
|
||||||
|
{_.range(0, total).map((_value, index) => {
|
||||||
|
return (
|
||||||
|
<li
|
||||||
|
key={index}
|
||||||
|
className={'item center-box' + (index === current ? ' active' : '')}
|
||||||
|
onClick={handleClick(index)}
|
||||||
|
>
|
||||||
|
<div className={'dot'} />
|
||||||
|
</li>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
</>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Indicator
|
export default Indicator
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Indicator from '@/components/common/Indicator.tsx'
|
|||||||
const Home: React.FC = () => {
|
const Home: React.FC = () => {
|
||||||
const {
|
const {
|
||||||
hideScrollbarRef,
|
hideScrollbarRef,
|
||||||
navbarHiddenState: { setNavbarHidden },
|
navbarHiddenState: { navbarHidden, setNavbarHidden },
|
||||||
preventScrollState: { setPreventScroll }
|
preventScrollState: { setPreventScroll }
|
||||||
} = useContext(MainFrameworkContext)
|
} = useContext(MainFrameworkContext)
|
||||||
|
|
||||||
@@ -124,6 +124,7 @@ const Home: React.FC = () => {
|
|||||||
if (event.key === 'ArrowDown') {
|
if (event.key === 'ArrowDown') {
|
||||||
handleScrollDown()
|
handleScrollDown()
|
||||||
}
|
}
|
||||||
|
console.log(content.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
const content = [
|
const content = [
|
||||||
@@ -152,8 +153,8 @@ const Home: React.FC = () => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={'indicator'}>
|
<div hidden={navbarHidden} className={'indicator'}>
|
||||||
<Indicator />
|
<Indicator total={content.length} current={currentContent} />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user