Either add the class and the line global.console = new Console()
in your main file, or put it in another folder and require/import the file in your main file.
Basically, in your main file you add require('path/to/the/file/console.color')
.
It will allow you to use the command console.color(<string>)
anywhere.
Colors are used the same way as minecraft: &<code>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const video = document.createElement('video') // video element to then ask for pip | |
// we can't use display = 'none' cause else, pip is blank | |
video.style.width = '0' // hides it so it doesn't destroy the flow, and shows ONLY the pip | |
video.style.height = '0' // hides it so it doesn't destroy the flow, and shows ONLY the pip | |
video.playsInline = true // useful, but not an obligation | |
video.autoplay = true // obligation | |
video.muted = true // useful, but not an obligation | |
const canvas = document.createElement('canvas') // creates the canvas in which we'll put the image | |
canvas.style.display = 'none' // hides it so it doesn't destroy the flow, and shows ONLY the pip | |
const ctx = canvas.getContext('2d') // get the 2d context of it |
English Version: Click me
Dans ce guide, nous allons explorer la création et la gestion des fenêtres avec JavaScript. Vous apprendrez comment créer des fenêtres avec des dimensions précises, positionner et déplacer des fenêtres, et en connaître les limitations. Vous trouverez ci-dessous la table des matières pour vous aider à naviguer facilement dans ce guide.