Skip to content

Instantly share code, notes, and snippets.

🐼
I'm a panda developer.

Maciej Korsan maciejkorsan

🐼
I'm a panda developer.
View GitHub Profile
View falcon.js
let ws = new WebSocket(socketUrl)
ws.on("open", function open() {
console.log("Connected 🚀")
});
ws.on("message", function incoming(data) {
const parsed = JSON.parse(data)
const message = parsed.payload
View webmanifest.json
{
"name": "Millennium Falcon",
"short_name": "Falcon",
"theme_color": "#2196f3",
"background_color": "#2196f3",
"display": "standalone",
"orientation": "portrait",
"scope": "/",
"icons": [{
"src": "/images/icons/icon-128x128.png",
View pwa.html
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link
rel="apple-touch-icon"
sizes="192x192"
href="/images/icons/icon-192x192.png"
/>
<link
href="splashscreens/iphone5_splash.png"
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)"
View webhook-socket.js
if (args.action == 'started') {
args.light = 'star'
args.status = 1
}
View webhook-falcon.js
if (light === "star") {
hyperdrive.writeSync(1);
try {
clearTimeout(hyperdriveTimer);
} catch (e) {}
hyperdriveTimer = setTimeout(function() {
hyperdrive.writeSync(0);
}, 3000);
play("r2d2");
}
View falcon-web.js
import axios from "axios";
const hyperdrive = document.querySelector(".-hyperdrive");
const cockpit = document.querySelector(".-cockpit");
const headlights = document.querySelector(".-headlights");
let lights = {
cockpit: 0,
front: 0,
hyperdrive: 0
You can’t perform that action at this time.