Skip to content
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

John Hill #415

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
494aa1f
Added functionality for 'Make Your Own Poster', 'Show Another Random …
jphill19 Aug 19, 2024
46000f3
Refactored: changed the selector for .show-saved & .back-to-main to a…
jphill19 Aug 20, 2024
fbd1a85
Refactored: Functions to include E6 syntax
jphill19 Aug 22, 2024
5d83f00
Refactored: Form url input to be for url rather than text
jphill19 Aug 22, 2024
26a6924
Merge pull request #1 from jphill19/Refactor
jphill19 Aug 22, 2024
39d6b6e
Added: Validation to the form, to check that user inputted urls are i…
jphill19 Aug 22, 2024
ca2ff82
Merge pull request #2 from jphill19/form_validation
jphill19 Aug 22, 2024
e265f8d
Added funcitonality to save poster button, which saves the poster and…
jphill19 Aug 22, 2024
4760b9b
Merge pull request #3 from jphill19/saving_poster
jphill19 Aug 22, 2024
5bb4c56
Refactored: refactored functions to utilize createPoster function
jphill19 Aug 22, 2024
c3abad0
Refactored isImage to be more concise
jphill19 Aug 22, 2024
e683434
Merge pull request #4 from jphill19/Refactor
jphill19 Aug 22, 2024
4f00966
Added buttons HTML section for unmotivational-posters
jphill19 Aug 22, 2024
64d7b01
Added: cleanData function
jphill19 Aug 22, 2024
9ebfdb9
Added: storeCurrentPosterElement
jphill19 Aug 22, 2024
768f8da
Added: functionality to Unmotivational Posters button, and page
jphill19 Aug 22, 2024
5a1ed3c
Added: CSS to unmotivational posters
jphill19 Aug 22, 2024
dc75c35
Added: Functions to identify the target that was clicked
jphill19 Aug 22, 2024
0dd223a
Added delete functionality
jphill19 Aug 23, 2024
fa16d66
Merge pull request #5 from jphill19/umotivational-posters
jphill19 Aug 23, 2024
a565097
Added: functionality to the create poster, so that when a poster is c…
jphill19 Aug 23, 2024
d6160e1
Added HTML input attributes to the form for max-length
jphill19 Aug 23, 2024
2ce867e
Merge pull request #6 from jphill19/Refactor
jphill19 Aug 23, 2024
21633a6
Refacted the way of selcting articles by utilziing event propagation
jphill19 Aug 24, 2024
be78060
Added Modal CSS styles
jphill19 Aug 24, 2024
9f9741e
Added functionality to view the modal screen
jphill19 Aug 24, 2024
ff81863
Added functionality to the close modal screen button
jphill19 Aug 24, 2024
6b56a34
Merge pull request #7 from jphill19/mainPosterAdjustments
jphill19 Aug 24, 2024
337e01a
Bug Fix: added eventListner to escape key,to remove the modal image, …
jphill19 Aug 24, 2024
366d4ca
Added: draggablePosters alongside refactor of code
jphill19 Aug 25, 2024
76e49bb
Merge pull request #8 from jphill19/draggablePosters
jphill19 Aug 25, 2024
c02ad16
Set up simple typescript, still working on it
jphill19 Aug 27, 2024
9bd13af
Added tsconfig.json file, and modified its configurations
jphill19 Aug 28, 2024
3e83fcb
Cleaned up all Typescript issues that were popping up
jphill19 Aug 28, 2024
b16d2fb
Merge pull request #9 from jphill19/typescript
jphill19 Aug 28, 2024
8f79126
Updated the readme
jphill19 Aug 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,56 @@ ______________________________________________________

# Hang in There

