Giter VIP home page Giter VIP logo

expandable_preview_demo's Introduction

Overview

This puts miniaturized versions of webpages in iframes, which expand to fullscreen when clicked. They remain iframes at this point, their URLs distinguished from the original via a slug. Upon "back", they shrink back to original size.

Notes

  • [work.co] has a simpler situation going on, in which the new locations are not different sites in iframes, but merely different react components. This makes things simpler and faster, and makes sense in the context of different pages on the same site.
  • this method is super slow as it loads each entire site
  • it's possible to actually navigate to each site via window.location.replace; this will of course take time. A slicker plan would be to grab the html out of the iframe and replace the window html with it. I gave up on this after ten minutes due to CORS-related difficulties, although it looks possible.

Ideally this technique would be used as in the original example with content within the same web page.

A craftier approach for different domains

Assuming a finite number of them, and us being ok with their content appearing under your own domain, would be to

  • (a) use a thumbnail image,
  • (b) kick off ajax requests for the content of each page in componentDidMount, saving the resulting html to state, and
  • (c) swap in the already-downloaded html upon completion of the animation.

To run

npm run start

expandable_preview_demo's People

Contributors

sosaysthecaptain avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.