<!-- following markup is required at the minimum --><divclass="container-reel" id="container-reel"><divclass="reel" id="reel-1"></div><divclass="reel" id="reel-2"></div><divclass="reel" id="reel-3"></div></div><divrole="alert" aria-live="assertive" aria-relevant="additions" id="result"></div><buttontype="button" class="button" id="button-start">Start</button>
varSlotMachine=require('../src/slot-machine');/* HTML elements to passed to the SlotMachine constructor*/varreelContainer=document.getElementById('container-reel');varstartButton=document.getElementById('button-start');varresultContainer=document.getElementById('result');varreel1=document.getElementById('reel-1');varreel2=document.getElementById('reel-2');varreel3=document.getElementById('reel-3');/* instantiate the slotMachine */varslotMachine=newSlotMachine({reels: [['coffee maker','teapot','espresso machine'],['coffee filter','tea strainer','espresso tamper'],['coffee grounds','loose tea','ground espresso beans']],sequence: ['coffee','tea','expresso'],reelNodes: [reel1,reel2,reel3],reelContainer: reelContainer,startButton: startButton,resultContainer: resultContainer,slotHeight: 100,text: {jackpot: 'Congratulations, you won a free {drink}.',tryAgain: 'Better luck next time.'},css: {jackpot: 'jackpot',result: 'result'}});slotMachine.init();