pixuireactcomponents 1.2.1 → 1.2.2
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/package.json
CHANGED
|
@@ -133,6 +133,10 @@ export class Slapface extends Component<any, any>
|
|
|
133
133
|
constructor(props) {
|
|
134
134
|
super(props)
|
|
135
135
|
this.LoadGroup = this.props.LoadGroup;
|
|
136
|
+
for(let i = 0;i<this.LoadGroup.length;i++)
|
|
137
|
+
{
|
|
138
|
+
this.LoadGroup[i].isLoadDone = false;
|
|
139
|
+
}
|
|
136
140
|
this.jumpButton = this.props.jumpButton? this.props.jumpButton : jumpButton
|
|
137
141
|
this.settingsitems = this.props.settingsitems? this.props.settingsitems : settingsitems
|
|
138
142
|
this.btn_closeButton = this.props.btn_closeButton? this.props.btn_closeButton : ''
|
|
@@ -150,9 +154,7 @@ export class Slapface extends Component<any, any>
|
|
|
150
154
|
}
|
|
151
155
|
|
|
152
156
|
return (
|
|
153
|
-
<div
|
|
154
|
-
<div style={{ flexDirection: 'row', flexWrap: 'nowrap' }}>
|
|
155
|
-
</div>
|
|
157
|
+
<div style ={{display:this.actDisplay,width:"100%",height:"100%"}}>
|
|
156
158
|
<div style={{ width: '100%', height: '100%', backgroundColor: "rgba(0,0,0,0.5)" }}>
|
|
157
159
|
{<Group {...slapfaceinfo} closeAct = {this.closeAct}/>}
|
|
158
160
|
</div>
|
|
@@ -198,9 +200,10 @@ class Group extends Component<any, any>
|
|
|
198
200
|
// setTimeout(()=>{this.picBack.style.display = 'flex';
|
|
199
201
|
// this.closeClick()},300)
|
|
200
202
|
// }
|
|
203
|
+
this.loadDisplay = "hidden"
|
|
201
204
|
if(this.firstFrameDisplay == "none"){
|
|
202
205
|
setTimeout(()=>{this.firstFrameDisplay = 'flex';
|
|
203
|
-
this.closeClick()},
|
|
206
|
+
this.closeClick()},300)
|
|
204
207
|
}
|
|
205
208
|
}
|
|
206
209
|
|
|
@@ -217,10 +220,9 @@ class Group extends Component<any, any>
|
|
|
217
220
|
closeClick(e?: Event) {
|
|
218
221
|
e?.stopPropagation()
|
|
219
222
|
let nextIndex = this.groupIndexList.CheckReady();
|
|
220
|
-
|
|
221
223
|
// setTimeout(() => {
|
|
222
224
|
// this.loadDisplay = "visible"
|
|
223
|
-
// },
|
|
225
|
+
// }, 50);
|
|
224
226
|
this.loadDisplay = "visible"
|
|
225
227
|
this.elseDisplay = "hidden"
|
|
226
228
|
if (nextIndex != -1) {
|
|
@@ -243,16 +245,14 @@ class Group extends Component<any, any>
|
|
|
243
245
|
)
|
|
244
246
|
}
|
|
245
247
|
|
|
246
|
-
return (<div
|
|
248
|
+
return (<div style={{ width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center', position: 'absolute'}}>
|
|
247
249
|
<div onClick={() => { if (this.props.settingsitems.is_mask == false) return; this.closeClick() }} style={{ position: "absolute", width: "100%", height: "100%" }}></div>
|
|
248
|
-
<div >
|
|
249
|
-
<img src = {this.groupArr[this.state.curIndex].picture} style ={{visibility:this.elseDisplay,width: this.groupArr[this.state.curIndex].width, height: this.groupArr[this.state.curIndex].height}} onLoad = {()=>{let curIndex = this.state.curIndex;if(!this.groupArr[curIndex].isLoadDone) {this.groupArr[curIndex].isLoadDone = true;
|
|
250
|
-
<
|
|
251
|
-
<
|
|
252
|
-
<CloseButton btn_closeButton = {this.props.btn_closeButton} elseDisplay = {this.elseDisplay} onClick={(e: Event) => { this.closeClick(e);this.loadDisplay = "hidden" }} />
|
|
253
|
-
<JumpButton elseDisplay = {this.elseDisplay} jumpButton = {this.props.jumpButton}/>
|
|
254
|
-
</div>
|
|
250
|
+
<div ref={(div)=>{this.picBack = div}} onAnimationEnd={() => {setTimeout(()=>{this.picBack.className = SlapfaceLess.groupBackReverse},0)}}>
|
|
251
|
+
<img src = {this.groupArr[this.state.curIndex].picture} style ={{visibility:this.elseDisplay,width: this.groupArr[this.state.curIndex].width, height: this.groupArr[this.state.curIndex].height}} onLoad = {()=>{let curIndex = this.state.curIndex;if(!this.groupArr[curIndex].isLoadDone) {this.groupArr[curIndex].isLoadDone = true;this.loadDisplay = "hidden";this.elseDisplay = "visible";this.forceUpdate()}}}></img>
|
|
252
|
+
<CloseButton firstFrameDisplay = {this.firstFrameDisplay} btn_closeButton = {this.props.btn_closeButton} elseDisplay = {this.elseDisplay} onClick={(e: Event) => { this.closeClick(e);}} />
|
|
253
|
+
<JumpButton firstFrameDisplay = {this.firstFrameDisplay} elseDisplay = {this.elseDisplay} jumpButton = {this.props.jumpButton}/>
|
|
255
254
|
</div>
|
|
255
|
+
<div ref={(div)=>{this.loadPic = div}} className={SlapfaceLess.loading_anim} style ={{backgroundImage: `url(${this.props.pic_loading})`,width:"300px", height: "300px",position:"absolute",visibility : this.loadDisplay}}> </div>
|
|
256
256
|
</div>);
|
|
257
257
|
}
|
|
258
258
|
|
|
@@ -262,7 +262,7 @@ class CloseButton extends Component<any, any>
|
|
|
262
262
|
{
|
|
263
263
|
render() {
|
|
264
264
|
return (
|
|
265
|
-
<button className={SlapfaceLess.closeButton} style={{
|
|
265
|
+
<button className={SlapfaceLess.closeButton} style={{display:this.props.firstFrameDisplay,visibility : this.props.elseDisplay,backgroundSize:"contain",backgroundImage: `url(${this.props.btn_closeButton})` }} onClick={this.props.onClick}></button>
|
|
266
266
|
)
|
|
267
267
|
}
|
|
268
268
|
}
|
|
@@ -272,8 +272,8 @@ class JumpButton extends Component<any, any>
|
|
|
272
272
|
private jumpbtnImg
|
|
273
273
|
render() {
|
|
274
274
|
return (
|
|
275
|
-
<div className= {SlapfaceLess.jumpButton} style ={{visibility : this.props.elseDisplay}}
|
|
276
|
-
onMouseDown={() => {(this.jumpbtnImg as HTMLImageElement).src = this.props.jumpButton.pic_yaxia;
|
|
275
|
+
<div className= {SlapfaceLess.jumpButton} style ={{display:this.props.firstFrameDisplay,visibility : this.props.elseDisplay}}
|
|
276
|
+
onMouseDown={() => {(this.jumpbtnImg as HTMLImageElement).src = this.props.jumpButton.pic_yaxia;}}
|
|
277
277
|
onMouseUp={() => { (this.jumpbtnImg as HTMLImageElement).src = this.props.jumpButton.pic_xuanfu }}
|
|
278
278
|
onMouseOver={() => { (this.jumpbtnImg as HTMLImageElement).src = this.props.jumpButton.pic_xuanfu; }}
|
|
279
279
|
onMouseOut={() => { (this.jumpbtnImg as HTMLImageElement).src = this.props.jumpButton.pic_changtai; }}>
|
|
@@ -15,14 +15,14 @@ let jumpButton = {
|
|
|
15
15
|
|
|
16
16
|
let btn_closeButton = Images.btn_close
|
|
17
17
|
|
|
18
|
-
let groupArr = [{ picture:
|
|
19
|
-
{ picture:
|
|
20
|
-
{ picture:
|
|
18
|
+
let groupArr = [{ picture: Images.slapface_samplepic1, width: 632, height: 639 }, { picture: Images.slapface_samplepic2, width: 304, height: 331 },
|
|
19
|
+
{ picture: Images.slapface_samplepic3, width: 662, height: 631 }, { picture: Images.slapface_samplepic4, width: 728, height: 651 },
|
|
20
|
+
{ picture: Images.slapface_samplepic5, width: 630, height: 579 }, { picture: Images.slapface_samplepic6, width: 703, height: 621 }];
|
|
21
21
|
|
|
22
22
|
export class SlapfaceDemo extends Component<any, any>{
|
|
23
23
|
render() {
|
|
24
24
|
return (
|
|
25
|
-
<div>
|
|
25
|
+
<div style={{position:"relative",width:"100%",height:"100%"}}>
|
|
26
26
|
<Slapface LoadGroup={groupArr} jumpButton={jumpButton} settingsitems={settingsitems} pic_loading={Images.loading} btn_closeButton = {Images.btn_close}/>
|
|
27
27
|
</div>
|
|
28
28
|
)
|