Skip to content

Instantly share code, notes, and snippets.

.button-favorites[aria-pressed="true"] {
background-color: #ff4136;
border-color: #ff4136;
color: #ffffff;
}
@cferdinandi
cferdinandi / 1-nested.js
Created April 8, 2025 16:48
View the tutorial for this code: https://youtu.be/YCGWNaI8w1E
function handleClick (event) {
// Make sure clicked element has the .save-data class
if (event.target.matches('.save-data')) {
// Get the value of the [data-id] attribute
let id = event.target.getAttribute('data-id');
// Make sure there's an ID
if (id) {
@cferdinandi
cferdinandi / index.html
Created April 1, 2025 18:01
Watch the tutorial on YouTube: https://youtu.be/v-3O0MCl41k
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Toast Library</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
@cferdinandi
cferdinandi / 1-promise-then.html
Created March 25, 2025 18:37
Watch the tutorial for this code: https://youtu.be/-KT7fSw0MuQ
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Promise.then()</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}
:is(h1, h2, h3, h4, h5, h6) {
font-weight: bold;
}
@cferdinandi
cferdinandi / count-up-display.js
Created March 12, 2025 15:56
Watch the tutorial for this code: https://youtu.be/Ap26IwDVOV8
customElements.define('count-up-display', class extends HTMLElement {
/**
* The class constructor object
*/
constructor () {
// Gives element access to the parent class properties
super();
customElements.define('ajax-html', class extends HTMLElement {
/**
* The class constructor object
*/
constructor () {
// Always call super first in constructor
super();
customElements.define('ajax-form', class extends HTMLElement {
/**
* The class constructor object
*/
constructor () {
// Always call super first in constructor
super();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Loop + String</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ecommerce Platform</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {