Skip to content

Commit dda82e7

Browse files
committed
Complete
1 parent dbc685a commit dda82e7

File tree

4 files changed

+65
-15
lines changed

4 files changed

+65
-15
lines changed

src/App.css

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
.App {
22
text-align: center;
3-
background-image: url("./etc/background.png");
4-
position: fixed;
5-
min-width: 100%;
6-
min-height: 100%;
7-
background-size: cover;
8-
background-position: center;
93
}
104

115
.App-logo {
@@ -51,3 +45,19 @@ body {
5145
margin-left: 10px;
5246
margin-right: 10px;
5347
}
48+
49+
.splide__arrow--prev {
50+
margin-left: -20px;
51+
width: 25px;
52+
height: 25px;
53+
}
54+
55+
.splide__arrow--next {
56+
margin-right: -20px;
57+
width: 25px;
58+
height: 25px;
59+
}
60+
61+
#code {
62+
background-color: #312F38;
63+
}

src/components/EBanner.js

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,40 @@
77
* Copyright © 2022 by Shen, Jen-Chieh $
88
*/
99
import React from 'react';
10-
import { Button, Container } from 'react-bootstrap';
10+
import { Button, Container, Collapse } from 'react-bootstrap';
1111

1212
import banner from '../etc/sink_white.png';
1313

1414
import { FiDownload } from 'react-icons/fi';
1515
import { RiInstallFill } from 'react-icons/ri';
1616

1717
class Ebanner extends React.Component {
18-
state = {};
18+
state = {
19+
install_cmd: 'git clone https://github.com/jcs-emacs/jcs-emacs ~/.emacs.d',
20+
open: false,
21+
copied: false,
22+
};
23+
24+
clickInstall = () => {
25+
this.setState({ open: !this.state.open });
26+
if (!this.state.open) {
27+
this.setState({ copied: false });
28+
}
29+
}
30+
31+
clickCopy = () => {
32+
navigator.clipboard.writeText(this.state.install_cmd);
33+
this.setState({ copied: true });
34+
}
35+
36+
copyText = () => {
37+
if (this.state.copied) {
38+
return "Copied";
39+
} else {
40+
return "Copy";
41+
}
42+
}
43+
1944
render () {
2045
return (
2146
<>
@@ -37,13 +62,28 @@ class Ebanner extends React.Component {
3762
</Button>{' '}
3863
<Button variant="dark"
3964
className="rounded-pill btn-lg border-2 border-success px-5 mx-1"
40-
href="#collapseExample"
65+
onClick={ this.clickInstall }
66+
aria-expanded={ this.state.open }
4167
type="button"
4268
data-toggle="collapse"
43-
role="button" aria-expanded="false" aria-controls="collapseExample">
69+
role="button">
4470
<RiInstallFill /> Install
4571
</Button>
4672
</Container>
73+
<Collapse in={ this.state.open }>
74+
<Container>
75+
<div className="mx-auto text-white p-3 mb-3 rounded shadow-lg"
76+
id="code"
77+
style={{ width: '60%' }}>
78+
{ this.state.install_cmd }
79+
</div>
80+
<Button variant="light"
81+
className="rounded-pill btn-sm"
82+
onClick= { this.clickCopy }>
83+
{ this.copyText() }
84+
</Button>
85+
</Container>
86+
</Collapse>
4787
</div>
4888
</>);
4989
}

src/components/ECarousel.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ class ECarousel extends React.Component {
2828
autoplay: true,
2929
lazyLoad: 'nearby',
3030
speed: 2000,
31-
interval: 2000,
31+
interval: 3000,
3232
rewind: true,
33+
drag: true,
34+
waitForTransition: false,
3335
}} renderControls={() => (
3436
<div className="splide__arrows">
35-
<button className="splide__arrow splide__arrow--prev"
36-
style={{ width: '25px', height: '25px' }}>
37+
<button className="splide__arrow splide__arrow--prev">
3738
3839
</button>
39-
<button className="splide__arrow splide__arrow--next"
40-
style={{ width: '25px', height: '25px' }}>
40+
<button className="splide__arrow splide__arrow--next">
4141
4242
</button>
4343
</div>

src/etc/background.png

-155 KB
Binary file not shown.

0 commit comments

Comments
 (0)