-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
547 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
dist/ | ||
node_modules/ | ||
assets/images/ | ||
examples/ |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Demo: All Themes | Revolve.js</title> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/webfont/1.3.0/webfont.js" type="text/javascript"></script> | ||
<script src="../dist/js/revolve.pkgd.js" type="text/javascript"></script> | ||
<script type="text/javascript"> | ||
// Revolve.js gauges and clocks can use custom web fonts from, for example, | ||
// Google Fonts. Here we're using a popular dynamic web font loader library | ||
// to kick off initialization of Revolve.js when necessary fonts have | ||
// loaded. | ||
WebFont.load({ | ||
google: { | ||
families: ['Oswald:300,400','Quattrocento','Six Caps'] | ||
}, | ||
active: function() { | ||
var canvases = document.querySelectorAll('canvas'); | ||
canvases.forEach( (can) => { | ||
var opt = { | ||
theme: can.dataset.theme, | ||
value: can.dataset.value || '10:10:00' | ||
}; | ||
let func = (can.dataset.theme === 'speedometer' || | ||
can.dataset.theme === 'dartboard' || | ||
can.dataset.theme === 'pressure' || | ||
can.dataset.theme === 'unitless' ) ? 'gauge' : 'clock'; | ||
Revolve[ func ]( can.getContext("2d"), opt ); | ||
}); | ||
} | ||
}); | ||
</script> | ||
</head> | ||
<body id="home"> | ||
<canvas width="256" height="256" data-theme="classic"></canvas> | ||
<canvas width="256" height="256" data-theme="dark"></canvas> | ||
<canvas width="256" height="256" data-theme="dartboard"></canvas> | ||
<canvas width="256" height="256" data-theme="decimal"></canvas> | ||
<canvas width="256" height="256" data-theme="elite"></canvas> | ||
<canvas width="256" height="256" data-theme="informatic"></canvas> | ||
<canvas width="256" height="256" data-theme="military"></canvas> | ||
<canvas width="256" height="256" data-theme="office"></canvas> | ||
<canvas width="256" height="256" data-theme="pressure" data-value="90"></canvas> | ||
<canvas width="256" height="256" data-theme="simple"></canvas> | ||
<canvas width="256" height="256" data-theme="speedometer" data-value="65"></canvas> | ||
<canvas width="256" height="256" data-theme="stopwatch" data-value="0"></canvas> | ||
<canvas width="256" height="256" data-theme="unitless" data-value="6"></canvas> | ||
<canvas width="256" height="256" data-theme="uptown"></canvas> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Demo: Custom Font Loader | Revolve.js</title> | ||
|
||
<!-- Include the web font loader we'll use to ensure custom fonts have loaded | ||
before rendering our clock. --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/webfont/1.3.0/webfont.js" type="text/javascript"></script> | ||
|
||
<!-- Include the packaged (.pkgd) version of Revolve.js, which contains all | ||
predefined Revolve.js themes. --> | ||
<script src="../dist/js/revolve.pkgd.js" type="text/javascript"></script> | ||
|
||
<!-- Use the WebFont loader to request our font. When fonts are received, | ||
initialize the Revolve.js clock control. --> | ||
<script type="text/javascript"> | ||
WebFont.load({ | ||
google: { families: ['Six Caps'] }, // fonts we want | ||
active: function() { | ||
// (Okay, fonts have loaded) | ||
let can = document.querySelector('canvas'); | ||
Revolve.clock( can.getContext('2d'), { theme: 'uptown' } ); | ||
}, | ||
inactive: function() { | ||
console.error('Font load failed.'); | ||
} | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<canvas width="512" height="512"></canvas> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Demo: Custom Font | Revolve.js</title> | ||
|
||
<!-- Request the custom font we want (Six Caps) from Google Fonts. This font | ||
is used by the 'uptown' theme. --> | ||
<link href="https://fonts.googleapis.com/css?family=Six+Caps&display=swap" rel="stylesheet"> | ||
|
||
<!-- Include the packaged (.pkgd) version of Revolve.js, which contains all | ||
predefined Revolve.js themes. --> | ||
<script src="../dist/js/revolve.pkgd.js" type="text/javascript"></script> | ||
|
||
</head> | ||
<body> | ||
|
||
<!-- Display an analog clock with the 'uptown' theme, which uses the | ||
'Six Caps' custom font we pulled in above. HOWEVER, you may still see a FOUT | ||
(a flash of unstyled text) using this method. To avoid that, use a web font | ||
loader. See clock-custom-fonts-dynamic.html. --> | ||
<canvas width="512" height="512" data-revolve="clock" data-theme="uptown"></canvas> | ||
|
||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Demo: Custom Theme | Revolve.js</title> | ||
|
||
<!-- Include the standalone version of Revolve.js since we don't need any of | ||
the predefined themes. --> | ||
<script src="../dist/js/revolve.js" type="text/javascript"></script> | ||
|
||
</head> | ||
<body> | ||
|
||
<!-- The canvas that will become our gauge --> | ||
<canvas width="512" height="512"></canvas> | ||
|
||
<!-- Our bottom-of-page script. We could also move this to the <head>. --> | ||
<script type="text/javascript"> | ||
|
||
// Define a custom theme | ||
let customTheme = { | ||
name: 'unitless', | ||
axes: { | ||
TEN: { | ||
name: 'TEN', | ||
pointA: { angle: 225, value: 0 }, | ||
pointB: { angle: 135, value: 10 } | ||
} | ||
}, | ||
layers: { | ||
ticks: { | ||
type: 'radial', content: 'ticks', layout: 'hour', color: '#DD2323', | ||
width: 8, degrees: 27, length: 40, start: 225, | ||
include: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] | ||
}, | ||
arc: { | ||
type: 'arc', radius: 226, | ||
border: { width: 10, color: '#DD2323' }, | ||
start: 225, degrees: 135 | ||
}, | ||
pointer: { | ||
type: 'arm', axis: 'TEN', color: '#DD2323', | ||
layers: [{ | ||
type: 'path', | ||
points: [ { x: -2, y: -212 }, { x: -5, y: 65 }, | ||
{ x: 5, y: 65 }, { x: 2, y: -212 } ] | ||
}] | ||
}, | ||
pin: { | ||
type: 'circle', radius: 26, color: 'white', | ||
border: { color: '#DD2323', width: 6 } | ||
} | ||
} | ||
}; | ||
|
||
// Initialize the gauge with the custom theme | ||
Revolve.gauge( | ||
document.querySelector('canvas').getContext('2d'), | ||
{ theme: customTheme } | ||
); | ||
</script> | ||
|
||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Demo: Data Options | Revolve.js</title> | ||
|
||
<!-- Include the packaged (.pkgd) version of Revolve.js, which contains all | ||
predefined Revolve.js themes. --> | ||
<script src="../dist/js/revolve.pkgd.js" type="text/javascript"></script> | ||
|
||
</head> | ||
<body> | ||
|
||
<!-- To pass options in via HTML, use "data-[optionName]" attributes --> | ||
<canvas width="512" height="512" | ||
data-revolve="clock" | ||
data-theme="dark" | ||
data-mode="continuous" | ||
> | ||
</canvas> | ||
|
||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Demo: Different Sizes | Revolve.js</title> | ||
|
||
<!-- Include the packaged (.pkgd) version of Revolve.js, which contains all | ||
predefined Revolve.js themes. --> | ||
<script src="../dist/js/revolve.pkgd.js" type="text/javascript"></script> | ||
|
||
</head> | ||
<body> | ||
|
||
<!-- Create five canvas elements, 512x512 pixels, but set different clock | ||
sizes using the data-radius option. --> | ||
<canvas width="512" height="512" data-revolve="clock" data-radius="512"></canvas> | ||
<canvas width="512" height="512" data-revolve="clock" data-radius="256"></canvas> | ||
<canvas width="512" height="512" data-revolve="clock" data-radius="128"></canvas> | ||
<canvas width="512" height="512" data-revolve="clock" data-radius="64"></canvas> | ||
<canvas width="512" height="512" data-revolve="clock" data-radius="32"></canvas> | ||
|
||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Demo: Simple Clock (JS) | Revolve.js</title> | ||
|
||
<!-- Include the packaged (.pkgd) version of Revolve.js, which contains all | ||
predefined Revolve.js themes. --> | ||
<script src="../dist/js/revolve.pkgd.js" type="text/javascript"></script> | ||
|
||
</head> | ||
<body> | ||
|
||
<canvas width="512" height="512"></canvas> | ||
<script type="text/javascript"> | ||
Revolve.clock( | ||
document.querySelector('canvas').getContext('2d'), | ||
{ theme: 'office' } | ||
); | ||
</script> | ||
|
||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Demo: Simple Clock | Revolve.js</title> | ||
|
||
<!-- Include the packaged (.pkgd) version of Revolve.js, which contains all | ||
predefined Revolve.js themes. --> | ||
<script src="../dist/js/revolve.pkgd.js" type="text/javascript"></script> | ||
|
||
</head> | ||
<body> | ||
|
||
<!-- Revolve.js will automatically render any <canvas> element with a | ||
data-revolve="clock" attribute as a clock using the default 'classic' theme | ||
theme if no theme is specified. --> | ||
<canvas width="512" height="512" data-revolve="clock"></canvas> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.