File:Animated analog SVG clock.svg
Summary
Description |
Deutsch: Animierte analoge SVG-Uhr.
English: Animated analog SVG clock. |
||
Date | |||
Source |
Own work English: Based on this master image.
Deutsch: Basierend auf dieser Bildvorlage. |
||
Author | Fleshgrinder | ||
Permission (Reusing this file) |
|
||
SVG development |
![]() |
This image is an animated SVG file. The .png preview above created by RSVG for use in Wikimedia is not animated and may be incomplete or incorrect. To see the animation, open media:Animated analog SVG clock.svg. It should run in any modern browser or viewer. Recent versions of Chrome, Firefox, Microsoft Edge, Safari, and Opera all support SVG animated with SMIL.
Other SVG animations can be found at Category:Animated SVG files.
|
Summary
English: To display the client's current system time, uncomment the JavaScript within the SVG. It’s not possible to upload the file with the JavaScript – security reasons. You can have a look at a working example here.
Deutsch: Um die aktuelle Systemzeit anzuzeigen, unkommentiere das JavaScript in der SVG. Es ist nicht möglich die Datei mit dem JavaScript hoch zu laden – Sicherheitsgründe. Ein funktionierendes Beispiel kann hier angesehen werden.
/**
* Set the clock to the client's system time, directly after the SVG is loaded.
*
* @param evt e
*/
function s(e) {
// Create new Date() object.
var d = new Date();
// Get current seconds.
var s = d.getSeconds();
// Get current minutes and add the current second.
var m = d.getMinutes() + s / 60;
// Get current hours and add the current minute.
var h = d.getHours() + m / 60;
// Get the current document, so we can alter the DOM.
var svg = e.target.ownerDocument;
// Rotate the second clockhand to the current seconds.
svg.getElementById("Second").setAttribute("transform", "rotate(" + (s * 6) + ", 256, 256)");
svg.getElementById("SecondShadow").setAttribute("transform", "rotate(" + (s * 6) + ", 253, 259)");
// Rotate the minute clockhand to the current minute.
svg.getElementById("Minute").setAttribute("transform", "rotate(" + (m * 6) + ", 256, 256)");
svg.getElementById("MinuteShadow").setAttribute("transform", "rotate(" + (m * 6) + ", 254, 258)");
// Rotate the hour clockhand to the current hour.
svg.getElementById("Hour").setAttribute("transform", "rotate(" + (h * 30) + ", 256, 256)");
svg.getElementById("HourShadow").setAttribute("transform", "rotate(" + (h * 30) + ", 255, 257)");
}
![]() |
This image has been assessed using the Quality image guidelines and is considered a Quality image.
|
Category:Analog clocks
Category:Animated clock images
Category:Clockfaces with 12 Arabic numerals and tick marks for minutes
Category:PD-user
Category:Quality images
Category:Quality images missing SDC depicts
Category:Quality images missing SDC source of file
Category:Valid SVG created with Other tools
Category:Valid animated SVG