This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Analog Clock</title> | |
<style> | |
body { | |
display: flex; | |
justify-content: center; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Image Map Example with Star Shape</title> | |
</head> | |
<body> | |
<!-- Define the image with usemap attribute referencing the map --> | |
<img src="example.jpg" alt="Example Image" usemap="#example-map" width="600" height="400"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
.dir{display:inline-block;height:22px;vertical-align:middle;background-color:transparent;background-size:contain !important;background-color:#000;color:#FFF;padding-left:0.15em;padding-right:0.15em;border-radius:0.23em;font-family:'Tahoma','Arial', sans-serif;font-weight:bold;/*width:22px;*/} | |
.btn{display:inline-block;width:22px;height:22px;vertical-align:middle;background-color:transparent;background-size:contain !important;} | |
#X{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA7CAYAAAAn+enKAAAOtElEQVRo3u1baXSU1RmuW1d7atX2ZyUsIUD2fZ3JvkxmspJtkkxC1sm+70B2SIJsiopLrRXbIorVYzlC5RQpVbTSWhVrW6WUisXKqVYt/fv0fe43M5nB7Iu2Pc45z8nwzb33fZ/7Lve997t86UtffL74LPhTVdXU6O3jh7DwKMTExiMuPhkJicmIT9AQG5eonkdFRSMwKBTrN3jh4JNHPf9nCJ4BbrhthRsihYAh1YT0jGzk5BbAUlKGxuZWbN4ygJHRMYyN78C27RMYHBxBZ1cvqmvqkJtnhtGUriYkOiYOAYHBsFjKhk+cwPX/dUTffx8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
.btn{display:inline-block;width:22px;height:22px;vertical-align:middle;background-color:transparent;background-size:contain !important;} | |
#X{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA7CAYAAAAn+enKAAAOtElEQVRo3u1baXSU1RmuW1d7atX2ZyUsIUD2fZ3JvkxmspJtkkxC1sm+70B2SIJsiopLrRXbIorVYzlC5RQpVbTSWhVrW6WUisXKqVYt/fv0fe43M5nB7Iu2Pc45z8nwzb33fZ/7Lve997t86UtffL74LPhTVdXU6O3jh7DwKMTExiMuPhkJicmIT9AQG5eonkdFRSMwKBTrN3jh4JNHPf9nCJ4BbrhthRsihYAh1YT0jGzk5BbAUlKGxuZWbN4ygJHRMYyN78C27RMYHBxBZ1cvqmvqkJtnhtGUriYkOiYOAYHBsFjKhk+cwPX/dUTffx83+vr5Iyk5FZlZOaissmJr/xD23rEP++7ej3377sHEjp0YGh4V0v3o6dmM7p4+9PZtkXaDGJVJ2HH7LjUJA4PDqG9okonKF49IRHiEDu5rPXD+PL76uRMFcK2Prz9SDGnIzslHV3cfdu++Ezt37cHg0AhaWtpRVW0VC29CgblIkcjKzkVG5kYFfucz/lZSWoZqay2aW9rURHBiurp75Xm5cv3wiCisXuOO/n5c+7mQjdDFnkxMSlEW7ejswZ69d2FoZJtSeFNZBTZuzENaeiZMpgyY0jJnhVG1y5A+WSoMyi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
.btn{display:inline-block;width:22px;height:22px;vertical-align:middle;background-color:transparent;background-size:contain !important;} | |
#X{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA7CAYAAAAn+enKAAAOtElEQVRo3u1baXSU1RmuW1d7atX2ZyUsIUD2fZ3JvkxmspJtkkxC1sm+70B2SIJsiopLrRXbIorVYzlC5RQpVbTSWhVrW6WUisXKqVYt/fv0fe43M5nB7Iu2Pc45z8nwzb33fZ/7Lve997t86UtffL74LPhTVdXU6O3jh7DwKMTExiMuPhkJicmIT9AQG5eonkdFRSMwKBTrN3jh4JNHPf9nCJ4BbrhthRsihYAh1YT0jGzk5BbAUlKGxuZWbN4ygJHRMYyN78C27RMYHBxBZ1cvqmvqkJtnhtGUriYkOiYOAYHBsFjKhk+cwPX/dUTffx83+vr5Iyk5FZlZOaissmJr/xD23rEP++7ej3377sHEjp0YGh4V0v3o6dmM7p4+9PZtkXaDGJVJ2HH7LjUJA4PDqG9okonKF49IRHiEDu5rPXD+PL76uRMFcK2Prz9SDGnIzslHV3cfdu++Ezt37cHg0AhaWtpRVW0VC29CgblIkcjKzkVG5kYFfucz/lZSWoZqay2aW9rURHBiurp75Xm5cv3wiCisXuOO/n5c+7mQjdDFnkxMSlEW7ejswZ69d2FoZJtSeFNZBTZuzENaeiZMpgyY0jJnhVG1y5A+WSoMyi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
.btn{display:inline-block;width:22px;height:22px;vertical-align:middle;background-color:transparent;background-size:contain !important;} | |
#X{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA7CAYAAAAn+enKAAAABGdBTUEAALGPC/xhBQAAAYRpQ0NQSUNDIHByb2ZpbGUAACiRfZE9SMNAHMVfU0uLVBTMIOKQoTrZRUUcSxWLYKG0FVp1MLn0C5q0JCkujoJrwcGPxaqDi7OuDq6CIPgB4uzgpOgiJf4vKbSI8eC4H+/uPe7eAUKryjSzLwZoumWkE3Epl1+Vgq8IQIQfQwjJzKwnM4tZeI6ve/j4ehflWd7n/hwDasFkgE8ijrG6YRFvEM9uWnXO+8QiK8sq8TnxpEEXJH7kuuLyG+eSwwLPFI1sep5YJJZKPaz0MCsbGvEMcUTVdMoXci6rnLc4a9UG69yTvzBc0FcyXKc5hgSWkEQKEhQ0UEEVFqK06qSYSNN+3MM/6vhT5FLIVQEjxwJq0CA7fvA/+N2tWZyecpPCcSDwYtsf40BwF2g3bfv72LbbJ4D/GbjSu/5aC5j7JL3Z1SJHwOA2cHHd1ZQ94HIHGHmqy4bsSH6aQrEIvJ/RN+WB4Vugf83trbOP0wcgS10t3wAHh8BEibLXPd4d6u3t3zOd/n4AP+xykrvEBfIAAAAJcEhZcwAALiMAAC4jAXilP3YAAAAHdElNRQfoBRQENiXkSZEZAAAAGXRFWHRDb21tZW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install hidapi | |
import hid | |
import time | |
# Define the vendor ID and product ID for the PlayStation 1 controller | |
VENDOR_ID = 0x054C | |
PRODUCT_ID = 0x05C4 | |
# Define the bit masks for each button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BUTTONS = { | |
'TRIANGLE': 0x1000, | |
'CIRCLE': 0x2000, | |
'CROSS': 0x4000, | |
'SQUARE': 0x8000 | |
}; | |
function isButtonPressed(state, button) { | |
return (state.buttons & button) === 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sudo apt-get install libhidapi-dev | |
// On macOS: bash brew install hidapi | |
// Compile: g++ -o ps1_controller ps1_controller.cpp -lhidapi-hidraw | |
#include <iostream> | |
#include <hidapi/hidapi.h> | |
#define VENDOR_ID 0x054C // Replace with your controller's vendor ID | |
#define PRODUCT_ID 0x05C4 // Replace with your controller's product ID |