Infinite Hyperbolic Helicoid Animation with Three.js

In this ALL YOUR HTML coding session, you’ll learn how to create a beautiful shape with parametric functions, a hyperbolic helicoid, inspired by J. Miguel Medina’s artwork. We’ll be upgrading MeshPhysicalMaterial with some custom shader code, making an infinite animation.

This coding session was streamed live on January 10, 2021.

Check out the live demo.

Support: https://www.patreon.com/allyourhtml

Setup: https://gist.github.com/akella/a19954…

The post Infinite Hyperbolic Helicoid Animation with Three.js appeared first on Codrops.

9 Software Development Mistakes Leading to Cyber Attacks

 Developers are at the base of any software, and from the very early stages, they have to think not only about the performance and effectiveness of the product but also about its security.

However, few programmers follow methods of writing secure code or aspects of cryptography. Keeping cybersecurity techniques and potential vulnerabilities constantly in mind is a daunting task, especially for a beginner.

Flash’s Web Tech Legacy

Tiffany B. Brown on how Flash paved the way for some things we might think of as fairly modern web technologies:

Flash wasn’t just good for playing multimedia. It was also good for manipulating it. Using ActionScript, you could pan audio, adjusting the input for the user’s left and right speakers, perhaps when they shifted their mouse from one side of the screen to the other. Now we can do that using the Web Audio API.

Web Storage and the localStoragesessionStorage APIs are conceptually similar to SharedObjects, or Flash cookies. And the demand for rich web typography enabled by Flash and sIFR, helped bring us @font-face, WOFF, and web-licensed fonts.

Flash also popularized the idea of the cross-domain policy file, an XML file that specifies whether one domain can read the content and data of another. It’s a precursor to cross-origin resource sharing (CORS), which uses HTTP headers instead of an XML configuration file.

Mike Davidson had some nostolgic thoughts as well:

Most technology is transitional if your window is long enough. Cassette tapes showed us that taking our music with us was possible. Tapes served their purpose until compact discs and then MP3s came along. Then they took their rightful place in history alongside other evolutionary technologies. Flash showed us where we could go, without ever promising that it would be the long-term solution once we got there.

Direct Link to ArticlePermalink


The post Flash’s Web Tech Legacy appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

.htaccess and mod_rewrite I’m guessing

Hi All,

It has been a long while since I've been here, but I have hit a wall/mind block/ whatever you want to call it.

This should be simple, but drawing a complete blank.

I have an affiliate website where my clients can refer us to their friends and receive our gratitude through free products... But I need to be able to track who referred who.

I've done it years ago, but not remembering how.

I want to use the base domain so it goes to index.php

so, it would be DomainName.com/'Username' where 'Username' is unique to each client.

When someone goes to that URL, I need to be able to capture that 'Username' in a variable in the index.php script so I can use it to access the DB to record the referral. But at the same time, they need to be able to view the index.php page to enter the site.

Probably a long explanation for a simple request.

Could someone head me in the right direction?

I've invested almost 10 hours searching the web and reading numerous articles, etc and feel like I know less now about how to do this then I did before I started...

Thanks in advance for anyones positive feedback and direction.

Douglas

EatsWP Brings Virtual Restaurant Menus to the WordPress Block Editor

Yesterday, Jack Kitterhing launched EatsWP, his new restaurant-related WordPress plugin. It is a menu creation system that works in the block editor. It also has a built-in QR code feature to work with customers’ phones.

Kitterhing is the Product Manager at LearnDash. He is also the founder of Immerseus, a shop that builds plugins for the learning management system. He is now extending his reach with the founding of EatsWP. He contracted out the development work to a private freelancer with who he regularly works.

“Apart from that, it’s just me on this project,” said Kitterhing. “My other business, I have five full-time employees, and so if required, one of those could be brought over for support. We, myself and my friend, took this idea to launch in under a month, which I’m very pleased with considering that Christmas was in the middle as well.”

Kitterhing decided to build this plugin based on what he was seeing with small restaurant owners he knew. Some of the issues facing these single-location restaurants are with their physical menus.

“It’s expensive to update them or make any changes as it requires a whole new print run,” he said. “By having a digital menu, they can update in minutes and generate a new QR code print. Then combine that with the current world situation, it also isn’t very healthy to have everyone touching physical menus, so digital menus made more sense than ever.”

Pricing for the plugin begins at $37 per year and increases based on the number of sites the user wants updates and support on. Kitterhing also offers a custom menu design and setup tier.

How the Plugin Works

Adding a menu item via the EatsWP WordPress plugin to the block editor.
Editing an EatsWP menu item in the block editor.

