#JS
I've got no idea how up-to-date it is (and I know it's a bit older), but this is probably one of the cleanest walkthroughs #react I've worked through.
https://www.taniarascia.com/getting-started-with-react/
I don't work in the front end at all, so having something that's accessible even with my limited time is a huge benefit.
Gonna use it as a jumping off point to more modern React, and front end in general.
TIL that `console.table()` exists. 😲
:kitten: Just merged an improved slots implementation to main and you can now pass CSS class lists to components. 🎉
Read more:
Slots:
https://codeberg.org/kitten/app#slots
Layout components:
https://codeberg.org/kitten/app#layout-components
Passing CSS class lists to components:
https://codeberg.org/kitten/app#layout-components
Named slots:
https://codeberg.org/kitten/app#layout-components
Sample project:
https://codeberg.org/kitten/app/src/branch/main/examples/layout
#Kitten #SmallWeb #templating #layout #components #web #dev #html #css #js
ThumbHash: A very compact representation of an image placeholder. Store it inline with your data and show it while the real image is loading for a smoother loading experience. Similar to BlurHash. #WebPerf #JS
https://evanw.github.io/thumbhash/

I didn't expect that day to come... iOS 16.4 will support #WebPush 🥳😱
This will be one big step into fully supporting #ProgressiveWebApps on all major platforms.
And lot more features all people in #WebDevelopment have waited for: https://webkit.org/blog/13966/webkit-features-in-safari-16-4/

WDRL 310
4-day Work Weeks, Awesome CSS, Image Performance, and Type-safe APIs.

