Skip to content

Commit d246fac

Browse files
committed
added firebase hosting, and I think I fixed the bug with path not found
1 parent 8d5d716 commit d246fac

File tree

11 files changed

+92
-16
lines changed

11 files changed

+92
-16
lines changed

.eslintcache

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

.firebase/hosting.YnVpbGQ.cache

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
favicon.ico.svg,1613366066720,55161443857d14d9de521375f3284fa9a9255de88cde4874020382e5be37ccb4
2+
labyrinth.svg,1613366372107,4a4f024e3f283d0d83575fc575a087d7e6326b3be30db8431e8992fb8d27394b
3+
logo192.png,499162500000,3ee59515172ee198f3be375979df15ac5345183e656720a381b8872b2a39dc8b
4+
logo512.png,499162500000,ee7e2f3fdb8209c4b6fd7bef6ba50d1b9dba30a25bb5c3126df057e1cb6f5331
5+
manifest.json,499162500000,aff3449bdc238776f5d6d967f19ec491b36aed5fb7f23ccff6500736fd58494a
6+
robots.txt,499162500000,bfe106a3fb878dc83461c86818bf74fc1bdc7f28538ba613cd3e775516ce8b49
7+
asset-manifest.json,1613371818444,4cef6a870d07ffdf10e2302001312a262e3175b957b65720cb41a6536d28cb3d
8+
index.html,1613371818444,ffaf462ab37ff6b6e29089a273a025129ca4e3ccffe0ea0ca8e80317de2833c7
9+
static/css/main.3605cbde.chunk.css,1613371818444,e31ae112efe520c43b358cee5f15ed7a8cfd0fba5e683ed39dd2f34ce8f57649
10+
static/js/3.0bc71846.chunk.js,1613371818460,ac038ec10a32c89a076db243d2ba0dfefdb72b1774509188e27cf82a0f478277
11+
static/js/2.0fe8b61e.chunk.js.LICENSE.txt,1613371818460,8a1c95c04d0dddd3c04dd38187999313350f4c4f4f76c68c50f0f7f022bc6589
12+
static/js/3.0bc71846.chunk.js.map,1613371818460,5c4635a17b287f82c6d6a4a40939affa42f94f867b76e18d8113e3598594b46e
13+
static/css/main.3605cbde.chunk.css.map,1613371818460,a144961e6e223eab5f4ba420dc9955da4f4173fc563857de39f90625a6263bb5
14+
static/js/main.b7bcc5b1.chunk.js,1613371818444,fe5e9171b942ea9112857ed8b17f21a01993d84e78e1cb84fbc87454309095de
15+
static/js/runtime-main.d8cdba88.js,1613371818460,68cb57a94630949cd8c26e9099ca2a779af8c18736ee1fd3094bd49289cb1b31
16+
static/js/runtime-main.d8cdba88.js.map,1613371818460,131656e605c3462da60541f0ce4dde06db907c3c5838adb1ca24964a8332611c
17+
static/js/main.b7bcc5b1.chunk.js.map,1613371818460,065da68d6d3887bde1920b2e639491168309011f7d998e544cda44351fb2ea9d
18+
static/css/2.20aa2d7b.chunk.css,1613371818460,42d8f8bb7fa2b73c29c1729810b23f28eba4374fe239680558db97037b5b03c4
19+
static/js/2.0fe8b61e.chunk.js,1613371818460,2d502c18fcdd1c17dcaf62c20d3fa5ce33cdffdd01cdd21e92ea58bd2e9483a6
20+
static/css/2.20aa2d7b.chunk.css.map,1613371818460,1bb14b85ccf69792bc488288d89c766a67b4cba877bfd0decfcc86dd45a82351
21+
static/js/2.0fe8b61e.chunk.js.map,1613371818460,f5895ea41d79fd3da97331493d098f35b21b6d09e328d98ca558709c886c4276

.firebase/hosting.cHVibGlj.cache

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
favicon.ico.svg,1613366066720,55161443857d14d9de521375f3284fa9a9255de88cde4874020382e5be37ccb4
2+
labyrinth.svg,1613366372107,4a4f024e3f283d0d83575fc575a087d7e6326b3be30db8431e8992fb8d27394b
3+
logo192.png,499162500000,3ee59515172ee198f3be375979df15ac5345183e656720a381b8872b2a39dc8b
4+
logo512.png,499162500000,ee7e2f3fdb8209c4b6fd7bef6ba50d1b9dba30a25bb5c3126df057e1cb6f5331
5+
index.html,1613367247295,1534497755ef03743a796301bc84d996099c199a53676d949f5a1a8e5cdc3fe9
6+
robots.txt,499162500000,bfe106a3fb878dc83461c86818bf74fc1bdc7f28538ba613cd3e775516ce8b49
7+
manifest.json,499162500000,aff3449bdc238776f5d6d967f19ec491b36aed5fb7f23ccff6500736fd58494a

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "path-finding-visualizer-52001"
4+
}
5+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file was auto-generated by the Firebase CLI
2+
# https://github.com/firebase/firebase-tools
3+
4+
name: Deploy to Firebase Hosting on PR
5+
'on': pull_request
6+
jobs:
7+
build_and_preview:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- run: npm run build
12+
- uses: FirebaseExtended/action-hosting-deploy@v0
13+
with:
14+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
15+
firebaseServiceAccount: >-
16+
${{ secrets.FIREBASE_SERVICE_ACCOUNT_PATH_FINDING_VISUALIZER_52001
17+
}}
18+
projectId: path-finding-visualizer-52001
19+
env:
20+
FIREBASE_CLI_PREVIEWS: hostingchannels

