Skip to content

Commit 79010d9

Browse files
committed
style: Add cute animation in landing page
1 parent 17313a7 commit 79010d9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/App.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class App extends React.Component {
169169
</div>
170170
{this.hexapodPlot()}
171171
</div>
172-
<NavDetailed />
172+
{this.state.inHexapodPage ? <NavDetailed /> : null}
173173
</Router>
174174
)
175175
}

src/components/pages/LandingPage.js

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import React from "react"
22
import { SECTION_NAMES } from "../vars"
3+
import { NavDetailed } from "../Nav"
4+
5+
const getImageUrl = () =>
6+
Math.random() > 0.5 ? "./img/small-robot.gif" : "./img/small-robot-2.gif"
37

48
class LandingPage extends React.Component {
59
pageName = SECTION_NAMES.landingPage
@@ -9,8 +13,17 @@ class LandingPage extends React.Component {
913
render = () => (
1014
<>
1115
<div id="landing">
16+
<img
17+
loading="lazy"
18+
src={getImageUrl()}
19+
alt="hexapod robot animation"
20+
height="75"
21+
style={{ marginTop: "20px", borderRadius: "20px" }}
22+
/>
1223
<h1>Mithi's Bare Minimum Hexapod Robot Simulator</h1>
1324
<p>Enjoy your stay and share with your friends!</p>
25+
26+
<NavDetailed />
1427
</div>
1528
</>
1629
)

0 commit comments

Comments
 (0)