Compare commits
No commits in common. "1e0b4a0a1f43326e5ca6d8f2c194772337f28f32" and "0c9e7ed1833ca79a020a480b395ed20af85838a0" have entirely different histories.
1e0b4a0a1f
...
0c9e7ed183
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
These are the public assets for the [wowtoken.app](https://wowtoken.app) website, served off Amazon S3 behind CloudFront.
|
These are the public assets for the [wowtoken.app](https://wowtoken.app) website, served off Amazon S3 behind CloudFront.
|
||||||
|
|
||||||
This project gets picked up by CodePipeline, built via CodeBuild, and deployed.
|
This project gets picked up by CodePipline, built via CodeBuild, and deployed.
|
||||||
|
|
||||||

|

|
@ -70,7 +70,7 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset id="y-start-options">
|
<fieldset id="y-start-options">
|
||||||
<label for="y-start">Start y-axis at 0:</label>
|
<label for="y-start">Start y-axis at 0:</label>
|
||||||
<input type="checkbox" id="y-start" name="y-start"/>
|
<input type="checkbox" id="y-start" name="y-start" value="enable" disabled/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
37
src/index.js
37
src/index.js
@ -28,7 +28,6 @@ Chart.register(
|
|||||||
let currentRegionSelection = '';
|
let currentRegionSelection = '';
|
||||||
let currentTimeSelection = '';
|
let currentTimeSelection = '';
|
||||||
let currentAggregateSelection = '';
|
let currentAggregateSelection = '';
|
||||||
let startYAtZero = false;
|
|
||||||
const currentPriceHash = {
|
const currentPriceHash = {
|
||||||
us: 0,
|
us: 0,
|
||||||
eu: 0,
|
eu: 0,
|
||||||
@ -81,9 +80,6 @@ function populateChart() {
|
|||||||
scales: {
|
scales: {
|
||||||
x: {
|
x: {
|
||||||
type: 'time',
|
type: 'time',
|
||||||
grid: {
|
|
||||||
color: '#625f62',
|
|
||||||
},
|
|
||||||
ticks: {
|
ticks: {
|
||||||
color: '#a7a4ab',
|
color: '#a7a4ab',
|
||||||
font: {
|
font: {
|
||||||
@ -95,10 +91,6 @@ function populateChart() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
y: {
|
y: {
|
||||||
beginAtZero: startYAtZero,
|
|
||||||
grid: {
|
|
||||||
color: '#2f2c2f',
|
|
||||||
},
|
|
||||||
ticks: {
|
ticks: {
|
||||||
color: '#a7a4ab',
|
color: '#a7a4ab',
|
||||||
font: {
|
font: {
|
||||||
@ -239,14 +231,6 @@ function toggleAdvancedSetting() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleStartYAtZero(){
|
|
||||||
startYAtZero = document.getElementById('y-start').checked;
|
|
||||||
if (tokenChart){
|
|
||||||
tokenChart.options.scales.y.beginAtZero = startYAtZero;
|
|
||||||
tokenChart.update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function urlBuilder() {
|
function urlBuilder() {
|
||||||
let url = "https://data.wowtoken.app/token/history/";
|
let url = "https://data.wowtoken.app/token/history/";
|
||||||
if (currentAggregateSelection !== 'none') {
|
if (currentAggregateSelection !== 'none') {
|
||||||
@ -326,16 +310,6 @@ function detectAggregateQuery(urlSearchParams) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function detectZeroQuery(urlSearchParams) {
|
|
||||||
startYAtZero = urlSearchParams.get('startAtZero') === 'true';
|
|
||||||
let advOptions = document.getElementById('enable-advanced');
|
|
||||||
let startAtZeroOption = document.getElementById('y-start');
|
|
||||||
advOptions.checked = startYAtZero;
|
|
||||||
startAtZeroOption.checked = startYAtZero;
|
|
||||||
toggleAdvancedSetting();
|
|
||||||
toggleStartYAtZero();
|
|
||||||
}
|
|
||||||
|
|
||||||
function detectURLQuery() {
|
function detectURLQuery() {
|
||||||
const urlSearchParams = new URLSearchParams(window.location.search);
|
const urlSearchParams = new URLSearchParams(window.location.search);
|
||||||
if (urlSearchParams.has('region')) {
|
if (urlSearchParams.has('region')) {
|
||||||
@ -347,9 +321,6 @@ function detectURLQuery() {
|
|||||||
if (urlSearchParams.has('aggregate')) {
|
if (urlSearchParams.has('aggregate')) {
|
||||||
detectAggregateQuery(urlSearchParams);
|
detectAggregateQuery(urlSearchParams);
|
||||||
}
|
}
|
||||||
if (urlSearchParams.has('startAtZero')) {
|
|
||||||
detectZeroQuery(urlSearchParams)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildDeepLinksURL() {
|
function buildDeepLinksURL() {
|
||||||
@ -361,10 +332,7 @@ function buildDeepLinksURL() {
|
|||||||
url += `region=${currentRegionSelection}&`
|
url += `region=${currentRegionSelection}&`
|
||||||
}
|
}
|
||||||
if (currentAggregateSelection !== '' && currentAggregateSelection !== 'none'){
|
if (currentAggregateSelection !== '' && currentAggregateSelection !== 'none'){
|
||||||
url += `aggregate=${currentAggregateSelection}&`
|
url += `aggregate=${currentAggregateSelection}`
|
||||||
}
|
|
||||||
if (startYAtZero !== false){
|
|
||||||
url += `startAtZero=${startYAtZero}&`
|
|
||||||
}
|
}
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
@ -396,9 +364,6 @@ function registerAdvancedHandlers() {
|
|||||||
document.getElementById('enable-advanced').addEventListener('change', () => {
|
document.getElementById('enable-advanced').addEventListener('change', () => {
|
||||||
toggleAdvancedSetting();
|
toggleAdvancedSetting();
|
||||||
})
|
})
|
||||||
document.getElementById('y-start').addEventListener('change', () => {
|
|
||||||
toggleStartYAtZero();
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerCopyHandlers() {
|
function registerCopyHandlers() {
|
||||||
|
Loading…
Reference in New Issue
Block a user