CHROMATIC-SYSTEM v1.03_INTERNET_SPEED_TEST_DISPLAY_ENGINE

INFORMATION & CODE

Internet Speed Test Display

What the Code Does

This code creates a simple Internet Speed Tester with a retro-style interface. The HTML provides the basic structure: a title, a display area for the speed result, a loading animation, and a button labelled "TEST YOUR INTERNET SPEED." It also loads the external CSS stylesheet, Google Fonts, Font Awesome icons, and the JavaScript file that controls the test.

How the Code Works

The CSS controls the appearance of the tester. It creates the green gradient outer container, black testing panel, large title, green circular spinning loader, and green button. The @keyframes spin animation makes the loader rotate while the speed test is running. The .result class enlarges the final speed display, while the .btn:hover rule changes the button colour when the mouse is over it.

When the user clicks the test button, the JavaScript downloads an image from Wikimedia. The time_start variable records the exact time the download begins, and when the image finishes loading, time_end records the finishing time. The script then calculates how many seconds the download took and uses the known image size (downloadSize) to estimate the download speed in Mbps.

The script temporarily hides the button and displays the spinning loader while the result is being processed. It then uses the animate() function to display the calculated speed progressively, creating the appearance of the speedometer counting upward. Once the animation reaches the final value, the loader disappears, the button returns, and the result is displayed with a speedometer icon and the Mbps unit.

How to Use the Code

To use it, save the HTML as something such as index.html, the CSS as styles.css, and the JavaScript as scripts.js in the same folder. Open index.html in a web browser and click TEST YOUR INTERNET SPEED. After the image has downloaded, the estimated internet download speed will be displayed. Clicking CHECK AGAIN repeats the test.

One important point is that this is an approximation rather than a professional internet-speed test. It measures the time required to download one particular image from Wikimedia, so the result can be affected by the image server, network conditions, browser caching, and the user's connection to that server.

HTML

CSS

JAVASCRIPT

PREVIEW

Test Your Internet Speed