At the moment, EatsWP is a simple affair. The plugin does not offer hundreds of options or every feature imaginable for a menu-type of plugin. It is a 1.0. However, for the features it does provide, it does them reasonably well. Kitterhing is off to a good start. He has set a foundation, and the only way to go from here is up.

Where the plugin tends to shine is with its primary features, which are its array of blocks. Users begin by adding the Eats Menu block. From there, they have a selection of inner blocks they can place within the menu:

  • Item With Picture
  • Item With Picture and Addons
  • Item Without Picture
  • Item Without Picture and Addons
  • Eats Section Heading

In reality, most of the blocks are just prearranged sets of existing core WordPress blocks. They provide structure and loads of color options. Plus, end-users can click a button to add a “New” or “Popular” tag to their menu items. It is a nice touch.

The color options offer some customizability. In the long term, users will likely want more design options. However, it may be prudent for the plugin author to follow core’s lead here and implement such options as they become available in the block editor API.

The one missing feature that should be available now is support for wide and full alignments. Kitterhing assured me this would land in the first quarter of this year.

On top of the plugin’s blocks, EatsWP allows end-users to generate a QR code for the page their restaurant’s menu is on. When a customer scans the QR code with their phone, the page then opens.

“The QR code generation is more straightforward than most people expect,” said Kitterhing. “We’re using a well-known QR code generation library. You then simply select the page your menu is on, generate the QR code, print it off, or show it on your website and you’re ready to go.”

The Future of EatsWP

On the EatsWP website, Kitterhing lightheartedly writes that “delicious desserts” are coming soon. This includes WooCommerce integration, recipes, and other secret features. Integrating with WooCommerce could open a new avenue for restaurant owners to explore as part of their checkout process.

“I’m hoping that WooCommerce support will be coming Q1 this year,” said Kitterhing. “As I’m sure you can imagine, it’s reasonably technically challenging to incorporate this in a user-friendly way. The goal is to have all the connections and product creation actually done within the block editor interface. So someone wouldn’t have to go off to WooCommerce to set a product and come back as that’s rather long-winded. I’m excited to show everyone!”

It will be interesting to watch how this integration unfolds in the coming months. Menus are a solid starting point, but having a payment option is necessary in a world with more people are ordering online. This is especially true in the Covid-era where contactless forms of payment are becoming the norm for takeout. Restaurants need simple solutions that they are not hacking together from multiple, non-integrated sources.

“The goal within the next 12 months is to turn EatsWP into everything that a restaurant needs to offer a minimal-contact experience for customers,” said Kitterhing. “Many restaurants don’t have websites either, so I’m looking into a SaaS option where I’d host the menu/site for the restaurant.”

Dynamic SQL Injection With Oracle ERP Cloud

In this previous article, we learned how to design and Develop an Oracle Cloud BI Report. We will use the same Report and convert it Into a Dynamic SQL Injection based Report.

Log in to Oracle Cloud Applications and Go to Tools in the Navigator and click on Reports and Analytics. Click on Browse Catalog to launch the BI workspace.

5 Ways to Drive Results With Conversational AI

Communication drives businesses and strategically implemented artificial intelligence (AI) and machine learning (ML) can tangibly improve your business results. A wide variety of AI and ML solutions are now available to integrate with API-enabled Unified Communications as a Services (UCaaS) solutions. This article will provide an overview of major use cases that have been successfully built and deployed so you can get an idea of where your opportunities lie. The specific examples have been implemented and are available with the RingCentral Office unified communications suite.

Topics covered include:

Scrum Commitments: Tying Up Loose Ends and Shoehorning the Definition of Done

TL; DR: Scrum Commitments

While the new Scrum Guide is less prescriptive and more inclusive, it also ties up loose ends by including elements better, namely the previously free-floating Sprint Goal and the Definition of Done with the creation of Scrum commitments. This inclusion works remarkably well in the former’s case; regarding the latter, we need a shoehorn, though.

The Scrum Guide 2020

Foremost, the new Scrum Guide is less prescriptive, eliminating many suggestions such as the Daily Scrum questions, the need for at least one mandatory action item from the Retrospective becoming a part of the Sprint Backlog, or the advice on why Sprint cancelations are rare events.

The Singleton Design Pattern

The Singleton Pattern

The singleton pattern is one of the simplest design patterns in Java. This design pattern is considered a creational pattern, as this pattern provides one of the best ways to create an object.

Sometimes it’s important for some classes to have exactly one instance. There are many times when we only need one instance of an object and if we instantiate more than one we’ll run into all sorts of problems, like incorrect program behavior, overuse of resources, or inconsistent results. You may require only one object of a class, for example, when you are creating:

how does nodejs docker kubernetes and travis work for process.env.Foo

