Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
76daced
html structure
victor-gv May 12, 2022
1d576cc
structure created in main
May 12, 2022
7fb5a78
added showTitle function
May 12, 2022
8a02dcf
feature(localhost dependencies)
reduansj May 12, 2022
0dd52a7
added id attributes to titles
May 12, 2022
252455c
get the body when click on the title
May 12, 2022
e551c7f
added bootstrap to main container and modal
May 12, 2022
5f6d150
separate js in different diles
May 12, 2022
c65f6c4
added css hover & pointer at class list-group-item
May 12, 2022
a59c8e9
centered title align
May 12, 2022
f39eec6
comments deleted
May 13, 2022
2e7dffe
feature(get all data json)
reduansj May 13, 2022
a73787d
added comment functions
May 13, 2022
b7d51d9
deleted unused div
May 13, 2022
62de896
comments accordion in progress
May 13, 2022
e2fa45b
added css on comments
May 13, 2022
d6dbcf7
feature (change style to grid, optimize js)
reduansj May 16, 2022
2e48492
addedgrid with bootstrap
May 16, 2022
f4e4b1a
css improvements added
May 16, 2022
ddcf3de
css improvements added
May 16, 2022
45bdba9
(feature: modal close key esc)
reduansj May 16, 2022
b05249a
change
reduansj May 16, 2022
13ecdde
css finished
May 16, 2022
80ea38a
(modal close key ESC)
reduansj May 16, 2022
7030d85
feature: modal
reduansj May 16, 2022
efe489f
Merge remote-tracking branch 'origin/improve' into develop
May 16, 2022
8cee060
deleted functions file
May 16, 2022
e54c444
add comments js
reduansj May 16, 2022
334e728
deletePost event added
May 17, 2022
eef0990
delete function works
May 17, 2022
91adb02
delete function finished
May 17, 2022
baf90db
function delete moved on the code
May 17, 2022
53f93a8
added confirmation question before removing post
May 18, 2022
122f5bc
added edit modal
May 18, 2022
cda81d5
edit function finished
May 23, 2022
2523df3
edit and delete functions finished
Jun 26, 2022
b51bce8
improved comments
Jun 26, 2022
ca78e6f
deleted unused code
Jun 26, 2022
d7cc1fc
unused code deleted
Jun 26, 2022
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
package-lock.json
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2021 Assembler School Of Software Engineering

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2021 Assembler School Of Software Engineering
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
118 changes: 59 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
`#html` `#css` `#js` `#dom` `#JSON` `#HTTP` `#API` `#Bootstrap` `#master-in-software-development`

# Blog with API <!-- omit in toc -->

<p>
<img alt="Version" src="https://img.shields.io/badge/version-1.0-blue.svg?cacheSeconds=2592000" />
</p>

> In this pill you will put into practice the knowledge learned about making HTTP requests to create a blog consuming the information from a third-party API. You will also learn how to use Bootstrap Framework for the layout.

## Index <!-- omit in toc -->

- [Requirements](#requirements)
- [Repository](#repository)
- [Technologies used](#technologies-used)
- [Project delivery](#project-delivery)
- [Resources](#resources)

## Requirements

- You must use semantic HTML5 elements for all the contents of the application
- You must use JSON server library to create your own local repository
- You must use fecth to do the requests
- You have to use Bootstrap Framework for the Layout and the styles


## Repository

First of all you must fork this project into your GitHub account.

To create a fork on GitHub is as easy as clicking the “fork” button on the repository page.

<img src="https://docs.github.com/assets/images/help/repository/fork_button.jpg" alt="Fork on GitHub" width='450'>

## Technologies used

\* HTML

\* CSS

\* JS

\* Bootstrap

\* HTTP Requests

\* JSON

\* API

## Project delivery

To deliver this project you must follow the steps indicated in the document:

- [Submitting a solution](https://www.notion.so/Submitting-a-solution-524dab1a71dd4b96903f26385e24cdb6)

## Resources

- [JSON server](https://github.com/typicode/json-server)
`#html` `#css` `#js` `#dom` `#JSON` `#HTTP` `#API` `#Bootstrap` `#master-in-software-development`
# Blog with API <!-- omit in toc -->
<p>
<img alt="Version" src="https://img.shields.io/badge/version-1.0-blue.svg?cacheSeconds=2592000" />
</p>
> In this pill you will put into practice the knowledge learned about making HTTP requests to create a blog consuming the information from a third-party API. You will also learn how to use Bootstrap Framework for the layout.
## Index <!-- omit in toc -->
- [Requirements](#requirements)
- [Repository](#repository)
- [Technologies used](#technologies-used)
- [Project delivery](#project-delivery)
- [Resources](#resources)
## Requirements
- You must use semantic HTML5 elements for all the contents of the application
- You must use JSON server library to create your own local repository
- You must use fecth to do the requests
- You have to use Bootstrap Framework for the Layout and the styles
## Repository
First of all you must fork this project into your GitHub account.
To create a fork on GitHub is as easy as clicking the “fork” button on the repository page.
<img src="https://docs.github.com/assets/images/help/repository/fork_button.jpg" alt="Fork on GitHub" width='450'>
## Technologies used
\* HTML
\* CSS
\* JS
\* Bootstrap
\* HTTP Requests
\* JSON
\* API
## Project delivery
To deliver this project you must follow the steps indicated in the document:
- [Submitting a solution](https://www.notion.so/Submitting-a-solution-524dab1a71dd4b96903f26385e24cdb6)
## Resources
- [JSON server](https://github.com/typicode/json-server)
- [Official Bootstrap](https://getbootstrap.com/)
90 changes: 90 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="./src/styles/style.css">
<script src="./src/js/main.js" type="module"></script>
<title>Blog with API</title>
</head>

<body>
<header class="blog__header__title">
<nav class="navbar navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand">Blog with API</a>
<img class="blog__header__img" src="./src/assets/pngwing.com.png" alt="logo">
</div>
</nav>
</header>

<main class="container-fluid">
<section id="postsTitlesContainer"
class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4 g-lg-2 blog__postTitle--container">

</section>

<!-- MODAL CONTENT-->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div id="bodyContent" class="modal-body">
</div>
<div id="userName" class="modal-body modal-body-name"></div>
<div class="accordion" id="accordionExample">
<div class="accordion-item">
<h2 class="accordion-header" id="headingTwo">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
COMMENTS
</button>
</h2>
<div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo"
data-bs-parent="#accordionExample">
<div id="commentContainer" class="accordion-body">
</div>
</div>
</div>
</div>
<div class="modal-footer modal-footer-flex">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>



<!-- Modal -->
<div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="staticBackdropLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div id="editBodyContent" class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button id="saveChanges" type="button" class="btn btn-primary" data-bs-dismiss="modal">Save changes</button>
</div>
</div>
</div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous">
</script>
</body>

</html>
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "blog-with-api",
"version": "1.0.0",
"description": "`#html` `#css` `#js` `#dom` `#JSON` `#HTTP` `#API` `#Bootstrap` `#master-in-software-development`",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"server": "json-server --watch ./src/data/db.json",
"start": "concurrently \"npm run json_server\" \"npm run server\" "

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent script, I copy it for future projects! Pikachu approves this JSON

},
"repository": {
"type": "git",
"url": "git+https://github.com/victor-gv/blog-with-api.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/victor-gv/blog-with-api/issues"
},
"homepage": "https://github.com/victor-gv/blog-with-api#readme",
"dependencies": {
"json-server": "^0.17.0"
}
}
Binary file added src/assets/pngwing.com.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading