This is a library for MADE LABORATORY. It's include MADE Lab font to any website. Insert the following code into the head section of your website.

JS

JS .min

Load Font Only

Load Font Only .min

DEV Docs

/** 
* NAME: MADE LABORATORY JS LIBRARY
* AUTHOR: NGUYEN PHAM
* VERSION: 1.0.0
* //////////////////////////////////////////
* function:  
* - load font only
* <script src="https://js.madelaboratory.net/js/madelab.prod.js?loadFont=true"></script>
* - load font and ads
* <script src="https://js.madelaboratory.net/js/madelab.prod.js"></script>
* //////////////////////////////////////////
* **/

CORS

For default, the website will be blocked by CORS policy. You need to add this code to your server config.

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "*"
Header set Access-Control-Allow-Credentials "true"
Header set Access-Control-Expose-Headers "*"
Header set Access-Control-Allow-Methods "GET, CONNECT, PUT, OPTIONS, PATCH, HEAD, POST, DELETE, TRACE"

Read more: https://www.stackhawk.com/blog/fixing-no-access-control-allow-origin-header-present/

Functions

This script will be add MADE_APP variable to window object (window.MADE_APP = MADE_APP;). It's include:

  • variable MADE_APP
  • app_version 1.0.0
  • app_url https://madelab.io/
  • checkQuery()
  • initFonts()
  • initSTYLE()
  • initHTML()
  • changeThemeBrowser()
  • init()

Events

  • addEventListener DOMContentLoaded
  • window onload

We are using DOMContentLoaded and window.onload event to load the font. If you want to load by hand, you can use MADE_APP.init(); function.

Source Code

https://js.madelaboratory.net/madelab.js

Copy right by MADE LABORATORY