Giter Site home page Giter Site logo

urdenko / print-wanted Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 36 KB

Joke about wanted criminal-friend

License: MIT License

TypeScript 52.79% JavaScript 12.54% HTML 18.43% CSS 16.24%
webcomponents webcomponent unistack print printable learn-to-code learning joke dom

print-wanted's Introduction

A prank about wanted criminal which you can print on the letterhead specifying anyone you knows.

This example help you understand or to recall principle of the web-components. Maybe you can find out some new about web-components or ways to print directly from web browsers.

How can you run it

The easiest way to run the example is do it in the Stackblitz. Just pick your stack:

  1. Run on Stackblitz using Angular
  2. Run on Stackblitz using React
  3. Run in mobile browsers

If you want to dive into code use the Webpack Dev Server inside the example via npm i && npm start

What want I point

  • You can use instance of web-component to directly work with its properties and methods. It's more convenient than use string attributes and DOM events.
  • Use *.d.ts Typescript file to describe interface of your web component in the package.
  • Yes, the web component can influence whole DOM of web page after call connectedCallback method. Use it with caution. In this example it have done as an exception to the normal.
  • This is a good example a "plug and play" architecture which is the web-component strong suit. The PrintWantedForm does not require further setting for print. You need just call print() method.
  • Native JS allowed me made difficult work with async load of Google fonts and fit a whole content into one print page regardless of count of words.
  • It is not hard to give up the dependencies and make a little package.
  • You may use render() method for the print yourself. For example, you can generate pdf on the server side using Puppeteer. Maybe it is difficult way but you will be sure to the expected outcome.

I hope this example will be useful to you!

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.