-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exquisite Corpse #8
Open
LemonyDesign
wants to merge
15
commits into
constructorlabs:master
Choose a base branch
from
LemonyDesign:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
009802b
Corpse list generated
LemonyDesign e715fc1
Implemented Favourites storage (not output yet)
LemonyDesign 2ffe670
Added Workshop (favourites) area
LemonyDesign 0d99c41
Add styles
LemonyDesign 0aa5f49
Develop styles
LemonyDesign b2cd03f
Timer added
LemonyDesign 625de48
Type with dynamic dropdown
LemonyDesign b2cba5a
Add select option for word type
LemonyDesign c2d7fe9
Read Me changed
LemonyDesign 6f3d601
Code review with tweaks to addFavourites function
LemonyDesign 8f20868
Update README.md
LemonyDesign d4d296b
added dotenv
LemonyDesign 1ea9475
readme, image, styles tweaks, dotenv ready for adding node
LemonyDesign b861002
merge readme
LemonyDesign 35ac7dc
Update README.md
LemonyDesign File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TESTING=Yay! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,27 @@ | ||
# Pick your own project | ||
|
||
Build an app of your choice. | ||
|
||
- You are free to use any technologies covered so far, but feel free to try new technologies you find interesting. | ||
- Keep it simple. Aim to get the basic functionality working on day one. You can then extend it on days two and three. | ||
- Feel free to use an external API to provide additional functionality to your app. Use an API that either does not have any authentication or uses API keys. | ||
- This is an opportunity to practice the parts you have challenging so far and improve your understanding of them. | ||
- Use pen and paper to draw a diagram of the webpage layout before starting to code. Have a think about what components you will need in advance. | ||
- Use prop-types and stateless components where appropriate. | ||
- Try to use Sass to create a separate stylesheet for each component. | ||
- Try to add some unit testing. Some parts will be easier to test than others, focus on those first. | ||
- Think about how to organise your data in advance | ||
- Make sure your app is responsive | ||
- Commit frequently | ||
- Create pull request at the end | ||
- Demos will be at 4pm on Friday | ||
- Keep it simple | ||
|
||
## Technical notes | ||
|
||
* Run `npm install` after cloning to download all dependencies | ||
* Use `npm run dev -- --watch` to build React | ||
* Use `npm test` or `npm test -- --watchAll` to run tests | ||
|
||
## README | ||
|
||
* Produce a README.md which explains | ||
* what the project does | ||
* what technologies it uses | ||
* how to build it and run it | ||
* any unresolved issues the user should be aware of | ||
|
||
## Inspiration | ||
|
||
- Take a look at [https://public-apis.jeremyfairbank.com/](https://public-apis.jeremyfairbank.com/) or [https://github.com/toddmotto/public-apis](https://github.com/toddmotto/public-apis) for possible APIs to use. | ||
|
||
## Default option | ||
|
||
If you are struggling to think of a project to build. Try to create a Top Trumps using the [Star Wars API](https://swapi.co/) which allows one user to play the game against the computer. | ||
|
||
- On load, fetch all vehicles from [https://swapi.co/api/vehicles/](https://swapi.co/api/vehicles/) end point. | ||
- Randomise the cards and deal half to player and half to computer. | ||
- Display top card to user | ||
- Allow user to pick an attribute from their card such as `cost_in_credits`, `length`, `max_atmosphering_speed`, `crew`, `passengers`, `cargo_capacity`. | ||
- If the value for chosen attribute is higher on the user's card than on computer's top card, they win the computer's card and it should be taken from computer's deck and added to the bottom of the user's deck. If the attribute is higher on the computer's top card, then user's card should be taken from the user's deck and added to the bottom of computer's deck. | ||
- Game continues until either user or computer has all the cards. | ||
- Implement some features of your choosing. | ||
![Screenshot](./static/exquisite-corpse-1.png) | ||
|
||
# Exquisite Corpse | ||
|
||
Exquisite corpse (_cadavre exquis_ in French) is a game invented by the Surrealists aimed at stimulating creative response. The method involves the collection and assemblage of generated words or images, according to an agreed rule (in this case “Adjective-Noun”). | ||
|
||
This game seeks to mimic the original by randomly generating lists of words, selected by type (adjective/adverb - noun/verb) and combining the results to create unique combinations. Intriguing combinations may then be chosen for 'workshopping' - with a timer allowing 5 minutes \* of free-flow writing. | ||
|
||
### Features | ||
|
||
- "random" endpoint on API is used to fetch 3 cycles of words, which the user may select by type - adjective/adverb, noun/verb | ||
- local storage is used to select generatedword combinations for workshopping (may be added or deleted from selected stock) | ||
- timer set on adding word combo to the workshop textarea | ||
- css classes (with animation) indicate when word combo has been added, and when the timer is reaching end | ||
|
||
**The app is currently under development:** | ||
|
||
- Add descriptions as tooltips to generated word lists - this requires rebuild of word list arrays as objects with keys word: and definition, so as to pull in definition with Fetch. | ||
- Textarea functionality set to fade… whenever user pauses | ||
- Currently desktop-oriented design; address UX for mobile usage - server a different view for writing | ||
- Resets required for select menus | ||
|
||
### Looking forward | ||
|
||
- Develop using GraphQL API approach, with OED | ||
|
||
\* set to 10s for testing! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
import TimerMachine from "./TimerMachine"; | ||
import cx from "classnames"; | ||
|
||
import "../styles/components/favourite.scss"; | ||
|
||
class Favourite extends React.Component { | ||
constructor() { | ||
super(); | ||
this.state = { active: false }; | ||
this.handleClick = this.handleClick.bind(this); | ||
} | ||
|
||
handleClick(event) { | ||
this.setState({ | ||
active: !this.state.active | ||
}); | ||
} | ||
|
||
render() { | ||
const favouriteclasses = cx("workshop__favourite", { | ||
active: this.state.active | ||
}); | ||
|
||
return ( | ||
<li className="workshop__listitem"> | ||
<h4> | ||
<a href="#" className={favouriteclasses} onClick={this.handleClick}> | ||
{this.props.favourite} | ||
</a> | ||
</h4> | ||
{this.state.active ? <TimerMachine /> : null} | ||
</li> | ||
); | ||
} | ||
} | ||
|
||
export default Favourite; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from "react"; | ||
import Favourite from "./Favourite"; | ||
import "../styles/components/favourites.scss"; | ||
|
||
function Favourites({ favourites }) { | ||
return ( | ||
<section className="workshop"> | ||
<h2>Workshop</h2> | ||
<ol> | ||
<li> | ||
<strong>Generate</strong> nouns and adjectives to create a list of | ||
‘exquisite corpses’ | ||
</li> | ||
<li> | ||
<i className="fas fa-plus-circle" /> appealing exquisite corpses to | ||
the workshop area | ||
</li> | ||
<li> | ||
<strong>Select</strong> a corpse to start the timer and begin writing. | ||
Do not pause. | ||
</li> | ||
</ol> | ||
<ul className="workshop__favourites menu--settings"> | ||
{favourites.map(favourite => ( | ||
<Favourite favourite={favourite} key={favourite} /> | ||
))} | ||
</ul> | ||
<textarea className="workshop__textarea" /> | ||
</section> | ||
); | ||
} | ||
|
||
export default Favourites; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than using a callback here, it would be better to use