Html codes
184 subscribers
111 photos
15 videos
226 files
197 links
👋 Welcome to Html Codee
🚀 Here you’ll find mini tools, code snippets, and web tricks to grow fast.
🧩 Built with HTML, PHP, and smart ideas.
💌 Support: support@bestpage.x10.mx
🏁 If you don't walk today, run tomorrow.
Download Telegram
CodePen Blog
Chris’ Corner: Color Accessibility

I’ve been a bit sucked into the game Balatro lately. Seriously. Tell me your strategies. I enjoy playing it equally as much lately as unwinding watching streamers play it on YouTube. Balatro has a handful of accessibility features. Stuff like slowing down or turning off animations and the like. I’m particularly interested one of the checkboxes below though: https://blog.codepen.io/wp-content/uploads/2025/02/image-1024x471.png “High Contrast Cards” is one of the options. It’s a nice option to have, but I find it particularly notable because of it’s popularity. You know those streamers I mentioned? The all seem to have this option turned on. Interesting how an “accessibility feature” actually seems to make the game better for everybody. As in, maybe the default should be reversed or just not there at all, with the high contrast version being just how it is.

It reminds me about how half of Americans, particularly the younger generation, prefer having closed captioning on TV some or all of the time. An accessibility feature that they just prefer.

Interestingly, the high contrast mode in Balatro mostly focuses on changing colors. https://blog.codepen.io/wp-content/uploads/2025/02/image-1-1024x471.png If you don’t suffer from any sort of colorblindness (like me? I think?) you’ll notice the clubs above are blue, which differentiates them from the spades which remain black. The hearts and clubs are slightly differentiated with the diamonds being a bit more orange than red.

Is that enough? It’s enough for many players preferring it, likely preventing accidentally playing a flush hand with the wrong suits, for example. But I can’t vouch for if it works for people with actual low vision or a type of color blindness, which is what I’d assume would be the main point of the feature. Andy Baio wrote a memorable post about colorblindness a few years ago called Chasing rainbows. There are some great examples in that post that highlight the particular type of colorblindness Andy has. Sometimes super different colors look a lot closer together than you’d expect, but still fairly distinct. Where sometimes two colors that are a bit different actually appear identical to Andy. https://blog.codepen.io/wp-content/uploads/2025/02/Screenshot-2025-02-24-at-7.57.24 AM-1024x679.png So maybe the Balatro colors are enough (lemme know!) or maybe they are not. I assume that’s why a lot of “high contrast” variations do more than color, they incorporate different patterns and whatnot. Which, fair enough, the playing cards of Balatro already do.

Let’s do a few more fun CSS and color related links to round out the week:

* Adam Argyle: A conic gradient diamond and okLCH — I’m always a little surprised at the trickery that conic gradients unlock. Whenever I think of them I’m like uhmmmmm color pickers and spinners I guess?
* Michelle Barker: Messing About with CSS Gradients — Layered gradients unlocking some interested effects and yet more trickery.
* Michelle Barker: Creating color palettes with the CSS color-mix() function — Sure, color-mix() is nice for a one-off where you’re trying to ensure contrast or build the perfect combo from an unknown other color, but it can also be the foundational tool for a system of colors.
* Keith Grant: Theme Machine — A nice take on going from choosing nice individual colors to crafting palettes, seeing them in action, and getting custom property output for CSS.
🆒2
Fascinating Facts About Web Development 🌍💻
1️⃣ The First Website Still Exists!
Tim Berners-Lee, the inventor of the World Wide Web, created the first website in 1991. You can still visit it here: info.cern.ch.
2️⃣ HTML is Not a Programming Language
Unlike JavaScript or Python, HTML is a markup language—it structures content but doesn’t perform logic-based operations.
3️⃣ JavaScript Runs Everywhere
Initially designed for web browsers, JavaScript is now used for server-side development (Node.js), mobile apps, AI, and even game development.
4️⃣ CSS Can Animate Without JavaScript
With CSS animations and transitions, you can create smooth effects without writing a single line of JavaScript.
5️⃣ The Web Has Over 1.5 Billion Websites
However, only about 200 million are actively maintained. The rest are inactive or abandoned.
6️⃣ Google Ranks Speed as a Factor
Websites that load faster than 2 seconds have a better chance of ranking higher on Google. Performance is key!
7️⃣ Most Users Leave a Slow Website in 3 Seconds
If your website takes too long to load, visitors will bounce—meaning they leave before interacting.
8️⃣ Mobile-First is the New Standard
More than 60% of web traffic comes from mobile devices, so responsive design isn’t optional—it’s essential.
9️⃣ Dark Mode Saves Battery
On OLED screens, dark mode can reduce power consumption by up to 60%, making it both stylish and energy-efficient.
🔟 Hackers Attack Every 39 Seconds
Security is crucial in web development. Using HTTPS, secure passwords, and firewalls helps protect websites from attacks.
Which fact surprised you the most? 🚀
Blocking text selection and screenshot functionality in HTML and CSS can be challenging, as users can always find ways around such measures, like using another device to take a screenshot. However, you can implement certain features to deter casual users from copying text or screenshots on your web page.

