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
(async () => { | |
const response = await fetch( | |
"https://calendrier.api.gouv.fr/jours-feries/metropole/2025.json" | |
); | |
const data = await response.json(); | |
for (const day in data) { | |
const date = new Date(day); | |
console.log( | |
date.toLocaleDateString("fr-FR", { |
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
// https://openweathermap.org/ | |
const apiKey = ""; // Insert your OpenWeatherMap API Key | |
const form = document.querySelector("form"); | |
function displayErrorMessage(message) { | |
document.querySelector("article").style.display = "none"; | |
const notice = document.querySelector(".notice"); | |
notice.textContent = message; | |
notice.style.display = "block"; |
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
h1 { | |
margin-bottom: 1em !important; | |
font-size: 2em !important; | |
} | |
h2 { | |
padding-bottom: 0.5em; | |
border-bottom: 1px solid #999; | |
margin: 1em 0 !important; | |
} |
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
const form = document.querySelector("form"); | |
form.addEventListener("submit", async (e) => { | |
e.preventDefault(); | |
document.querySelector("#results").textContent = ""; | |
const q = form.q.value; | |
if (!q) { |
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
const options = { | |
data() { | |
return { | |
taskInput: "", | |
tasks: [], | |
error: false, | |
}; | |
}, | |
methods: { | |
addTask() { |
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
function convertDateInFrench(datetime) { | |
if (!datetime) { | |
return "-"; | |
} | |
const date = new Date(datetime); | |
return date.toLocaleDateString("fr-FR", { | |
year: "numeric", | |
month: "long", | |
day: "numeric", |
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
[ | |
{ | |
"name": "Persimmon", | |
"id": 52, | |
"family": "Ebenaceae", | |
"order": "Rosales", | |
"genus": "Diospyros", | |
"nutritions": { | |
"calories": 81, | |
"fat": 0.0, |
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
Vue.createApp({ | |
data() { | |
return { | |
q: "", | |
error: "", | |
shows: [], | |
}; | |
}, | |
methods: { | |
async search() { |
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
let Search = { | |
data() { | |
return { | |
q: "", | |
}; | |
}, | |
methods: { | |
async search() { | |
if (!this.q) { | |
this.$emit("updateError", "Veuillez entrer une sΓ©rie"); |
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
const apiKey = "7DM9xWMcFqBNGWzapWk6d7e5FdsBkwe9"; | |
const limit = 10; | |
// Get results (gifs, stickers) from Giphy API | |
function getGiphyResults(url) { | |
$.get(url) | |
.done((response) => { | |
$.each(response.data, (index, value) => { | |
$( | |
`<img src="${value.images.fixed_height.webp}" alt="${value.title}" loading="lazy">` |