Skip to content

Instantly share code, notes, and snippets.

View cba85's full-sized avatar
🌊

Clément Barbaza cba85

🌊
View GitHub Profile
@cba85
cba85 / fetch-async.js
Last active October 2, 2024 12:45
IPI Toulouse 2024-2025 - IJVS020
const loadButton = document.querySelector("#load");
const loadingElement = document.querySelector("#loading");
const errorElement = document.querySelector(".error");
const usersListElement = document.querySelector("#users");
loadButton.addEventListener("click", async function (event) {
event.preventDefault();
loadingElement.style.display = "block";
@cba85
cba85 / dog.html
Last active September 13, 2024 10:27
IPI Toulouse - 2024-2025 - IJVS010
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://unpkg.com/mvp.css">
<script src="dog.js" defer></script>
<style>
.error {
@cba85
cba85 / app.js
Created September 11, 2024 08:32
IPI Toulouse - 2024-2025 - IJVS010
// getElement(s)By*
//const title = document.getElementById("title");
const title = document.getElementsByTagName("h1");
console.log(title[0]);
const subsubtitles = document.getElementsByTagName("h3");
console.log(subsubtitles);
const subsubtitle2 = document.getElementById("subsubtitle2")
@cba85
cba85 / app.js
Created September 8, 2024 13:20
2024-2025 - IPI Toulouse - IJVS010
function max(a, b) {
if (a > b) {
return a;
}
return b;
}
console.log(max(1, 5));
console.log(max(2, 2));
@cba85
cba85 / app.js
Last active May 14, 2024 16:08
IJVS030 - Recherche de communes françaises jQuery
$(document).ready(function () {
$("form").on("submit", function (e) {
e.preventDefault();
$(".error").hide();
$(".no-results").hide();
$("#results").hide();
//const name = $("#name").val();
let name = $("input[name='name']").val();
@cba85
cba85 / app.js
Created January 11, 2024 12:49
jQuery Giphy - IPI Toulouse TSTN2A 2023-2024
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">`
@cba85
cba85 / index.html
Created December 27, 2023 16:53
Vue 3 TV Maze (with components) - IPI Toulouse - CDAN SOPRA
let Search = {
data() {
return {
q: "",
};
},
methods: {
async search() {
if (!this.q) {
this.$emit("updateError", "Veuillez entrer une série");
@cba85
cba85 / app.js
Created December 27, 2023 16:51
Vue 3 TV Maze (no components) - IPI Toulouse - CDAN SOPRA
Vue.createApp({
data() {
return {
q: "",
error: "",
shows: [],
};
},
methods: {
async search() {
@cba85
cba85 / api.json
Created December 21, 2023 18:05
IPI Toulouse 2023-2024 - Fruity
[
{
"name": "Persimmon",
"id": 52,
"family": "Ebenaceae",
"order": "Rosales",
"genus": "Diospyros",
"nutritions": {
"calories": 81,
"fat": 0.0,
@cba85
cba85 / app.js
Created December 14, 2023 14:43
jQuery Jikan - IPI Toulouse TSTN2A 2023/2024
function convertDateInFrench(datetime) {
if (!datetime) {
return "-";
}
const date = new Date(datetime);
return date.toLocaleDateString("fr-FR", {
year: "numeric",
month: "long",
day: "numeric",