examples/dom/html_like.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<chrono>//foroperator""s,chrono_literals
    #include<ftxui/screen/screen.hpp>//forScreen
    #include<iostream>//forcout,ostream
    #include<string>//forallocator,operator<<,string
    #include<thread>//forsleep_for

    #include"ftxui/dom/elements.hpp"//forparagraph,text,operator|,Element,border,Fit,color,hflow,spinner,vbox,bold,dim,underlined
    #include"ftxui/dom/node.hpp"//forRender
    #include"ftxui/screen/box.hpp"//forftxui
    #include"ftxui/screen/color.hpp"//forColor,Color::Red

    intmain(){
    usingnamespaceftxui;
    usingnamespacestd::chrono_literals;

    autoimg1=[](){returntext("img")|border;};
    autoimg2=[](){returnvbox({text("big"),text("image")})|border;};

    std::stringreset_position;
    for(inti=0;;++i){
    autodocument=//
    hflow(
    paragraph("Helloworld!Hereisanimage:"),img1(),
    paragraph("Hereisatext"),text("underlined")|underlined,
    paragraph("Hereisatext"),text("bold")|bold,
    paragraph("Helloworld!Hereisanimage:"),img2(),
    paragraph(
    "LeLoremIpsumestsimplementdufauxtexteemployédansla"
    "compositionetlamiseenpageavantimpression.LeLorem"
    "Ipsumestlefauxtextestandarddel'imprimeriedepuisles"
    "années1500,quandunimprimeuranonymeassemblaensemble"
    "desmorceauxdetextepourréaliserunlivrespécimende"
    "policesdetexte.Iln'apasfaitquesurvivrecinqsiècles,"
    "maiss'estaussiadaptéàlabureautiqueinformatique,sans"
    "quesoncontenun'ensoitmodifié.Ilaétépopularisédans"
    "lesannées1960grâceàlaventedefeuillesLetraset"
    "contenantdespassagesduLoremIpsum,et,plusrécemment,"
    "parsoninclusiondansdesapplicationsdemiseenpagede"
    "texte,commeAldusPageMaker."),
    paragraph("Hereisatext"),text("dim")|dim,
    paragraph("Helloworld!Hereisanimage:"),img1(),
    paragraph("Hereisatext"),text("red")|color(Color::Red),
    paragraph("Aspinner"),spinner(6,i/10))|
    border;

    autoscreen=Screen::Create(Dimension::Fit(document));
    Render(screen,document);
    std::cout<<reset_position;
    screen.Print();
    reset_position=screen.ResetPosition();

    std::this_thread::sleep_for(0.01s);
    }

    return0;
    }