Disclaimer: this is a project work.
I might be having issues with the follow but here is what I am doing:

push changes to github
travils builds image and pushes to docker
AWS EKS pulls the image and starts container

now my issue is the following variable is undefined:

         const = process.env.FOO

i am really lost on how to set FOO. I already tried setting it in deployment.yaml, travis.yml and Dockerfile (ENV foo=bar). I have seen documentations with docker-compose but is there a way without docker-compose?

pc will not turn on

Hi.
Just bought a new pc,intel i7 2600 (integrated intel hd 2000),4x2 ram,1tb hdd.
Worked normal for a couple of hours of gaming (ETS2,idk if its cpu heavy)then suddenly it turned off.Waited for a couple of minutes then it turned back on normally. Weird i thought but alright. After some time, turned off again,but this time shows a blue screen that reads about something (windows has problems or something). Turned off, couldn't get it to turn on from then.
Its been about 10 days.
To be precise,i turn on the pc,hear one beep and then the fans get louder and louder but there is no signal showing.
Im sure it isn't about the cables (VGA)(already tested that).
My cpu seems fine,hdd seems okay,inside of the pc is clean and newly built.
I also tried cleaning the ram,putting it in one by one and turning the pc on,didnt work. Tried changing rams locations still didn't work. If i put all rams out and turn it on i hear 2 beeps so im pretty sure the motherboard or the ram isn't the issue.
Can anyone please help me? Today i thought maybe my system failed (Windows). I got an usb,made it bootable with a windows 10 iso.
I can't even seem to get to the bios, my monitor reads there is no signal.
Also i tried switching monitors it wouldnt work on either ones.
It's worth mentioning that,when i bought it,i updated windows 10 to the latest version and updated my video drivers(maybe the drivers caused this,but i doubt).
I don't know what to do anymore,if you need any more info or a picture of the inside of the pc,please tell me.
Please,help me.

Animating with Lottie

I believe animation on the web is not only fun, but engaging in such a way that it has converted site visitors into customers. Think of the “Like” button on Twitter. When you “like” a tweet, tiny colorful bubbles spread around the heart button while it appears to morph into a circle around the button before settling into the final “liked” state, a red fill. It would be much less exciting if the heart just went from being outlined to filled. That excitement and satisfaction is a perfect example of how animation can be used to enhance user experience.

This article is going to introduce the concept of rendering Adobe After Effects animation on the web with Lottie, which can make advanced animations— like that Twitter button — achievable.

Bodymovin is a plugin for Adobe After Effects that exports animations as JSON, and Lottie is the library that renders them natively on mobile and on the web. It was created by Hernan Torrisi. If you’re thinking Oh, I don’t use After Effects, this article is probably not for me, hold on just a moment. I don’t use After Effects either, but I’ve used Lottie in a project.

You don’t have to use Lottie to do animation on the web, of course. An alternative is to design animations from scratch. But that can be time-consuming, especially for the complex types of animations that Lottie is good at. Another alternative is using GIF animations, which are limitless in the types of animation they can display, but are typically double the size of the JSON files that Bodymovin produces.

So let’s jump into it and see how it works.

Get the JSON

To use Lottie, we need a JSON file containing the animation from After Effects. Luckily for us, Icons8 has a lot of free animated icons here in JSON, GIF, and After Effects formats.

Add the script to HTML

We also need to get the Bodymovin player’s JavaScript library in our HTML, and call its loadAnimation() method. The fundamentals are demonstrated here:

<div id="icon-container"></div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.7.4/lottie.min.js">

<script>
  var animation = bodymovin.loadAnimation({
  // animationData: { /* ... */ },
  container: document.getElementById('icon-container'), // required
  path: 'data.json', // required
  renderer: 'svg', // required
  loop: true, // optional
  autoplay: true, // optional
  name: "Demo Animation", // optional
});
</script>

Activate the animation

After the animation has loaded in the container, we can configure it to how we want it to be activated and what action should activate it with event listeners. Her are the properties we have to work with:

  • container: the DOM element that the animation is loaded into
  • path: the relative path of the JSON file that contains the animation
  • renderer: the format of the animation, including SVG, canvas, and HTML
  • loop: boolean to specify whether or not the animation should loop
  • autoplay: boolean to specify whether or not the animation should play as soon as it’s loaded
  • name: animation name for future referencing

Note in the earlier example that the animationData property is commented out. It is mutually exclusive with the path property and is an object that contains the exported animated data.

Let’s try an example

I’d like to demonstrate how to use Lottie with this animated play/pause control icon from Icons8:

The Bodymovin player library is statically hosted here and can be dropped into the HTML that way, but it is also available as a package:

npm install lottie-web ### or yarn add lottie-web

