• Daily Sandbox
  • Posts
  • πŸ”₯ How to Become a Very Expensive Programmer

πŸ”₯ How to Become a Very Expensive Programmer

PLUS: Add a Vue 3 back-to-top button, automate browsers with JavaScript, and explore tools for animations, draggable sliders, and text comparison. Build a Blockchain App, Master CSS Size Units, and Optimize Node.js for Production

πŸ›©οΈ QUICK SUMMARY

Hello Developers!

Discover how to use CSS size units for smarter web design and learn what it takes to become a very expensive programmer. Get your Node.js app production-ready with our tutorial, automate your browser with 20 JavaScript scripts, and master WebSockets in Node.js.

Quick Wins:

  • Build a Blockchain App: Create a transactions app with React.

  • Vue 3 Back-to-Top Button: A 1-minute guide to add this handy feature.

Tools to Explore:

  • draggable-slider: Make carousels draggable on desktop while preserving native gestures.

  • Kinesis.js: Create animations driven by user interactions.

  • Diff Text: Quickly compare differences between two text blocks.

  • cherry-studio: A desktop client supporting multiple LLM providers.

Dive in and keep coding!

πŸŽ† NEWS, INNOVATIONS, TRENDS, TUTORIALS

πŸ’» TUTORIAL OF THE WEEK

Simple 1-Minute Guide to add a Back-to-Top Button with Vue 3

Adding a "Back-to-Top" button to your Vue 3 app can significantly improve user experience, especially on long pages. This button remains hidden until the user scrolls down a specified distance, then smoothly scrolls them back to the top when clicked.

What Makes It Great?

  • Scroll Detection: Monitors window.scrollY to determine when the button should appear.

  • Smooth Scrolling: Enhances navigation by animating the scroll action.

  • Modern UI: Sleek and minimalistic design that integrates seamlessly into any application.

The Code (Script Setup)

The script uses Vue's Composition API to manage the button's visibility and handle the scroll behavior.

<script setup>
const isVisible = ref(false); //Tracks the button's visibility

//Function to check scroll position and toggle visibility
const handleScroll = () => {
	isVisible.value = window.scrollY > 200; // Show when scrolled > 200px
};

//Smoothly scroll to the top of the page
const scrollToTop = () => {
	window.scrollTo({ top: 0, behavior: 'smooth' });
};

... //see full article for complete details
</script>

How It Works

  1. Scroll Detection: A scroll event listener checks if the user has scrolled more than 200 pixels. If true, isVisible becomes true, displaying the button.

  2. Smooth Scroll: Clicking the button triggers the scrollToTop function, which uses window.scrollTo with a behavior of smooth.

  3. Lifecycle Hooks: onMounted and onBeforeUnmount ensure that event listeners are properly managed to prevent memory leaks.

πŸ€– AI GENERATED, OR REAL?

What do you think?

Login or Subscribe to participate in polls.

🧰 CODING TOOLBOX

  • draggable-slider - a small lib that makes carousels draggable on desktop while keeping native wheel / scroll gestures

  • Kinesis.js - A library that offers a suite of components to create engaging animations and transformations based on user interactions like mouse movements, scroll events, and even audio input.

  • Diff Text - A simple diff checker tool to quickly find the difference between two blocks of text.

  • cherry-studio - a desktop client that supports for multiple LLM providers

🀣 CTRL + LOL <JOKES ONLY PROGRAMMERS WILL GET />

A programmer puts two glasses on his bedside table before going to sleep.

<A full one, in case he gets thirsty, 

&& an empty one, in case he doesn’t./>

πŸ“£ HELP SPREAD THE WORD 

πŸš€ Spread the Code! Love what you read? Share the newsletter with your fellow devs - every recommendation helps power up the community.

πŸ’» Sponsor the Dev Journey! Keep the bytes flowing and the newsletter growing by becoming a sponsor. Your support helps maintain this valuable resource.

πŸ’¬ Tweet the Deets! Share the latest with your code crew - let’s make this viral, not just a bug!

🎁 FREE RESOURCES FOR DEVELOPERS!! ❀️😍πŸ₯³ (updated daily)

  • 1400+ HTML Templates

  • 440+ News Articles

  • 81+ AI Prompts

  • 376+ Free Code Libraries

  • 38+ Code Snippets & Boilerplates for Node, Nuxt, Vue, and more!

  • 25+ Open Source Icon Libraries

Visit dailysandbox.pro for free access to a treasure trove of resources!

(use your email to login)

πŸ› οΈ SUGGEST A TOOL

If you have built anything that you’d like to share with the community, get with me on X @dailysandbox_ πŸ˜€ 

Reply

or to participate.