https://github.com/ramxcodes/internet-speed-meter
https://github.com/ramxcodes/internet-speed-meter
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ramxcodes/internet-speed-meter
- Owner: ramxcodes
- Created: 2023-07-23T14:26:04.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-24T11:22:27.000Z (almost 3 years ago)
- Last Synced: 2025-02-05T13:51:18.391Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://ramxcodes.github.io/internet-speed-meter/
- Size: 2.07 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Internet Speed Meter
The "Internet Speed Meter" is a web page that measures the internet speed by loading random images from Unsplash.com and calculates the download speed in bits per second (bps), kilobits per second (kbps), and megabits per second (Mbps).
#### HTML Structure
1. ``: The document type declaration.
2. ``: The opening tag for the HTML document, with the language set to English.
3. ``: Contains meta-information about the document, such as the character set and the title of the page.
- ``: Specifies the character encoding for the document (UTF-8).
- ``: Sets the viewport for mobile devices.
- ``: External link to a custom CSS file for styling the page.
- `Internet Speed Meter`: The title of the web page, displayed in the browser's title bar.
4. ``: Contains the visible content of the web page.
- `
`: A container to hold the content of the internet speed meter.
- `
`: An animated image (speedometer.gif) representing the internet speed meter.
- `...
`: A paragraph with a span to display status or messages. Initially, it shows "...".
- `Speed In Mbs:
`: A paragraph with a span to display the internet speed in Mbps.
- `Speed In Kbs:
`: A paragraph with a span to display the internet speed in Kbps.
- `Speed In Bits:
`: A paragraph with a span to display the internet speed in bps.
- `
`: A paragraph displaying credits and a link to the author's portfolio.
- `Made with 💖 Ram`: The text "Made with 💖" and a link to the author's portfolio with the name "Ram".
5. ``: External link to a JavaScript file ("script.js") that contains the internet speed testing functionality.
#### JavaScript Code
The provided JavaScript code is responsible for measuring the internet speed by loading random images from Unsplash.com. The script initializes a number of tests (numTests) and measures the time taken to load an image from the given Unsplash URL ("imageApi").
Upon loading an image, the script calculates the average speed in bits per second (bps), kilobits per second (kbps), and megabits per second (Mbps) for all the tests. It then displays the average speeds in the respective HTML elements with the IDs "bits," "kbs," and "mbs."
The output of the speed test is displayed in the HTML file within the respective paragraphs ("Speed In Bits," "Speed In Kbs," and "Speed In Mbs").
Note: The provided CSS file ("style.css") and the actual functionality of the script ("script.js") are not included in the provided code snippet, so their details are not available for documentation.