Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joekav committed Feb 1, 2024
1 parent 291e3e5 commit 22d4610
Show file tree
Hide file tree
Showing 27 changed files with 21,347 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*/node_modules
/tmp
*/__pycache__
*/tests
*.html
detection/assets
34 changes: 34 additions & 0 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const express = require('express');
const app = express();
const port = 3000;
const generatePayload = require('./src/gen.js');
const fs = require('fs');

app.use(express.json());

app.post('/solve', async (req, res) => {
if (!req.body) {
res.status(400).send({
error: "Invalid request body: no body provided"
});
return;

} else if (!req.body.ddm.hash || !req.body.ddm.ua || !req.body.ddm.cid) {
res.status(400).send({
error: "Invalid request body: invalid ddm"
});
return;
} else if (!req.body.background_image) {
res.status(400).send({
error: "Invalid request body: no image url"
});
return;
}

var response = await generatePayload.main(req.body)
res.send(response);
});

app.listen(port, () => {
console.log(`API server is running on port ${port}`);
});
13 changes: 13 additions & 0 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "slide-api",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"axios": "^1.6.7",
"express": "^4.18.2"
}
}
98 changes: 98 additions & 0 deletions api/src/devices.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@



const possibleGlvd = [
"Google Inc. (AMD)",
"Google Inc. (NVIDIA)",
]

const possibleGlrd = {
"Google Inc. (AMD)": [
"ANGLE (AMD, AMD Radeon RX 6500 XT Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (AMD, AMD Radeon RX 6600 XT Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (AMD, AMD Radeon RX 6700 XT Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (AMD, AMD Radeon RX 6800 XT Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (AMD, AMD Radeon RX 6900 XT Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (AMD, AMD Radeon(TM) RX Vega 11 Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (AMD, AMD Radeon(TM) Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (AMD, AMD Radeon RX 6700 Pro Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (AMD, AMD Radeon RX 6600 Direct3D11 vs_5_0 ps_5_0, D3D11)",
],
"Google Inc. (NVIDIA)": [
"ANGLE (NVIDIA, NVIDIA GeForce RTX 3090 Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (NVIDIA, NVIDIA GeForce RTX 3080 Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (NVIDIA, NVIDIA GeForce RTX 3070 Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 Ti Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (NVIDIA, NVIDIA GeForce GTX 1660 SUPER Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (NVIDIA, NVIDIA GeForce GTX 1060 6GB Direct3D11 vs_5_0 ps_5_0, D3D11-30.0.14.9613)",
"ANGLE (NVIDIA, NVIDIA GeForce GTX 1050 Ti Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (NVIDIA, NVIDIA GeForce GTX 1050 Direct3D11 vs_5_0 ps_5_0, D3D11-27.21.14.5671)",
"ANGLE (NVIDIA, NVIDIA GeForce GTX 1660 Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (NVIDIA, NVIDIA GeForce GTX 1650 Super Direct3D11 vs_5_0 ps_5_0, D3D11)",
],
}

const possibleOrientationTypes = ["portrait-primary", "landscape-primary", "portrait-secondary", "landscape-secondary"]

const possibleHc = [4, 6, 8, 10, 12, 16, 32, 48]
const possibleDvm = [4, 8, 16, 32]
const possiblePixelRatios = [1, 2]
const possibleRs_cd = [1, 4, 8, 15, 16, 24, 32, 48]
const possibleResolutions = [
{
width: 2560,
height: 1440,
},
{
width: 1920,
height: 1080,
},
{
width: 1280,
height: 720,
},
{
width: 1024,
height: 768,
},
{
width: 1280,
height: 960,
},
{
width: 1280,
height: 1024,
},
{
width: 1400,
height: 1050,
},
{
width: 1600,
height: 1200,
},
{
width: 4096,
height: 2160,
},
{
width: 1366,
height: 768,
},
{
width: 3200,
height: 1800,
},
{
width: 3840,
height: 2160,
},
{
width: 1600,
height: 900,
},
]

// Remove the 'export default' statement
module.exports = { possibleGlvd, possibleGlrd, possibleOrientationTypes, possibleHc, possibleDvm, possiblePixelRatios, possibleRs_cd, possibleResolutions }
Loading

0 comments on commit 22d4610

Please sign in to comment.