Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
education.js 30.1 KiB
Newer Older
peter_rabbit's avatar
peter_rabbit committed
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
const ENV = "dev";

let server_url;

switch (ENV) {
    case "dev":
        server_url = "http://localhost:9000";
        break;
    case "prod":
        server_url = "http://your_production_server_url:port";
}

module.exports = { server_url };

},{}],2:[function(require,module,exports){
const { server_url } = require("./config");

module.exports = {
    images_url: `${server_url}/assets/images`,
};

},{"./config":1}],3:[function(require,module,exports){
peter_rabbit's avatar
peter_rabbit committed
"use strict";

module.exports = {
    setRenderCycleRoot(renderCycleRoot) {
        this.renderCycleRoot = renderCycleRoot;
    },
    objectToHtml: function objectToHtml(obj) {
        const { tag } = obj;

        const node = document.createElement(tag);
        const excludeKeys = ["tag", "contents", "style_rules", "state"];

        Object.keys(obj)
            .filter(attr => !excludeKeys.includes(attr))
            .forEach(attr => {
                if (attr === "class") {
                    node.classList.add(...obj[attr].split(" ").filter(s => s !== ""));
                } else {
                    node[attr] = obj[attr];
                }
            });
        if (obj.contents && typeof obj.contents === "string") {
            node.innerHTML = obj.contents;
        } else {
            obj.contents &&
                obj.contents.length > 0 &&
                obj.contents.forEach(el => {
                    switch (typeof el) {
                        case "string":
                            node.innerHTML = el;
                            break;
                        case "object":
                            node.appendChild(objectToHtml(el));
                            break;
                    }
                });
        }

        if (obj.style_rules) {
            Object.keys(obj.style_rules).forEach(rule => {
                node.style[rule] = obj.style_rules[rule];
            });
        }

        return node;
    },
    renderCycle: function () {
        this.subRender(this.renderCycleRoot.render(), document.getElementsByTagName("main")[0], {
            mode: "replace",
        });
    },
    subRender(object, htmlNode, options = { mode: "append" }) {
        const insert = this.objectToHtml(object);
        switch (options.mode) {
            case "append":
                htmlNode.appendChild(insert);
                break;
            case "override":
                htmlNode.innerHTML = "";
                htmlNode.appendChild(insert);
                break;
            case "insert-before":
                htmlNode.insertBefore(insert, htmlNode.childNodes[options.insertIndex]);
                break;
            case "adjacent":
                /**
                 * options.insertLocation must be one of:
                 *
                 * afterbegin
                 * afterend
                 * beforebegin
                 * beforeend
                 */
                htmlNode.insertAdjacentHTML(options.insertLocation, insert);
                break;
            case "replace":
                htmlNode.parentNode.replaceChild(insert, htmlNode);
                break;
            case "remove":
                htmlNode.remove();
                break;
        }
    },
};

},{}],4:[function(require,module,exports){
peter_rabbit's avatar
peter_rabbit committed
"use strict";

peter_rabbit's avatar
peter_rabbit committed
const GAMEDEV_THEMES = [
peter_rabbit's avatar
peter_rabbit committed
    {
        title: "Dessin et création 2D",
        class: "crea2d",
peter_rabbit's avatar
peter_rabbit committed
        details: [
peter_rabbit's avatar
peter_rabbit committed
            "Création de décors et de personnages",
            "Dessin sur ordinateur, pixel art, vectoriel",
            "Animations 2D",
        title: "Musique et sons",
        class: "sound",
peter_rabbit's avatar
peter_rabbit committed
        details: ["Logiciels de son et synthétiseurs", "Composition", "Prise de son", "Mixage"],
peter_rabbit's avatar
peter_rabbit committed
    },
    {
        title: "Écriture",
        class: "write",
peter_rabbit's avatar
peter_rabbit committed
        details: [
            "Écrire une histoire, construire une narration",
            "Imaginer des mondes et des personnages",
        ],
    },
    {
        title: "Conception",
        class: "conception",
peter_rabbit's avatar
peter_rabbit committed
        comment: "",
        details: [
            "Concevoir les différents éléments qui composent le jeu",
peter_rabbit's avatar
peter_rabbit committed
            "Développer les mécanismes de gameplay",
        ],
    },
    {
        title: "Programmation",
        class: "coding",
peter_rabbit's avatar
peter_rabbit committed
        comment: "",
        details: [
            "Apprendre pas à pas à coder avec différents langages de programmation",
            "Découvrir les bases du web en créant des mini-jeux en lignes",
        ],
    },
    {
        title: "Mathématiques",
        class: "math",
peter_rabbit's avatar
peter_rabbit committed
        comment:
            "<em>Créer un jeu vidéo c'est l'occasion de découvrir plein de sujets en maths et en physique tout en s'amusant !</em>",
peter_rabbit's avatar
peter_rabbit committed
        details: [
peter_rabbit's avatar
peter_rabbit committed
            "Algorithmie",
            "Logique (algèbre booléen)",
            "Géométrie",
            "Trigonométrie",
            "Algèbre linéaire",
            "Repères 2D / 3D",
            "Vecteurs 2D / 3D",
            "Newton",
            "...",
        title: "Travail d'équipe",
        class: "team",
peter_rabbit's avatar
peter_rabbit committed
        comment: `
            <em>
                Faire son jeu tout seul c'est bien mais ça peut être long !
                <br>Créer des jeux c'est aussi l'occasion de se mettre à plusieurs pour tirer le meilleur parti des différents talents de chacun.
            </em>`,
peter_rabbit's avatar
peter_rabbit committed
        details: [],
    },
    {
peter_rabbit's avatar
peter_rabbit committed
        title: "Logiciels libres, GNU/Linux",
        class: "linux",
peter_rabbit's avatar
peter_rabbit committed
        comment:
            "<em>Nous utilisons essentiellement des logiciels libres sur Linux.<br>C'est donc une bonne occasion de découvrir et démystifier tout ça en douceur !</em>",
peter_rabbit's avatar
peter_rabbit committed
        details: [],
    },
];

class GameStudioClub {
peter_rabbit's avatar
peter_rabbit committed
    render() {
        return {
            tag: "section",
peter_rabbit's avatar
peter_rabbit committed
            contents: [
peter_rabbit's avatar
peter_rabbit committed
                {
                    tag: "div",
                    class: "title-banner",
peter_rabbit's avatar
peter_rabbit committed
                    id: "game-studio-club", // anchor id
                    contents: [{ tag: "h2", contents: "Game Studio Club" }],
                    tag: "div",
                    class: "section-contents",
peter_rabbit's avatar
peter_rabbit committed
                    contents: [
                        {
                            tag: "div",
peter_rabbit's avatar
peter_rabbit committed
                            class: "full-row",
peter_rabbit's avatar
peter_rabbit committed
                            contents: [
                                { tag: "h3", contents: "Apprendre à créer un jeu vidéo de A à Z" },
                                {
                                    tag: "strong",
                                    contents:
                                        "La création d'un jeu vidéo c'est l'occasion d'aborder plein de choses différentes !",
                                },
                                {
                                    tag: "p",
                                    contents:
                                        "<em>Aucun prérequis nécessaire. Pas besoin d'être fort en maths ou en informatique, le but est d'apprendre et se détendre !</em>",
                                },
                            tag: "div",
                            class: "practical-infos",
peter_rabbit's avatar
peter_rabbit committed
                            contents: [
                                {
                                    tag: "div",
                                    class: "info-item",
                                    contents: [
                                        { tag: "strong", contents: "Ça se passe où ?" },
                                        {
                                            tag: "span",
                                            contents:
                                                "Dans nos locaux,<br/><em>32 rue Simon Vialet, passage du Cheminou<br/>07240 Vernoux en Vivarais</em>",
                                        },
                                    ],
                                },
                                {
                                    tag: "div",
                                    class: "info-item",
                                    contents: [
                                        { tag: "strong", contents: "Pour qui ?" },
                                        {
                                            tag: "span",
                                            contents: "Tout le monde à partir de 12 ans.",
                                        },
                                    ],
                                },
                                {
                                    tag: "div",
                                    class: "info-item",
                                    contents: [
                                        {
                                            tag: "strong",
                                            contents: "Contact",
                                        },
                                        {
                                            tag: "span",
                                            contents: "04 75 78 08 72",
                                        },
                                        {
                                            tag: "a",
                                            href: "mailto:kuadrado-software@tutanota.com",
                                            contents: "kuadrado-software@tutanota.com",
                                        },
                                    ],
                                },
                            tag: "ul",
                            class: "learning-themes",
peter_rabbit's avatar
peter_rabbit committed
                            contents: GAMEDEV_THEMES.map(li => {
                                return {
                                    tag: "li",
                                    class: "learning-theme " + li.class,
                                    contents: [
                                        { tag: "strong", class: "title", contents: li.title },
                                        {
                                            tag: "div",
                                            class: "details",
                                            contents: [
peter_rabbit's avatar
peter_rabbit committed
                                                li.comment && {
                                                    tag: "div",
                                                    class: "comment",
                                                    contents: li.comment,
                                                },
                                                {
                                                    tag: "ul",
                                                    contents: li.details.map(d => {
                                                        return {
                                                            tag: "li",
                                                            contents: d,
                                                        };
                                                    }),
                                                },
                                            ],
                                        },
                                    ],
                                };
                            }),
peter_rabbit's avatar
peter_rabbit committed
                        },
                            tag: "p",
peter_rabbit's avatar
peter_rabbit committed
                            class: "full-row",
                            contents: `<b>Une de ces choses vous intéresse mais pas spécialement le jeu vidéo ?</b>
                                <br>Pas de problème ! On peut se concentrer par exemple uniquement sur de la création 2D, ou de la création sonore, ou même uniquement des maths !
                                <br>L'orientation se fait en fonction des préférences de chacun.`,
                            tag: "div",
peter_rabbit's avatar
peter_rabbit committed
                            class: "infos-inscriptions full-row",
peter_rabbit's avatar
peter_rabbit committed
                            contents: [
                                {
                                    tag: "div",
                                    class: "groups",
                                    contents: [
                                        {
                                            tag: "h3",
                                            contents: "Groupes",
                                        },
                                        {
peter_rabbit's avatar
peter_rabbit committed
                                            tag: "p",
                                            contents: "Les groupes sont de 5 personnes maximum.",
                                        },
                                        {
                                            tag: "div",
                                            class: "table-wrapper",
                                            contents: [
                                                {
peter_rabbit's avatar
peter_rabbit committed
                                                    tag: "table",
                                                    contents: [
peter_rabbit's avatar
peter_rabbit committed
                                                        {
                                                            tag: "tr",
                                                            contents: [
                                                                { tag: "td", contents: "Mardi" },
                                                                {
                                                                    tag: "td",
                                                                    contents: "16h - 19h",
                                                                },
                                                            ],
                                                        },
                                                        {
                                                            tag: "tr",
                                                            contents: [
                                                                { tag: "td", contents: "Mercredi" },
                                                                {
                                                                    tag: "td",
                                                                    contents: "14h - 17h",
                                                                },
                                                            ],
                                                        },
                                                        {
                                                            tag: "tr",
                                                            contents: [
                                                                { tag: "td", contents: "Jeudi" },
                                                                {
                                                                    tag: "td",
                                                                    contents: "16h - 19h",
                                                                },
                                                            ],
                                                        },
                                                    ],
                                                },
                                            ],
                                        },
                                    ],
                                },
                                {
                                    tag: "div",
                                    class: "pricing",
                                    contents: [
                                        {
                                            tag: "h3",
                                            contents: "Inscription, fonctionnement et tarifs",
                                        },
                                        {
                                            tag: "p",
                                            contents: `Vous pouvez vous inscrire dans un des groupes pour un mois ou un trimestre.
                                        <br>Le matériel informatique est fourni sur place, mais vous pouvez amener votre propre ordinateur portable si vous le souhaitez.
                                        `,
                                        },
                                        {
peter_rabbit's avatar
peter_rabbit committed
                                            tag: "div",
                                            class: "table-wrapper",
                                            contents: [
                                                {
peter_rabbit's avatar
peter_rabbit committed
                                                    tag: "table",
                                                    contents: [
                                                        {
peter_rabbit's avatar
peter_rabbit committed
                                                            tag: "tr",
                                                            contents: [
                                                                {
                                                                    tag: "td",
                                                                    contents: "Abonnement 1 mois",
                                                                },
                                                                {
                                                                    tag: "td",
                                                                    contents: "(4 séances)",
                                                                },
                                                                { tag: "td", contents: "70€" },
                                                            ],
peter_rabbit's avatar
peter_rabbit committed
                                                            tag: "tr",
                                                            contents: [
                                                                {
                                                                    tag: "td",
                                                                    contents:
                                                                        "Abonnement 1 trimestre",
                                                                },
                                                                {
                                                                    tag: "td",
                                                                    contents: "(12 séances)",
                                                                },
                                                                { tag: "td", contents: "190€" },
                                                            ],
            ],
        };
    }
}

module.exports = GameStudioClub;

},{}],5:[function(require,module,exports){
"use strict";

peter_rabbit's avatar
peter_rabbit committed
const { images_url } = require("../../../../constants");
peter_rabbit's avatar
peter_rabbit committed
const VULGARISATION_THEMES = [
    {
        title: "Qu'est-ce qui se passe dans mon ordinateur ?",
        class:"general-pc",
peter_rabbit's avatar
peter_rabbit committed
        comment: "",
        details: [
            "Répondre aux questions sur l'informatique de tous les jours",
peter_rabbit's avatar
peter_rabbit committed
            "L'organisation des fichiers",
            "Le navigateur web et les logiciels usuels",
peter_rabbit's avatar
peter_rabbit committed
        ],
    },
    {
        title: "GNU/Linux, le monde du libre",
        class:"linux",
peter_rabbit's avatar
peter_rabbit committed
        comment: "",
        details: [
            "Installer Linux, démystifier et faire tomber les barrières.",
            "Qu'est-ce qu'un logiciel libre ? Quels sont les enjeux ?",
        ],
    },
    {
        title: "Comment fonctionne le web ?",
        class:"web",
peter_rabbit's avatar
peter_rabbit committed
        comment: "",
        details: [
            "De quoi est fait le réseau internet ?",
            "Comment fonctionnent les différents services que nous utilisons ?",
peter_rabbit's avatar
peter_rabbit committed
            "Qu'est-ce qu'un cloud ?",
        ],
    },
    {
        title: "Le langages des machines",
        class:"coding",
peter_rabbit's avatar
peter_rabbit committed
        comment: "",
        details: [
            "Démystifier la programmation informatique",
            "Qu'est-ce qu'un langage de programmation",
            "À quoi ça sert ?",
            "Les métiers du développement informatique",
        ],
    },
];
peter_rabbit's avatar
peter_rabbit committed
class Popularization {
    render() {
        return {
peter_rabbit's avatar
peter_rabbit committed
            tag: "section",
            contents: [
                {
                    tag: "div",
peter_rabbit's avatar
peter_rabbit committed
                    class: "title-banner",
peter_rabbit's avatar
peter_rabbit committed
                    id: "popularization", // anchor id
peter_rabbit's avatar
peter_rabbit committed
                    contents: [{ tag: "h2", contents: "Ateliers de vulgarisation" }],
peter_rabbit's avatar
peter_rabbit committed
                    tag: "div",
                    class: "section-contents",
                    contents: [
peter_rabbit's avatar
peter_rabbit committed
                            tag: "div",
                            class: "full-row",
                            contents:
                                "<b>Nous proposons des animations d'une journée de vulgarisation autour de l'informatique sur les thèmes suivants</b>",
peter_rabbit's avatar
peter_rabbit committed
                            tag: "div",
                            class: "practical-infos",
peter_rabbit's avatar
peter_rabbit committed
                            contents: [
peter_rabbit's avatar
peter_rabbit committed
                                    tag: "div",
                                    class: "info-item",
                                    contents: [
                                        {
peter_rabbit's avatar
peter_rabbit committed
                                            tag: "span",
                                            contents:
peter_rabbit's avatar
peter_rabbit committed
                                                "Si vous êtes intéressé pour proposer une de ces animations dans votre structure, contactez-nous pour un devis gratuit.",
peter_rabbit's avatar
peter_rabbit committed
                                    tag: "div",
                                    class: "info-item",
                                    contents: [
                                        {
peter_rabbit's avatar
peter_rabbit committed
                                            tag: "strong",
                                            contents: "Contact",
peter_rabbit's avatar
peter_rabbit committed
                                            tag: "span",
                                            contents: "04 75 78 08 72",
peter_rabbit's avatar
peter_rabbit committed
                                            tag: "a",
                                            href: "mailto:kuadrado-software@tutanota.com",
                                            contents: "kuadrado-software@tutanota.com",
peter_rabbit's avatar
peter_rabbit committed
                            tag: "ul",
                            class: "learning-themes",
                            contents: VULGARISATION_THEMES.map(li => {
                                return {
                                    tag: "li",
                                    class: "learning-theme " + li.class,
                                    contents: [
                                        { tag: "strong", class: "title", contents: li.title },
peter_rabbit's avatar
peter_rabbit committed
                                            tag: "div",
                                            class: "details",
peter_rabbit's avatar
peter_rabbit committed
                                            contents: [
                                                {
                                                    tag: "strong",
                                                    class: "title",
                                                    contents: li.title,
                                                },
peter_rabbit's avatar
peter_rabbit committed
                                                {
                                                    tag: "div",
                                                    class: "comment",
                                                    contents: li.comment,
                                                },
                                                {
                                                    tag: "ul",
                                                    contents: li.details.map(d => {
                                                        return {
                                                            tag: "li",
                                                            contents: d,
                                                        };
                                                    }),
                                                },
                                            ],
peter_rabbit's avatar
peter_rabbit committed
                        },
peter_rabbit's avatar
peter_rabbit committed
                    ],
                },
peter_rabbit's avatar
peter_rabbit committed
module.exports = Popularization;
peter_rabbit's avatar
peter_rabbit committed

},{"../../../../constants":2}],6:[function(require,module,exports){
"use strict";

const GameStudioClub = require("./components/game-studio-club");
peter_rabbit's avatar
peter_rabbit committed
const Popularization = require("./components/popularization");
peter_rabbit's avatar
peter_rabbit committed

class EducationPage {
    constructor(args) {
        Object.assign(this, args);
    }

    render() {
        return {
            tag: "div",
            id: "education-page",
            contents: [
                { tag: "h1", contents: "Pédagogie" },
peter_rabbit's avatar
peter_rabbit committed
                    tag: "p",
                    class: "edu-philo",
                    contents: `
                    Nous pensons que la démystification de la technologie et son appropriation par les utilisateurs passent 
                    avant tout par la pédagogie et le partage de connaissances. Nous proposons blablabla`,
peter_rabbit's avatar
peter_rabbit committed
                },
peter_rabbit's avatar
peter_rabbit committed
                new GameStudioClub().render(),
peter_rabbit's avatar
peter_rabbit committed
                new Popularization().render(),
peter_rabbit's avatar
peter_rabbit committed
            ],
        };
    }
}

module.exports = EducationPage;

peter_rabbit's avatar
peter_rabbit committed
},{"./components/game-studio-club":4,"./components/popularization":5}],7:[function(require,module,exports){
peter_rabbit's avatar
peter_rabbit committed
"use strict";

"use strict";
const runPage = require("../../run-page");
const EducationPage = require("./education");
runPage(EducationPage);

peter_rabbit's avatar
peter_rabbit committed
},{"../../run-page":8,"./education":6}],8:[function(require,module,exports){
peter_rabbit's avatar
peter_rabbit committed
"use strict";

const objectHtmlRenderer = require("./lib/object-html-renderer");
const Template = require("./template/template");

module.exports = function runPage(PageComponent) {
    const template = new Template({ page: new PageComponent() });
    objectHtmlRenderer.setRenderCycleRoot(template);
    objectHtmlRenderer.renderCycle();
};

peter_rabbit's avatar
peter_rabbit committed
},{"./lib/object-html-renderer":3,"./template/template":9}],9:[function(require,module,exports){
peter_rabbit's avatar
peter_rabbit committed
"use strict";

peter_rabbit's avatar
peter_rabbit committed
const { images_url } = require("../../constants");

peter_rabbit's avatar
peter_rabbit committed
const NAV_MENU_ITEMS = [
peter_rabbit's avatar
peter_rabbit committed
    ["/public/", "logo_kuadrado_s32.png; "],
peter_rabbit's avatar
peter_rabbit committed
    ["/public/games/", "Jeux"],
    ["/public/software-development/", "Software"],
    [
        "/public/education/",
        "Pédagogie",
        [
            // submenu
            ["/public/education/#game-studio-club", "Game Studio Club"],
            ["/public/education/#popularization", "Animations vulgarisation"],
        ],
    ],
];

peter_rabbit's avatar
peter_rabbit committed
class Template {
    constructor(props) {
        this.props = props;
    }

peter_rabbit's avatar
peter_rabbit committed
    renderMenu(menuItemsArray, isSubmenu = false) {
        const r = {
            tag: "ul",
            class: isSubmenu ? "submenu" : "",
            contents: menuItemsArray.map(link => {
peter_rabbit's avatar
peter_rabbit committed
                let [href, text, submenu] = link;
                const spltTxt = text.split(";");
                text = spltTxt.length > 1 ? spltTxt[1] : text;
                const img = spltTxt.length > 1 ? spltTxt[0] : undefined;
peter_rabbit's avatar
peter_rabbit committed
                return {
                    tag: "li",
                    class: !isSubmenu && window.location.pathname === href ? "active" : "",
peter_rabbit's avatar
peter_rabbit committed
                    contents: [
                        {
                            tag: "a",
                            href,
                            contents: img
                                ? [
                                      { tag: "img", src: `${images_url}/${img}` },
                                      { tag: "span", contents: text },
                                  ]
                                : text,
                        },
                    ].concat(submenu ? [this.renderMenu(submenu, true)] : []),
peter_rabbit's avatar
peter_rabbit committed
                };
            }),
        };
        return r;
    }

peter_rabbit's avatar
peter_rabbit committed
    render() {
        return {
            tag: "main",
            contents: [
                {
                    tag: "header",
                    contents: [
                        {
                            tag: "nav",
peter_rabbit's avatar
peter_rabbit committed
                            contents: [this.renderMenu(NAV_MENU_ITEMS)],
peter_rabbit's avatar
peter_rabbit committed
                        },
                    ],
                },
                {
                    tag: "div",
                    id: "page-container",
                    contents: [this.props.page.render()],
                },
                {
                    tag: "footer",
                    contents: [
                        {
                            tag: "a",
                            href: "mailto:kuadrado-software@tutanota.com",
                            contents: "kuadrado-software@tutanota.com",
                        },
                    ],
                },
            ],
        };
    }
}

module.exports = Template;

peter_rabbit's avatar
peter_rabbit committed
},{"../../constants":2}]},{},[7]);