pixuireactcomponents 1.1.16 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -12,4 +12,5 @@ export { Logger } from "./tools/Logger";
|
|
|
12
12
|
export { EventDispatcherJs } from "./tools/EventDispatcherJs";
|
|
13
13
|
export { Carousel } from "./ui/components/carousel/Carousel";
|
|
14
14
|
export { Slapface } from "./ui/components/slapface/Slapface";
|
|
15
|
+
export { SlapfaceLess } from "./ui/components/slapface/less/Slapface.less";
|
|
15
16
|
console.log("Hello, 欢迎使用PixUI React Components");
|
package/package.json
CHANGED
|
@@ -19,12 +19,16 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
19
19
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
20
|
};
|
|
21
21
|
import { h } from "preact";
|
|
22
|
-
import { useState, useEffect, useRef, useMemo } from '../../../../../lib/preact/hooks/src';
|
|
22
|
+
import { useState, useEffect, useRef, useMemo, useImperativeHandle } from '../../../../../lib/preact/hooks/src';
|
|
23
23
|
// import React, { useState, useEffect, useRef, useMemo } from 'preact/hooks';
|
|
24
24
|
var indicatorStyle = { width: '20px', height: '8px', margin: '5px', backgroundColor: '#cecfda', borderRadius: '3px' };
|
|
25
25
|
var indicatorSelectedStyle = __assign(__assign({}, indicatorStyle), { backgroundColor: '#fafbfc' });
|
|
26
26
|
export function Carousel(props) {
|
|
27
27
|
var _a = props.children, children = _a === void 0 ? [] : _a, _b = props.defaultIndex, defaultIndex = _b === void 0 ? 1 : _b, _c = props.compWidth, compWidth = _c === void 0 ? 100 : _c, _d = props.compHeight, compHeight = _d === void 0 ? 100 : _d, _e = props.autoplay, autoplay = _e === void 0 ? true : _e, _f = props.switchDuration, switchDuration = _f === void 0 ? 3000 : _f, _g = props.loop, loop = _g === void 0 ? true : _g, _h = props.isVertical, isVertical = _h === void 0 ? false : _h, _j = props.touchable, touchable = _j === void 0 ? true : _j, _k = props.onSlideChange, onSlideChange = _k === void 0 ? null : _k, _l = props.onclickEvent, onclickEvent = _l === void 0 ? null : _l;
|
|
28
|
+
useImperativeHandle(props.cRef, function () { return ({
|
|
29
|
+
handleNext: handleNext,
|
|
30
|
+
handlePrev: handlePrev
|
|
31
|
+
}); });
|
|
28
32
|
var duration = switchDuration < 1000 ? 1000 : switchDuration;
|
|
29
33
|
var _m = useState(defaultIndex), showIndex = _m[0], setShowIndex = _m[1];
|
|
30
34
|
//轮播元素正在滚动
|
|
@@ -199,9 +203,7 @@ export function Carousel(props) {
|
|
|
199
203
|
}, onDragEnd: function () { gestureUp(); } }),
|
|
200
204
|
h("div", { style: { flexDirection: isVertical ? 'column' : 'row', } }, children.map(function (v, i) {
|
|
201
205
|
return h("div", { style: (showIndex == i + 1) ? indicatorSelectedStyle : indicatorStyle, onClick: function () { setShowIndex(i + 1); } });
|
|
202
|
-
}))
|
|
203
|
-
h("div", { onClick: handlePrev, style: { width: '50px', height: '50px' } }, "left"),
|
|
204
|
-
h("div", { onClick: handleNext, style: { width: '50px', height: '50px' } }, "right")));
|
|
206
|
+
}))));
|
|
205
207
|
}
|
|
206
208
|
Carousel.Item = function (props) {
|
|
207
209
|
return h("div", { style: {
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
.maininterface{
|
|
2
|
+
width:1200px;
|
|
3
|
+
height:682px;
|
|
4
|
+
/* width:100%;
|
|
5
|
+
height:100%; */
|
|
6
|
+
margin: auto;
|
|
7
|
+
/* padding: 0px 36px 36px 36px; */
|
|
8
|
+
/* background-color: grey; */
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
.gameTitle{
|
|
13
|
+
height : 76px;
|
|
14
|
+
width:244px;
|
|
15
|
+
position: relative;
|
|
16
|
+
/* left:12px;
|
|
17
|
+
top:0px; */
|
|
18
|
+
font-size: 44px;
|
|
19
|
+
color:white;
|
|
20
|
+
background-color: rgb(180, 180, 180);
|
|
21
|
+
z-index: 999;
|
|
22
|
+
text-align: center;
|
|
23
|
+
float:left;
|
|
24
|
+
}
|
|
25
|
+
.closeButton{
|
|
26
|
+
width:36px;
|
|
27
|
+
height:36px;
|
|
28
|
+
background-size: contain;
|
|
29
|
+
/* float: left; */
|
|
30
|
+
position: absolute;
|
|
31
|
+
right:0px;
|
|
32
|
+
top:0px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@keyframes zoom{
|
|
36
|
+
from{
|
|
37
|
+
transform: scale(0)
|
|
38
|
+
}
|
|
39
|
+
80%{
|
|
40
|
+
transform: scale(1.1);
|
|
41
|
+
}
|
|
42
|
+
to{
|
|
43
|
+
transform: scale(1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.groupBack{
|
|
48
|
+
animation-name:zoom;
|
|
49
|
+
animation-timing-function:ease-in-out;
|
|
50
|
+
animation-iteration-count:1;
|
|
51
|
+
animation-duration: 1s;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.isShowToday{
|
|
55
|
+
width:36px;
|
|
56
|
+
height:31px;
|
|
57
|
+
background-size: contain;
|
|
58
|
+
position: absolute;
|
|
59
|
+
right:0px;
|
|
60
|
+
bottom:0px;
|
|
61
|
+
}
|
|
62
|
+
.title{
|
|
63
|
+
position: absolute;
|
|
64
|
+
color:red;
|
|
65
|
+
left:0px;
|
|
66
|
+
top:0px;
|
|
67
|
+
}
|
|
68
|
+
.groupFrame{
|
|
69
|
+
position:absolute;
|
|
70
|
+
right:0%;
|
|
71
|
+
bottom:0%;
|
|
72
|
+
}
|
|
73
|
+
.jumpButton{
|
|
74
|
+
position: absolute;
|
|
75
|
+
right:50%;
|
|
76
|
+
bottom:10%;
|
|
77
|
+
/* top:80%; */
|
|
78
|
+
transform: translate(50%, -50%);
|
|
79
|
+
}
|
|
80
|
+
.slapImage{
|
|
81
|
+
box-sizing: content-box;
|
|
82
|
+
/* border-width: 5px;
|
|
83
|
+
border-color: black;
|
|
84
|
+
border-style: solid; */
|
|
85
|
+
position: absolute;
|
|
86
|
+
left:50%;
|
|
87
|
+
top:50%;
|
|
88
|
+
transform:translate(-50%,-50%);
|
|
89
|
+
}
|
|
90
|
+
.frame {
|
|
91
|
+
border: 12px solid rgb(60, 65, 71);
|
|
92
|
+
display: flex;
|
|
93
|
+
/* flex-direction: row; */
|
|
94
|
+
/* flex-basis: content; */
|
|
95
|
+
/* justify-content: space-around; */
|
|
96
|
+
width: 1128px;
|
|
97
|
+
height: 604px;
|
|
98
|
+
position: relative;
|
|
99
|
+
top:-12px;
|
|
100
|
+
background-color: rgb(60, 65, 71);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.mask{
|
|
104
|
+
// background:url(images/coupon-logo.gif) no-repeat;
|
|
105
|
+
height:100px;background-color:#fff;
|
|
106
|
+
opacity:0.6;
|
|
107
|
+
}
|