todepond / habitat Goto Github PK
View Code? Open in Web Editor NEWmy javascript helpers
License: MIT License
my javascript helpers
License: MIT License
Colour objects should have read-only hue
, saturation
and lightness
values. Maybe they should be accessible with h
, s
and l
as well.
This issue comes from: #19
There are some issues when making a canvas with the HTML
function.
Add the TodePond colours maybe? Or should it be in its own repo?
eg: Random.from
isn't there
eg: Array.prototype.shuffle()
-> shuffleArray(array)
Optional new while we're at it:
When you try to use habitat in a web worker, it has issues because of document
the launch
and land
options do the opposite of what they should.
It would be useful if Colour objects had named rgb properties
Similar to JavaScript
and HTML
, it would be great to be able to call WebGL
somehow.
const Player = struct ({
name: undefined,
score: 0,
health: 10,
})
const lu = Player({name: "Lu", score: 5})
Object.prototype.values()
and similar functions should return an iterable, not an array, so that it has parity with how Map.prototype.values()
etc works.
Auto function memo-iser
It would be handy to have a version of Colour.make
that doesn't do all the heavyweight calculations of the current one. Sometimes you wanna make colours on the fly, and the current one is very slow.
I made some little helper functions to help me work with webassembly in my 'Scale' video. It would be useful to have them in the Habitat library.
https://github.com/TodePond/BigPond/blob/93fa001b4bfb0f66e20cc63fe18a0df18a52f983/7c/script.js#L31
It would be useful to have clamp
and wrap
functions as I end up remaking them a lot. Not sure if they should just be globals (bold move!?) or like... Math.clamp
?
Make a tween or animate function that lets you gradually change a variable's value over time.
let height = 10
tween(height, {from: 2, to: 8})
Provide some global state for tracking pointer events, similar-ish to Mouse
. Use the opportunity to reconsider Mouse
and Touch
/Touches
because they're a bit clumsy.
Including basics of building the bundle Frogasaurus-style.
And where to put specific bits of code, eg: exports, globals, etc
Linked with #36
I make this construct so often it would be good to make it
It would be great to have a function that turns webassembly text format into native code.
const scores = {english: 2, maths: 5, science: 3}
const results = scores.map((value) => value > 3? true : false)
print(results) // {english: false, maths: true, science: false}
There should be a function to cache all splash colours
if you make from
something other than zero, it still tweens from zero, and other stuff goes weird
Colour objects should have read-only cyan
, magenta
, yellow
, and key
properties. And maybe c
,y
,m
,k
properties too.
This issue comes from: #19
(instead of a string literal)
It's annoying to use in its current state!
This breaks habitat-import.js
It messes with the global scope too much. I don't really use it ever anymore. Get rid of it?
It has a special place in my heart though because it's silly. Maybe I should move it (and other silly JS ideas) into their own esoteric project!
if you don't specify to
or from
args, then it bugs out
If to
and from
are the same, it goes wrong
I hate trigonometry. I can't even spell it.
I want some helper functions that use non-maths language to help me out.
The tween function is messy and dodgy. Redo!
Stage does too much in some ways. eg: I don't want it to have its own tick/draw/update functions! However, it does too little in other ways. eg: It doesn't auto-resize, and it doesn't have background colour, or overflow settings, or margin. It should be rewritten so that it focuses more on its HTML and less on its javascript.
A simple linked list maker would be handy.
There should be a rough guide for the principles/goals/style of the Habitat library, so that it is easier for people (including me) to contribute to the library!
Copy some stuff over from the ScreenPond code
An error appears when you touch the screen. Something's broken.
Related to #36
This would make editing/adding to Habitat a lot easier
Copy over some stuff from the ScreenPond code
The tween
function has lots of good functionality now. It has grown to be more complicated. Maybe we could try to simplify it down into smaller pieces. The one function does a few different things:
launch
and land
options)Here's a wishlist I would have:
Tween
object, like Tween.EASE_IN_CIRCULAR
or something. Then the tween
function would only do one thing: accept an ease function. No strings, or default launch/land behaviour.Those are my loose + messy thoughts!
Function that converts JSX to element(s)
And spoof a React
object to hijack the default deno JSX factory
It would be great if there were some functions available for Colour objects that let you adjust brightness/saturation/etc...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.