This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: axios 라이브러리 사용 * feat: scss 라이브러리 사용 * chore: 기타 코드 정리
- Loading branch information
Showing
6 changed files
with
75 additions
and
6 deletions.
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
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,9 +1,23 @@ | ||
import views from '../views/home.html'; | ||
import views from '../views/home/home.html'; | ||
import Axios from "axios"; | ||
|
||
export default () => { | ||
const divElement = document.createElement('div'); | ||
divElement.classList = 'text-white'; | ||
divElement.classList = "home-section"; | ||
divElement.innerHTML = views; | ||
|
||
const API_URL = 'http://43.201.103.199/posts'; | ||
|
||
Axios.get(API_URL).then((res) => { | ||
let posts = res.data.data.posts; | ||
console.log(posts); | ||
|
||
posts.forEach((post) => { | ||
let postEl = document.createElement('div') | ||
postEl.innerHTML = post.title; | ||
divElement.querySelector("#post-list-section").innerHTML += `<div>${post.title}</div>` | ||
}) | ||
}); | ||
|
||
return divElement; | ||
}; |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class="button-section"> | ||
<button class="create-post"> | ||
<img class="icon-post" src="../../assets/svg/create-post.svg"> | ||
새 글 작성하기 | ||
</button> | ||
</div> | ||
<div id="post-list-section"> | ||
|
||
</div> | ||
|
||
|
||
|
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,42 @@ | ||
.font-css { | ||
color: #fff; | ||
} | ||
|
||
.home-section{ | ||
height: 100%; | ||
.button-section { | ||
height: 15%; | ||
background: red; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
.post-list-section { | ||
height: 85%; | ||
background: white; | ||
} | ||
} | ||
|
||
button { | ||
@extend .font-css; | ||
|
||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #AC354B; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
appearance: none; | ||
width: 90vw; | ||
height: 90%; | ||
margin-top: 5px; | ||
font: { | ||
size: 2rem; | ||
} | ||
.create-post { | ||
} | ||
img { | ||
width: 20%; | ||
} | ||
} | ||
|