0.4.0 • Published 6 years ago

slot-game-js v0.4.0

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

slot-game-npm

创建老虎机插件

npm install slot-game-js

import SlotGame from 'slot-game-js';
const slotProps = {
    prizeNum: 12,// 滚动显示奖品的数量
    isSync: true,// 老虎机动画是否同步进行
    time: 2000,
};

const t = new SlotGame('#slot-game', slotProps);

t.startGame('13', function () {

});
$itemWidth: 100;

#slot-game {
    width: rem($itemWidth*3);
    height: rem($itemWidth*2);
    background-color: aliceblue;
    @include prefixv(display, flex);
    @include prefix(flex-flow, row wrap);
    @include prefix(justify-content, center);

    position: absolute;
    top: 50%;
    left: 50%;
    @include prefix(transform, translate(-50%, -50%));

    .content {
        @include prefix(flex, 1);
        overflow: hidden;
        position: relative;

        > ul {
            position: absolute;
            top: rem(-$itemWidth/2);
        }

        .slot-icon {
            width: rem($itemWidth);
            height: rem($itemWidth);
            line-height: rem($itemWidth);
            text-align: center;
        }

        //.slot-icon-1 {
        //    @include bg('../images/apple.png', 100);
        //}
        //.slot-icon-2 {
        //    @include bg('../images/diamond.png', 100);
        //}
        //.slot-icon-3 {
        //    @include bg('../images/coin.png', 100);
        //}
        //.slot-icon-4 {
        //    @include bg('../images/banana.png', 100);
        //}
        //.slot-icon-5 {
        //    @include bg('../images/watermelon.png', 100);
        //}
    }
}
0.4.0

6 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago