Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.15
- import QtQuick.Layouts 1.3
- import QtQuick.Controls 2.12
- import QtGraphicalEffects 1.0
- import "../../../qml/common/controls"
- import "../../PokerGlobalScript.js" as PokerGlobalScript
- Item{
- id: lobbyLabelJackpot
- //Custom properties
- property string textTop: ""
- property string textBottom: ""
- property string textValue: ""
- property int backgroundRadius: 4
- property string moneyJackpot: "123456789"
- // pokerGlobalsModel.lobbyStateModel.smartJackpot
- // pokerGlobalsModel.lobbyStateModel.winUpJackpot
- // pokerGlobalsModel.lobbyStateModel.badBeatJackpot
- anchors.fill: parent
- clip: true
- RowLayout{
- id: lobbyLabelJackpotRowlabel
- spacing: 9
- anchors.fill: parent
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- SwipeView{
- id: jackpotLabelSwipe
- currentIndex: 0
- anchors.fill: parent
- Layout.fillWidth: true
- Repeater{
- id: repeaterSwipeViewContent
- model: 4
- Item{
- id: windowOne
- RowLayout{
- id: labelJackpot
- spacing: 16
- Layout.fillWidth: true
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- Rectangle{
- id: rectangeTextLabel
- width: linearGradientText.width
- height: linearGradientText.height
- color: "transparent"
- Label{
- id: labelText
- renderType: Text.NativeRendering
- font.weight: Font.ExtraBold
- antialiasing: true
- font.pointSize: 9.5
- Layout.alignment: Qt.AlignRight
- text: PokerGlobalScript.qsNls2( appManager.mainForm ? appManager.mainForm.locale : null, "dlg.lobby.title-jackpot", " SMART BADBEAT" + "\n" + "JACKPOT" )
- }
- DropShadow {
- anchors.fill: labelText
- horizontalOffset: 3
- verticalOffset: 3
- radius: 8.0
- samples: 17
- color: "#80000000"
- source: labelText
- }
- LinearGradient {
- id: linearGradientText
- anchors.fill: labelText
- source: labelText
- gradient: Gradient {
- GradientStop { position: 0; color: "#FFC452" }
- GradientStop { position: 0.5; color: "#FFC452" }
- GradientStop { position: 1; color: "#90630D" }
- }
- }
- }
- Label{
- id: amountOfMoney
- font.pointSize: 15
- color: "#ffffff"
- font.bold: true
- text: numberWithCommas(moneyJackpot) + ".00" + "$"
- }
- }
- }
- }
- }
- Button{
- id: buttonLeftClick
- width: 28
- height: 44
- // Layout.alignment: Qt.AlignLeft
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- background: Image {
- id: leftarrow
- opacity: 0.3
- source: "../../../qml/mobile/forms/lobby/home/jackpot/image/Union_Left.png"
- }
- onClicked: {
- console.log("Left");
- triggerFlippingLeft();
- }
- }
- Button{
- id: buttonRightClick
- width: 28
- height: 44
- anchors.right: parent.right
- // Layout.alignment: Qt.AlignRight
- anchors.verticalCenter: parent.verticalCenter
- background: Image {
- id: rightarrow
- opacity: 0.3
- source: "../../../qml/mobile/forms/lobby/home/jackpot/image/Union_Right.png"
- }
- onClicked: {
- console.log("Right");
- triggerFlippingRight();
- }
- }
- }
- Timer{
- id: timerFlippingContentJackpot
- interval: 3500;
- running: true;
- repeat: true
- onTriggered:{
- triggerFlippingRight();
- }
- }
- //function random value
- function getRandomMoney(min, max) {
- return Math.floor(Math.random() * (max - min) + min)
- }
- //function right button
- function triggerFlippingRight(){
- if(jackpotLabelSwipe.currentIndex < 3){
- jackpotLabelSwipe.currentIndex++;
- moneyJackpot = getRandomMoney(100000000, 500000000);
- }else{
- jackpotLabelSwipe.currentIndex = 0;
- }
- }
- //function left button
- function triggerFlippingLeft(){
- if(jackpotLabelSwipe.currentIndex > 0){
- jackpotLabelSwipe.currentIndex--;
- moneyJackpot = getRandomMoney(100000000, 500000000);
- }else{
- jackpotLabelSwipe.currentIndex = 3;
- }
- }
- //function automatic scrolling
- function triggerDelayTimer() {
- if(timerFlippingContentJackpot.running === true) {
- timerFlippingContentJackpot.running = false;
- sleep(5000);
- timerFlippingContentJackpot.running = true;
- }
- }
- //function sleep timer
- function sleep(millis) {
- var t = (new Date()).getTime();
- var i = 0;
- while (((new Date()).getTime() - t) < millis) {
- i++;
- }
- }
- //function division into categories
- function numberWithCommas(num) {
- return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement