Coder Social home page Coder Social logo

roleta_da_sorte_angular's Introduction

Roleta da sorte - Cliente

Código de elementos da roda

        <AbsoluteLayout class="item" >
                <Image src="~/assets/images/desconto.png" loadMode="async" stretch="aspectFit" class="icon"></Image>    
                <label class="textoElemento" text="30% desconto"></label>

        </AbsoluteLayout>

        <AbsoluteLayout class="item2">
            <Image src="~/assets/images/beer-outline.png" loadMode="async" stretch="aspectFit" class="icon2"></Image>

            <label class="textoElemento2" text="3 rodadas gratis"></label>
        
        </AbsoluteLayout>

        <AbsoluteLayout class="item3">
            <Image src="~/assets/images/beer-outline.png" loadMode="async" stretch="aspectFit" class="icon3"></Image>
            <label class="textoElemento3" text="Cerveja Gratis"></label>
        </AbsoluteLayout>

        <AbsoluteLayout class="item4">
            <Image src="~/assets/images/clock.png" loadMode="async" stretch="aspectFit" class="icon4"></Image>
            <label class="textoElemento4" text="Relogio evento"></label>
        
        </AbsoluteLayout>

        <AbsoluteLayout class="item5">
            <Image src="~/assets/images/vip.png" loadMode="async" stretch="aspectFit" class="icon5"></Image>
            <label class="textoElemento5" text="Pulseira VIP"></label> 

        </AbsoluteLayout>

        <AbsoluteLayout class="item6">
            <Image src="~/assets/images/glass.png" loadMode="async" stretch="aspectFit" class="icon6"></Image>
            <label class="textoElemento6" text="Copo Evento"></label>

        </AbsoluteLayout>

Código de sorteio da roda

   let ale = parseInt(this.sortear(1,6).join(','));
   let deg,premio;
   switch(ale){
       case 1:
            deg=790;
            premio="30% de desconto !"
            break;
        case 2:
            deg=1330
            premio="3 rodadas grátis"
            break;
        case 3:
            deg=910;
            premio="Cerveja Grátis"
            break;
        case 4:
            deg=1090;
            premio="Relógio Evento"
            break;
        case 5:
            deg=670;
            premio="Pulseira VIP"
            break;
        case 6:
            deg=850;
            premio="Copo Evento"
            break;
   }

  //Duration como duração da animação em milisegundos
   lbl.animate({rotate : deg, duration: 3000 });

Link do funcionamento no youtube

Funcionamento da Roleta

roleta_da_sorte_angular's People

Contributors

7ipolito avatar douglasjr97 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.