Skip to content

Instantly share code, notes, and snippets.

Avatar

VA79 vanaf1979

View GitHub Profile
View classlist-add-js.js
const box = document.querySelector(".box");
const addButton = document.querySelector('#setStyles');
addButton.addEventListener('click', () => {
box.classList.add("active");
});
View classlist-add-css.css
.box {
width: 200px;
height: 150px;
background-color: hsl(222, 99%, 38%);
transition: all 0.2s ease-out;
}
.box.active {
background-color: hsl(222, 99%, 58%);
View swap-text-colors-with-variables.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Using css variables to change color in a specific section</title>
<link rel="stylesheet" href="./styles.css">
</head>
View align-lists-lsp.css
ul {
padding-left: 0;
list-style-position: inside;
}
View align-lists-background.css
ul {
padding-left: 0;
background-color: lightblue;
}
View ga-cf7-submit.js
document.addEventListener( 'wpcf7mailsent', function( event ) {
var form = event.target.querySelector( 'input[name="_wpcf7"]' ).getAttribute("value");
if( parseInt( form ) == 4839 ) {
gtag('event', 'form_submit', {
event_category: 'Forms',
event_action: 'Submit',
View ga-send-email-link-click.js