Browse Source

initial release - 1.0

Michael Hoskins 5 years ago
parent
commit
764d93e65b
13 changed files with 92 additions and 5 deletions
  1. 2 1
      README.md
  2. BIN
      assets/icon-128x128.png
  3. BIN
      assets/icon-16x16.png
  4. BIN
      assets/icon-24x24.png
  5. BIN
      assets/icon-48x48.png
  6. BIN
      assets/outrun-grid.jpg
  7. BIN
      assets/outrun-sun.png
  8. 23 2
      index.css
  9. 14 2
      index.html
  10. 29 0
      index.js
  11. 24 0
      manifest.json
  12. BIN
      sample.gif
  13. BIN
      screenshot-01.jpg

+ 2 - 1
README.md

@@ -4,5 +4,6 @@ Originally grabbed this source from https://github.com/wayou/t-rex-runner and dr
 
 see the [source](https://cs.chromium.org/chromium/src/components/neterror/resources/offline.js?q=t-rex+package:%5Echromium$&dr=C&l=7) from chromium
 
-![chrome offline game cast](assets/screenshot.gif)
+This extension was inspired directly by the following reddit post in /r/outrun: https://www.reddit.com/r/outrun/comments/8zq03l/c_h_r_o_m_e/
 
+![sample](sample.gif)

BIN
assets/icon-128x128.png


BIN
assets/icon-16x16.png


BIN
assets/icon-24x24.png


BIN
assets/icon-48x48.png


BIN
assets/outrun-grid.jpg


BIN
assets/outrun-sun.png


+ 23 - 2
index.css

@@ -7,7 +7,7 @@ html, body {
   margin: 0;
   width: 100%;
   height: 100%;
-  background-color: #000;
+  background-color:transparent;
 }
 
 .icon {
@@ -25,17 +25,38 @@ html, body {
   display: none;
 }
 
+h1 {
+  font-weight: normal;
+}
+
+a {
+  color: #bf9dde;
+}
 
+#grid {
+  width: 100%; 
+  height: 100%; 
+  position: fixed; 
+  left: 0px; 
+  bottom: 0px; 
+  z-index: -1;
+}
+
+.stretch {
+  width:100%;
+  height:100%;
+}
 /* Offline page */
 
 .offline .interstitial-wrapper {
-  color: #2b2b2b;
+  color: #bf9dde;
   font-size: 1em;
   line-height: 1.55;
   margin: 0 auto;
   max-width: 600px;
   padding-top: 100px;
   width: 100%;
+  text-shadow: #bf9dde 0 0 10px;
 }
 
 .offline .runner-container {

File diff suppressed because it is too large
+ 14 - 2
index.html


+ 29 - 0
index.js

@@ -286,6 +286,8 @@
          * definition.
          */
         loadImages: function () {
+            Sun.imageSprite = document.getElementById('sun');
+
             if (IS_HIDPI) {
                 Runner.imageSprite = document.getElementById('offline-resources-2x');
                 this.spriteDef = Runner.spriteDefinition.HDPI;
@@ -2099,6 +2101,30 @@
         }
     };
 
+    function Sun(canvas) {
+        this.canvas = canvas;
+        this.canvasCtx = this.canvas.getContext('2d');
+        this.init();
+    }
+
+    Sun.config = {
+        X_POS: 120,
+        Y_POS: 15,
+    };
+
+    Sun.prototype = {
+        init: function() {
+            this.draw();
+        },
+
+        draw: function() {
+            this.canvasCtx.drawImage(Sun.imageSprite, Sun.config.X_POS, Sun.config.Y_POS);
+        },
+
+        update: function() {
+            this.draw();
+        }
+    };
 
     //******************************************************************************
 
@@ -2536,6 +2562,7 @@
             this.horizonLine = new HorizonLine(this.canvas, this.spritePos.HORIZON);
             this.nightMode = new NightMode(this.canvas, this.spritePos.MOON,
                 this.dimensions.WIDTH);
+            this.sun = new Sun(this.canvas);
         },
 
         /**
@@ -2547,6 +2574,7 @@
          * @param {boolean} showNightMode Night mode activated.
          */
         update: function (deltaTime, currentSpeed, updateObstacles, showNightMode) {
+            this.sun.update();
             this.runningTime += deltaTime;
             this.horizonLine.update(deltaTime, currentSpeed);
             this.nightMode.update(showNightMode);
@@ -2555,6 +2583,7 @@
             if (updateObstacles) {
                 this.updateObstacles(deltaTime, currentSpeed);
             }
+
         },
 
         /**

+ 24 - 0
manifest.json

@@ -0,0 +1,24 @@
+{
+    "manifest_version": 2,
+    "name": "T-Rex Outrunner",
+    "description": "Replaces the new tab page with a custom Chrome disconnected page, inspired by an /r/outrun post.",
+    "version": "1",
+    "author": "Michael Hoskins",
+   
+   "browser_action": {
+      "default_title": "Outrun",
+      "default_icon": "assets/icon-24x24.png"
+    },
+
+    "icons": {
+      "16": "assets/icon-16x16.png",
+      "48": "assets/icon-48x48.png",
+      "128": "assets/icon-128x128.png"
+    },
+   
+   "chrome_url_overrides" : {
+     "newtab": "index.html"
+   },
+   
+    "permissions": ["activeTab"]
+}

BIN
sample.gif


BIN
screenshot-01.jpg


Some files were not shown because too many files changed in this diff