depot git
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 784 B |
|
After Width: | Height: | Size: 882 B |
|
After Width: | Height: | Size: 773 B |
|
After Width: | Height: | Size: 774 B |
|
After Width: | Height: | Size: 881 B |
|
After Width: | Height: | Size: 871 B |
|
After Width: | Height: | Size: 878 B |
|
After Width: | Height: | Size: 877 B |
|
After Width: | Height: | Size: 770 B |
|
After Width: | Height: | Size: 843 B |
@@ -0,0 +1,9 @@
|
||||
# picocad material
|
||||
newmtl cybergirl_mtl
|
||||
ka 1.000000 1.000000 1.000000
|
||||
kd 1.000000 1.000000 1.000000
|
||||
ks 0.000000 0.000000 0.000000
|
||||
tr 1.000000
|
||||
illum 1
|
||||
ns 0.000000
|
||||
map_kd cybergirl_tex.png
|
||||
|
After Width: | Height: | Size: 764 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,323 @@
|
||||
|
||||
|
||||
|
||||
const socket = io();
|
||||
|
||||
let barreStress = document.getElementById('barreStress')
|
||||
let stress = 0;
|
||||
let maxInterval1;
|
||||
let maxInterval2;
|
||||
|
||||
// ________________________________________________________________________________________
|
||||
|
||||
|
||||
function test() {
|
||||
setInterval(() => {
|
||||
stress+=10;
|
||||
console.log(stress);
|
||||
testBarre();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function teste(){
|
||||
setInterval(() => {
|
||||
stress=0;
|
||||
}, 15000);
|
||||
}
|
||||
|
||||
function animBarreMax() {
|
||||
clearInterval(maxInterval1);
|
||||
clearInterval(maxInterval2);
|
||||
|
||||
maxInterval1 = setInterval(() => {
|
||||
barreStress.style.backgroundImage = 'url("barre/barreMax1.PNG")';
|
||||
}, 250);
|
||||
|
||||
maxInterval2 = setInterval(() => {
|
||||
barreStress.style.backgroundImage = 'url("barre/barreMax2.PNG")';
|
||||
}, 500);
|
||||
}
|
||||
|
||||
|
||||
function stopAnimBarreMax() {
|
||||
clearInterval(maxInterval1);
|
||||
clearInterval(maxInterval2);
|
||||
}
|
||||
|
||||
|
||||
function testBarre() {
|
||||
if (stress < 100) {
|
||||
stopAnimBarreMax();
|
||||
}
|
||||
|
||||
if (stress <= 10) {
|
||||
barreStress.style.backgroundImage = 'url("barre/barre1.PNG")';
|
||||
} else if (stress <= 20) {
|
||||
barreStress.style.backgroundImage = 'url("barre/barre2.PNG")';
|
||||
} else if (stress <= 30) {
|
||||
barreStress.style.backgroundImage = 'url("barre/barre3.PNG")';
|
||||
} else if (stress <= 40) {
|
||||
barreStress.style.backgroundImage = 'url("barre/barre4.PNG")';
|
||||
} else if (stress <= 50) {
|
||||
barreStress.style.backgroundImage = 'url("barre/barre5.PNG")';
|
||||
} else if (stress <= 60) {
|
||||
barreStress.style.backgroundImage = 'url("barre/barre6.PNG")';
|
||||
} else if (stress <= 70) {
|
||||
barreStress.style.backgroundImage = 'url("barre/barre7.PNG")';
|
||||
} else if (stress <= 80) {
|
||||
barreStress.style.backgroundImage = 'url("barre/barre8.PNG")';
|
||||
} else if (stress <= 90) {
|
||||
barreStress.style.backgroundImage = 'url("barre/barre9.PNG")';
|
||||
} else if (stress >= 100) {
|
||||
animBarreMax();
|
||||
}
|
||||
}
|
||||
|
||||
// ________________________________________________________________________________________
|
||||
|
||||
|
||||
function addNoise() {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
canvas.width = window.innerWidth;
|
||||
canvas.height = window.innerHeight;
|
||||
const imageData = ctx.createImageData(canvas.width, canvas.height);
|
||||
const data = imageData.data;
|
||||
|
||||
for (let i = 0; i < data.length; i += 4) {
|
||||
const value = Math.random() * 255;
|
||||
data[i] = data[i + 1] = data[i + 2] = value;
|
||||
data[i + 3] = 255; // alpha
|
||||
}
|
||||
|
||||
ctx.putImageData(imageData, 0, 0);
|
||||
document.body.style.backgroundImage = `url(${canvas.toDataURL()})`;
|
||||
}
|
||||
|
||||
|
||||
// ________________________________________________________________________________________
|
||||
|
||||
|
||||
function lireTexte() {
|
||||
// Récupérer le texte à lire depuis l'élément HTML avec l'ID 'texte'
|
||||
const Texte = document.getElementById('texte');
|
||||
const texteToSpeak = Texte ? Texte.innerText : "Texte par défaut";
|
||||
|
||||
// Appeler l'API backend pour lire le texte
|
||||
fetch(`/speak?text=${encodeURIComponent(texteToSpeak)}`)
|
||||
.then(reponse => {
|
||||
if (!reponse.ok) {
|
||||
throw new Error('Erreur réseau lors de l\'appel de l\'API');
|
||||
}
|
||||
return reponse.text();
|
||||
})
|
||||
.then(data => {
|
||||
console.log(data); // Affiche la réponse du serveur
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Erreur :', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// ________________________________________________________________________________________
|
||||
|
||||
let envoyerQuestion = document.getElementById("envoyerQuestion");
|
||||
|
||||
|
||||
function doubleRandomWord(question) {
|
||||
let words = question.split(' ');
|
||||
if (words.length === 0) return question;
|
||||
|
||||
let randomIndex = Math.floor(Math.random() * words.length);
|
||||
words.splice(randomIndex, 0, words[randomIndex]);
|
||||
|
||||
return words.join(' ');
|
||||
}
|
||||
|
||||
|
||||
function addInsulte(question) {
|
||||
let listeInsulte = [
|
||||
'PUTE',
|
||||
'BITE',
|
||||
'CON',
|
||||
'CONNARD',
|
||||
'SALOPE',
|
||||
'MERDE',
|
||||
'PUTAIN'
|
||||
];
|
||||
let Insulte = listeInsulte[Math.floor(Math.random() * listeInsulte.length)];
|
||||
|
||||
let words = question.split(' ');
|
||||
let randomIndex = Math.floor(Math.random() * (words.length + 1));
|
||||
words.splice(randomIndex, 0, Insulte);
|
||||
|
||||
return words.join(' ');
|
||||
}
|
||||
|
||||
function submitQuestion (){
|
||||
let question = document.getElementById('questionInput').value;
|
||||
if (question.trim() !== '') {
|
||||
|
||||
// Modifier la question
|
||||
// question = doubleRandomWord(question);
|
||||
// question = addInsulte(question);
|
||||
|
||||
// Envoyer la question au serveur via socket.io ou une requête HTTP
|
||||
socket.emit('question', question);
|
||||
|
||||
// Afficher la question dans le conteneur de réponses
|
||||
const reponseContainer = document.getElementById('reponseContainer');
|
||||
const questionElement = document.createElement('div');
|
||||
questionElement.textContent = `Question: ${question}`;
|
||||
reponseContainer.appendChild(questionElement);
|
||||
|
||||
// Vider le champ de saisie
|
||||
document.getElementById('questionInput').value = '';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// ________________________________________________________________________________________
|
||||
|
||||
|
||||
// // Créez une scène, une caméra et un rendu
|
||||
// const scene = new THREE.Scene();
|
||||
// const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
|
||||
// const renderer = new THREE.WebGLRenderer();
|
||||
// renderer.setSize(window.innerWidth, window.innerHeight);
|
||||
// document.body.appendChild(renderer.domElement);
|
||||
|
||||
// // Ajoutez des lumières
|
||||
// const light = new THREE.HemisphereLight(0xffffbb, 0x080820, 1);
|
||||
// scene.add(light);
|
||||
|
||||
// // Chargez le modèle .obj
|
||||
// const objLoader = new THREE.OBJLoader();
|
||||
// objLoader.load(
|
||||
// 'cybergirl.obj', // Remplacez par le chemin de votre fichier .obj
|
||||
// (object) => {
|
||||
// scene.add(object);
|
||||
// object.position.set(0, 0, 0); // Ajustez la position si nécessaire
|
||||
// },
|
||||
// (xhr) => {
|
||||
// console.log((xhr.loaded / xhr.total * 100) + '% loaded');
|
||||
// },
|
||||
// (error) => {
|
||||
// console.error('Une erreur est survenue lors du chargement du modèle:', error);
|
||||
// }
|
||||
// );
|
||||
|
||||
|
||||
// const mtlLoader = new THREE.MTLLoader();
|
||||
// mtlLoader.load('cybergirl.mtl', (materials) => {
|
||||
// materials.preload();
|
||||
|
||||
// const objLoader = new THREE.OBJLoader();
|
||||
// objLoader.setMaterials(materials);
|
||||
// objLoader.load('cybergirl.obj',(object) => {
|
||||
// scene.add(object);
|
||||
// object.position.set(0, 0, 0); // Ajustez la position si nécessaire
|
||||
// },
|
||||
// (xhr) => {
|
||||
// console.log((xhr.loaded / xhr.total * 100) + '% loaded');
|
||||
// },
|
||||
// (error) => {
|
||||
// console.error('Une erreur est survenue lors du chargement du modèle:', error);
|
||||
// }
|
||||
// );
|
||||
// });
|
||||
|
||||
|
||||
// // Positionnez la caméra
|
||||
// camera.position.z = 5;
|
||||
|
||||
|
||||
// // Fonction de rendu
|
||||
// function animate() {
|
||||
// requestAnimationFrame(animate);
|
||||
// renderer.render(scene, camera);
|
||||
// }
|
||||
// animate();
|
||||
|
||||
|
||||
|
||||
// ________________________________________________________________________________________
|
||||
|
||||
|
||||
let intervalEcoute;
|
||||
let intervalEcoute1;
|
||||
let intervalEcoute2;
|
||||
|
||||
let tete = document.getElementById('tete');
|
||||
let tetegif =document.getElementById('teteGif')
|
||||
let parle = -1;
|
||||
|
||||
function animAttente() {
|
||||
tete.style.display='none';
|
||||
tetegif.style.display='block';
|
||||
}
|
||||
|
||||
function Ecoute() {
|
||||
tete.style.display='block';
|
||||
tetegif.style.display='none';
|
||||
}
|
||||
|
||||
|
||||
function animEcoute() {
|
||||
tete.style.display='block';
|
||||
tetegif.style.display='none';
|
||||
clearInterval(intervalEcoute1);
|
||||
clearInterval(intervalEcoute2);
|
||||
|
||||
intervalEcoute = setInterval(() => {
|
||||
if (parle <= 0) {
|
||||
|
||||
intervalEcoute1 = setInterval(() => {
|
||||
clearInterval(intervalEcoute1);
|
||||
tete.style.backgroundImage='url("cybergirl_anim/png/^^1.png")';
|
||||
console.log('1');
|
||||
|
||||
intervalEcoute2 = setInterval(() => {
|
||||
clearInterval(intervalEcoute2);
|
||||
tete.style.backgroundImage='url("cybergirl_anim/png/^^2.png")';
|
||||
console.log('2');
|
||||
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
} else {
|
||||
console.log('stop');
|
||||
clearInterval(intervalEcoute);
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
|
||||
function animParle() {
|
||||
parle = 0;
|
||||
}
|
||||
|
||||
|
||||
function animInsulte() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ________________________________________________________________________________________
|
||||
|
||||
|
||||
|
||||
envoyerQuestion.addEventListener("click",submitQuestion);
|
||||
document.addEventListener("keydown", function(event) {
|
||||
if (event.key === "Enter") {
|
||||
submitQuestion();
|
||||
}
|
||||
});
|
||||
|
||||
barreStress.addEventListener("click", lireTexte);
|
||||
questionInput.addEventListener("click",animEcoute);
|
||||
addNoise();
|
||||
teste();
|
||||
test();
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 506 KiB |
|
After Width: | Height: | Size: 481 KiB |
|
After Width: | Height: | Size: 553 KiB |
@@ -0,0 +1,87 @@
|
||||
|
||||
|
||||
@keyframes flicker {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.9; }
|
||||
}
|
||||
|
||||
|
||||
body{
|
||||
margin: 0;
|
||||
border: 0;
|
||||
background-color: #1d2b53;
|
||||
/* filter: sepia(0.5) grayscale(0.3) contrast(1.2); */
|
||||
animation: flicker 0.15s infinite;
|
||||
}
|
||||
|
||||
#fond{
|
||||
position: fixed;
|
||||
background-color: #1d2b53;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-left: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#teteGif{
|
||||
position: fixed;
|
||||
margin-left: 22.5%;
|
||||
margin-top: -5%;
|
||||
width: 55%;
|
||||
height: 105%;
|
||||
background-image: url("cybergirl_3.gif");
|
||||
background-size: 98%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
|
||||
#tete{
|
||||
position: fixed;
|
||||
border: 0;
|
||||
display: none;
|
||||
margin-left: 22.5%;
|
||||
margin-top: -5%;
|
||||
width: 55%;
|
||||
height: 105%;
|
||||
background-size: 110%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
|
||||
#barreStress{
|
||||
position: fixed;
|
||||
margin-top: 2%;
|
||||
margin-left: 2%;
|
||||
width: 300px;
|
||||
height: 85px;
|
||||
background-image: url("barre/barre1.PNG");
|
||||
background-size: 100%;
|
||||
}
|
||||
|
||||
|
||||
#questionInput{
|
||||
/* background-color: #FF77A8; */
|
||||
position: fixed;
|
||||
width: 50%;
|
||||
bottom: 10%;
|
||||
margin-left: 25%;
|
||||
}
|
||||
|
||||
#envoyerQuestion{
|
||||
background-color: #7E2553;
|
||||
position: fixed;
|
||||
width: 10%;
|
||||
bottom: 5%;
|
||||
margin-left: 45%;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
|
||||
#reponseContainer{
|
||||
position: fixed;
|
||||
width: 10%;
|
||||
height: 100%;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
|
||||