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

Opsplitsen van de functie / const #14

Open
zainuwachtig opened this issue Mar 8, 2022 · 0 comments
Open

Opsplitsen van de functie / const #14

zainuwachtig opened this issue Mar 8, 2022 · 0 comments
Assignees
Labels
C Could do

Comments

@zainuwachtig
Copy link

const item = (data, id) => {
container.innerHTML = ""
const section = document.createElement("section")
section.classList.add("singleArt")
const result = data.artObjects.filter((item) => item.id === id)
console.log(result)
const link = result.map((item) => item.links.web)
const imgObject = result.map((item) => item.webImage)
const itemImg = imgObject.map((item) => item.url.slice(0, -3) + "=s1000")
const itemTitle = result.map((item) => item.longTitle)
section.innerHTML = `
<a href="/rijksmuseum-app/">Terug</a>
<img src="${itemImg}"/>
<p>${itemTitle[0]}</p>
<a href="${link}" target="_blanc">Bekijk hier meer over dit kunstwerk.</a>
`
container.insertAdjacentElement("afterbegin", section)
}

Misschien kan je dit beter opsplitsen in verschillende functies, maar eigelijk weet ik het niet zeker

@Tomvandenberg11 Tomvandenberg11 self-assigned this Mar 8, 2022
@Tomvandenberg11 Tomvandenberg11 added the C Could do label Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Could do
Projects
None yet
Development

No branches or pull requests

2 participants