Commit eba4c7b1 authored by hewenhao's avatar hewenhao

feat: ui

parent 37e157cf
......@@ -8,13 +8,4 @@
color: #FFFFFF;
line-height: 44px;
padding: 0 32px;
display: flex;
align-items: center;
justify-content: center;
}
.content {
display: flex;
align-items: center;
justify-content: center;
}
import { View } from '@tarojs/components'
import { useMemo } from 'react'
import classNames from 'classnames'
import { cs } from '@/styles'
import LazeImage from '../lazy-image'
import { type Part, type SmallPart, groupRoundToSmallPart, getPartBg } from './constants'
import { type Part, groupRoundToSmallPart, getPartBg } from './constants'
import SceneSmallPart from './small-part'
import styles from './part.module.scss'
......@@ -22,8 +24,8 @@ const ScenePart = (props: ScenePartProps) => {
return (
<View>
<LazeImage source={bg} contentClass={styles.content}>
<View className={styles.partName}>Part {part.number + 1}</View>
<LazeImage source={bg} contentClass={classNames(cs.flex, cs.align_center)}>
<View className={classNames(styles.partName, cs.flex, cs.align_center)}>Part {part.number + 1}</View>
</LazeImage>
{smallParts.map(item => {
return (
......
import { View, Image } from '@tarojs/components'
import assets from '@/assets/oss/assets-round'
import classNames from 'classnames'
import { cs } from '@/styles'
import { RoundState, type Round, RoundType, type ImageSource, RoundScore, CurrentRoundId, SceneContext } from './constants'
import RoundTag from './round-tag'
......@@ -142,7 +143,7 @@ const RoundComp = (props: RoundProps) => {
return (
<SceneContext.Consumer>
{({ ready }) => (
<View className={props.className} id={round.state === RoundState.UnLocked ? CurrentRoundId : undefined}>
<View className={classNames(props.className, cs.bounce_btn)} hoverClass={cs.bounce_btn_hover} id={round.state === RoundState.UnLocked ? CurrentRoundId : undefined}>
{renderRound(ready)}
<View className={styles.roundName}>{round.name}</View>
</View>
......
.flex {
display: flex;
&__item {
flex: 1;
}
}
.align_center {
align-items: center;
justify-content: center;
}
.is_hover {
position: relative;
&::after {
position: absolute;
content: " ";
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,.1);
}
}
.bounce_btn {
transition: transform .3s ease-in-out;
will-change: transform;
&.bounce_btn_hover {
transform: scale(.95);
}
}
import commonStyles from './common.module.scss'
/** 公用样式 */
type CommonStyles = {
flex: string;
flex__item: string;
is_hover: string;
align_center: string;
bounce_btn: string;
bounce_btn_hover: string;
[key: string]: string;
}
const cs = commonStyles as CommonStyles
export { cs as commonStyles, cs }
@mixin hairline-common() {
position: absolute;
box-sizing: border-box;
transform-origin: center; /* cover wechat button:after default transforn-origin */
content: ' ';
pointer-events: none;
}
@mixin btn($bg-color: #FFA315) {
height: 80px;
background: $bg-color;
border-radius: 40px;
flex: 1;
overflow: hidden;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
}
@mixin hairline($border-color: #eee) {
@include hairline-common();
top: -50%;
right: -50%;
bottom: -50%;
left: -50%;
border: 0 solid $border-color;
transform: scale(0.5);
}
@mixin hairline-bottom($border-color: #eee, $left: 0) {
@include hairline-common();
top: auto;
right: 0;
bottom: 0;
left: $left;
border-bottom: 1px solid $border-color;
transform: scaleY(0.5);
}
@mixin multi-ellipsis($lines) {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: $lines;
/*! autoprefixer: ignore next */
-webkit-box-orient: vertical;
}
@mixin ellipsis() {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
@mixin flexLayout($direction: row, $align: stretch) {
display: flex;
flex-flow: $direction;
align-items: $align;
}
\ No newline at end of file
$primary-color: #35B8FE;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment