Import of glitchdotcom/glitch-hello-website

This commit is contained in:
Glitch (glitch-hello-website)
2021-05-26 21:53:06 +00:00
parent ed6f42c944
commit 8fb1d937b5
4 changed files with 142 additions and 18 deletions

View File

@ -1,5 +1,25 @@
/* If you're feeling fancy you can add interactivity
to your site with Javascript */
/*
This is your site JavaScript code - you can add interactivity and carry out processing
- Initially the JS writes a message to the console, and rotates a button you can add from the README
*/
// prints a message in the browser's dev tools console
// Print a message in the browser's dev tools console each time the page loads
// Use your menus or right-click / control-click and choose "Inspect" > "Console"
console.log("Hello 🌎");
/*
Make the "Click me!" button rotate when the visitor clicks it:
- First add the button to the page by following the "Next steps" in the README
*/
const btn = document.querySelector("button"); // Get the button from the page
// Detect clicks on the button
btn.onclick = function() {
// The JS works in conjunction with the 'rotated' code in style.css
btn.classList.toggle('rotated');
};
// This is a single line JS comment
/*
This is a comment that can span multiple lines
- use comments to make your own notes!
*/