Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 0f91d5b

Browse files
authored
Merge pull request #96 from PSDTools/map-fixes
Backport Refactors from PHS-Map
2 parents 5d4e9b3 + fbeb5f5 commit 0f91d5b

File tree

134 files changed

+941
-1119
lines changed

Some content is hidden

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

134 files changed

+941
-1119
lines changed

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.yarn/releases/** binary
2+
/.yarn/plugins/** binary
3+
*.lockb diff=lockb

.github/workflows/main.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,27 @@ jobs:
3030

3131
- name: Install bun
3232
uses: oven-sh/setup-bun@v1
33+
with:
34+
bun-version: 1.0.29
3335

3436
- name: Cache
35-
uses: actions/[email protected]
37+
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
38+
id: cache
3639
with:
3740
path: |
3841
.turbo
3942
node_modules
4043
~/.bun/install/cache
41-
key: ${{ runner.os }}-bun-turbo-${{ hashFiles('**/turbo.json') }}
44+
key: ${{ runner.os }}-${{ runner.arch }}-node_modules-${{ hashFiles('**/bun.lockb', '**/turbo.json') }}
4245

4346
- name: Install dependencies
44-
run: bun install --frozen-lockfile
47+
if: steps.cache.outputs.cache-hit != 'true'
48+
run: bun --bun install --frozen-lockfile
49+
env:
50+
SHARP_IGNORE_GLOBAL_LIBVIPS: 1
4551

4652
- name: Lint & Build
47-
# Use --bun once the next release is cut.
48-
# Right now, bun is incorrectly parsing dotfiles.
49-
run: bun run turbo build
53+
run: bun --bun run turbo build
5054

5155
- name: Redirect 404 to Index for SPA
5256
run: cp dist/index.html dist/404.html

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v21.6.2

.vscode/settings.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
}
88
},
99
"explorer.fileNesting.patterns": {
10-
".replit": "replit.nix",
11-
"package.json": "package-lock.json",
12-
"REAME*": "*.${capture}"
10+
"package.json": ".prettierrc, .prettierignore, bun.lockb, eslint.config.js, turbo.json",
11+
"README*": "*.${capture}",
12+
".replit": "replit.*"
1313
},
1414
"cSpell.enableFiletypes": ["!typescript"],
1515
"prettier.prettierPath": "./node_modules/prettier/index.cjs"

bun.lockb

53.3 KB
Binary file not shown.

eslint.config.js

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,44 @@
1-
// @ts-check
21
import { sheriff } from "eslint-config-sheriff";
32
import { defineFlatConfig } from "eslint-define-config";
43

4+
/**
5+
* @type import("@sherifforg/types").SheriffSettings
6+
*/
57
const sheriffOptions = {
68
react: false,
79
lodash: false,
810
next: false,
911
playwright: false,
1012
jest: false,
1113
vitest: false,
14+
// astro: false, // THIS DOESN'T DO ANYTHING!
1215
pathsOveriddes: {
1316
tsconfigLocation: [
1417
"./tsconfig.json",
1518
"./tsconfig.sw.json",
1619
"./tsconfig.eslint.json",
1720
],
18-
ignores: [
19-
"**/node_modules/**",
20-
"**/dist/**",
21-
"**/dev-dist/**",
22-
"**/build/**",
23-
"**/.yarn/**",
24-
"**/.pnp.*",
25-
],
2621
},
2722
};
2823