📚 Block Text Selection

You can use CSS to disable text selection. This can be done by applying the user-select property:

.noselect {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera, and Edge */
}


Then, you can apply this class to the elements you want to protect:

<div class="noselect">
    This text cannot be selected or copied.
</div>


📚 Block Right-Click Context Menu

You may also want to block the right-click context menu to further discourage users from copying content:

<script>
    document.addEventListener('contextmenu', function(e) {
        e.preventDefault();
    });
</script>


📚 Using a Transparent Overlay

You can use a transparent overlay that covers your content, which can help deter screenshot capturing:

<div class="overlay"></div>
<div class="content">
    This is the content you want to protect.
</div>


And the associated CSS:

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5); /* Semi-transparent */
    z-index: 10; /* Higher than content */
    pointer-events: none; /* Let clicks go through */
}

.content {
    position: relative; /* Keep it above the overlay */
    z-index: 20; /* Higher than overlay */
}


📚 Additional Considerations

1. Watermarking: If you are concerned about images, consider watermarking them to deter unauthorized use.

2. Web Application Limitations: Blocked actions are not foolproof; tech-savvy users will still find ways to bypass these restrictions. Blocking text selection or right-clicking may frustrate some users, as they may want to copy text for legitimate use.

3. Legal Notice: Consider placing a copyright notice or terms of service on your site, which legally protects your content.

4. JavaScript Disabling: Keep in mind that users can disable JavaScript, which would allow them to copy text as normal.

📚 Final Note

While these methods can make it more challenging to copy content, it's essential to remember that no solution is entirely foolproof. The best approach is often to accept that some level of copying may occur and focus on providing valuable, unique content instead.
🚀 AI is Already Used by Billions! 🤖
AI is no longer the future—it’s the present! With billions of users relying on AI daily, how is it shaping our world? 🌎
🔥 Current Impacts:
Efficiency Boom – AI automates work, boosting productivity.
New Industries – AI-driven jobs and businesses are growing.
Job Displacement – Many roles are being replaced by automation.
Over-Reliance on AI – Critical thinking and creativity are at risk.
⚖️ The Big Question:
Is AI making life easier or slowly replacing human intelligence? 🤔
💬 What do you think? Is AI helping or harming society? Drop your thoughts below! 👇
🚀 Developers, this is a GAME-CHANGER! 🤯💻

Ever wished for an AI coding assistant that truly understands your code? Meet Qodo Gen – your smartest coding partner that helps you write cleaner, faster, and error-free code! 🔥

Code smarter, not harder – Get AI-powered suggestions
🛠️ No more debugging nightmares – Catch issues before they break your code
💡 Seamless IDE integration – Work without interruptions

💯 Upgrade your coding workflow now!

🔗 Try it out here 👉 https://www.qodo.ai/ 🚀
🎲 Quiz 'Web development'
🖊 5 questions · 15 sec
11th Physical Chemistry (1).html
84.7 KB
Problem: The .second-summary class was missing(in :Mathematics By VG Sir), causing the animation not to work. It has been fixed and now works correctly.
CodePen Blog
Chris’ Corner: PerformanCSS

How CSS relates to web performance is a funny dance. Some aspects are entirely negligible the vast majority of time. Some aspects are incredibly impactful and crucial to consider.

For example, whenever I see research into the performance of some form of CSS syntax, the results always seem to be meh, it’s fine. It can matter, but typically only with fairly extreme DOM weight situations, and spending time optimizing selectors is almost certainly wasted time. I do like that the browser powers that be think and care about this though, like Bramus here measuring the performance of @property for CSS Custom Property performance. In the end, it doesn’t matter much, which is an answer I hope they knew before it shipped everywhere (they almost certainly did). Issues with CSS syntax tend to be about confusion or error-prone situations, not speed.

But even though the syntax of CSS isn’t particularly worrisome for performance, the weight of it generally does matter. It’s important to remember that CSS that is a regular in the is render blocking, so until it’s downloaded and parsed, the website will not be displayed. Ship, say, 1.5MB of CSS, and the site’s performance will absolutely suffer for absolutely everyone. JavaScript is a worse offender on the web when it comes to size and resources, generally, but at least it’s loading is generally deferred.

The idea of “Critical CSS” became hot for a minute, meaning ship as little render blocking CSS as you can, and defer the rest, but that idea has it’s own big tradeoffs. Related to that, it absolutely should be easier to make CSS async, so let’s all vote for that. And while I’m linking to Harry, his The Three Cs: 🤝 Concatenate, 🗜️ Compress, 🗳️ Cache is a good one for your brain.

The times when CSS performance tends to rear it’s head are in extreme DOM weight situations. Like a web page that renders all of Moby Dick, or every single Unicode character, or 10,000 product images, or a million screenshots, or whatever. That way a box-shadow just has a crazy amount of work to do. But even then, while CSS can be the cause of pain, it can be the solution as well. The content-visibility property in CSS can inform the browser to chill out on rendering more than it needs to up front. It’s not the more intuitive feature to use, but it’s nice we have these tools when we need them.
ball.html
4.1 KB
3D Bouncing and Moving Ball
What codes are needed ?