And then, in your HTML file, include the script from the dist folder in the installed package. You could also import the library as a module from Skypack:

import lottieWeb from "https://cdn.skypack.dev/lottie-web";

For now, our pause button is in a loop and it also plays automatically:

Let’s change that so the animation is triggered by an action.

Animating on a trigger

If we turn autoplay off, we get a static pause icon because that was how it was exported from After Effects.

But, worry not! Lottie provides some methods that can be applied to animation instances. That said, the documentation of the npm package is more comprehensive.

We need to do a couple things here:

  • Make it show as the “play” state initially.
  • Animate it to the “paused” state on click
  • Animate between the two on subsequent clicks.

The goToAndStop(value, isFrame) method is appropriate here. When the animation has loaded in the container, this method sets the animation to go to the provided value, then stop there. In this situation, we’d have to find the animation value when it’s at play and set it. The second parameter specifies whether the value provided is based on time or frame. It’s a boolean type and the default is false (i.e., time-based value). Since we want to set the animation to the play frame, we set it to true.

A time-based value sets the animation to a particular point in the timeline. For example, the time value at the beginning of the animation, when it’s paused, is 1. However, a frame-based value sets the animation to a particular frame value. A frame, according to TechTerms, is an individual picture in a sequence of images. So, if I set the frame value of the animation to 5, the animation goes to the fifth frame in the animation (the “sequence of images” in this situation).

After trying different values, I found out the animation plays from frame values 11 through 16. Hence, I chose 14 to be on the safe side.

Now we have to set the animation to change to pause when the user clicks it, and play when the user clicks it again. Next, we need the playSegments(segments, forceFlag) method. The segments parameter is an array type containing two numbers. The first and second numbers represent the first and last frame that the method should read, respectively. The forceFlag is a boolean that indicates whether or not the method should be fired immediately. If set to false, it will wait until the animation plays to the value specified as the first frame in the segments array before it is triggered. If true, it plays the segments immediately.

Here, I created a flag to indicate when to play the segments from play to pause, and from pause to play. I also set the forceFlag boolean to true because I want an immediate transition.

So there we have it! We rendered an animation from After Effects to the browser! Thanks Lottie!

Canvas?

I prefer to use SVG as my renderer because it supports scaling and I think it renders the sharpest animations. Canvas doesn’t render quite as nicely, and also doesn’t support scaling. However, if you want to use an existing canvas to render an animation, there are some extra things you’d have to do.

Doing more

Animation instances also have events that can also be used to configure how the animation should act.

For example, in the Pen below, I added two event listeners to the animation and set some text to be displayed when the events are fired.

All the events are available on the npm package’s docs. With that I say, go forth and render some amazing animations!


The post Animating with Lottie appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

CSS Snapshot 2020

I think it’s great that the CSS Working Group does these. It’s like planting a flag in the ground saying this is what CSS looks like at this specific point in time. They do specifically say it’s not for us CSS authors though…

This document collects together into one definition all the specs that together form the current state of Cascading Style Sheets (CSS) as of 2020. The primary audience is CSS implementers, not CSS authors, as this definition includes modules by specification stability, not Web browser adoption rate.

Remember “CSS3”? That was the closest thing we had to a “snapshot” that was designed for CSS authors (and learners). Because CSS3 was so wildly successful, we saw a short round of enthusiasm for CSS4, me included. There is zero marketing panache on that snapshot page, which is exactly what CSS4 would need to succeed. Remember, HTML5 and friends (including CSS3) even had fancy logos!

If someone were to say to me “Chris, when CSS3 came around, I boned up on all that, but I haven’t kept up with CSS since, what should I learn?” I’d say “That’s a damn fine question, developer that has a normal healthy relationship with technology.” But honestly, I might struggle to answer cohesively.

I’d say: Uhm, CSS grid for sure. Custom properties. Clipping and Offset paths I suppose. prefers-reduced-motion. I dunno. There are probably like 100 things, but there is no great single reference point to see them all together.

I’ll work on putting a list together. I don’t think I’ll have the gumption to call it CSS4, but at least I’ll be able to answer that question. Feel free to suggest ideas in the comments.


The post CSS Snapshot 2020 appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

Build a Monitoring Dashboard With QuestDB and Grafana

Photo by Luke Chesser on Unsplash

In this tutorial, we will cover how to load demo data from .CSVfiles into QuestDB and use this as a data source for a Grafana dashboard. The dashboard will have line charts as data visualizations that make use of aggregate SQL functions and Grafana global variables for sampling data based on dashboard settings.

What Is Grafana?

Grafana is an open-source visualization tool. It consists of a server that connects to one or more data-sources to retrieve data, which is then visualized by the user in a browser.