// ==UserScript==
// @name phaser3-examples firstgame
// @namespace http://tampermonkey.net/
// @version 0.3
// @description 在 tampermonkey 中运行一个由 phaser3 编写的游戏,无法跳跃可以按一下Tab键。参考链接:(1) http://phaser.io/tutorials/making-your-first-phaser-3-game (2) https://github.com/Quinten/phaser-3-assets-as-data-uri/blob/master/src/index.js
// @author beibeibeibei
// @match https://www.baidu.com/
// @match https://m.baidu.com/*
// @require https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js
// @require https://cdn.jsdelivr.net/npm/phaser/dist/phaser.min.js
// @grant none
// ==/UserScript==
(function () {
'use strict';
const $ = jQuery.noConflict();
$("body").prepend('<div id="phaser-game"></div>');
$("#phaser-game").css("text-align", "left");
const P = Phaser;
const browser = {
versions: function () {
var u = navigator.userAgent, app = navigator.appVersion;
return {
trident: u.indexOf('Trident') > -1, //IE内核
presto: u.indexOf('Presto') > -1, //opera内核
webKit: u.indexOf('AppleWebKit') > -1,//苹果、谷歌内核
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,//火狐内核
mobile: !!u.match(/AppleWebKit.*Mobile.*/),//是否为移动终端
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),//ios终端
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,//android终端或者uc浏览器
iPhone: u.indexOf('iPhone') > -1,//是否为iPhone或者QQHD浏览器
iPad: u.indexOf('iPad') > -1//是否iPad
}
}()
}
var config_type = P.AUTO;
if(browser.versions.android){
config_type = P.CANVAS;
}
var config = {
type: config_type,
parent: 'phaser-game',
width: 800,
height: 600,
physics: {
default: 'arcade',
arcade: {
gravity: { y: 300 },
debug: false
}
},
scene: {
preload: preload,
create: create,
update: update
}
};
let player;
let platforms;
let stars;
let score = 0;
let scoreText;
let bombs;
let cursors;
let gameOver;
let game = new P.Game(config);
function preload() {
}
function create() {
let container = this.add.container();
this.textures.addBase64('bg', blueSrc);
var bgimage = new Image();
bgimage.onload = () => {
let bg = this.add.image(400, 300, 'bg');
container.addAt(bg, 0);
};
bgimage.src = blueSrc;
this.textures.addBase64('ground', platformSrc);
var groundimage = new Image();
groundimage.onload = () => {
platforms = this.physics.add.staticGroup();
platforms.create(400, 568, 'ground').setScale(2).refreshBody();
platforms.create(600, 400, 'ground');
platforms.create(50, 250, 'ground');
platforms.create(750, 220, 'ground');
};
groundimage.src = platformSrc;
var dudeimage = new Image();
dudeimage.onload = () => {
this.textures.addSpriteSheet('dude', dudeimage, { frameWidth: 32, frameHeight: 48 });
player = this.physics.add.sprite(100, 450, 'dude');
player.setBounce(0.2);
player.setCollideWorldBounds(true);
this.anims.create({
key: 'left',
frames: this.anims.generateFrameNumbers('dude', { start: 0, end: 3 }),
frameRate: 10,
repeat: -1
});
this.anims.create({
key: 'turn',
frames: [{ key: 'dude', frame: 4 }],
frameRate: 20
});
this.anims.create({
key: 'right',
frames: this.anims.generateFrameNumbers('dude', { start: 5, end: 8 }),
frameRate: 10,
repeat: -1
});
};
dudeimage.src = dudeSrc;
this.textures.addBase64('star', starSrc);
var starimage = new Image();
starimage.onload = () => {
stars = this.physics.add.group({
key: 'star',
repeat: 11,
setXY: { x: 12, y: 0, stepX: 70 }
});
stars.children.iterate(function (child) {
child.setBounceY(P.Math.FloatBetween(0.4, 0.8));
});
};
starimage.src = starSrc;
this.textures.addBase64('bomb', bombSrc);
var bombimage = new Image();
bombimage.onload = () => {
bombs = this.physics.add.group();
};
bombimage.src = bombSrc;
scoreText = this.add.text(16, 16, '分数: 0', { fontSize: '30px', fill: '#fff' });
container.addAt(scoreText, 1);
cursors = this.input.keyboard.createCursorKeys();
this.input.addPointer(9);
}
let notAlreadyRunCollider = true;
let window_orientation = -1;
function update() {
if (this.textures.exists("dude") && this.textures.exists("ground") && this.textures.exists("star") && !gameOver) {
if (notAlreadyRunCollider) {
this.physics.add.collider(player, platforms);
this.physics.add.collider(stars, platforms);
this.physics.add.overlap(player, stars, collectStar, null, this);
this.physics.add.collider(bombs, platforms);
this.physics.add.collider(player, bombs, hitBomb, null, this);
notAlreadyRunCollider = false;
}
var pointer = this.input.activePointer;
if (cursors.left.isDown || (pointer.isDown && pointer.worldX < 800 * 1 / 3)) {
player.setVelocityX(-160);
player.anims.play('left', true);
}
else if (cursors.right.isDown || (pointer.isDown && pointer.worldX < 800 * 2 / 3)) {
player.setVelocityX(160);
player.anims.play('right', true);
}
else {
player.setVelocityX(0);
player.anims.play('turn');
}
if ((cursors.up.isDown && player.body.touching.down) || (pointer.isDown && pointer.worldX > 800 * 2 / 3 && player.body.touching.down)) {
player.setVelocityY(-330);
}
}
if(window_orientation != window.orientation){
if($(window).width() < 800||$(window).height() < 600){
this.scale.setZoom(Math.min($(window).width() / 800, $(window).height() / 600, 1));
}
let window_orientation = window.orientation;
}
}
function collectStar(player, star) {
star.disableBody(true, true);
score += 10;
scoreText.setText('分数: ' + score);
if (stars.countActive(true) === 0) {
stars.children.iterate(function (child) {
child.enableBody(true, child.x, 0, true, true);
});
var x = (player.x < 400) ? P.Math.Between(400, 800) : P.Math.Between(0, 400);
var bomb = bombs.create(x, 16, 'bomb');
bomb.setBounce(1);
bomb.setCollideWorldBounds(true);
bomb.setVelocity(P.Math.Between(-200, 200), 20);
}
}
function hitBomb(player, bomb) {
this.physics.pause();
player.setTint(0xff0000);
player.anims.play('turn');
gameOver = true;
}
const blueSrc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAJYCAYAAACadoJwAAAgAElEQVR4Xu3XoUomUBRG0bkvMdVqtpqt5qlTzVaz1WywWCyGKVMsFkERDIrwB4cBwSAIBh/gCvchdlrnBT5YnLLHz9Ob+cMRIECAAAECBAgQIEAgEBgCJFA2QYAAAQIECBAgQIDAEhAgHoEAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQGFtntxMDAQIECBAgQIAAAQIECgEBUijbIECAAAECBAgQIEBgCQgQj0CAAAECBAgQIECAQCYgQDJqQwQIECBAgAABAgQICBA/QIAAAQIECBAgQIBAJiBAMmpDBAgQIECAAAECBAgIED9AgAABAgQIECBAgEAmIEAyakMECBAgQIAAAQIECAgQP0CAAAECBAgQIECAQCYgQDJqQwQIECBAgAABAgQICBA/QIAAAQIECBAgQIBAJiBAMmpDBAgQIECAAAECBAgIED9AgAABAgQIECBAgEAmIEAyakMECBAgQIAAAQIECAgQP0CAAAECBAgQIECAQCYgQDJqQwQIECBAgAABAgQICBA/QIAAAQIECBAgQIBAJiBAMmpDBAgQIECAAAECBAgIED9AgAABAgQIECBAgEAmIEAyakMECBAgQIAAAQIECAgQP0CAAAECBAgQIECAQCYgQDJqQwQIECBAgAABAgQICBA/QIAAAQIECBAgQIBAJiBAMmpDBAgQIECAAAECBAgIED9AgAABAgQIECBAgEAmIEAyakMECBAgQIAAAQIECAgQP0CAAAECBAgQIECAQCYgQDJqQwQIECBAgAABAgQICBA/QIAAAQIECBAgQIBAJiBAMmpDBAgQIECAAAECBAgIED9AgAABAgQIECBAgEAmIEAyakMECBAgQIAAAQIECAgQP0CAAAECBAgQIECAQCYgQDJqQwQIECBAgAABAgQICBA/QIAAAQIECBAgQIBAJiBAMmpDBAgQIECAAAECBAgIED9AgAABAgQIECBAgEAmIEAyakMECBAgQIAAAQIECAgQP0CAAAECBAgQIECAQCYgQDJqQwQIECBAgAABAgQIjO3z+4mBAAECBAgQIECAAAEChYAAKZRtECBAgAABAgQIECCwBASIRyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIExs7Fw8RAgAABAgQIECBAgACBQkCAFMo2CBAgQIAAAQIECBBYAgLEIxAgQIAAAQIECBAgkAkIkIzaEAECBAgQIECAAAECAsQPECBAgAABAgQIECCQCQiQjNoQAQIECBAgQIAAAQICxA8QIECAAAECBAgQIJAJCJCM2hABAgQIECBAgAABAgLEDxAgQIAAAQIECBAgkAkIkIzaEAECBAgQIECAAAECAsQPECBAgAABAgQIECCQCQiQjNoQAQIECBAgQIAAAQICxA8QIECAAAECBAgQIJAJCJCM2hABAgQIECBAgAABAgLEDxAgQIAAAQIECBAgkAkIkIzaEAECBAgQIECAAAECAsQPECBAgAABAgQIECCQCQiQjNoQAQIECBAgQIAAAQICxA8QIECAAAECBAgQIJAJCJCM2hABAgQIECBAgAABAgLEDxAgQIAAAQIECBAgkAkIkIzaEAECBAgQIECAAAECAsQPECBAgAABAgQIECCQCQiQjNoQAQIECBAgQIAAAQICxA8QIECAAAECBAgQIJAJCJCM2hABAgQIECBAgAABAgLEDxAgQIAAAQIECBAgkAkIkIzaEAECBAgQIECAAAECAsQPECBAgAABAgQIECCQCQiQjNoQAQIECBAgQIAAAQICxA8QIECAAAECBAgQIJAJCJCM2hABAgQIECBAgAABAgLEDxAgQIAAAQIECBAgkAkIkIzaEAECBAgQIECAAAECAsQPECBAgAABAgQIECCQCQiQjNoQAQIECBAgQIAAAQICxA8QIECAAAECBAgQIJAJCJCM2hABAgQIECBAgAABAgLEDxAgQIAAAQIECBAgkAkIkIzaEAECBAgQIECAAAECY/fycWIgQIAAAQIECBAgQIBAISBACmUbBAgQIECAAAECBAgsAQHiEQgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgACBsffneWIgQIAAAQIECBAgQIBAISBACmUbBAgQIECAAAECBAgsAQHiEQgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgACBsf93MzEQIECAAAECBAgQIECgEBAghbINAgQIECBAgAABAgSWgADxCAQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQIDA+HX1MjEQIECAAAECBAgQIECgEBAghbINAgQIECBAgAABAgSWgADxCAQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQIDA+H39f2IgQIAAAQIECBAgQIBAISBACmUbBAgQIECAAAECBAgsAQHiEQgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgAABAeIHCBAgQIAAAQIECBDIBARIRm2IAAECBAgQIECAAAEB4gcIECBAgAABAgQIEMgEBEhGbYgAAQIECBAgQIAAAQHiBwgQIECAAAECBAgQyAQESEZtiAABAgQIECBAgACBcXDzOjEQIECAAAECBAgQIECgEBAghbINAgQIECBAgAABAgSWgADxCAQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQICAAPEDBAgQIECAAAECBAhkAgIkozZEgAABAgQIECBAgIAA8QMECBAgQIAAAQIECGQCAiSjNkSAAAECBAgQIECAgADxAwQIECBAgAABAgQIZAICJKM2RIAAAQIECBAgQIDAOLx7mxgIECBAgAABAgQIECBQCAiQQtkGAQIECBAgQIAAAQJLQIB4BAIECBAgQIAAAQIEMgEBklEbIkCAAAECBAgQIEBAgPgBAgQIECBAgAABAgQyAQGSURsiQIAAAQIECBAgQECA+AECBAgQIECAAAECBDIBAZJRGyJAgAABAgQIECBAQID4AQIECBAgQIAAAQIEMgEBklEbIkCAAAECBAgQIEBAgPgBAgQIECBAgAABAgQyAQGSURsiQIAAAQIECBAgQECA+AECBAgQIECAAAECBDIBAZJRGyJAgAABAgQIECBAQID4AQIECBAgQIAAAQIEMgEBklEbIkCAAAECBAgQIEBAgPgBAgQIECBAgAABAgQyAQGSURsiQIAAAQIECBAgQECA+AECBAgQIECAAAECBDIBAZJRGyJAgAABAgQIECBAQID4AQIECBAgQIAAAQIEMgEBklEbIkCAAAECBAgQIEBAgPgBAgQIECBAgAABAgQyAQGSURsiQIAAAQIECBAgQECA+AECBAgQIECAAAECBDIBAZJRGyJAgAABAgQIECBAQID4AQIECBAgQIAAAQIEMgEBklEbIkCAAAECBAgQIEBAgPgBAgQIECBAgAABAgQyAQGSURsiQIAAAQIECBAgQECA+AECBAgQIECAAAECBDIBAZJRGyJAgAABAgQIECBAQID4AQIECBAgQIAAAQIEMgEBklEbIkCAAAECBAgQIEBAgPgBAgQIECBAgAABAgQyAQGSURsiQIAAAQIECBAgQECA+AECBAgQIECAAAECBDIBAZJRGyJAgAABAgQIECBAQID4AQIECBAgQIAAAQIEMgEBklEbIkCAAAECBAgQIEBgHD28TwwECBAgQIAAAQIECBAoBARIoWyDAAECBAgQIECAAIElIEA8AgECBAgQIECAAAECmYAAyagNESBAgAABAgQIECAgQPwAAQIECBAgQIAAAQKZgADJqA0RIECAAAECBAgQICBA/AABAgQIECBAgAABApmAAMmoDREgQIAAAQIECBAgIED8AAECBAgQIECAAAECmYAAyagNESBAgAABAgQIECAgQPwAAQIECBAgQIAAAQKZgADJqA0RIECAAAECBAgQICBA/AABAgQIECBAgAABApmAAMmoDREgQIAAAQIECBAgIED8AAECBAgQIECAAAECmYAAyagNESBAgAABAgQIECAgQPwAAQIECBAgQIAAAQKZgADJqA0RIECAAAECBAgQICBA/AABAgQIECBAgAABApmAAMmoDREgQIAAAQIECBAgIED8AAECBAgQIECAAAECmYAAyagNESBAgAABAgQIECAgQPwAAQIECBAgQIAAAQKZgADJqA0RIECAAAECBAgQICBA/AABAgQIECBAgAABApmAAMmoDREgQIAAAQIECBAgIED8AAECBAgQIECAAAECmYAAyagNESBAgAABAgQIECAgQPwAAQIECBAgQIAAAQKZgADJqA0RIECAAAECBAgQICBA/AABAgQIECBAgAABApmAAMmoDREgQIAAAQIECBAgIED8AAECBAgQIECAAAECmYAAyagNESBAgAABAgQIECAgQPwAAQIECBAgQIAAAQKZgADJqA0RIECAAAECBAgQICBA/AABAgQIECBAgAABApmAAMmoDREgQIAAAQIECBAgIED8AAECBAgQIECAAAECmYAAyagNESBAgAABAgQIECAwjp8+JgYCBAgQIECAAAECBAgUAgKkULZBgAABAgQIECBAgMASECAegQABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgflsq41cAAAYNSURBVIAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAQIH6AAAECBAgQIECAAIFMQIBk1IYIECBAgAABAgQIEBAgfoAAAQIECBAgQIAAgUxAgGTUhggQIECAAAECBAgQECB+gAABAgQIECBAgACBTECAZNSGCBAgQIAAAQIECBAYJ5vPiYEAAQIECBAgQIAAAQKFgAAplG0QIECAAAECBAgQILAEBIhHIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgTG6b+viYEAAQIECBAgQIAAAQKFgAAplG0QIECAAAECBAgQILAEBIhHIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgQEiB8gQIAAAQIECBAgQCATECAZtSECBAgQIECAAAECBASIHyBAgAABAgQIECBAIBMQIBm1IQIECBAgQIAAAQIEBIgfIECAAAECBAgQIEAgExAgGbUhAgQIECBAgAABAgS+Af1a3ssQniAuAAAAAElFTkSuQmCC";
const platformSrc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAgCAYAAAA8Ai4NAAABRklEQVR4Xu3VMQ3AMBAEQRuKEQRO+CNJJDP4rce1vxmdtPu8z7c8AgQIECAwFNgCMhTznQABAgSugIAYAgECBAgkAQFJbI4IECBAQEBsgAABAgSSgIAkNkcECBAgICA2QIAAAQJJQEASmyMCBAgQEBAbIECAAIEkICCJzREBAgQICIgNECBAgEASEJDE5ogAAQIEBMQGCBAgQCAJCEhic0SAAAECAmIDBAgQIJAEBCSxOSJAgAABAbEBAgQIEEgCApLYHBEgQICAgNgAAQIECCQBAUlsjggQIEBAQGyAAAECBJKAgCQ2RwQIECAgIDZAgAABAklAQBKbIwIECBAQEBsgQIAAgSQgIInNEQECBAgIiA0QIECAQBIQkMTmiAABAgQExAYIECBAIAkISGJzRIAAAQICYgMECBAgkAQEJLE5IkCAAIEfgU804fsD3KUAAAAASUVORK5CYII=";
const dudeSrc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAAwCAYAAACxIqevAAANn0lEQVR4Xu1dXagdVxXeV0SfKlhQiT+gloIK1pDGCMam14CgTaAqigTpg/ahuRVtETSR2DwkBhMFaRW96UP1oUgQRS20VRDibdoIxrSkFVQoVcGfoEIF+6SII9/kfKfrrLNn9tp79sy+NzPzcu7PnFn7W/tb3/r2njn3rrjpmDIwZWDKQKEMrBSKO4WdMjBlYMqAmwRoIsGUgSkDxTIwCVCx1E+BpwxMGZgEaOLAlIEpA8UyMAlQsdRPgacMTBnY8gK05h6u1t3+LY8jlYpjx5+atxzvG3vuc+Df0oWLBHyr2ufuXHnEjVGExo4/h4ikXmPsuc+Fv7MA5VDBLiQ4en6fO7a7nACNGX9J7OBMyfiIPXGve+11EqBcKpgiQIh9+/o+97obnPvLM849sDa8CI0Zf0nsFJ9S7nfiXr7a6yxApboAOxDFq4QLKtkFS+MviZ0CNHGvuwNJbf7IfY7aSxagkl1AxmYShnZBY8ZfEjvFp5T7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