Added Games

This commit is contained in:
QuiteAFancyEmerald 2021-01-19 22:25:52 +00:00
parent 9f52e45b13
commit bbf7c910aa
17 changed files with 3485 additions and 0 deletions

45
views/archive/dino/.gitignore vendored Normal file
View file

@ -0,0 +1,45 @@
# Log file
*.log
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
*.7z
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# macOS
.DS_Store
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

View file

@ -0,0 +1,16 @@
# T-Rex Runner
T-Rex Runner is an Easter Egg in Google Chrome which appears when you suddenly lose internet access. [Here](https://www.blog.google/products/chrome/chrome-dino/) is the origin of this game.
The dino game is extracted from the Chromium [source code](https://cs.chromium.org/chromium/src/components/neterror/resources/offline.js) in commit `24d8c44`
## Controls
* Press the space bar to jump and to start the game
* Use the down arrow key to duck
## How to play
You can click [here](https://congerh.github.io/dino/) to play online.
You can also play the origin Chrome dino game without turning off your network connections. Just open `chrome://dino` in your web browser, and youll be taken to an "arcade mode" where you can practice in a full-window environment.

549
views/archive/dino/dino.css Normal file
View file

@ -0,0 +1,549 @@
/* Copyright 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
* Extract source code from chromium by congerh. */
body {
--google-blue-600: rgb(26, 115, 232);
--google-blue-700: rgb(25, 103, 210);
--google-gray-50: rgb(248, 249, 250);
--google-gray-500: rgb(154, 160, 166);
--google-gray-600: rgb(128, 134, 139);
--google-gray-700: rgb(95, 99, 105);
background-color: #fff;
color: var(--google-gray-700);
word-wrap: break-word;
}
html {
-webkit-text-size-adjust: 100%;
font-size: 125%;
}
.icon {
background-repeat: no-repeat;
background-size: 100%;
}
/* Copyright 2014 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
.bad-clock button,
.captive-portal button,
.main-frame-blocked button,
.neterror button,
.offline button,
.pdf button,
.ssl button,
.safe-browsing-billing button {
background: var(--google-blue-600);
}
.error-code {
color: #646464;
font-size: .86667em;
text-transform: uppercase;
margin-top: 12px;
}
h1 {
color: var(--google-gray-900);
font-size: 1.6em;
font-weight: normal;
line-height: 1.25em;
margin-bottom: 16px;
}
h2 {
font-size: 1.2em;
font-weight: normal;
}
.icon {
height: 72px;
margin: 0 0 40px;
width: 72px;
}
.interstitial-wrapper {
box-sizing: border-box;
font-size: 1em;
line-height: 1.6em;
margin: 14vh auto 0;
max-width: 600px;
width: 100%;
}
#main-message > p {
display: inline;
}
@media (max-width: 700px) {
.interstitial-wrapper {
padding: 0 10%;
}
}
@media (max-width: 420px) {
.interstitial-wrapper {
padding: 0 5%;
}
}
/**
* Mobile specific styling.
* Navigation buttons are anchored to the bottom of the screen.
* Details message replaces the top content in its own scrollable area.
*/
/* Fixed nav. */
@media (min-width: 240px) and (max-width: 420px) and (min-height: 401px),
(min-width: 421px) and (min-height: 240px) and (max-height: 560px) {
body .nav-wrapper {
background: #fff;
bottom: 0;
box-shadow: 0 -22px 40px #fff;
left: 0;
margin: 0 auto;
max-width: 736px;
padding-left: 24px;
padding-right: 24px;
position: fixed;
right: 0;
width: 100%;
z-index: 2;
}
.interstitial-wrapper {
max-width: 736px;
}
#details,
#main-content {
padding-bottom: 40px;
}
}
@media (max-width: 420px) and (orientation: portrait),
(max-height: 560px) {
body {
margin: 0 auto;
}
#details.hidden,
#main-content.hidden {
display: block;
height: 0;
opacity: 0;
overflow: hidden;
padding-bottom: 0;
transition: none;
}
h1 {
font-size: 1.5em;
margin-bottom: 8px;
}
.icon {
margin-bottom: 5.69vh;
}
.interstitial-wrapper {
box-sizing: border-box;
margin: 7vh auto 12px;
padding: 0 24px;
position: relative;
}
.interstitial-wrapper p {
font-size: .95em;
line-height: 1.61em;
margin-top: 8px;
}
#main-content {
margin: 0;
transition: opacity 100ms cubic-bezier(0.4, 0, 0.2, 1);
}
}
@media (min-width: 421px) and (min-height: 500px) and (max-height: 560px) {
.interstitial-wrapper {
margin-top: 10vh;
}
}
@media (min-height: 400px) and (orientation:portrait) {
.interstitial-wrapper {
margin-bottom: 145px;
}
}
@media (min-height: 500px) and (max-height: 650px) and (max-width: 414px) and
(orientation: portrait) {
.interstitial-wrapper {
margin-top: 7vh;
}
}
@media (min-height: 650px) and (max-width: 414px) and (orientation: portrait) {
.interstitial-wrapper {
margin-top: 10vh;
}
}
/* Small mobile screens. No fixed nav. */
@media (max-height: 400px) and (orientation: portrait),
(max-height: 239px) and (orientation: landscape),
(max-width: 419px) and (max-height: 399px) {
.interstitial-wrapper {
display: flex;
flex-direction: column;
margin-bottom: 0;
}
#main-content {
flex: 1 1 auto;
order: 0;
}
}
/* Copyright 2013 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
/* Don't use the main frame div when the error is in a subframe. */
html[subframe] #main-frame-error {
display: none;
}
/* Don't use the subframe error div when the error is in a main frame. */
html:not([subframe]) #sub-frame-error {
display: none;
}
h1 {
margin-top: 0;
word-wrap: break-word;
}
h1 span {
font-weight: 500;
}
h2 {
color: #666;
font-size: 1.2em;
font-weight: normal;
margin: 10px 0;
}
a {
color: rgb(17, 85, 204);
text-decoration: none;
}
.icon {
-webkit-user-select: none;
display: inline-block;
}
.icon-offline {
content: -webkit-image-set(
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIAQMAAABvIyEEAAAABlBMVEUAAABTU1OoaSf/AAAAAXRSTlMAQObYZgAAAGxJREFUeF7tyMEJwkAQRuFf5ipMKxYQiJ3Z2nSwrWwBA0+DQZcdxEOueaePp9+dQZFB7GpUcURSVU66yVNFj6LFICatThZB6r/ko/pbRpUgilY0Cbw5sNmb9txGXUKyuH7eV25x39DtJXUNPQGJtWFV+BT/QAAAAABJRU5ErkJggg==) 1x,
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQBAMAAAAVaP+LAAAAGFBMVEUAAABTU1NNTU1TU1NPT09SUlJSUlJTU1O8B7DEAAAAB3RSTlMAoArVKvVgBuEdKgAAAJ1JREFUeF7t1TEOwyAMQNG0Q6/UE+RMXD9d/tC6womIFSL9P+MnAYOXeTIzMzMzMzMzaz8J9Ri6HoITmuHXhISE8nEh9yxDh55aCEUoTGbbQwjqHwIkRAEiIaG0+0AA9VBMaE89Rogeoww936MQrWdBr4GN/z0IAdQ6nQ/FIpRXDwHcA+JIJcQowQAlFUA0MfQpXLlVQfkzR4igS6ENjknm/wiaGhsAAAAASUVORK5CYII=) 2x);
position: relative;
}
.icon-disabled {
content: -webkit-image-set(
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAABICAMAAAAZF4G5AAAABlBMVEVMaXFTU1OXUj8tAAAAAXRSTlMAQObYZgAAASZJREFUeAHd11Fq7jAMRGGf/W/6PoWB67YMqv5DybwG/CFjRuR8JBw3+ByiRjgV9W/TJ31P0tBfC6+cj1haUFXKHmVJo5wP98WwQ0ZCbfUc6LQ6VuUBz31ikADkLMkDrfUC4rR6QGW+gF6rx7NaHWCj1Y/W6lf4L7utvgBSt3rBFSS/XBMPUILcJINHCBWYUfpWn4NBi1ZfudIc3rf6/NGEvEA+AsYTJozmXemjXeLZAov+mnkN2HfzXpMSVQDnGw++57qNJ4D1xitA2sJ+VAWMygSEaYf2mYPTjZfk2K8wmP7HLIH5Mg4/pP+PEcDzUvDMvYbs/2NWwPO5vBdMZE4EE5UTQLiBFDaUlTDPBRoJ9HdAYIkIo06og3BNXtCzy7zA1aXk5x+tJARq63eAygAAAABJRU5ErkJggg==) 1x,
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOAAAACQAQMAAAArwfVjAAAABlBMVEVMaXFTU1OXUj8tAAAAAXRSTlMAQObYZgAAAYdJREFUeF7F1EFqwzAUBNARAmVj0FZe5QoBH6BX+dn4GlY2PYNzGx/A0CvkCIJuvIraKJKbgBvzf2g62weDGD7CYggpfFReis4J0ey9EGFIiEQQojFSlA9kSIiqd0KkFjKsewgRbStEN19mxUPTtmW9HQ/h6tyqNQ8NlSMZdzyE6qkoE0trVYGFm0n1WYeBhduzwbwBC7voS+vIxfeMjeaiLxsMMtQNwMPtuew+DjzcTHk8YMfDknEcIUOtf2lVfgVH3K4Xv5PRYAXRVMtItIJ3rfaCIVn9DsTH2NxisAVRex2Hh3hX+/mRUR08bAwPEYsI51ZxWH4Q0SpicQRXeyEaIug48FEdegARfMz/tADVsRciwTAxW308ehmC2gLraC+YCbV3QoTZexa+zegAEW5PhhgYfmbvJgcRqngGByOSXdFJcLk2JeDPEN0kxe1JhIt5FiFA+w+ItMELsUyPF2IaJ4aILqb4FbxPwhImwj6JauKgDUCYaxmYIsd4KXdMjIC9ItB5Bn4BNRwsG0XM2nwAAAAASUVORK5CYII=) 2x);
width: 112px;
}
.error-code {
display: block;
font-size: .8em;
}
.hidden {
display: none;
}
#suggestions-list p {
margin-block-end: 0;
}
#suggestions-list ul {
margin-top: 0;
}
.snackbar {
background: #323232;
border-radius: 2px;
bottom: 24px;
box-sizing: border-box;
color: #fff;
font-size: .87em;
left: 24px;
max-width: 568px;
min-width: 288px;
opacity: 0;
padding: 16px 24px 12px;
position: fixed;
transform: translateY(90px);
will-change: opacity, transform;
z-index: 999;
}
.snackbar-show {
-webkit-animation:
show-snackbar .25s cubic-bezier(0.0, 0.0, 0.2, 1) forwards,
hide-snackbar .25s cubic-bezier(0.4, 0.0, 1, 1) forwards 5s;
}
@-webkit-keyframes show-snackbar {
100% {
opacity: 1;
transform: translateY(0);
}
}
@-webkit-keyframes hide-snackbar {
0% {
opacity: 1;
transform: translateY(0);
}
100% {
opacity: 0;
transform: translateY(90px);
}
}
/* Decrease padding at low sizes. */
@media (max-width: 640px), (max-height: 640px) {
h1 {
margin: 0 0 15px;
}
#content-top {
margin: 15px;
}
}
/* Don't allow overflow when in a subframe. */
html[subframe] body {
overflow: hidden;
}
#sub-frame-error {
-webkit-align-items: center;
background-color: #DDD;
display: -webkit-flex;
-webkit-flex-flow: column;
height: 100%;
-webkit-justify-content: center;
left: 0;
position: absolute;
text-align: center;
top: 0;
transition: background-color .2s ease-in-out;
width: 100%;
}
#sub-frame-error:hover {
background-color: #EEE;
}
#sub-frame-error .icon-generic {
margin: 0 0 16px;
}
#sub-frame-error-details {
margin: 0 10px;
text-align: center;
visibility: hidden;
}
/* Show details only when hovering. */
#sub-frame-error:hover #sub-frame-error-details {
visibility: visible;
}
/* If the iframe is too small, always hide the error code. */
/* TODO(mmenke): See if overflow: no-display works better, once supported. */
@media (max-width: 200px), (max-height: 95px) {
#sub-frame-error-details {
display: none;
}
}
/* Adjust icon for small embedded frames in apps. */
@media (max-height: 100px) {
#sub-frame-error .icon-generic {
height: auto;
margin: 0;
padding-top: 0;
width: 25px;
}
}
/* Offline page */
.offline {
transition: -webkit-filter 1.5s cubic-bezier(0.65, 0.05, 0.36, 1),
background-color 1.5s cubic-bezier(0.65, 0.05, 0.36, 1);
will-change: -webkit-filter, background-color;
}
.offline #main-message > p {
display: none;
}
.offline.inverted {
-webkit-filter: invert(100%);
background-color: #000;
}
.offline .interstitial-wrapper {
color: #2b2b2b;
font-size: 1em;
line-height: 1.55;
margin: 0 auto;
max-width: 600px;
padding-top: 100px;
width: 100%;
}
.offline .runner-container {
direction: ltr;
height: 150px;
max-width: 600px;
overflow: hidden;
position: absolute;
top: 35px;
width: 44px;
}
.offline .runner-canvas {
height: 150px;
max-width: 600px;
opacity: 1;
overflow: hidden;
position: absolute;
top: 0;
z-index: 10;
}
.offline .controller {
background: rgba(247,247,247, .1);
height: 100vh;
left: 0;
position: absolute;
top: 0;
width: 100vw;
z-index: 9;
}
#offline-resources {
display: none;
}
@media (max-width: 420px) {
.snackbar {
left: 0;
bottom: 0;
width: 100%;
border-radius: 0;
}
}
@media (max-height: 350px) {
h1 {
margin: 0 0 15px;
}
.icon-offline {
margin: 0 0 10px;
}
.interstitial-wrapper {
margin-top: 5%;
}
}
@media (min-width: 420px) and (max-width: 736px) and
(min-height: 240px) and (max-height: 420px) and
(orientation:landscape) {
.interstitial-wrapper {
margin-bottom: 100px;
}
}
@media (max-width: 360px) and (max-height: 480px) {
.offline .interstitial-wrapper {
padding-top: 60px;
}
.offline .runner-container {
top: 8px;
}
}
@media (min-height: 240px) and (orientation: landscape) {
.offline .interstitial-wrapper {
margin-bottom: 90px;
}
.icon-offline {
margin-bottom: 20px;
}
}
@media (max-height: 320px) and (orientation: landscape) {
.icon-offline {
margin-bottom: 0;
}
.offline .runner-container {
top: 10px;
}
}
@media (max-width: 240px) {
.interstitial-wrapper {
overflow: inherit;
padding: 0 8px;
}
}
.arcade-mode,
.arcade-mode .runner-container,
.arcade-mode .runner-canvas {
image-rendering: pixelated;
max-width: 100%;
overflow: hidden;
}
.arcade-mode #buttons,
.arcade-mode #main-content {
opacity: 0;
overflow: hidden;
}
.arcade-mode .interstitial-wrapper {
height: 100vh;
max-width: 100%;
overflow: hidden;
}
.arcade-mode .runner-container {
left: 0;
margin: auto;
right: 0;
transform-origin: top center;
transition: transform 250ms cubic-bezier(0.4, 0.0, 1, 1) .4s;
z-index: 2;
}

