AS β€’ Portfolio

My creative works, graded works, and robotics and engineering projects

Welcome

The password is my last name with the first letter capitalized. Enjoy!


Aziza's Interactive Code

Enter values below.

Here is a sample of the code used to create this interactive experience.


function handleConvSubmit() {
    const inp = document.getElementById('convInput');
    const v = inp.value.trim();
    if (!v) return;

    appendConvMessage('user', v);
    convAnswers.push(v);
    inp.value = '';

    const stepIndex = convStep;
    convStep++;

    if (stepIndex === 0) {
        // user just gave their name β€” friendly reply + name fun fact
        appendConvMessage('bot', `Hey ${v}, nice to meet you! 😊`);
        appendConvMessage('bot', nameFunFact(v));
        // ask next question
        appendConvMessage('bot', convQuestions[1]);
        document.getElementById('convInput').focus();
    } else if (stepIndex === 1) {
        // user answered favorite color(s)
        const colorRaw = v.split(',')[0].trim();
        const color = colorRaw.toLowerCase();
        const fact = colorFacts[color] || "Colors can influence mood β€” interesting stuff!";
        const name = convAnswers[0] || '';
        appendConvMessage('bot', `${colorRaw} β€” that's cool, ${name}! ${fact} ✨`);
        appendConvMessage('bot', 'Thanks for sharing β€” I reset the chat so you can try again.');
        // reset after short pause so user can run again
        setTimeout(() => { startConversation(); }, 6000);
    }
}