Skip to content

Commit 25bc199

Browse files
authored
Merge pull request #15 from ajmas/issue-1-threejs
Issue #1 Conversion to Threejs
2 parents 0612e66 + 493ec5c commit 25bc199

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+4407
-9999
lines changed

.eslintrc.cjs

Lines changed: 81 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,88 @@
1+
const { resolve } = require('path');
12
module.exports = {
3+
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
4+
// This option interrupts the configuration hierarchy at this file
5+
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
6+
root: true,
7+
8+
// https://eslint.vuejs.org/user-guide/#how-to-use-custom-parser
9+
// Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
10+
// `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
11+
parserOptions: {
12+
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#configuration
13+
// https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#eslint
14+
// Needed to make the parser take into account 'vue' files
15+
extraFileExtensions: ['.vue'],
16+
parser: '@typescript-eslint/parser',
17+
project: resolve(__dirname, './tsconfig.json'),
18+
tsconfigRootDir: __dirname,
19+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
20+
sourceType: 'module' // Allows for the use of imports
21+
},
22+
223
env: {
3-
browser: true,
4-
es2021: true,
5-
jquery: true
24+
browser: true
625
},
7-
extends: 'airbnb-base',
8-
overrides: [
9-
{
10-
env: {
11-
node: true
12-
},
13-
files: [
14-
'.eslintrc.{js,cjs}'
15-
],
16-
parserOptions: {
17-
sourceType: 'script'
18-
}
19-
}
26+
27+
ignorePatterns: [
28+
'vite.config.js'
2029
],
21-
parserOptions: {
22-
ecmaVersion: 'latest',
23-
sourceType: 'module'
24-
},
30+
31+
// Rules order is important, please avoid shuffling them
32+
extends: [
33+
// Base ESLint recommended rules
34+
// 'eslint:recommended',
35+
36+
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage
37+
// ESLint typescript rules
38+
'plugin:@typescript-eslint/recommended',
39+
// consider disabling this class of rules if linting takes too long
40+
'plugin:@typescript-eslint/recommended-requiring-type-checking'
41+
],
42+
43+
plugins: [
44+
// required to apply rules which need type information
45+
'@typescript-eslint',
46+
'import'
47+
],
48+
49+
// add your custom rules here
2550
rules: {
26-
'no-plusplus': 'off',
27-
'comma-dangle': ['error', 'never'],
28-
'no-console': 'warn',
29-
'max-len': ['error', { code: 130 }],
30-
'no-else-return': 'warn',
31-
'no-param-reassign': 'off',
32-
'prefer-destructuring': 'off',
33-
'prefer-template': 'warn',
34-
'no-continue': 'off',
35-
'space-before-function-paren': ['error', { anonymous: 'never', named: 'always' }],
36-
'no-await-in-loop': 'off',
37-
'class-methods-use-this': 'off',
38-
indent: ['error', 2]
51+
// allow async-await
52+
'generator-star-spacing': 'off',
53+
// allow paren-less arrow functions
54+
'arrow-parens': 'off',
55+
'one-var': 'off',
56+
'no-void': 'off',
57+
'multiline-ternary': 'off',
58+
59+
'import/first': 'off',
60+
'import/namespace': 'error',
61+
'import/default': 'error',
62+
'import/export': 'error',
63+
'import/extensions': 'off',
64+
'import/no-unresolved': 'off',
65+
'import/no-extraneous-dependencies': 'off',
66+
'prefer-promise-reject-errors': 'off',
67+
'space-before-function-paren': 'error',
68+
semi: [2, 'always'],
69+
indent: ['error', 2],
70+
71+
// TypeScript
72+
quotes: ['warn', 'single', { avoidEscape: true }],
73+
'@typescript-eslint/explicit-function-return-type': 'off',
74+
'@typescript-eslint/explicit-module-boundary-types': 'off',
75+
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
76+
'@typescript-eslint/no-unsafe-assignment': 'off',
77+
'@typescript-eslint/no-unsafe-member-access': 'off',
78+
'@typescript-eslint/no-unsafe-call': 'off',
79+
'@typescript-eslint/no-explicit-any': 'off',
80+
'@typescript-eslint/restrict-template-expressions': 'off',
81+
'@typescript-eslint/no-misused-promises': 'off',
82+
'@typescript-eslint/no-unsafe-argument': 'off',
83+
84+
85+
// allow debugger during development only
86+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
3987
}
4088
};

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919

2020
- name: Setup Node
2121
uses: actions/setup-node@v3
22+
with:
23+
node-version: '16.20'
2224

2325
- name: Install dependencies
2426
uses: bahmutov/npm-install@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ node_modules
22
.DS_Store
33
logs/
44
*.env
5+
.cookiejar
56

67
# Devenv
78
.direnv

bin/fetch-tle.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/sh
2+
3+
basepath=`dirname "$0"`
4+
cd "$basepath"
5+
6+
identity=$SPACETRACK_IDENTITY
7+
password=$SPACETRACK_PASSWORD
8+
9+
if [ -z "$SPACETRACK_IDENTITY" ] || [ -z "$SPACETRACK_PASSWORD" ]
10+
then
11+
echo 'ensure both "SPACETRACK_IDENTITY" and "SPACETRACK_PASSWORD" are set'
12+
fi
13+
14+
source_url="https://www.space-track.org/basicspacedata/query/class/tle_latest/ORDINAL/1/EPOCH/%3Enow-30/orderby/NORAD_CAT_ID/format/json"
15+
tle_file="../public/data/TLE.json"
16+
output_file="../public/data/attributed-TLE.json"
17+
current_date=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
18+
cookie_jar="/tmp/$USER-cookiejar"
19+
20+
echo "Downloading TLE data"
21+
curl -c $cookie_jar -b $cookie_jar https://www.space-track.org/ajaxauth/login \
22+
-d "identity=$identity&password=$password"
23+
24+
curl ---limit-rate 100K -cookie $cookie_jar "${source_url}" > $tle_file
25+
26+
echo "Generating Attributed TLE file"
27+
echo "{
28+
\"source\": {
29+
\"name\": \"Space-Track.org\",
30+
\"url\": \"https://www.space-track.org/\"
31+
},
32+
\"date\": \"$current_date\",
33+
\"data\":
34+
" > $output_file
35+
36+
cat $tle_file >> $output_file
37+
echo "\n}\n" >> $output_file

