Skip to content

Commit

Permalink
feat: initial commit!
Browse files Browse the repository at this point in the history
Update README.md

Update README.md

Remove potentially ToS breaking assets.

Update README.md

Add back potentially ToS breaking assets. (Sorry ST, the Scratch cat looks too good!)

Update README.md

Add feature list to readme.md

Update README.md

Update README.md

Added:

Network extension, echo effect in sounds, a variety of ScratchAddons, letters x to y of z, startswith, endswith, fastpower

Update README.md

Remove backpack and annoying coming soon tooltips

v0.3
  • Loading branch information
ZXMushroom63 committed Dec 3, 2023
1 parent 6fdb459 commit 6e8236d
Show file tree
Hide file tree
Showing 37 changed files with 1,930 additions and 597 deletions.
2 changes: 0 additions & 2 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
108 changes: 58 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,74 @@
# scratch-gui
#### Scratch GUI is a set of React components that comprise the interface for creating and running Scratch 3.0 projects
# Scratch++
#### Scratch++ is a Scratch mod that adds new blocks which can compile to normal Scratch.

## How to use
Example:
In the editor, write a script with a new block (like the power operator).
```scratchblocks
when 🏳️ clicked
say ( 5 ^ 3 )
```
Then, click on `File` > `Compile to Scratch (.sb3)`. It should download an sb3 file that is fully compatible with normal Scratch.

## Installation
This requires you to have Git and Node.js installed.
Go to the [releases tab](https://github.com/ZXMushroom63/scratch-gui/releases/latest), and download the zip file from the assets section.
Create a new folder on your computer, naming it whateverr you want.
Extract the zip file to this folder.
Open index.html in Chrome or your preferred browser!

In your own node environment/application:
```bash
npm install https://github.com/LLK/scratch-gui.git
```
If you want to edit/play yourself:
```bash
git clone https://github.com/LLK/scratch-gui.git
cd scratch-gui
npm install
```

**You may want to add `--depth=1` to the `git clone` command because there are some [large files in the git repository history](https://github.com/LLK/scratch-gui/issues/5140).**
## Building
This requires you to have Git and Node.js installed.

## Getting started
Running the project requires Node.js to be installed.

## Running
Open a Command Prompt or Terminal in the repository and run:
```bash
npm start
```
Then go to [http://localhost:8601/](http://localhost:8601/) - the playground outputs the default GUI component

## Developing alongside other Scratch repositories
cd scratchplusplus #Folder dedicated to Scratch++

### Getting another repo to point to this code


If you wish to develop `scratch-gui` alongside other scratch repositories that depend on it, you may wish
to have the other repositories use your local `scratch-gui` build instead of fetching the current production
version of the scratch-gui that is found by default using `npm install`.

Here's how to link your local `scratch-gui` code to another project's `node_modules/scratch-gui`.

#### Configuration

1. In your local `scratch-gui` repository's top level:
1. Make sure you have run `npm install`
2. Build the `dist` directory by running `BUILD_MODE=dist npm run build`
3. Establish a link to this repository by running `npm link`
git clone --depth=1 https://github.com/ZXMushroom63/scratch-gui.git
cd scratch-gui
npm install

2. From the top level of each repository (such as `scratch-www`) that depends on `scratch-gui`:
1. Make sure you have run `npm install`
2. Run `npm link scratch-gui`
3. Build or run the repository
cd ..
git clone --depth=1 https://github.com/ZXMushroom63/scratch-vm.git
cd scratch-vm
npm install

#### Using `npm run watch`
cd ..
git clone --depth=1 https://github.com/ZXMushroom63/scratch-blocks.git
cd scratch-blocks
npm install
npm run translate
sudo npm run prepublish #Requires python 2 and Java installed!!!

Instead of `BUILD_MODE=dist npm run build`, you can use `BUILD_MODE=dist npm run watch` instead. This will watch for changes to your `scratch-gui` code, and automatically rebuild when there are changes. Sometimes this has been unreliable; if you are having problems, try going back to `BUILD_MODE=dist npm run build` until you resolve them.
cd ../scratch-gui
npm link ../scratch-blocks ../scratch-vm #Might also need sudo

#### Oh no! It didn't work!
# Now, to run it in localhost:
npm start

If you can't get linking to work right, try:
* Follow the recipe above step by step and don't change the order. It is especially important to run `npm install` _before_ `npm link` as installing after the linking will reset the linking.
* Make sure the repositories are siblings on your machine's file tree, like `.../.../MY_SCRATCH_DEV_DIRECTORY/scratch-gui/` and `.../.../MY_SCRATCH_DEV_DIRECTORY/scratch-www/`.
* Consistent node.js version: If you have multiple Terminal tabs or windows open for the different Scratch repositories, make sure to use the same node version in all of them.
* If nothing else works, unlink the repositories by running `npm unlink` in both, and start over.
# Or, to make a build:
npm run build
# Outputs to the build folder
```
## Current feature list
- fencing control blocks
- power operator
- previous costume & previous backdrop
- force set size
- point to X Y
- min operator
- max operator
- if operator
- replace x with y in z operator
- newline reporter
- decimal to hexadecimal operator
- color at my position reporter
- set list to x split by y
- Network extension
- fastpower
- letters x to y of string
- starts with
- ends with

## Testing
### Documentation
Expand Down
4 changes: 3 additions & 1 deletion src/components/gui/gui.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,11 @@ const GUIComponent = props => {
{soundsTabVisible ? <SoundTab vm={vm} /> : null}
</TabPanel>
</Tabs>
{/*/
{backpackVisible ? (
<Backpack host={backpackHost} />
) : null}
/*/}
</Box>

<Box className={classNames(styles.stageAndTargetWrapper, styles[stageSize])}>
Expand Down Expand Up @@ -452,7 +454,7 @@ GUIComponent.defaultProps = {
canSave: false,
canCreateCopy: false,
canShare: false,
canUseCloud: false,
canUseCloud: true,
enableCommunity: false,
isCreating: false,
isShared: false,
Expand Down
1 change: 1 addition & 0 deletions src/components/menu-bar/menu-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
}

.scratch-logo.clickable {
transition: 0.125s;
cursor: pointer;
}

Expand Down
Loading

0 comments on commit 6e8236d

Please sign in to comment.