A
A
Anuar Mendubaev2018-06-14 11:44:14
JavaScript
Anuar Mendubaev, 2018-06-14 11:44:14

How to make the copied minified react file work on another project?

Good afternoon!
There is a task - to copy animations from this site (mainly canvas).
The catch is that the entire js code of the site lies in one minified app.js file (of course, in addition to third-party libs), which contains React inside.
All content on the site appears after the initialization of the script in the footer:

window.onload = function () {
      window.Application.init();
      window.Application.load();
    };

Also, js events are hung on the tag . As I understand it, content loading is tied to the block . As it turned out later, all content (text, pictures) is also loaded from the app.js file, for example:<body>
<div class="root"></div>
function(e, exports) {
    e.exports = {
        data: [{
            title: ["Text"],
            clients: ["Asics", "Nike"]
        }, {
            projects: [{
                title: "Text",
                slug: "text",
                image_big: "images/home/image.jpg",
                image_small: "images/home/image.jpg"
            } etc...

I copied all the .js files that are present on the donor site and the desired html structure.
However, when I run the project, nothing happens.
Nevertheless, there are no errors in the console and this app.js inserts the only non-working canvas block at the end of the DOM, and events are not hung at all. Thank you all for your time <body>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2018-06-14
@Frunky

Look at the vendor libraries. Check out the demos that are freely available on the official website or on codepen . They may have been used on the site. You can try to look for the use of libraries in the code. There is no need to copy the entire project. And even more so to try to run.
Tree.js demo example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question