2774
views/archive/dino/dino.js Normal file

File diff suppressed because it is too large Load diff

2
views/archive/dino/dino.min.css vendored Normal file

File diff suppressed because one or more lines are too long

65
views/archive/dino/dino.min.js vendored Normal file
View file

@ -0,0 +1,65 @@
/*! Copyright (c) 2014 The Chromium Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Extract source code from chromium by congerh. */
(function(){function c(a,b){if(c.instance_)return c.instance_;c.instance_=this;this.outerContainerEl=document.querySelector(a);this.touchController=this.snackbarEl=this.containerEl=null;this.config=b||c.config;this.dimensions=c.defaultDimensions;this.distanceMeter=this.tRex=this.canvasCtx=this.canvas=null;this.runningTime=this.time=this.highestScore=this.distanceRan=0;this.msPerFrame=1E3/60;this.currentSpeed=this.config.SPEED;this.obstacles=[];this.inverted=this.paused=this.crashed=this.playing=this.activated=
!1;this.invertTimer=0;this.resizeTimerId_=null;this.playCount=0;this.audioBuffer=null;this.soundFx={};this.audioContext=null;this.images={};this.imagesLoaded=0;this.isDisabled()?this.setupDisabledRunner():this.loadImages()}function q(a,b){return Math.floor(Math.random()*(b-a+1))+a}function B(a){var b=a.length/4*3;a=atob(a);var d=new ArrayBuffer(b);d=new Uint8Array(d);for(var c=0;c<b;c++)d[c]=a.charCodeAt(c);return d.buffer}function r(){return w?(new Date).getTime():performance.now()}function u(a,
b,d,c){this.canvas=a;this.canvasCtx=a.getContext("2d");this.canvasDimensions=c;this.textImgPos=b;this.restartImgPos=d;this.draw()}function z(a,b){return new g(a.x+b.x,a.y+b.y,a.width,a.height)}function A(a,b){var d=!1,c=b.x;a.x<c+b.width&&a.x+a.width>c&&a.y<b.y+b.height&&a.height+a.y>b.y&&(d=!0);return d}function g(a,b,d,c){this.x=a;this.y=b;this.width=d;this.height=c}function m(a,b,d,c,n,f,e){this.canvasCtx=a;this.spritePos=d;this.typeConfig=b;this.gapCoefficient=n;this.size=q(1,m.MAX_OBSTACLE_LENGTH);
this.dimensions=c;this.remove=!1;this.xPos=c.WIDTH+(e||0);this.width=this.yPos=0;this.collisionBoxes=[];this.timer=this.currentFrame=this.speedOffset=this.gap=0;this.init(f)}function f(a,b){this.canvas=a;this.canvasCtx=a.getContext("2d");this.spritePos=b;this.currentFrame=this.groundYPos=this.yPos=this.xPos=0;this.currentAnimFrames=[];this.timer=this.animStartTime=this.blinkCount=this.blinkDelay=0;this.msPerFrame=1E3/60;this.config=f.config;this.status=f.status.WAITING;this.ducking=this.jumping=!1;
this.jumpVelocity=0;this.speedDrop=this.reachedMinHeight=!1;this.jumpspotX=this.jumpCount=0;this.init()}function h(a,b,d){this.canvas=a;this.canvasCtx=a.getContext("2d");this.image=c.imageSprite;this.spritePos=b;this.x=0;this.y=5;this.highScore=this.maxScore=this.currentDistance=0;this.container=null;this.digits=[];this.achievement=!1;this.defaultString="";this.flashIterations=this.flashTimer=0;this.invertTrigger=!1;this.config=h.config;this.maxScoreUnits=this.config.MAX_DISTANCE_UNITS;this.init(d)}
function p(a,b,d){this.canvas=a;this.canvasCtx=this.canvas.getContext("2d");this.spritePos=b;this.xPos=this.containerWidth=d;this.yPos=0;this.remove=!1;this.cloudGap=q(p.config.MIN_CLOUD_GAP,p.config.MAX_CLOUD_GAP);this.init()}function e(a,b,d){this.spritePos=b;this.canvas=a;this.canvasCtx=a.getContext("2d");this.xPos=d-50;this.yPos=30;this.opacity=this.currentPhase=0;this.containerWidth=d;this.stars=[];this.drawStars=!1;this.placeStars()}function k(a,b){this.spritePos=b;this.canvas=a;this.canvasCtx=
a.getContext("2d");this.sourceDimensions={};this.dimensions=k.dimensions;this.sourceXPos=[this.spritePos.x,this.spritePos.x+this.dimensions.WIDTH];this.xPos=[];this.yPos=0;this.bumpThreshold=.5;this.setSourceDimensions();this.draw()}function v(a,b,d,c){this.canvas=a;this.canvasCtx=this.canvas.getContext("2d");this.config=v.config;this.dimensions=d;this.gapCoefficient=c;this.obstacles=[];this.obstacleHistory=[];this.horizonOffsets=[0,0];this.cloudFrequency=this.config.CLOUD_FREQUENCY;this.spritePos=
b;this.nightMode=null;this.clouds=[];this.cloudSpeed=this.config.BG_CLOUD_SPEED;this.horizonLine=null;this.init()}window.Runner=c;var t=1<window.devicePixelRatio,w=/iPad|iPhone|iPod/.test(window.navigator.platform),y=/Android/.test(window.navigator.userAgent)||w;c.config={ACCELERATION:.001,BG_CLOUD_SPEED:.2,BOTTOM_PAD:10,CANVAS_IN_VIEW_OFFSET:-10,CLEAR_TIME:3E3,CLOUD_FREQUENCY:.5,GAMEOVER_CLEAR_TIME:750,GAP_COEFFICIENT:.6,GRAVITY:.6,INITIAL_JUMP_VELOCITY:12,INVERT_FADE_DURATION:12E3,INVERT_DISTANCE:700,
MAX_BLINK_COUNT:3,MAX_CLOUDS:6,MAX_OBSTACLE_LENGTH:3,MAX_OBSTACLE_DUPLICATION:2,MAX_SPEED:13,MIN_JUMP_HEIGHT:35,MOBILE_SPEED_COEFFICIENT:1.2,RESOURCE_TEMPLATE_ID:"audio-resources",SPEED:6,SPEED_DROP_COEFFICIENT:3,ARCADE_MODE_INITIAL_TOP_POSITION:35,ARCADE_MODE_TOP_POSITION_PERCENT:.1};c.defaultDimensions={WIDTH:600,HEIGHT:150};c.classes={ARCADE_MODE:"arcade-mode",CANVAS:"runner-canvas",CONTAINER:"runner-container",CRASHED:"crashed",ICON:"icon-offline",INVERTED:"inverted",SNACKBAR:"snackbar",SNACKBAR_SHOW:"snackbar-show",
TOUCH_CONTROLLER:"controller"};c.spriteDefinition={LDPI:{CACTUS_LARGE:{x:332,y:2},CACTUS_SMALL:{x:228,y:2},CLOUD:{x:86,y:2},HORIZON:{x:2,y:54},MOON:{x:484,y:2},PTERODACTYL:{x:134,y:2},RESTART:{x:2,y:2},TEXT_SPRITE:{x:655,y:2},TREX:{x:848,y:2},STAR:{x:645,y:2}},HDPI:{CACTUS_LARGE:{x:652,y:2},CACTUS_SMALL:{x:446,y:2},CLOUD:{x:166,y:2},HORIZON:{x:2,y:104},MOON:{x:954,y:2},PTERODACTYL:{x:260,y:2},RESTART:{x:2,y:2},TEXT_SPRITE:{x:1294,y:2},TREX:{x:1678,y:2},STAR:{x:1276,y:2}}};c.sounds={BUTTON_PRESS:"offline-sound-press",
HIT:"offline-sound-hit",SCORE:"offline-sound-reached"};c.keycodes={JUMP:{38:1,32:1},DUCK:{40:1},RESTART:{13:1}};c.events={ANIM_END:"webkitAnimationEnd",CLICK:"click",KEYDOWN:"keydown",KEYUP:"keyup",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",RESIZE:"resize",TOUCHEND:"touchend",TOUCHSTART:"touchstart",VISIBILITY:"visibilitychange",BLUR:"blur",FOCUS:"focus",LOAD:"load"};c.prototype={isDisabled:function(){return!1},setupDisabledRunner:function(){this.containerEl=document.createElement("div");this.containerEl.className=
c.classes.SNACKBAR;this.containerEl.textContent=loadTimeData.getValue("disabledEasterEgg");this.outerContainerEl.appendChild(this.containerEl);document.addEventListener(c.events.KEYDOWN,function(a){c.keycodes.JUMP[a.keyCode]&&(this.containerEl.classList.add(c.classes.SNACKBAR_SHOW),document.querySelector(".icon").classList.add("icon-disabled"))}.bind(this))},updateConfigSetting:function(a,b){if(a in this.config&&void 0!=b)switch(this.config[a]=b,a){case "GRAVITY":case "MIN_JUMP_HEIGHT":case "SPEED_DROP_COEFFICIENT":this.tRex.config[a]=
b;break;case "INITIAL_JUMP_VELOCITY":this.tRex.setJumpVelocity(b);break;case "SPEED":this.setSpeed(b)}},loadImages:function(){t?(c.imageSprite=document.getElementById("offline-resources-2x"),this.spriteDef=c.spriteDefinition.HDPI):(c.imageSprite=document.getElementById("offline-resources-1x"),this.spriteDef=c.spriteDefinition.LDPI);c.imageSprite.complete?this.init():c.imageSprite.addEventListener(c.events.LOAD,this.init.bind(this))},loadSounds:function(){if(!w){this.audioContext=new AudioContext;
var a=document.getElementById(this.config.RESOURCE_TEMPLATE_ID).content,b;for(b in c.sounds){var d=a.getElementById(c.sounds[b]).src;d=d.substr(d.indexOf(",")+1);d=B(d);this.audioContext.decodeAudioData(d,function(a,b){this.soundFx[a]=b}.bind(this,b))}}},setSpeed:function(a){var b=a||this.currentSpeed;600>this.dimensions.WIDTH?(a=b*this.dimensions.WIDTH/600*this.config.MOBILE_SPEED_COEFFICIENT,this.currentSpeed=a>b?b:a):a&&(this.currentSpeed=a)},init:function(){document.querySelector("."+c.classes.ICON).style.visibility=
"hidden";this.adjustDimensions();this.setSpeed();this.containerEl=document.createElement("div");this.containerEl.className=c.classes.CONTAINER;var a=this.containerEl,b=this.dimensions.WIDTH,d=this.dimensions.HEIGHT,l=c.classes.PLAYER,n=document.createElement("canvas");n.className=l?c.classes.CANVAS+" "+l:c.classes.CANVAS;n.width=b;n.height=d;a.appendChild(n);this.canvas=n;this.canvasCtx=this.canvas.getContext("2d");this.canvasCtx.fillStyle="#f7f7f7";this.canvasCtx.fill();c.updateCanvasScaling(this.canvas);
this.horizon=new v(this.canvas,this.spriteDef,this.dimensions,this.config.GAP_COEFFICIENT);this.distanceMeter=new h(this.canvas,this.spriteDef.TEXT_SPRITE,this.dimensions.WIDTH);this.tRex=new f(this.canvas,this.spriteDef.TREX);this.outerContainerEl.appendChild(this.containerEl);this.startListening();this.update();window.addEventListener(c.events.RESIZE,this.debounceResize.bind(this))},createTouchController:function(){this.touchController=document.createElement("div");this.touchController.className=
c.classes.TOUCH_CONTROLLER;this.touchController.addEventListener(c.events.TOUCHSTART,this);this.touchController.addEventListener(c.events.TOUCHEND,this);this.outerContainerEl.appendChild(this.touchController)},debounceResize:function(){this.resizeTimerId_||(this.resizeTimerId_=setInterval(this.adjustDimensions.bind(this),250))},adjustDimensions:function(){clearInterval(this.resizeTimerId_);this.resizeTimerId_=null;var a=window.getComputedStyle(this.outerContainerEl);a=Number(a.paddingLeft.substr(0,
a.paddingLeft.length-2));this.dimensions.WIDTH=this.outerContainerEl.offsetWidth-2*a;this.isArcadeMode()&&(this.dimensions.WIDTH=Math.min(600,this.dimensions.WIDTH),this.activated&&this.setArcadeModeContainerScale());this.canvas&&(this.canvas.width=this.dimensions.WIDTH,this.canvas.height=this.dimensions.HEIGHT,c.updateCanvasScaling(this.canvas),this.distanceMeter.calcXPos(this.dimensions.WIDTH),this.clearCanvas(),this.horizon.update(0,0,!0),this.tRex.update(0),this.playing||this.crashed||this.paused?
(this.containerEl.style.width=this.dimensions.WIDTH+"px",this.containerEl.style.height=this.dimensions.HEIGHT+"px",this.distanceMeter.update(0,Math.ceil(this.distanceRan)),this.stop()):this.tRex.draw(0,0),this.crashed&&this.gameOverPanel&&(this.gameOverPanel.updateDimensions(this.dimensions.WIDTH),this.gameOverPanel.draw()))},playIntro:function(){this.activated||this.crashed?this.crashed&&this.restart():(this.playingIntro=!0,this.tRex.playingIntro=!0,document.styleSheets[0].insertRule("@-webkit-keyframes intro { from { width:"+
f.config.WIDTH+"px }to { width: "+this.dimensions.WIDTH+"px }}",0),this.containerEl.addEventListener(c.events.ANIM_END,this.startGame.bind(this)),this.containerEl.style.webkitAnimation="intro .4s ease-out 1 both",this.containerEl.style.width=this.dimensions.WIDTH+"px",this.setPlayStatus(!0),this.activated=!0)},startGame:function(){this.isArcadeMode()&&this.setArcadeMode();this.runningTime=0;this.playingIntro=!1;this.tRex.playingIntro=!1;this.containerEl.style.webkitAnimation="";this.playCount++;document.addEventListener(c.events.VISIBILITY,
this.onVisibilityChange.bind(this));window.addEventListener(c.events.BLUR,this.onVisibilityChange.bind(this));window.addEventListener(c.events.FOCUS,this.onVisibilityChange.bind(this))},clearCanvas:function(){this.canvasCtx.clearRect(0,0,this.dimensions.WIDTH,this.dimensions.HEIGHT)},isCanvasInView:function(){return this.containerEl.getBoundingClientRect().top>c.config.CANVAS_IN_VIEW_OFFSET},update:function(){this.updatePending=!1;var a=r(),b=a-(this.time||a);this.time=a;if(this.playing){this.clearCanvas();
this.tRex.jumping&&this.tRex.updateJump(b);this.runningTime+=b;a=this.runningTime>this.config.CLEAR_TIME;1!=this.tRex.jumpCount||this.playingIntro||this.playIntro();this.playingIntro?this.horizon.update(0,this.currentSpeed,a):(b=this.activated?b:0,this.horizon.update(b,this.currentSpeed,a,this.inverted));if(a)a:{var d=this.horizon.obstacles[0],l=this.tRex;a=new g(l.xPos+1,l.yPos+1,l.config.WIDTH-2,l.config.HEIGHT-2);var n=new g(d.xPos+1,d.yPos+1,d.typeConfig.width*d.size-2,d.typeConfig.height-2);
if(A(a,n)){d=d.collisionBoxes;l=l.ducking?f.collisionBoxes.DUCKING:f.collisionBoxes.RUNNING;for(var e=0;e<l.length;e++)for(var x=0;x<d.length;x++){var h=z(l[e],a),k=z(d[x],n);if(A(h,k)){a=[h,k];break a}}}a=!1}a?this.gameOver():(this.distanceRan+=this.currentSpeed*b/this.msPerFrame,this.currentSpeed<this.config.MAX_SPEED&&(this.currentSpeed+=this.config.ACCELERATION));this.distanceMeter.update(b,Math.ceil(this.distanceRan))&&this.playSound(this.soundFx.SCORE);this.invertTimer>this.config.INVERT_FADE_DURATION?
(this.invertTimer=0,this.invertTrigger=!1,this.invert()):this.invertTimer?this.invertTimer+=b:(a=this.distanceMeter.getActualDistance(Math.ceil(this.distanceRan)),0<a&&(this.invertTrigger=!(a%this.config.INVERT_DISTANCE))&&0===this.invertTimer&&(this.invertTimer+=b,this.invert()))}if(this.playing||!this.activated&&this.tRex.blinkCount<c.config.MAX_BLINK_COUNT)this.tRex.update(b),this.scheduleNextUpdate()},handleEvent:function(a){var b=c.events;switch(a.type){case b.KEYDOWN:case b.TOUCHSTART:case b.POINTERDOWN:this.onKeyDown(a);
break;case b.KEYUP:case b.TOUCHEND:case b.POINTERUP:this.onKeyUp(a)}},startListening:function(){document.addEventListener(c.events.KEYDOWN,this);document.addEventListener(c.events.KEYUP,this);this.containerEl.addEventListener(c.events.TOUCHSTART,this);document.addEventListener(c.events.POINTERDOWN,this);document.addEventListener(c.events.POINTERUP,this)},stopListening:function(){document.removeEventListener(c.events.KEYDOWN,this);document.removeEventListener(c.events.KEYUP,this);this.touchController&&
(this.touchController.removeEventListener(c.events.TOUCHSTART,this),this.touchController.removeEventListener(c.events.TOUCHEND,this));this.containerEl.removeEventListener(c.events.TOUCHSTART,this);document.removeEventListener(c.events.POINTERDOWN,this);document.removeEventListener(c.events.POINTERUP,this)},onKeyDown:function(a){y&&this.playing&&a.preventDefault();this.isCanvasInView()&&(this.crashed||this.paused?this.crashed&&a.type==c.events.TOUCHSTART&&a.currentTarget==this.containerEl&&this.restart():
c.keycodes.JUMP[a.keyCode]||a.type==c.events.TOUCHSTART?(a.preventDefault(),this.playing||(this.touchController||a.type!=c.events.TOUCHSTART||this.createTouchController(),this.loadSounds(),this.setPlayStatus(!0),this.update(),window.errorPageController&&errorPageController.trackEasterEgg()),this.tRex.jumping||this.tRex.ducking||(this.playSound(this.soundFx.BUTTON_PRESS),this.tRex.startJump(this.currentSpeed))):this.playing&&c.keycodes.DUCK[a.keyCode]&&(a.preventDefault(),this.tRex.jumping?this.tRex.setSpeedDrop():
this.tRex.jumping||this.tRex.ducking||this.tRex.setDuck(!0)))},onKeyUp:function(a){var b=String(a.keyCode),d=c.keycodes.JUMP[b]||a.type==c.events.TOUCHEND||a.type==c.events.POINTERUP;this.isRunning()&&d?this.tRex.endJump():c.keycodes.DUCK[b]?(this.tRex.speedDrop=!1,this.tRex.setDuck(!1)):this.crashed?(d=r()-this.time,this.isCanvasInView()&&(c.keycodes.RESTART[b]||this.isLeftClickOnCanvas(a)||d>=this.config.GAMEOVER_CLEAR_TIME&&c.keycodes.JUMP[b])&&this.restart()):this.paused&&d&&(this.tRex.reset(),
this.play())},isLeftClickOnCanvas:function(a){return null!=a.button&&2>a.button&&a.type==c.events.POINTERUP&&a.target==this.canvas},scheduleNextUpdate:function(){this.updatePending||(this.updatePending=!0,this.raqId=requestAnimationFrame(this.update.bind(this)))},isRunning:function(){return!!this.raqId},gameOver:function(){this.playSound(this.soundFx.HIT);y&&window.navigator.vibrate&&window.navigator.vibrate(200);this.stop();this.crashed=!0;this.distanceMeter.achievement=!1;this.tRex.update(100,f.status.CRASHED);
this.gameOverPanel?this.gameOverPanel.draw():this.gameOverPanel=new u(this.canvas,this.spriteDef.TEXT_SPRITE,this.spriteDef.RESTART,this.dimensions);this.distanceRan>this.highestScore&&(this.highestScore=Math.ceil(this.distanceRan),this.distanceMeter.setHighScore(this.highestScore));this.time=r()},stop:function(){this.setPlayStatus(!1);this.paused=!0;cancelAnimationFrame(this.raqId);this.raqId=0},play:function(){this.crashed||(this.setPlayStatus(!0),this.paused=!1,this.tRex.update(0,f.status.RUNNING),
this.time=r(),this.update())},restart:function(){this.raqId||(this.playCount++,this.runningTime=0,this.setPlayStatus(!0),this.crashed=this.paused=!1,this.distanceRan=0,this.setSpeed(this.config.SPEED),this.time=r(),this.containerEl.classList.remove(c.classes.CRASHED),this.clearCanvas(),this.distanceMeter.reset(this.highestScore),this.horizon.reset(),this.tRex.reset(),this.playSound(this.soundFx.BUTTON_PRESS),this.invert(!0),this.bdayFlashTimer=null,this.update())},setPlayStatus:function(a){this.touchController&&
this.touchController.classList.toggle(HIDDEN_CLASS,!a);this.playing=a},isArcadeMode:function(){return"chrome://dino/"==document.title},setArcadeMode:function(){document.body.classList.add(c.classes.ARCADE_MODE);this.setArcadeModeContainerScale()},setArcadeModeContainerScale:function(){var a=window.innerHeight,b=Math.max(1,Math.min(a/this.dimensions.HEIGHT,window.innerWidth/this.dimensions.WIDTH));this.containerEl.style.transform="scale("+b+") translateY("+Math.ceil(Math.max(0,(a-this.dimensions.HEIGHT*
b-c.config.ARCADE_MODE_INITIAL_TOP_POSITION)*c.config.ARCADE_MODE_TOP_POSITION_PERCENT))*window.devicePixelRatio+"px)"},onVisibilityChange:function(a){document.hidden||document.webkitHidden||"blur"==a.type||"visible"!=document.visibilityState?this.stop():this.crashed||(this.tRex.reset(),this.play())},playSound:function(a){if(a){var b=this.audioContext.createBufferSource();b.buffer=a;b.connect(this.audioContext.destination);b.start(0)}},invert:function(a){a?(document.body.classList.toggle(c.classes.INVERTED,
!1),this.invertTimer=0,this.inverted=!1):this.inverted=document.body.classList.toggle(c.classes.INVERTED,this.invertTrigger)}};c.updateCanvasScaling=function(a,b,d){var c=a.getContext("2d"),n=Math.floor(window.devicePixelRatio)||1,f=Math.floor(c.webkitBackingStorePixelRatio)||1,e=n/f;if(n!==f)return b=b||a.width,d=d||a.height,a.width=b*e,a.height=d*e,a.style.width=b+"px",a.style.height=d+"px",c.scale(e,e),!0;1==n&&(a.style.width=a.width+"px",a.style.height=a.height+"px");return!1};u.dimensions={TEXT_X:0,
TEXT_Y:13,TEXT_WIDTH:191,TEXT_HEIGHT:11,RESTART_WIDTH:36,RESTART_HEIGHT:32};u.prototype={updateDimensions:function(a,b){this.canvasDimensions.WIDTH=a;b&&(this.canvasDimensions.HEIGHT=b)},draw:function(){var a=u.dimensions,b=this.canvasDimensions.WIDTH/2,d=a.TEXT_X,l=a.TEXT_Y,e=a.TEXT_WIDTH,f=a.TEXT_HEIGHT,g=Math.round(b-a.TEXT_WIDTH/2),h=Math.round((this.canvasDimensions.HEIGHT-25)/3),k=a.TEXT_WIDTH,p=a.TEXT_HEIGHT,m=a.RESTART_WIDTH,q=a.RESTART_HEIGHT;b-=a.RESTART_WIDTH/2;var r=this.canvasDimensions.HEIGHT/
2;t&&(l*=2,d*=2,e*=2,f*=2,m*=2,q*=2);d+=this.textImgPos.x;l+=this.textImgPos.y;this.canvasCtx.drawImage(c.imageSprite,d,l,e,f,g,h,k,p);this.canvasCtx.drawImage(c.imageSprite,this.restartImgPos.x,this.restartImgPos.y,m,q,b,r,a.RESTART_WIDTH,a.RESTART_HEIGHT)}};m.MAX_GAP_COEFFICIENT=1.5;m.MAX_OBSTACLE_LENGTH=3;m.prototype={init:function(a){this.cloneCollisionBoxes();1<this.size&&this.typeConfig.multipleSpeed>a&&(this.size=1);this.width=this.typeConfig.width*this.size;if(Array.isArray(this.typeConfig.yPos)){var b=
y?this.typeConfig.yPosMobile:this.typeConfig.yPos;this.yPos=b[q(0,b.length-1)]}else this.yPos=this.typeConfig.yPos;this.draw();1<this.size&&(this.collisionBoxes[1].width=this.width-this.collisionBoxes[0].width-this.collisionBoxes[2].width,this.collisionBoxes[2].x=this.width-this.collisionBoxes[2].width);this.typeConfig.speedOffset&&(this.speedOffset=.5<Math.random()?this.typeConfig.speedOffset:-this.typeConfig.speedOffset);this.gap=this.getGap(this.gapCoefficient,a)},draw:function(){var a=this.typeConfig.width,
b=this.typeConfig.height;t&&(a*=2,b*=2);var d=a*this.size*.5*(this.size-1)+this.spritePos.x;0<this.currentFrame&&(d+=a*this.currentFrame);this.canvasCtx.drawImage(c.imageSprite,d,this.spritePos.y,a*this.size,b,this.xPos,this.yPos,this.typeConfig.width*this.size,this.typeConfig.height)},update:function(a,b){this.remove||(this.typeConfig.speedOffset&&(b+=this.speedOffset),this.xPos-=Math.floor(60*b/1E3*a),this.typeConfig.numFrames&&(this.timer+=a,this.timer>=this.typeConfig.frameRate&&(this.currentFrame=
this.currentFrame==this.typeConfig.numFrames-1?0:this.currentFrame+1,this.timer=0)),this.draw(),this.isVisible()||(this.remove=!0))},getGap:function(a,b){var d=Math.round(this.width*b+this.typeConfig.minGap*a);return q(d,Math.round(d*m.MAX_GAP_COEFFICIENT))},isVisible:function(){return 0<this.xPos+this.width},cloneCollisionBoxes:function(){for(var a=this.typeConfig.collisionBoxes,b=a.length-1;0<=b;b--)this.collisionBoxes[b]=new g(a[b].x,a[b].y,a[b].width,a[b].height)}};m.types=[{type:"CACTUS_SMALL",
width:17,height:35,yPos:105,multipleSpeed:4,minGap:120,minSpeed:0,collisionBoxes:[new g(0,7,5,27),new g(4,0,6,34),new g(10,4,7,14)]},{type:"CACTUS_LARGE",width:25,height:50,yPos:90,multipleSpeed:7,minGap:120,minSpeed:0,collisionBoxes:[new g(0,12,7,38),new g(8,0,7,49),new g(13,10,10,38)]},{type:"PTERODACTYL",width:46,height:40,yPos:[100,75,50],yPosMobile:[100,50],multipleSpeed:999,minSpeed:8.5,minGap:150,collisionBoxes:[new g(15,15,16,5),new g(18,21,24,6),new g(2,14,4,3),new g(6,10,4,7),new g(10,8,
6,9)],numFrames:2,frameRate:1E3/6,speedOffset:.8}];f.config={DROP_VELOCITY:-5,GRAVITY:.6,HEIGHT:47,HEIGHT_DUCK:25,INIITAL_JUMP_VELOCITY:-10,INTRO_DURATION:1500,MAX_JUMP_HEIGHT:30,MIN_JUMP_HEIGHT:30,SPEED_DROP_COEFFICIENT:3,SPRITE_WIDTH:262,START_X_POS:50,WIDTH:44,WIDTH_DUCK:59};f.collisionBoxes={DUCKING:[new g(1,18,55,25)],RUNNING:[new g(22,0,17,16),new g(1,18,30,9),new g(10,35,14,8),new g(1,24,29,5),new g(5,30,21,4),new g(9,34,15,4)]};f.status={CRASHED:"CRASHED",DUCKING:"DUCKING",JUMPING:"JUMPING",
RUNNING:"RUNNING",WAITING:"WAITING"};f.BLINK_TIMING=7E3;f.animFrames={WAITING:{frames:[44,0],msPerFrame:1E3/3},RUNNING:{frames:[88,132],msPerFrame:1E3/12},CRASHED:{frames:[220],msPerFrame:1E3/60},JUMPING:{frames:[0],msPerFrame:1E3/60},DUCKING:{frames:[264,323],msPerFrame:125}};f.prototype={init:function(){this.yPos=this.groundYPos=c.defaultDimensions.HEIGHT-this.config.HEIGHT-c.config.BOTTOM_PAD;this.minJumpHeight=this.groundYPos-this.config.MIN_JUMP_HEIGHT;this.draw(0,0);this.update(0,f.status.WAITING)},
setJumpVelocity:function(a){this.config.INIITAL_JUMP_VELOCITY=-a;this.config.DROP_VELOCITY=-a/2},update:function(a,b){this.timer+=a;b&&(this.status=b,this.currentFrame=0,this.msPerFrame=f.animFrames[b].msPerFrame,this.currentAnimFrames=f.animFrames[b].frames,b==f.status.WAITING&&(this.animStartTime=r(),this.setBlinkDelay()));this.playingIntro&&this.xPos<this.config.START_X_POS&&(this.xPos+=Math.round(this.config.START_X_POS/this.config.INTRO_DURATION*a));this.status==f.status.WAITING?this.blink(r()):
this.draw(this.currentAnimFrames[this.currentFrame],0);this.timer>=this.msPerFrame&&(this.currentFrame=this.currentFrame==this.currentAnimFrames.length-1?0:this.currentFrame+1,this.timer=0);this.speedDrop&&this.yPos==this.groundYPos&&(this.speedDrop=!1,this.setDuck(!0))},draw:function(a,b){var d=a,l=b,e=this.ducking&&this.status!=f.status.CRASHED?this.config.WIDTH_DUCK:this.config.WIDTH,g=this.config.HEIGHT,h=g;t&&(d*=2,l*=2,e*=2,g*=2);d+=this.spritePos.x;l+=this.spritePos.y;this.ducking&&this.status!=
f.status.CRASHED?this.canvasCtx.drawImage(c.imageSprite,d,l,e,g,this.xPos,this.yPos,this.config.WIDTH_DUCK,h):(this.ducking&&this.status==f.status.CRASHED&&this.xPos++,this.canvasCtx.drawImage(c.imageSprite,d,l,e,g,this.xPos,this.yPos,this.config.WIDTH,h));this.canvasCtx.globalAlpha=1},setBlinkDelay:function(){this.blinkDelay=Math.ceil(Math.random()*f.BLINK_TIMING)},blink:function(a){a-this.animStartTime>=this.blinkDelay&&(this.draw(this.currentAnimFrames[this.currentFrame],0),1==this.currentFrame&&
(this.setBlinkDelay(),this.animStartTime=a,this.blinkCount++))},startJump:function(a){this.jumping||(this.update(0,f.status.JUMPING),this.jumpVelocity=this.config.INIITAL_JUMP_VELOCITY-a/10,this.jumping=!0,this.speedDrop=this.reachedMinHeight=!1)},endJump:function(){this.reachedMinHeight&&this.jumpVelocity<this.config.DROP_VELOCITY&&(this.jumpVelocity=this.config.DROP_VELOCITY)},updateJump:function(a,b){var d=a/f.animFrames[this.status].msPerFrame;this.yPos=this.speedDrop?this.yPos+Math.round(this.jumpVelocity*
this.config.SPEED_DROP_COEFFICIENT*d):this.yPos+Math.round(this.jumpVelocity*d);this.jumpVelocity+=this.config.GRAVITY*d;if(this.yPos<this.minJumpHeight||this.speedDrop)this.reachedMinHeight=!0;(this.yPos<this.config.MAX_JUMP_HEIGHT||this.speedDrop)&&this.endJump();this.yPos>this.groundYPos&&(this.reset(),this.jumpCount++)},setSpeedDrop:function(){this.speedDrop=!0;this.jumpVelocity=1},setDuck:function(a){a&&this.status!=f.status.DUCKING?(this.update(0,f.status.DUCKING),this.ducking=!0):this.status==
f.status.DUCKING&&(this.update(0,f.status.RUNNING),this.ducking=!1)},reset:function(){this.yPos=this.groundYPos;this.jumpVelocity=0;this.ducking=this.jumping=!1;this.update(0,f.status.RUNNING);this.speedDrop=this.midair=!1;this.jumpCount=0}};h.dimensions={WIDTH:10,HEIGHT:13,DEST_WIDTH:11};h.yPos=[0,13,27,40,53,67,80,93,107,120];h.config={MAX_DISTANCE_UNITS:5,ACHIEVEMENT_DISTANCE:100,COEFFICIENT:.025,FLASH_DURATION:250,FLASH_ITERATIONS:3};h.prototype={init:function(a){var b="";this.calcXPos(a);this.maxScore=
this.maxScoreUnits;for(a=0;a<this.maxScoreUnits;a++)this.draw(a,0),this.defaultString+="0",b+="9";this.maxScore=parseInt(b)},calcXPos:function(a){this.x=a-h.dimensions.DEST_WIDTH*(this.maxScoreUnits+1)},draw:function(a,b,d){var c=h.dimensions.WIDTH,e=h.dimensions.HEIGHT;b*=h.dimensions.WIDTH;var f=a*h.dimensions.DEST_WIDTH,g=this.y,k=h.dimensions.WIDTH,m=h.dimensions.HEIGHT;t&&(c*=2,e*=2,b*=2);b+=this.spritePos.x;a=0+this.spritePos.y;this.canvasCtx.save();d?this.canvasCtx.translate(this.x-2*this.maxScoreUnits*
h.dimensions.WIDTH,this.y):this.canvasCtx.translate(this.x,this.y);this.canvasCtx.drawImage(this.image,b,a,c,e,f,g,k,m);this.canvasCtx.restore()},getActualDistance:function(a){return a?Math.round(a*this.config.COEFFICIENT):0},update:function(a,b){var c=!0,e=!1;this.achievement?this.flashIterations<=this.config.FLASH_ITERATIONS?(this.flashTimer+=a,this.flashTimer<this.config.FLASH_DURATION?c=!1:this.flashTimer>2*this.config.FLASH_DURATION&&(this.flashTimer=0,this.flashIterations++)):(this.achievement=
!1,this.flashTimer=this.flashIterations=0):(b=this.getActualDistance(b),b>this.maxScore&&this.maxScoreUnits==this.config.MAX_DISTANCE_UNITS?(this.maxScoreUnits++,this.maxScore=parseInt(this.maxScore+"9")):this.distance=0,0<b?(0==b%this.config.ACHIEVEMENT_DISTANCE&&(this.achievement=!0,this.flashTimer=0,e=!0),this.digits=(this.defaultString+b).substr(-this.maxScoreUnits).split("")):this.digits=this.defaultString.split(""));if(c)for(c=this.digits.length-1;0<=c;c--)this.draw(c,parseInt(this.digits[c]));
this.drawHighScore();return e},drawHighScore:function(){this.canvasCtx.save();this.canvasCtx.globalAlpha=.8;for(var a=this.highScore.length-1;0<=a;a--)this.draw(a,parseInt(this.highScore[a],10),!0);this.canvasCtx.restore()},setHighScore:function(a){a=this.getActualDistance(a);a=(this.defaultString+a).substr(-this.maxScoreUnits);this.highScore=["10","11",""].concat(a.split(""))},reset:function(){this.update(0);this.achievement=!1}};p.config={HEIGHT:14,MAX_CLOUD_GAP:400,MAX_SKY_LEVEL:30,MIN_CLOUD_GAP:100,
MIN_SKY_LEVEL:71,WIDTH:46};p.prototype={init:function(){this.yPos=q(p.config.MAX_SKY_LEVEL,p.config.MIN_SKY_LEVEL);this.draw()},draw:function(){this.canvasCtx.save();var a=p.config.WIDTH,b=p.config.HEIGHT,d=a,e=b;t&&(a*=2,b*=2);this.canvasCtx.drawImage(c.imageSprite,this.spritePos.x,this.spritePos.y,a,b,this.xPos,this.yPos,d,e);this.canvasCtx.restore()},update:function(a){this.remove||(this.xPos-=Math.ceil(a),this.draw(),this.isVisible()||(this.remove=!0))},isVisible:function(){return 0<this.xPos+
p.config.WIDTH}};e.config={FADE_SPEED:.035,HEIGHT:40,MOON_SPEED:.25,NUM_STARS:2,STAR_SIZE:9,STAR_SPEED:.3,STAR_MAX_Y:70,WIDTH:20};e.phases=[140,120,100,60,40,20,0];e.prototype={update:function(a,b){a&&0==this.opacity&&(this.currentPhase++,this.currentPhase>=e.phases.length&&(this.currentPhase=0));a&&(1>this.opacity||0==this.opacity)?this.opacity+=e.config.FADE_SPEED:0<this.opacity&&(this.opacity-=e.config.FADE_SPEED);if(0<this.opacity){this.xPos=this.updateXPos(this.xPos,e.config.MOON_SPEED);if(this.drawStars)for(var c=
0;c<e.config.NUM_STARS;c++)this.stars[c].x=this.updateXPos(this.stars[c].x,e.config.STAR_SPEED);this.draw()}else this.opacity=0,this.placeStars();this.drawStars=!0},updateXPos:function(a,b){return a=a<-e.config.WIDTH?this.containerWidth:a-b},draw:function(){var a=3==this.currentPhase?2*e.config.WIDTH:e.config.WIDTH,b=e.config.HEIGHT,d=this.spritePos.x+e.phases[this.currentPhase],f=a,g=e.config.STAR_SIZE,h=c.spriteDefinition.LDPI.STAR.x;t&&(a*=2,b*=2,d=this.spritePos.x+2*e.phases[this.currentPhase],
g*=2,h=c.spriteDefinition.HDPI.STAR.x);this.canvasCtx.save();this.canvasCtx.globalAlpha=this.opacity;if(this.drawStars)for(var k=0;k<e.config.NUM_STARS;k++)this.canvasCtx.drawImage(c.imageSprite,h,this.stars[k].sourceY,g,g,Math.round(this.stars[k].x),this.stars[k].y,e.config.STAR_SIZE,e.config.STAR_SIZE);this.canvasCtx.drawImage(c.imageSprite,d,this.spritePos.y,a,b,Math.round(this.xPos),this.yPos,f,e.config.HEIGHT);this.canvasCtx.globalAlpha=1;this.canvasCtx.restore()},placeStars:function(){for(var a=
Math.round(this.containerWidth/e.config.NUM_STARS),b=0;b<e.config.NUM_STARS;b++)this.stars[b]={},this.stars[b].x=q(a*b,a*(b+1)),this.stars[b].y=q(0,e.config.STAR_MAX_Y),this.stars[b].sourceY=t?c.spriteDefinition.HDPI.STAR.y+2*e.config.STAR_SIZE*b:c.spriteDefinition.LDPI.STAR.y+e.config.STAR_SIZE*b},reset:function(){this.opacity=this.currentPhase=0;this.update(!1)}};k.dimensions={WIDTH:600,HEIGHT:12,YPOS:127};k.prototype={setSourceDimensions:function(){for(var a in k.dimensions)t?"YPOS"!=a&&(this.sourceDimensions[a]=
2*k.dimensions[a]):this.sourceDimensions[a]=k.dimensions[a],this.dimensions[a]=k.dimensions[a];this.xPos=[0,k.dimensions.WIDTH];this.yPos=k.dimensions.YPOS},getRandomType:function(){return Math.random()>this.bumpThreshold?this.dimensions.WIDTH:0},draw:function(){this.canvasCtx.drawImage(c.imageSprite,this.sourceXPos[0],this.spritePos.y,this.sourceDimensions.WIDTH,this.sourceDimensions.HEIGHT,this.xPos[0],this.yPos,this.dimensions.WIDTH,this.dimensions.HEIGHT);this.canvasCtx.drawImage(c.imageSprite,
this.sourceXPos[1],this.spritePos.y,this.sourceDimensions.WIDTH,this.sourceDimensions.HEIGHT,this.xPos[1],this.yPos,this.dimensions.WIDTH,this.dimensions.HEIGHT)},updateXPos:function(a,b){var c=0==a?1:0;this.xPos[a]-=b;this.xPos[c]=this.xPos[a]+this.dimensions.WIDTH;this.xPos[a]<=-this.dimensions.WIDTH&&(this.xPos[a]+=2*this.dimensions.WIDTH,this.xPos[c]=this.xPos[a]-this.dimensions.WIDTH,this.sourceXPos[a]=this.getRandomType()+this.spritePos.x)},update:function(a,b){var c=Math.floor(.06*b*a);0>=
this.xPos[0]?this.updateXPos(0,c):this.updateXPos(1,c);this.draw()},reset:function(){this.xPos[0]=0;this.xPos[1]=k.dimensions.WIDTH}};v.config={BG_CLOUD_SPEED:.2,BUMPY_THRESHOLD:.3,CLOUD_FREQUENCY:.5,HORIZON_HEIGHT:16,MAX_CLOUDS:6};v.prototype={init:function(){this.addCloud();this.horizonLine=new k(this.canvas,this.spritePos.HORIZON);this.nightMode=new e(this.canvas,this.spritePos.MOON,this.dimensions.WIDTH)},update:function(a,b,c,e){this.runningTime+=a;this.horizonLine.update(a,b);this.nightMode.update(e);
this.updateClouds(a,b);c&&this.updateObstacles(a,b)},updateClouds:function(a,b){var c=this.cloudSpeed/1E3*a*b,e=this.clouds.length;if(e){for(var f=e-1;0<=f;f--)this.clouds[f].update(c);c=this.clouds[e-1];e<this.config.MAX_CLOUDS&&this.dimensions.WIDTH-c.xPos>c.cloudGap&&this.cloudFrequency>Math.random()&&this.addCloud();this.clouds=this.clouds.filter(function(a){return!a.remove})}else this.addCloud()},updateObstacles:function(a,b){for(var c=this.obstacles.slice(0),e=0;e<this.obstacles.length;e++){var f=
this.obstacles[e];f.update(a,b);f.remove&&c.shift()}this.obstacles=c;0<this.obstacles.length?(c=this.obstacles[this.obstacles.length-1])&&!c.followingObstacleCreated&&c.isVisible()&&c.xPos+c.width+c.gap<this.dimensions.WIDTH&&(this.addNewObstacle(b),c.followingObstacleCreated=!0):this.addNewObstacle(b)},removeFirstObstacle:function(){this.obstacles.shift()},addNewObstacle:function(a){var b=q(0,m.types.length-1);b=m.types[b];this.duplicateObstacleCheck(b.type)||a<b.minSpeed?this.addNewObstacle(a):
(this.obstacles.push(new m(this.canvasCtx,b,this.spritePos[b.type],this.dimensions,this.gapCoefficient,a,b.width)),this.obstacleHistory.unshift(b.type),1<this.obstacleHistory.length&&this.obstacleHistory.splice(c.config.MAX_OBSTACLE_DUPLICATION))},duplicateObstacleCheck:function(a){for(var b=0,d=0;d<this.obstacleHistory.length;d++)b=this.obstacleHistory[d]==a?b+1:0;return b>=c.config.MAX_OBSTACLE_DUPLICATION},reset:function(){this.obstacles=[];this.horizonLine.reset();this.nightMode.reset()},resize:function(a,
b){this.canvas.width=a;this.canvas.height=b},addCloud:function(){this.clouds.push(new p(this.canvas,this.spritePos.CLOUD,this.dimensions.WIDTH))}}})();var HIDDEN_CLASS="hidden";function onDocumentLoad(){new Runner(".interstitial-wrapper")}document.addEventListener("DOMContentLoaded",onDocumentLoad);

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -112,6 +112,14 @@
<div class="desc">vib&#8203;eOS is a Jav&#8203;aScript based Desk&#8203;top Envior&#8203;nment that runs in your brow&#8203;ser.</div>
</div>
</div>
<div class="responsive">
<div class="gallery">
<a id="dino" href="#">
<img src="/assets/img/flash.png" alt="dinogame">
</a>
<div class="desc">T-Rex Runner game, an Easter Egg in Google Chrome.</div>
</div>
</div>
<div class="responsive">
<div class="gallery">
<a target="_blank" href="./archive/g/run3/index.html">