This file contains hidden or 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
| litecanvas({}) | |
| function init() { | |
| framerate(1) | |
| } | |
| function draw() { | |
| cls(0) | |
| // linedash([10,5]) | |
| // circ(W/2, H/2, 150, 2) |
This file contains hidden or 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
| litecanvas({ | |
| width: 320, | |
| autoscale: false | |
| }) | |
| let offset = 0 | |
| let pos = vec(10, 10) | |
| function tapped(x, y) { | |
| vecSet(pos, x, y) |
This file contains hidden or 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
| let pos = {}, | |
| speed = 100, | |
| ts = 32, | |
| bg | |
| litecanvas({ | |
| width: 320, | |
| autoscale: 0 | |
| }) |
This file contains hidden or 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
| # BEGIN HOTLINK PROTECTION | |
| RewriteEngine on | |
| RewriteCond %{HTTP_REFERER} !^$ | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC] | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC] | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing.com [NC] | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo.com [NC] | |
| RewriteRule \.(jpg|jpeg|png|gif|svg)$ - [NC,F,L] |
This file contains hidden or 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
| litecanvas({ | |
| width: 320, | |
| autoscale: false | |
| }) | |
| const J = 340 // jump force | |
| const G = 550 // gravity | |
| const TS = 32 // tile size | |
| const p = { | |
| pos: vec(32,0), |
This file contains hidden or 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
| /** | |
| * Catch browser errors. Useful while developing. | |
| * | |
| * @author Luiz Bills <[email protected]> | |
| * @licese MIT | |
| * @version 1.2 | |
| * | |
| * @param {(message: string, event: Event) => void} callback A function called when an error happens | |
| * @returns {function} A function to remove the event listeners | |
| */ |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <link | |
| rel="stylesheet" | |
| href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css" | |
| > |
This file contains hidden or 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
| let str = "" | |
| litecanvas() | |
| // create a invisible input | |
| const input = document.createElement("input") | |
| document.body.append(input) | |
| input.style.cssText = "position:absolute;transform:translate(-99999px,-99999px)" | |
| function tapped(tapx, tapy) { |
This file contains hidden or 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 date = () => { | |
| const offset = (new Date()).getTimezoneOffset() | |
| return new Date(Date.now() - (offset*60*1000)).toISOString().split('T')[0] | |
| } |
NewerOlder