index.html

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,27 @@
55

66
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
77

8+
<meta property="og:type" content="website" />
9+
<meta property="og:title" content="Stuff in Space" />
10+
<meta property="og:site_name" content="Stuff in Space" />
11+
<meta property="og:locale" content="en_GB" />
12+
<meta property="og:description" content="Viewer for satellites and space debris" />
13+
<meta property="og:url" content="https://ajmas.github.io/StuffInSpace/" />
14+
<meta property="og:image" content="https://ajmas.github.io/StuffInSpace/images/preview.png" />
15+
16+
<meta name="twitter:card" content="summary_large_image" />
17+
<meta name="twitter:title" content="Stuff in Space" />
18+
<meta name="twitter:description" content="Viewer for satellites and space debris" />
19+
<meta name="twitter:image" content="https://ajmas.github.io/StuffInSpace/images/preview.png" />
20+
<meta name="twitter:url" content="https://ajmas.github.io/StuffInSpace/" />
21+
<meta name="twitter:site" content="https://ajmas.github.io/StuffInSpace/" />
22+
823
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />
924
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Droid+Sans" type="text/css">
1025
<link rel="stylesheet" href="styles/icomoon.css" type="text/css">
11-
<link rel="stylesheet" href="styles/perfect-scrollbar.min.css" type="text/css">
1226
<link rel="stylesheet" href="styles/style.css" type="text/css">
1327

14-
<script type="module" src="src/main.ts"></script>
28+
<script type="module" src="src/index.ts"></script>
1529

1630
<title>Stuff in Space</title>
1731
</head>
@@ -20,7 +34,7 @@
2034
Stuff in Space requires <a href="https://caniuse.com/#feat=webgl">WebGL</a> and <a href="https://caniuse.com/#feat=webworkers">Web Worker</a> support.
2135
</div>
2236
<div id="canvas-holder">
23-
<canvas id="canvas"></canvas>
37+
<div class="viewer"></div>
2438

2539
<div id="mobile-hamburger"><span class="material-symbols-outlined">menu</span></div>
2640

0 commit comments

Comments
 (0)