{"size": 4509, "ext": "js", "max_stars_repo_path": "build/static/js/main.f999e064.chunk.js", "max_stars_repo_name": "melikalbasi/clicky-game", "max_stars_repo_stars_event_min_datetime": "2019-02-18T03:10:41.000Z", "max_stars_repo_stars_event_max_datetime": "2019-02-18T03:10:41.000Z", "max_issues_repo_path": "build/static/js/main.f999e064.chunk.js", "max_issues_repo_name": "melikalbasi/clicky-game", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "build/static/js/main.f999e064.chunk.js", "max_forks_repo_name": "melikalbasi/clicky-game", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 2254.5, "max_line_length": 4461, "alphanum_fraction": 0.747172322}
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{13:function(e,t,c){e.exports=c(37)},19:function(e,t,c){},2:function(e){e.exports=[{id:1,link:"https://assets.vogue.com/photos/5c48ae54153d8a2d1ae2feea/master/w_175,c_limit/_VIE0008.jpg",clicked:!1},{id:2,link:"https://assets.vogue.com/photos/5c48ae6fc114db2d1212b273/master/w_175,c_limit/_VIE0029.jpg",clicked:!1},{id:3,link:"https://assets.vogue.com/photos/5c48ad89846ee32d4e7e7152/master/w_175,c_limit/_VIE0047.jpg",clicked:!1},{id:4,link:"https://assets.vogue.com/photos/5c48add58cd9fb2d35e2824c/master/w_175,c_limit/_VIE0067.jpg",clicked:!1},{id:5,link:"https://assets.vogue.com/photos/5c48aeec153d8a2d1ae2feed/master/w_175,c_limit/_VIE0238.jpg",clicked:!1},{id:6,link:"https://assets.vogue.com/photos/5c48aeb6846ee32d4e7e715b/master/w_175,c_limit/_VIE0100.jpg",clicked:!1},{id:7,link:"https://assets.vogue.com/photos/5c48aec33476db3b7bd26a72/master/w_175,c_limit/_VIE0127.jpg",clicked:!1},{id:8,link:"https://assets.vogue.com/photos/5c48ae62733a802cfeea8002/master/w_175,c_limit/_VIE0142.jpg",clicked:!1},{id:9,link:"https://assets.vogue.com/photos/5c48ae84aa8b2e2d2f978fba/master/w_175,c_limit/_VIE0158.jpg",clicked:!1},{id:10,link:"https://assets.vogue.com/photos/5c48aebc13714b2cff25ba7c/master/w_175,c_limit/_VIE0183.jpg",clicked:!1},{id:11,link:"https://assets.vogue.com/photos/5c48aee53476db3b7bd26a76/master/w_175,c_limit/_VIE0268.jpg",clicked:!1},{id:12,link:"https://assets.vogue.com/photos/5c48ae91c114db2d1212b275/master/w_175,c_limit/_VIE0296.jpg",clicked:!1}]},21:function(e,t,c){},37:function(e,t,c){"use strict";c.r(t);var a=c(0),s=c.n(a),o=c(4),r=c.n(o),n=(c(19),c(5)),i=c(6),l=c(11),d=c(7),m=c(12),u=(c(21),function(e){return s.a.createElement("div",null,s.a.createElement("div",{className:"jumbotron"},s.a.createElement("text",null,s.a.createElement("h1",{className:"row justify-content-center"},"Clicky Couture"),s.a.createElement("p",{className:"row justify-content-center",id:"rules"},"Let's test your memory of the show. Click any card to start the game."),s.a.createElement("hr",null),s.a.createElement("p",{className:"row justify-content-center",id:"scores"},"Current Score: ",e.currentScore," | Top Score: ",e.topScore),s.a.createElement("p",{className:"row justify-content-center",id:"message"},e.message))))}),p=function(e){return s.a.createElement("div",{onClick:function(){return e.click(e.character.id)}},s.a.createElement("img",{className:"img-fluid hvr-pop","data-clicked":e.clicked,alt:e.character.name,src:e.character.link}))},h=c(2),k=c(8),f=h,g=function(e){function t(){var e,c;Object(n.a)(this,t);for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return(c=Object(l.a)(this,(e=Object(d.a)(t)).call.apply(e,[this].concat(s)))).state={characters:h,currentScore:0,topScore:0,message:"",clicked:[],videoOptions:{}},c.shuffle=function(e){for(var t=e.length-1;t>0;t--){var c=Math.floor(Math.random()*(t+1)),a=[e[c],e[t]];e[t]=a[0],e[c]=a[1]}return e},c.handleClick=function(e){c.setState({characters:c.shuffle(f)}),c.state.clicked.includes(e)?c.setState({currentScore:0,clicked:[],message:"You lost! \nClick a card to restart the game."}):(c.setState({currentScore:c.state.currentScore+1,topScore:c.state.topScore+1,clicked:c.state.clicked.concat(e),message:""},function(){12===c.state.currentScore&&c.setState({message:"You won!"})}),c.state.currentScore<c.state.topScore&&c.setState({topScore:c.state.topScore}))},c}return Object(m.a)(t,e),Object(i.a)(t,[{key:"componentDidMount",value:function(){this.setState({characters:this.shuffle(this.state.characters)})}},{key:"_onReady",value:function(e){e.target.playVideo()}},{key:"_onEnd",value:function(e){e.target.playVideo()}},{key:"render",value:function(){var e=this;return s.a.createElement("div",null,s.a.createElement("div",{className:"video-background"},s.a.createElement("div",{className:"video-foreground"},s.a.createElement(k.a,{videoId:"aook_jC2Wxc",opts:this.state.videoOptions,className:"video-iframe",onReady:this._onReady,onEnd:this._onEnd}))),s.a.createElement(u,{currentScore:this.state.currentScore,topScore:this.state.topScore,message:this.state.message}),s.a.createElement("div",{className:"row justify-content-center no-gutters"},this.state.characters.map(function(t,c){return s.a.createElement(p,{video:e.backgroundVid,id:t.id,character:t,click:e.handleClick,key:c})})))}}]),t}(a.Component);r.a.render(s.a.createElement(g,null),document.getElementById("root"))}},[[13,2,1]]]);
//# sourceMappingURL=main.f999e064.chunk.js.map