Friday, November 22

Author: phpInfo

Monthly Web Development Update 8/2018: The Cost Of JavaScript, Ethics In Open Source, And QUIC
Web Tricks

Monthly Web Development Update 8/2018: The Cost Of JavaScript, Ethics In Open Source, And QUIC

Monthly Web Development Update 8/2018: The Cost Of JavaScript, Ethics In Open Source, And QUICMonthly Web Development Update 8/2018: The Cost Of JavaScript, Ethics In Open Source, And QUIC Anselm Hannemann 2018-08-17T11:57:10+02:00 2018-08-17T11:59:10+00:00 Building technology and software has become a very responsible job. People trust the products we create, and they can have a significant impact on their lives, too. Considering this, we not only need to think about inclusive solutions, but also stand up and advocate for ethics, reliability, and security. It’s a position that gives us power. Eric Meyer published an article elaborating the problems which an H...
Working with refs in React
CSS Tricks

Working with refs in React

Refs make it possible to access DOM nodes directly within React. This comes in handy in situations where, just as one example, you want to change the child of a component. Let’s say you want to change the value of an <input> element, but without using props or re-rendering the whole component. That’s the sort of thing refs are good for and what we’ll be digging into in this post. How to create a ref createRef() is a new API that shipped with React 16.3. You can create a ref by calling React.createRef() and attaching a React element to it using the ref attribute on the element. class Example extends React.Component { constructor(props) { super(props) // Create the ref this.exampleRef = React.createRef() } render() { return ( <div> // Call t...
Web Tricks

Debugging Angular CLI Applications in Visual Studio Code

Debugging Angular CLI Applications in Visual Studio Code In this post, we are going to create an Angular CLI application, then add configuration to debug it in Visual Studio Code. Watch on YouTube TLDR - For an Angular CLI application, create a debug configuration in VS Code, install the Debugger for Chrome extension, then run in debug mode. Debugging Angular CLI Applications in Visual Studio Code Creating a Starter Project Creating Debug Configuration Let's Debug Learn VS Code If you're interested in learning more about VS Code, you definitely want to check out the upcoming Learn VS Code course. Creating a Starter Project To be able to test an Angular CLI application, you need an Angular CLI application :) I'll provide the basic steps, but for more reference on how to get start...
Web Tricks

Building a Portfolio Carousel with Synchronized Sliders

Undoubtedly, one of the fundamental sections that every personal or business website must have is a Portfolio. In this section the most outstanding works are generally shown, becoming a showcase of our potential. As well as having a Portfolio full of good works that endorse our performance, the design and functionality of it helps a lot to impress a potential client. For this reason, many of us choose to develop unique Portfolios, with amazing designs and great functionality. Without further ado, in this tutorial we invite you to develop this elegant and functional Portfolio to get the attention of your potential clients: The original design belongs to Francesco Zagami, and is published in Dribbble. If you follow this tutorial, you will see that it is not very complicated to achieve, espe...
Building Battleship in CSS
CSS Tricks

Building Battleship in CSS

This is an experiment to see how far into an interactive experience I can get using only CSS. What better project to attempt than a game? Battleship seemed like a good challenge and a step up from the CSS games I’ve seen so far because it has the complexity of multiple areas that have to interact with two players. Wanna see the complete game? View Repo View Demo Oh, you wanna learn how it works? Let’s dig in. I could tell right away there was going to be a lot of repetitive HTML and very long CSS selectors coming, so I set up Pug to compile HTML and Less to compile CSS. This is what all the code from here on is going to be written in. Interactive elements in CSS In order to get the game mechanics working, we need some interactive elements. We’re going to walk through each one. HTML che...
CSS Tricks

​Task management has never been easier

(This is a sponsored post.)monday.com is a team management tool that is exceptionally suitable for any industry sector and by any sized team. It will perfectly serve a team of two or a team of hundreds spread around the globe, and it can manage multiple projects at once. monday.com promotes effortless collaboration and transparency, it's "cheetah fast," it displays status in as many as 20 different colors, and its status board can be customized to fit your needs and your workflow. It serves as an excellent alternative to having to force fit your work to meet the demands of your project management tools or systems. Direct Link to Article — PermalinkThe post ​Task management has never been easier appeared first on CSS-Tricks. Source: CSS-tricks.com
Google Tag Manager

Get More Data About a User with JavaScript Variable

Before we continue This guide will not be one of those where “copy-paste” will work. Every website/web app has its own unique structure, therefore, what works on one site, might not work on another. The goal of this blog post is to show you the possibility and the workflow to make this technique work. However, there is always a chance of failure. What is JavaScript Variable? A quick refresher. If you haven’t read it, please go and check this guide first. Before we start digging deeper, you need to learn about the scope. In JavaScript, there are two types of scope: Local scope Global scope Variables declared within a JavaScript function, become LOCAL to the function, meaning that they are not accessible (visible) from outside the function. Take a look at the example belo...
CSS Tricks

Understanding why Semantic HTML is important, as told by TypeScript

What a great technological analogy by Mandy Michael. A reminder that TypeScript... makes use of static typing so, for example, you can give your variables a type when you write your code and then TypeScript checks the types at compile time and will throw an error if the variable is given a value of a different type. In other words, you have a variable age that you declare to be a number, the value for age has to stay a number otherwise TypeScript will yell at you. That type checking is a valuable thing that helps thwart bugs and keep code robust. This is the same with HTML. If you use the <div> everywhere, you aren’t making the most of language. Because of this it’s important that you actively choose what the right element is and don’t just use the default <div>. And hey, i...
CSS Tricks

Creating the “Perfect” CSS System

My pal Lindsay Grizzard wrote about creating a CSS system that works across an organization and all of the things to keep in mind when starting a new project: Getting other developers and designers to use the standardized rules is essential. When starting a project, get developers onboard with your CSS, JS and even HTML conventions from the start. Meet early and often to discuss every library, framework, mental model, and gem you are interested in using and take feedback seriously. Simply put, if they absolutely hate BEM and refuse to write it, don’t use BEM. You can explore working around this with linters, but forcing people to use a naming convention they hate isn’t going to make your job any easier. Hopefully, you will be able to convince them why the extra underscores are useful, but...
PHP, Web Tricks

Show/Hide button on window scrolling

Today I worked on this for one of my client so I thought I should share this with all of you. My client wanted me to show a fixed button in the right side of his website and it should only show on scrolling between particular area. I've coded according to requirements and I am going to share jQuery code for the same. Code is as below: (I am expecting that you already have jquery library in your code.) <script> jQuery(document).ready(function(e) { var topScrollpos = 360; var bottomScrollpos = 1820; window.onscroll = function() { var currentScrollPos = window.pageYOffset; if (currentScrollPos > topScrollpos && currentScrollPos < bottomScrollpos) { jQuery("#float-button").css('display','block'); } else { jQuery("#float-button").css('display','none'); } } })...
CSS Tricks

Practical CSS Scroll Snapping

CSS scroll snapping allows you to lock the viewport to certain elements or locations after a user has finished scrolling. It’s great for building interactions like this one:   Browser support and basic usage Browser support for CSS scroll snapping has improved significantly since it was introduced in 2016, with Google Chrome (69+), Firefox, Edge, and Safari all supporting some version of it. This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up. Desktop Chrome Opera Firefox IE Edge Safari 69 No 63 11* 18* 11 Mobile / Tablet iOS Safari Opera Mobile Opera Mini Android Android Chrome Android Firefox 11.0-11.2 No No No N...
Web Tricks

Scroll Bouncing On Your Websites

Scroll bouncing (also sometimes referred to as scroll ‘rubber-banding’, or ‘elastic scrolling’) is often used to refer to the effect you see when you scroll to the very top of a page or HTML element, or to the bottom of a page or element, on a device using a touchscreen or a trackpad, and empty space can be seen for a moment before the element or page springs back and aligns itself back to its top/bottom (when you release your touch/fingers). You can see a similar effect happen in CSS scroll-snapping between elements. However, this article focuses on scroll bouncing when you scroll to the very top or very bottom of a web page. In other words, when the scrollport has reached its scroll boundary. Collecting Data, The Powerful Way Did you know that CSS can be used for collecting statis...
8 Design Mistakes That Spell Disaster
Web Tricks

8 Design Mistakes That Spell Disaster

Just like anything else, product design can be done well, and it can be done poorly. When a product is designed well, users don’t notice it. But when a product is designed poorly, users not only notice, but also complain. In this article, I want to share five the most common things that lead to bad product design. 1. Adding Too Many Features to a Product All too often designers think about features as a synonymous with value. They believe that the more features they add to the product, the more valuable it adds for the user. As a result, a lot of products are designed with too many unnecessary features which detract from the product’s primary purpose. This effect is known as feature creep—a continuous addition of new product features beyond the original scope. Here are two tips tha...
Web Tricks

Java and MongoDB 4.0 Support for Multi-Document ACID Transactions

MongoDB 4.0 adds support for multi-document ACID transactions. But wait... Does that mean MongoDB did not support transactions until now? No, actually MongoDB has always supported transactions in the form of single document transactions. MongoDB 4.0 extends these transactional guarantees across multiple documents, multiple statements, multiple collections, and multiple databases. What good would a database be without any form of transactional data integrity guarantee? Before we dive in this blog post, you can find all the code and try multi-document ACID transactions here. Quick start Step 1: Start MongoDB Start a single node MongoDB ReplicaSet in version 4.0.0 minimum on localhost, port 27017. If you use Docker: You can use start-mongo.sh. When you are done, you can use stop-mongo.sh. If ...
CSS Tricks

The possibilities of the color-adjust property

The Open Web continues to show up in places we would have never originally expected to find it: our phones, televisions, watches, books, video game consoles, fast food menus, gas pumps, elevators, cars—even our refrigerators. By not making too many or too strict assumptions about how the web should be used, it remains flexible and adaptable. These qualities have allowed it to outperform closed technologies like Flash and Silverlight. With the web’s growth comes new features to better accommodate its new form factors and use cases. One feature I’m excited about is the color-adjust property, proposed in CSS Color Module Level 4. It is an acknowledgement that the web will continue to show up on devices that have less-than-stellar displays.   There are two values for color-adj...