Skip to content

Commit 5f709ca

Browse files
committed
Add readme and donation page.
1 parent 2cb8780 commit 5f709ca

File tree

3 files changed

+191
-2
lines changed

3 files changed

+191
-2
lines changed

.github/workflows/start-site.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- run: cp ./scratch-microbit-more/site/index.html ./scratch-gui/build/index.html
3232
- run: cp ./scratch-microbit-more/site/favicon.ico ./scratch-gui/build/static/favicon.ico
3333
- run: cp -r ./scratch-microbit-more/dist ./scratch-gui/build/dist
34+
- run: cp ./scratch-microbit-more/site/donation.html ./scratch-gui/build/donation.html
3435
- uses: peaceiris/actions-gh-pages@v3
3536
with:
3637
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}

README.md

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,110 @@
1-
# mbit-more
2-
Another micro:bit extension for Scratch3.
1+
<h1 align="center">scratch-microbit-more</h1>
2+
<p>
3+
<img alt="Version" src="https://img.shields.io/badge/version-0.5.0-blue.svg?cacheSeconds=2592000" />
4+
<a href="https://yokobond.github.io/scratch-microbit-more" target="_blank">
5+
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
6+
</a>
7+
<a href="https://github.com/yokobond/scratch-microbit-more/graphs/commit-activity" target="_blank">
8+
<img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" />
9+
</a>
10+
<a href="https://github.com/yokobond/scratch-microbit-more/blob/trunk/LICENSE" target="_blank">
11+
<img alt="License: MIT" src="https://img.shields.io/github/license/yokobond/scratch-microbit-more" />
12+
</a>
13+
</p>
14+
15+
> Full-functional extension of micro:bit for Scratch3
16+
17+
### ✨ Open [Microbit More Web-App](https://yokobond.github.io/scratch-microbit-more)
18+
19+
### 🏠 [Homepage](https://lab.yengawa.com/project/scratch-microbit-more/)
20+
21+
## Setup Development Environment
22+
23+
Download the Scratch3 repositories according to the supporsed directory configuration.
24+
25+
```
26+
.
27+
|-- scratch-microbit-more
28+
|-- scratch-vm
29+
|-- scratch-gui
30+
```
31+
32+
Install node modules and setup to use local repo for development.
33+
34+
```sh
35+
cd ./scratch-microbit-more
36+
npm install
37+
npm run setup:local
38+
npm run install:local
39+
```
40+
41+
## Install into Scratch3
42+
43+
To install this extention into your selfbuild Scratch3, execute `scripts/install.js` with options as follows.
44+
45+
```sh
46+
node ./scripts/install.js --gui="../scratch-gui" --vm="../scratch-gui/node_modules/scratch-vm" --url="https://yokobond.github.io/scratch-microbit-more/dist/microbitMore.mjs"
47+
```
48+
49+
- --gui : location of scratch-gui from current dir.
50+
- --vm : location of scratch-vm form current dir.
51+
- --url : URL to get its module as a lodable extension for Xcratch.
52+
53+
**CAUTION:** This script will change '`extension default`' in `scratch-gui/src/lib/libraries/extensions/index.jsx` as follows.
54+
55+
change from the original code
56+
57+
```js
58+
export default [...];
59+
```
60+
61+
to
62+
63+
```js
64+
const extensions = [...];
65+
export default extensions;
66+
```
67+
68+
It may break installation mechanism of the other extensions.
69+
70+
71+
## Xcratch Module Building
72+
73+
Build module as loadable extension for [Xcratch](https://github.com/yokobond/xcratch).
74+
75+
```sh
76+
node ./scripts/build.js --name=microbitMore --block="./src/block" --entry="./src/entry" --vm="../scratch-vm" --gui="../scratch-gui" --output="./dist"
77+
```
78+
79+
- --name: name of the module file (without '.mjs').
80+
- --block : location of block files from current dir.
81+
- --entry : location of entry files from current dir.
82+
- --gui : location of scratch-gui from current dir.
83+
- --vm : location of scratch-vm form current dir.
84+
- --output : location to save module form current dir.
85+
86+
## Author
87+
88+
👤 **Koji Yokokawa**
89+
90+
* Website: http://www.yengawa.com/
91+
* Github: [@yokobond](https://github.com/yokobond)
92+
93+
## 🤝 Contributing
94+
95+
Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/yokobond/scratch-microbit-more/issues). You can also take a look at the [contributing guide](https://github.com/yokobond/scratch-microbit-more/blob/master/CONTRIBUTING.md).
96+
97+
## Show your support
98+
99+
Give a ⭐️ if this project helped you!
100+
101+
[Donate](https://yokobond.github.io/scratch-microbit-more/donation.html) if this project is worth for you.
102+
103+
104+
## 📝 License
105+
106+
Copyright © 2020 [Koji Yokokawa](https://github.com/yokobond).<br />
107+
This project is [MIT](https://github.com/yokobond/scratch-microbit-more/blob/trunk/LICENSE) licensed.
108+
109+
***
110+
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

site/donation.html

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<!DOCTYPE html>
2+
3+
<head>
4+
<meta name="viewport" content="width=device-width, initial-scale=1">
5+
<!-- Ensures optimal rendering on mobile devices. -->
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!-- Optimal Internet Explorer compatibility -->
7+
<style>
8+
@media screen and (max-width: 400px) {
9+
#paypal-button-container {
10+
width: 100%;
11+
}
12+
}
13+
14+
@media screen and (min-width: 400px) {
15+
#paypal-button-container {
16+
width: 250px;
17+
}
18+
}
19+
</style>
20+
</head>
21+
22+
<body>
23+
<div id="smart-button-container">
24+
<div>
25+
<h1>Donation for MicrobitMore</h1>
26+
<p>Please <strong>purchase</strong> it for donation to <a href="https://github.com/yokobond/scratch-microbit-more/" target="_blank">MicrobitMore</a>
27+
project.</p>
28+
<div style="margin-bottom: 10px;">
29+
<label>Set your own price ($1~): $ </label><input type="number" id="amount" required maxlength="4" size="4" value="10"> USD
30+
</div>
31+
<div id="paypal-button-container"></div>
32+
</div>
33+
</div>
34+
<script
35+
src="https://www.paypal.com/sdk/js?client-id=AdG4OQmiRiyRrz1Iv1RD8Ssdbay4G0b-GFaTPZN2Xavs93ijuHjAx7SkKK6el_IidOwqOyNJaFQbVN75&currency=USD"
36+
data-sdk-integration-source="button-factory"></script>
37+
<script>
38+
function initPayPalButton() {
39+
paypal.Buttons({
40+
style: {
41+
shape: 'pill',
42+
color: 'white',
43+
layout: 'vertical',
44+
label: 'paypal',
45+
size: 'responsive'
46+
},
47+
48+
createOrder: function (data, actions) {
49+
var amt = document.getElementById("amount").value;
50+
return actions.order.create({
51+
purchase_units: [
52+
{
53+
"description": "Donation to MicrobitMore",
54+
"amount": {
55+
"currency_code": "USD",
56+
"value": amt
57+
}
58+
}
59+
],
60+
application_context: {
61+
shipping_preference: 'NO_SHIPPING'
62+
}
63+
});
64+
},
65+
66+
onApprove: function (data, actions) {
67+
return actions.order.capture()
68+
.then(function (details) {
69+
alert('Donated to MicrobitMore by ' + details.payer.name.given_name + '!');
70+
});
71+
},
72+
73+
onError: function (err) {
74+
console.log(err);
75+
}
76+
}).render('#paypal-button-container');
77+
}
78+
initPayPalButton();
79+
</script>
80+
</body>

0 commit comments

Comments
 (0)