24+
/**
25+
* @type import("eslint-define-config").FlatESLintConfig[]
26+
*/
27+
// @ts-expect-error: null and undefined are different.
28+
const sheriffRules = sheriff(sheriffOptions);
29+
2930
export default defineFlatConfig([
30-
...sheriff(sheriffOptions),
31+
...sheriffRules,
3132
{
3233
files: ["**/*.ts"],
3334
rules: {
34-
"padding-line-between-statements": "off",
3535
"@typescript-eslint/naming-convention": "off",
3636
"prefer-destructuring": "off",
37-
"unicorn/prefer-query-selector": "off",
37+
"@typescript-eslint/prefer-destructuring": "warn",
38+
"unicorn/prefer-query-selector": "warn",
3839
"func-style": ["error", "declaration", { allowArrowFunctions: true }],
3940
"no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
40-
"operator-assignment": ["off", "always"],
41+
"operator-assignment": ["warn", "always"],
4142
"@typescript-eslint/no-non-null-assertion": "off",
4243
"no-console": "warn",
4344
"no-negated-condition": "off",
@@ -47,6 +48,10 @@ export default defineFlatConfig([
4748
{ "ts-expect-error": true, "ts-check": false },
4849
],
4950
"import/no-unresolved": [2, { ignore: ["^virtual:"] }],
51+
"@typescript-eslint/prefer-function-type": "warn",
52+
"@typescript-eslint/explicit-function-return-type": "warn",
53+
"@typescript-eslint/promise-function-async": "warn",
54+
"@typescript-eslint/strict-boolean-expressions": "warn",
5055
},
5156
},
5257
]);

index.html

+11-160
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,35 @@
55
<meta name="viewport" content="width=device-width" />
66
<base href="/" />
77
<title>GPA Calculator</title>
8-
<link
9-
href="/AppImages/android/android-launchericon-512-512.png"
10-
rel="shortcut icon"
11-
/>
128
<script type="module" src="/src/script.ts"></script>
139
<script src="https://cdn.tailwindcss.com"></script>
1410
</head>
1511
<body
1612
id=""
1713
class="bg-[url('/GPA_Calculator/bground.png')]"
18-
onload="getStorage()"
14+
onload="startApp()"
1915
>
2016
<!-- The overlay -->
21-
<div id="mySidenav" class="overlay">
17+
<div id="mySidenav" class="overlay w-0">
2218
<!-- Button to close the overlay navigation -->
2319
<a href="javascript:void(0)" class="closebtn" onclick="toggleNav(false)"
2420
>&times;</a
2521
>
2622

2723
<!-- Overlay content -->
28-
<form class="overlay-content text-white">
29-
<label>
30-
<button
31-
type="submit"
32-
id="clearDataButton"
33-
style="background-color: #00d5ff; color: black"
34-
onclick="clearData()"
35-
>
36-
Clear Grade Data
37-
</button>
38-
<p class="text-sm mt-4">Note: This action refreshes the page.</p>
39-
</label>
40-
41-
<!-- <button id="darkModeButton" onclick="darkMode()">Dark Mode</button> -->
42-
<p></p>
24+
<form class="overlay-content text-white flex flex-col">
25+
<p class="text-white text-sm mt-4">These actions refresh the page.</p>
4326
<button
27+
class="text-white m-2"
4428
type="submit"
45-
style="background-color: #00d5ff; color: black"
46-
onclick="clearAll()"
29+
id="clearDataButton"
30+
onclick="clearData()"
4731
>
32+
Clear Grade Data
33+
</button>
34+
<button class="text-white m-2" type="submit" onclick="clearAll()">
4835
Clear All Site Data
4936
</button>
50-
<p></p>
5137
</form>
5238
</div>
5339

@@ -59,7 +45,6 @@
5945
type="button"
6046
onclick="toggleNav(true)"
6147
class="pb-8 text-xl text-white rounded-full w-8 h-8"
62-
style="background-color: #00d5ff; color: black"
6348
>
6449
6550
</button>
@@ -86,56 +71,7 @@
8671
</div>
8772
</div>
8873

89-
<!-- Side Navigation -->
90-
<!-- <nav id="mySidebar">
91-
<button onclick="w3_close()">Close <i></i></button>
92-
<p></p>
93-
<button onclick="document.getElementById('id01').style.display='block'">
94-
Select Grade Level
95-
</button>
96-
<p></p>
97-
<button id="darkModeButton" onclick="darkMode()">Dark Mode</button>
98-
<p></p>
99-
<p></p>
100-
101-
<p>Note: This action refreshes the page.</p>
102-
<p></p>
103-
<button onclick="clearAll()">Clear All Site Data</button>
104-
<p></p>
105-
106-
<!- Google Translate -->
107-
<!-- <div id="google_translate_element"></div> -->
108-
<!-- <script type="text/javascript">
109-
// <![CDATA[
110-
function googleTranslateElementInit() {
111-
new google.translate.TranslateElement(
112-
{
113-
pageLanguage: "en",
114-
layout: google.translate.TranslateElement.InlineLayout.SIMPLE,
115-
},
116-
"google_translate_element"
117-
);
118-
}
119-
// ]]>
120-
</script>
121-
<script
122-
src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"
123-
type="text/javascript"
124-
></script> -->
125-
<!-- </nav> -->
126-
127-
<!-- Header -->
128-
<header id="myHeader">
129-
<!-- <i onclick="w3_open()"></i>
130-
<div>
131-
<h4 class="absolute top-0 left-0 shadow-lg p-4 text-white bg-black">
132-
Pattonville
133-
</h4>
134-
<input onclick="hsmsSwap()" type="checkbox" id="hsmsInput" checked />
135-
136-
<h1>GPA Calculator</h1>
137-
</div> -->
138-
</header>
74+
<header id="myHeader"></header>
13975
<div class="lg:pb-8 lg:flex h-full text-white">
14076
<div
14177
class="basis-1/3 lg:rounded-br-lg lg:px-10 lg:pt-8 p-8 bg-black lg:h-screen"
@@ -145,7 +81,6 @@ <h5>How to use!</h5>
14581
Input number of classes you are taking and press "Submit", then input
14682
your grades under "Grades".
14783
</p>
148-
<p></p>
14984
<p id="Directions2">
15085
Your class data will then be saved to your device. This is so if you
15186
refresh, your data is saved!
@@ -161,107 +96,23 @@ <h5>How to use!</h5>
16196
<button
16297
onclick="classAmount()"
16398
class="text-black px-1 rounded-sm"
164-
style="background-color: #00d5ff; color: black"
16599
type="submit"
166100
>
167101
Submit
168102
</button>
169103
</form>
170-
<p></p>
171104
</div>
172105

173106
<div class="lg:w-2/3 lg:px-16 px-4 lg:p-8 p-4" id="c">
174107
<h5>Grades:</h5>
175-
<p></p>
176108
<div id="temp1"></div>
177109
<div
178110
class="lg:drop-shadow-2xl lg:fixed static lg:right-16 lg:bottom-16 p-4 bg-black rounded-lg text-white"
179111
>
180112
<h2 class="" id="gpa">No Data</h2>
181113
</div>
182114
<p id="saved"></p>
183-
<!-- <button id="gpaButton" onclick="loadgpa()">
184-
Calculate GPA and Save
185-
</button> -->
186115
</div>
187116
</div>
188-
189-
<!-- <div id="id01" class="">
190-
<div class="">
191-
<header class="">
192-
<h3>Choose Your Grade Level</h3>
193-
</header>
194-
<div class="">
195-
<h4 id="modalClass">Middle School</h4>
196-
<label class="switch">
197-
<span></span>
198-
</label>
199-
<p></p>
200-
<span
201-
onclick="document.getElementById('id01').style.display='none'"
202-
class=""
203-
>Ok</span
204-
>
205-
<p></p>
206-
</div>
207-
<footer class="">
208-
<p>This can be changed later inside the menu.</p>
209-
</footer>
210-
</div>
211-
</div> -->
212-
213-
<!-- Easter Egg -->
214-
215-
<!-- Footer -->
216-
<footer id="myFooter">
217-
<!-- <h3>About</h3>
218-
Easter egg
219-
<p>.... . .-.. .-.. --- / - .... . .-. . -.-.--</p>
220-
<!- Info -->
221-
<!--
222-
<p>
223-
Created by Parker Hasenkamp for the
224-
<a href="https://psdr3.org" target="_blank"
225-
>Pattonville School District</a
226-
>
227-
</p>
228-
<p>
229-
My submission for the 2021
230-
<a href="https://www.congressionalappchallenge.us/" target="_blank"
231-
>Congressional App Challenge!</a
232-
>
233-
</p> -->
234-
</footer>
235-
<!--Smooth Scroll Buttons-->
236-
<!-- <script type="module">
237-
import $ from "jquery";
238-
239-
$(document).ready(function () {
240-
// Add smooth scrolling to all links
241-
$("a").on("click", function (event) {
242-
// Make sure this.hash has a value before overriding default behavior
243-
if (this.hash !== "") {
244-
// Prevent default anchor click behavior
245-
event.preventDefault();
246-
247-
// Store hash
248-
var hash = this.hash;
249-
250-
// Using jQuery's animate() method to add smooth page scroll
251-
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
252-
$("html, body").animate(
253-
{
254-
scrollTop: $(hash).offset().top,
255-
},
256-
1000,
257-
function () {
258-
// Add hash (#) to URL when done scrolling (default click behavior)
259-
window.location.hash = hash;
260-
}
261-
);
262-
} // #ENDIF
263-
});
264-
});
265-
</script> -->
266117
</body>
267118
</html>

0 commit comments

Comments
 (0)