### Abstract:
### Abstract
[//]: <> (Briefly describe what you built and its features. What problem is the app solving? How does this application solve that problem?)
This app is a front-end-only application built with HTML, CSS, TypeScript, and JavaScript, designed to create Motivational/Unmotivational posters for users to display.

**Features:**
- Generate random motivational posters using pre-existing images, titles, and text.
- Click to change images, titles, or text to customize posters.
- Save your favorite posters for future reference.
- View all saved posters in a dedicated screen.
- Display saved posters in a modal within the saved posters screen.
- Drag and Drop posters inside the saved poster screen for reordering
- Create unmotivational posters with an option to delete them.
- Custom poster creation with strong validation for user-uploaded images.

### Installation Instructions:
[//]: <> (What steps does a person have to take to get your app cloned down and running?)
1. Clone the repository to your local machine using the following command:
```bash
git clone https://github.com/jphill19/hang-in-there-boilerplate

2. Navigate to the project directory
3. Open the index.html file in your web browser. You can do this by double-clicking the file or using the following command in the terminal: `open index.html`
### Preview of App:
[//]: <> (Provide ONE gif or screenshot of your application - choose the "coolest" piece of functionality to show off. gifs preferred!)

Bellow is a preview of the app and its capabilities of validating image links
![Demo](assets/giphy.gif)
### Context:
[//]: <> (Give some context for the project here. How long did you have to work on it? How far into the Turing program are you?)

### Contributors:
I am currently in my second week of Mod 2 at Turing School. This project was completed over a week and a half during my spare time. I was able to finish the core content midway through the project, and I dedicated the remaining time to improving my skills by incorporating TypeScript as a self-imposed challenge.
### Contributor:
[//]: <> (Who worked on this application? Link to your GitHub. Consider also providing LinkedIn link)
**John Hill**
- [John's LinkedIn](www.linkedin.com/in/johnpierrehill)
- [John's GitHub](https://github.com/jphill19)

### Learning Goals:
[//]: <> (What were the learning goals of this project? What tech did you work with?)
- Utilize JavaScript to implement the core functionality of the website.
- Incorporate HTML and CSS to structure and style the website, ensuring it meets the desired user experience and visual design standards.
- Explore and integrate TypeScript to enhance code quality and maintainability as a self-imposed challenge.

### Wins + Challenges:
[//]: <> (What are 2-3 wins you have from this project? What were some challenges you faced - and how did you get over them?)
### Challenge #1:
**Figuring out how to validate the HTML to check whether the submitted link was an image.**

- **Solution**: After a long code spike where I experimented with multiple strategies, I discovered event listeners that can determine whether an `img` HTML element has loaded successfully or encountered an error. This approach allowed me to validate the link effectively by checking if the image loaded correctly.


### Challenge #2:
**Being able to drag and sort your posters inside your saved poster section.**

- **Solution**: I watched [this YouTube tutorial](https://www.youtube.com/watch?v=jfYWwQrtzzY&t=1183s), which provided a starting point for creating draggable elements and allowing them to be dropped elsewhere. However, the video addressed a 1-dimensional plane, where the logic worked perfectly. In contrast, my saved posters section was a 2-dimensional grid, which added complexity to the process. To solve this, I moved away from intensive mathematical calculations and instead opted to simply swap the element the cursor was dragging over with the current element being dragged.
Binary file added assets/giphy.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 15 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ <h3 class="poster-quote">Quote</h3>
<button class="show-saved">Show Saved Posters</button>
<button class="show-random">Show Another Random Poster</button>
<button class="show-form">Make Your Own Poster</button>
<button class="show-unmotivational-poster">Unmotivational Posters</button>
</section>
<section class="poster-form hidden">
<form>
<h2>Create your own motivational poster</h2>
<label for="poster-image-url">Image url</label>
<input type="text" name="poster-image-url" id="poster-image-url" placeholder="https://gph.is/2n553Ra">
<input type="url" name="poster-image-url" id="poster-image-url" placeholder="https://gph.is/2n553Ra" required/>
<label for="poster-title">Motivational title</label>
<input type="text" name="poster-title" id="poster-title" placeholder="Growth Mindset">
<input type="text" name="poster-title" id="poster-title" placeholder="Growth Mindset" maxlength="10" required>
<label for="poster-quote">Motivational quote</label>
<input type="text" name="poster-quote" id="poster-quote" placeholder="Hang in there!">
<button class="make-poster">Show my poster</button>
<input type="text" name="poster-quote" id="poster-quote" placeholder="Hang in there!" maxlength="20" required>
<button type="submit" class="make-poster">Show my poster</button>
</form>
<div class="divider"></div>
<button class="show-main">Nevermind, take me back!</button>
Expand All @@ -38,6 +39,16 @@ <h2>Saved Posters</h2>
<div class="saved-posters-grid"></div>
<button class="back-to-main">Back to Main</button>
</section>
<section class="unmotivational-poster hidden">
<h2>Unmotivational Posters</h2>
<div class="unmotivational-poster-flex">

</div>
<button class="back-to-main-unmotivational">Back to Main</button>
</section>
<dialog id="poster-modal">
<button id="closeModal">&times;</button>
</dialog>
<script src="./src/main.js"></script>
</body>
</html>
Loading