![// Change text selection in document
document.onselectionchange = () => {
/* HACK[id=safari-selection] In Safari, clicking a button clears the text
selection. Because the Pelicanizer relies on the text selection being
preserved upon clicking a button, we have to find some way to preserve the
text selection.
To work around this, every time the text selection changes, we save all text
selection ranges (only Firefox supports multiple ranges, but just in case),
and whenever a Hide/Toggle/Show button is clicked, we clear the text selection
(again, just in case) and store the saved ranges back into it.
*/
const sel = window.getSelection();
// If selection type isn't Range or selection has 0 ranges
if (sel.type !== "Range" || sel.rangeCount === 0)
{
// We aren't selecting anything
lastSelectionRanges = null;
return;
}
// Collect all ranges in selection
lastSelectionRanges = [];
for (let i = 0; i < sel.rangeCount; i++)
{
lastSelectionRanges[i] = sel.getRangeAt(i);
}
};](https://s3.eu-central-2.wasabisys.com/mastodonworld/cache/media_attachments/files/110/095/525/552/289/681/small/a3162bb8899d2bad.png)
![// Helper function for "___ Selected" buttons
function buildSelectedButtonHandler(action) {
return () => {
// Clear text selection
const sel = window.getSelection();
sel.removeAllRanges();
// Add back ranges from last selection
// LINK #safari-selection
for (const range of lastSelectionRanges ?? [])
{
sel.addRange(range);
}
const letters = getSelectedElements()
.filter(nodeIsVisible)
.filter(n => n.classList.contains(PELICAN_LETTER_CLASS));
// If there are no letters, do nothing
if (!letters.length) return;
shouldRegenerateImage = true;
letters.forEach(n => {
n.classList[action](PELICAN_LETTER_HIDDEN_CLASS);
});
};
}
// Click "___ Selected" buttons
hideButtonEl.onclick = buildSelectedButtonHandler("add");
showButtonEl.onclick = buildSelectedButtonHandler("remove");
toggleButtonEl.onclick = buildSelectedButtonHandler("toggle");](https://s3.eu-central-2.wasabisys.com/mastodonworld/cache/media_attachments/files/110/095/525/633/804/308/small/d86cb7c9bf2745d3.png)
Just saw this on Twitter account of @donavon
Saw it, wanted to share also here 🤡
> I saw this code in the wild. It doesn't fail, but 🤦♀️
> Do you see it?

Follow Me! #introduction
#oregon #pdx #pnw #portland #sanFrancisco #sf #arkansas #cannabis #coffee #cycling #bike #eBike #fungi #mushrooms #unreal #videoGames #gaming #vr #retroGaming #rg35xx #sega #web #css #developer #frontEnd #fullStack #html #javaScript #js #webApps #webDev #aws #customElements #cypress #devops #graphql #lit #pwa #react #reactjs #serverless #shadowDom #webComponents #web3 #activityPub #bitcoin #blockchain #btc #crypto #cryptocurrency #filecoin #helium #hnt #icp #ipfs
RT simey
the @CodePen #codepen #challenge is about Expanding Buttons ... Well here's the Expanding Brain meme (Galaxy Brain) in button format.
The code is a mess, don't look.
https://codepen.io/simeydotme/pen/jOveeBg
#webdev #css #js #frontend #FrontEndDeveloper
:sys_twitter: https://twitter.com/simeydotme/status/1638858415895109634
I'm feeling unimpressed with Yarn/Npm incompatibilities this morning. Overrides vs resolutions, wut? #js #javascript

In case you need to solve some quartic equations: https://www.mdpi.com/2227-7390/10/14/2377
Tried for days to get a JS quartic solver running for all cases in my geometry tool. All methods had issues. Maybe due to wrong implementations... Most descriptions I found weren't written that clearly for all cases. Then I found the linked paper. Easiest to implement and most stable without getting into numerical stuff! Only used the largest abs. value cube root instead of an arbitrary one #js #math
The brilliant Josh Comeau shares: "The End of Front-End Development" [not]
https://www.joshwcomeau.com/blog/the-end-of-frontend-development/ #CSS #AI #JS

The brilliant Josh Comeau shares: "The End of Front-End Development" [not]
https://www.joshwcomeau.com/blog/the-end-of-frontend-development/ #CSS #AI #JS

Trying ai.com to write a piece of date code for me for the first time (I hate working with dates!) and this seems right! (apart from the return statements…)
Prompt: `javascript code to return true if the date "2023-03-10T14:45:04Z" is two weeks or older `
alt: https://gist.github.com/blackspike/7c57b80fc747721e739b88b11256e50c

The anatomy of a javascript error. :blobaww: Helpful article about javascript error handling and throwing.
#javascript #js #errorhandling #errorthrowing #bookmark #fueraufmklo
UI Dev Newsletter is all about HTML, CSS, JS, UI, UX, and a11y, and it has a new design!
Stay ahead of the latest UI Dev news, and get a shiny list of up to ten free links every second Monday.
https://www.silvestar.codes/side-projects/ui-dev-newsletter/
New article: With or without the JS framework
Is it really that unusual for a frontend developer not to use a JS framework?
https://www.silvestar.codes/articles/with-or-without-the-js-framework/
Added lines and polygons to my JS geometry tool! Was inspired by a tweet to make a demo to test out those new features. Basically one way to find the shape of the ground when you don't have access to geometry, but maybe a raycast. I suppose this is similar to how some games do it (not a game dev lol). Video shows some "sensors" looking down. The intersections are then combined as segments (green), closest points line (red), convex hull (blue area), and steepest incline (dashed line). #js #math

Okay so, I have a webpage that just uses only CSS variables for its colors, and all the elements have a transition for the background color
When changing the theme, I simply swap out an attribute value in the HTML element for the CSS selector that contains the CSS variables for the corresponding theme
However, while changing themes, the CSS transitions just don't seem smooth at all on mobile... Meanwhile on other websites that do similar don't have this issue
I'm confused :blobfoxnotlikethis:
#js #javascript
Soooo, anyone who have had a problem using .append() or another js method in a recursion? I have (ugly) complicated nested functions and they are going perfectly fine for a full loop and than there's that .append() method going completely crazy, although it was fine in the first loop.
It doesn't create the <div> that I'm trying to create, therefore I'm not able to get the <div> in jQuery by id, and therefore it fucks up everything afterwards. Aaaaand than the <div> magically appears on the screen, although I'm not able to get to it on the back end. Also, I don't think that should be a problem but I thought it's worth mentioning, I use a full stop (.) in the id I use for the <div> in question I'm trying to create.
Also, sorry for the painful poor explanation, I'm just completely confused what the f is happening, so yeah, I found it hard to find good words to explain it.
UPDATE: it was the full stop 🤡
Just enabled the Live Demo, check it out https://plrang.github.io/CHIP8-Interpreter-Vanilla-Javascript/ #chip8 #js #javascript #emulator #interpreter #spaceinvaders #retrogames #codingisfun #vanillaJS
After a recent involuntary team change at work I want to update my #JS/#TS/#CSS/#React knowledge to ingest all the big changes from the last 3 years since I stopped working on web related projects. Any sites/books/projects recommendations beyond beginner level?
RT @cyberghost
Personal websites/blogs that have a simple and clean layout and work with Tor using the safest option (JavaScript disabled):
Thank you ❤️
Personal websites/blogs that have a simple and clean layout and work with Tor using the safest option (JavaScript disabled):
Thank you ❤️
til about https://github.com/tc39/proposal-change-array-by-copy, and that it's stage 4
no more .slice().sort()!! #js
https://npmjs.com/set-cookie-parser now supports fetch()'s new getSetCookie() API, to provide easier and more reliable access to uncombined Set-Cookie headers.
(Multiple Set-Cookie header values were combined into a single comma-separated string previously, which is tricky to parse since the values can also contain commas!)
#Node.js supports the API, #deno has an open PR, and hopefully #ReactNative will roll out support sometime soon.
See https://github.com/whatwg/fetch/pull/1346 for more.
Alternatives to #Handlebars:
Mustache: zero dependencies, and dead simple. Too simple? Being logic-less means that conditionals and loops are pre-cooked, and that may limit options.
Pug: main advantage and main drawback: its concise but idiosyncratic syntax, similar to that of #Slim — which I know and have used in the past, but is too much of a departure from #HTML.
EJS: similar to Handlebars, simple but apparently versatile. Documentation isn’t great.
:javascript: #JS #JavaScript :node: #Node.js #Node
Alternatives to #Express:
Koa, which can either replace or complement both Express and Connect.
Fastify, which looks straightforward and very similar to Express. Plugin for templating (supporting Handlebars, Mustache, Pug and EJS): @fastify/view.
NestJS, which seems too convoluted and probably redundant since it works on top of either Express or Fastify (?).
Meteor: more of a platform. No tutorial for vanilla JS (only for React, Vue, etc), and not oriented towards SSR.
I’ll probably go for #Koa or #Fastify.
:javascript: #JS #JavaScript :node: #Node.js #Node
What should I use instead of #Express and #Handlebars for a web application in Node.js in 2023? Can someone summarise pros and cons of the most popular alternatives? I see way too many…
"Ain't it fun
Living in the real world"
Where the #documentation for the #JS browser project was written for the #C/C++ project.
"Ain't it good?
...
So what are you gonna do
When the world don't orbit around you?"
😂 I actually kind of enjoy the challenge, but it does make things much more time consuming.
🔗 A good reminder from @andy why #performance matters: https://andy-bell.co.uk/this-is-why-performance-matters/ #webdev #js
I've upgraded all the bitrot on my blog and it's nice to see that the #JS ecosystem is just as easy in the ways it's easy and hard in the ways it's hard as it's always been.
More proof that Stackoverflow starts negging you if you stop answering questions for 10 years or so. #js


And the most random assortment of buttons to summon Satan https://codepen.io/thebabydino/pen/eYYyqZR
Fun fact: first made this for a conference talk. Upon arriving there, discovered the venue was a church. One of the paintings there crashed with a loud noise during my talk.
https://twitter.com/anatudor/status/1197923211347931138
Requires support for registering custom properties via @ property.
#CSS #JS #CodePen #webDev #button #buttons #control #controls #coding #webDevelopment #mask #svg #satan
Plus:
✨ an old download button https://codepen.io/thebabydino/pen/xZxyPb
✨ an animated version https://codepen.io/thebabydino/pen/VwzpMxV (Chromium only) of the candy ghost buttons I wrote about a few years back on CSS-Tricks: https://css-tricks.com/css-ing-candy-ghost-buttons/
#CSS #JS #CodePen #webDev #button #buttons #control #controls #coding #webDevelopment #mask #pastel
Some XOR effect close buttons for some random quotes https://codepen.io/thebabydino/pen/VwmQQwJ
The basic idea behind is something I recorded myself coding from scratch https://codepen.io/thebabydino/pen/bGBLXEy
The concept behind the XOR is something I explaine in this @css article https://css-tricks.com/taming-blend-modes-difference-and-exclusion/
#CSS #JS #blending #CodePen #webDev #button #buttons #control #controls #coding #webDevelopment
Tauri Mobile - Develop mobile apps with JavaScript and Rust
🦀 https://studioterabyte.nl/en/blog/tauri-mobile-app-development
--
#dev #develop #rust #rustlang #javascript #js #webdev #app #mobile
So we must scale down edges along the y axis post-skew in order to get a rhombus again!
This scaling factor is the cosine of the skew angle, which doesn't change linearly with a linear change in the angle from -90° to 90°. We can approximate the change with cubic-bezier, but we can't use individual transform properties as those would place the skew after the scale.
So when I first coded this 5 years ago, I chose to use #JS.
#css #transform #maths #trigonometry #CodePen #webDev #coding
There's also this square tiling https://codepen.io/thebabydino/pen/JjBEzMQ
This is a pure #CSS version of something I coded with #JS a few years back https://codepen.io/thebabydino/pen/JNZGwE/
If you look at the orange squares, they get squished to rhombi & eventually to a line (then they go back).
This is done with skew along the x axis. But the way this works https://codepen.io/thebabydino/full/JoQRdb means edges along the other axis (y) get longer & we don't have a rhombus (all 4 edges equal) anymore!
Meanwhile, in WEBDEV-134, we have the classic "error I don't know the cause of". #js #javascript
Here it is. I have been thinking about this for so long. And in a recent conversation that I had, I finally decided to actually write the post:
https://helloyes.dev/blog/2023/craft-vs-industry/
This is not a happy post. But it is attempting to provide words where they might be needed.
There is the job and the craft of making websites. What if we consider them separate identities with separate concerns?
Thank you to @darth_mall, @sebastianlaube, @sarajw, @ItsCrisDiaz, @nshki, @mnmlst and @m2m
If you don't think that #ReactJS has improved #DX then I don't think you have done much #development; with or without it.