Skip to content

Commit

Permalink
UI: 调整二次验证的样式实现和移动实现
Browse files Browse the repository at this point in the history
  • Loading branch information
lingting committed Apr 25, 2023
1 parent fe411a9 commit 147e35a
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 104 deletions.
99 changes: 0 additions & 99 deletions src/components/Captcha/index.css

This file was deleted.

104 changes: 104 additions & 0 deletions src/components/Captcha/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
@captcha-img-url: '/captcha-tianai.png';

.slider {
background-color: #fff;
width: 278px;
height: 285px;
z-index: 999;
box-sizing: border-box;
padding: 9px;
border-radius: 6px;
box-shadow: 0 0 11px 0 #999;
user-select: none;

.content {
width: 100%;
height: 159px;
position: relative;
}

.bg-img-div {
width: 100%;
height: 100%;
position: absolute;
transform: translate3d(0, 0, 0);
}

.slider-img-div {
height: 100%;
position: absolute;
transform: translate3d(0, 0, 0);
}

.bg-img-div img {
width: 100%;
}

.slider-img-div img {
height: 100%;
}

.refresh-btn,
.close-btn,
.slider-move-track,
.slider-move-btn {
background: url(@captcha-img-url) no-repeat;
}

.refresh-btn,
.close-btn {
display: inline-block;
}

.slider-move {
height: 60px;
width: 100%;
margin: 11px 0;
position: relative;

.slider-move-track {
line-height: 38px;
font-size: 14px;
text-align: center;
white-space: nowrap;
color: #88949d;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
}

.slider-move-btn {
transform: translate3d(0, 0, 0);
background-position: -5px 11.79625%;
position: absolute;
top: -12px;
left: 0;
width: 66px;
height: 66px;
}
}

.slider-move-btn:hover,
.close-btn:hover,
.refresh-btn:hover {
cursor: pointer;
}

.bottom {
height: 19px;
width: 100%;

.close-btn {
width: 20px;
height: 20px;
background-position: 0 44.86874%;
margin-right: 5px;
}

.refresh-btn {
width: 20px;
height: 20px;
background-position: 0 81.38425%;
}
}
}
10 changes: 5 additions & 5 deletions src/components/Captcha/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { captchaGet, captchaValid } from '@/services/captcha';
import I18n from '@/utils/I18nUtils';
import type { CSSProperties, RefObject } from 'react';
import React, { Component } from 'react';
import './index.css';
import './index.less';

export * from './typings';

Expand Down Expand Up @@ -43,10 +43,10 @@ const defaultState = {
trackArr: [],
moveBtnStyles: {
backgroundPosition: '-5px 11.79625%',
transform: 'translate(0px, 0px)',
transform: 'translate3d(0px, 0px, 0)',
},
imgDivStyles: {
transform: 'translate(0px, 0px)',
transform: 'translate3d(0px, 0px, 0)',
},
raw: {},
};
Expand Down Expand Up @@ -186,8 +186,8 @@ export default class extends AbstractVerify<State> {
moveX,
trackArr,
movePercent: moveX / (bgImgRef.current?.width || 1),
moveBtnStyles: { ...moveBtnStyles, transform: `translate(${moveX}px, 0px)` },
imgDivStyles: { transform: `translate(${moveX}px, 0px)` },
moveBtnStyles: { ...moveBtnStyles, transform: `translate3d(${moveX}px, 0px, 0)` },
imgDivStyles: { transform: `translate3d(${moveX}px, 0px, 0)` },
});
}

Expand Down

0 comments on commit 147e35a

Please sign in to comment.