Speedometer, Velocimeter

Size
2,256 Kb
Views
40,480

How do I make an speedometer, velocimeter?

Trying to implement a car velocimeter using css+gauge.js. What is a speedometer, velocimeter? How do you make a speedometer, velocimeter? This script and codes were developed by Hélio Marcondes on 09 November 2022, Wednesday.

Speedometer, Velocimeter Previews

Speedometer, Velocimeter - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Speedometer, Velocimeter</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <canvas id="foo"></canvas>
<div class="zero">0</div>
<div class="twohundred">200</div>
<div class="wrap">
<button onclick="chamar()">Try</button> <input type="text" id="campo">Insert a number 0 ~ 200</div>
00 <script src='https://bernii.github.io/gauge.js/dist/gauge.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Speedometer, Velocimeter - Script Codes CSS Codes

*{ margin:0; padding:0;
}
#foo{ height:200px; width:400px;
}
.wrap{ position:absolute; top:210px; left:50px;
}
.zero{ position:absolute; top:165px; left:80px;
}
.twohundred{ position:absolute; top:165px; left:280px;
}

Speedometer, Velocimeter - Script Codes JS Codes

var opts = { lines: 12, // The number of lines to draw angle: 0.00, // The length of each line lineWidth: 0.44, // The line thickness pointer: { length: 0.5, // The radius of the inner circle strokeWidth: 0.035, // The rotation offset color: 'red' // Fill color }, limitMax: false, // If true, the pointer will not go past the end of the gauge colorStart: 'blue', // Colors colorStop: '#8FC0DA', // just experiment with them strokeColor: '#E0E0E0', // to see which ones work best for you generateGradient: true
};
var target = document.getElementById('foo'); // your canvas element
var gauge = new Gauge(target).setOptions(opts); // create sexy gauge!
gauge.maxValue = 200; // set max gauge value
gauge.animationSpeed = 32; // set animation speed (32 is default value)
function chamar(valor){ valor=document.getElementById("campo").value; gauge.set(valor); // set actual value
}
Speedometer, Velocimeter - Script Codes
Speedometer, Velocimeter - Script Codes
Home Page Home
Developer Hélio Marcondes
Username haykou
Uploaded November 09, 2022
Rating 3
Size 2,256 Kb
Views 40,480
Do you need developer help for Speedometer, Velocimeter?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Hélio Marcondes (haykou) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!