firebase.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"hosting": {
3+
"public": "build",
4+
"ignore": [
5+
"firebase.json",
6+
"**/.*",
7+
"**/node_modules/**"
8+
],
9+
"rewrites": [
10+
{
11+
"source": "**",
12+
"destination": "/index.html"
13+
}
14+
]
15+
}
16+
}

public/index.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
Notice the use of %PUBLIC_URL% in the tags above.
2020
It will be replaced with the URL of the `public` folder during the build.
2121
Only files inside the `public` folder can be referenced from the HTML.
22-
2322
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
2423
work correctly both with client-side routing and a non-root public URL.
2524
Learn how to configure a non-root public URL by running `npm run build`.
@@ -33,12 +32,19 @@
3332
<!--
3433
This HTML file is a template.
3534
If you open it directly in the browser, you will see an empty page.
36-
3735
You can add webfonts, meta tags, or analytics to this file.
3836
The build step will place the bundled scripts into the <body> tag.
39-
4037
To begin the development, run `npm start` or `yarn start`.
4138
To create a production bundle, use `npm run build` or `yarn build`.
4239
-->
4340
</body>
41+
<!-- The core Firebase JS SDK is always required and must be listed first -->
42+
<script src="/__/firebase/8.2.7/firebase-app.js"></script>
43+
44+
<!-- TODO: Add SDKs for Firebase products that you want to use
45+
https://firebase.google.com/docs/web/setup#available-libraries -->
46+
<script src="/__/firebase/8.2.7/firebase-analytics.js"></script>
47+
48+
<!-- Initialize Firebase -->
49+
<script src="/__/firebase/init.js"></script>
4450
</html>

src/components/AppNavbar/AppNavbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const AppNavbar = (props) => {
4949
<Button onClick={() => { props.handleBFS(); props.handleVisualization() }}>BFS</Button>
5050
</DropdownItem>
5151
<DropdownItem>
52-
<Button onClick={() => { props.handleAstar(); props.handleVisualization() }}>Astar</Button>
52+
<Button onClick={() => { props.handleAstar(); props.handleVisualization() }}>A*</Button>
5353
</DropdownItem>
5454
</DropdownMenu>
5555
</UncontrolledDropdown>

src/components/Node/Node.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ $laptop: 769px;
7878
}
7979
}
8080

81+
// animation credits - Clement' original project
8182
.node-visited {
8283
animation-name: visitedAnimation;
8384
animation-duration: 1.5s;

src/components/PathVisualizer/PathVisualizer.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ class PathVisualizer extends Component {
139139
});
140140
animatePath(this, visitedNodesInOrder, nodesInShortestPathOrder, startNode, finishNode);
141141
} catch (error) {
142-
this.setState({ isPathNotFound: true });
142+
this.setState({ isPathNotFound: true, isVisualizing: true });
143143
setTimeout(() => {
144-
this.setState({ isPathNotFound: false });
144+
this.setState({ isPathNotFound: false, isVisualizing: false });
145145
}, 3000);
146146
}
147-
this.setState({ isVisualizing: !this.state.isVisualizing });
147+
//this.setState({ isVisualizing: false });
148148
}
149149

150150
// dfs
@@ -166,15 +166,15 @@ class PathVisualizer extends Component {
166166
animatePath(this, visitedNodesInOrder, nodesInShortestPathOrder, startNode, finishNode);
167167
} catch (error) {
168168
console.log(error)
169-
this.setState({ isPathNotFound: true });
169+
this.setState({ isPathNotFound: true, isVisualizing: true });
170170
setTimeout(() => {
171-
this.setState({ isPathNotFound: false });
171+
this.setState({ isPathNotFound: false, isVisualizing: false });
172172
}, 3000);
173173
}
174174
}
175175

176176
// bfs
177-
visualizeBFS = async () => {
177+
visualizeBFS = () => {
178178
if (this.state.isVisualizing)
179179
return;
180180
const { grid, startNode_Pos, finishNode_Pos } = this.state;
@@ -191,9 +191,9 @@ class PathVisualizer extends Component {
191191
});
192192
animatePath(this, visitedNodesInOrder, nodesInShortestPathOrder, startNode, finishNode);
193193
} catch (error) {
194-
this.setState({ isPathNotFound: true });
194+
this.setState({ isPathNotFound: true, isVisualizing: true });
195195
setTimeout(() => {
196-
this.setState({ isPathNotFound: false });
196+
this.setState({ isPathNotFound: false, isVisualizing: false });
197197
}, 3000);
198198
}
199199
}
@@ -219,9 +219,9 @@ class PathVisualizer extends Component {
219219
});
220220
animatePath(this, visitedNodesInOrder, nodesInShortestPathOrder, startNode, finishNode);
221221
} catch (error) {
222-
this.setState({ isPathNotFound: true });
222+
this.setState({ isPathNotFound: true, isVisualizing: true });
223223
setTimeout(() => {
224-
this.setState({ isPathNotFound: false });
224+
this.setState({ isPathNotFound: false, isVisualizing: false });
225225
}, 3000);
226226
}
227227
}

0 commit comments

Comments
 (0)