This repository has been archived by the owner on Nov 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
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
6 changed files
with
167 additions
and
26 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
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 |
---|---|---|
|
@@ -26,9 +26,7 @@ | |
"package:win64": "electron-builder dist/Temps-win32-x64/ --platform=win --out=dist --config=config.json && mv 'dist/Temps Setup.exe' dist/Temps_Windows64.exe", | ||
"package:win32": "electron-builder dist/Temps-win32-ia32/ --platform=win --out=dist --config=config.json && mv 'dist/Temps Setup.exe' dist/Temps_Windows32.exe", | ||
"package:osx": "hdiutil create -format UDZO -srcfolder dist/Temps-darwin-x64/Temps.app dist/Temps_Mac.dmg", | ||
"package:linux": "cd dist/ && zip -r Temps_Linux_x64.zip Temps-linux-x64 && zip -r Temps_Linux_ia32.zip Temps-linux-ia32 && cd ../", | ||
"test": "npm run lint", | ||
"lint": "standard --fix" | ||
"package:linux": "cd dist/ && zip -r Temps_Linux_x64.zip Temps-linux-x64 && zip -r Temps_Linux_ia32.zip Temps-linux-ia32 && cd ../" | ||
}, | ||
"author": "Konrad Michalik <[email protected]>", | ||
"license": "MIT", | ||
|
@@ -57,6 +55,8 @@ | |
"json-storage": "^2.1.1", | ||
"localStorage": "^1.0.3", | ||
"chart.js": "^2.2.1", | ||
"countup.js": "^1.7.1" | ||
"countup.js": "^1.7.1", | ||
"semver": "^5.1.0", | ||
"superagent": "^2.0.0" | ||
} | ||
} |
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,56 @@ | ||
const setColor = function (c) { | ||
color = c | ||
jQuery('#main').css('background-color', c) | ||
jQuery('.spinner > div').css('background-color', c) | ||
} | ||
|
||
const colorPalette = function (data) { | ||
if (data[0].cod == 404) { | ||
setColor('#444444') | ||
return | ||
} | ||
var temp = roundTemp(data[0].main.temp) | ||
var colors = config.colors | ||
|
||
if (Store.getFormat() == 'metric') { | ||
if (temp > 30) { | ||
setColor(colors[0]) | ||
} else if (temp > 26) { | ||
setColor(colors[1]) | ||
} else if (temp > 22) { | ||
setColor(colors[2]) | ||
} else if (temp > 18) { | ||
setColor(colors[3]) | ||
} else if (temp > 14) { | ||
setColor(colors[4]) | ||
} else if (temp > 10) { | ||
setColor(colors[5]) | ||
} else if (temp > 6) { | ||
setColor(colors[6]) | ||
} else if (temp > 2) { | ||
setColor(colors[7]) | ||
} else { | ||
setColor(colors[8]) | ||
} | ||
} else { | ||
if (temp > 86) { | ||
setColor(colors[0]) | ||
} else if (temp > 78) { | ||
setColor(colors[1]) | ||
} else if (temp > 71) { | ||
setColor(colors[2]) | ||
} else if (temp > 64) { | ||
setColor(colors[3]) | ||
} else if (temp > 57) { | ||
setColor(colors[4]) | ||
} else if (temp > 50) { | ||
setColor(colors[5]) | ||
} else if (temp > 42) { | ||
setColor(colors[6]) | ||
} else if (temp > 35) { | ||
setColor(colors[7]) | ||
} else { | ||
setColor(colors[8]) | ||
} | ||
} | ||
} |
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,44 @@ | ||
const months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'] | ||
|
||
const getTodayDay = function () { | ||
var days = [ | ||
'sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday' | ||
] | ||
var date = getDate(new Date()) | ||
return days[(date.getDay())] | ||
} | ||
|
||
const getTodayDate = function () { | ||
var date = getDate(new Date()) | ||
return getTodayDay() + ', ' + months[date.getMonth()] + ' ' + date.getDate() | ||
} | ||
|
||
const addZero = function (i) { | ||
if (i < 10) { | ||
i = '0' + i | ||
} | ||
return i | ||
} | ||
|
||
const getTime = function () { | ||
var dt = getDate(new Date()) | ||
return dt.getHours() + ':' + addZero(dt.getMinutes()) | ||
} | ||
|
||
const getStyledDate = function (num) { | ||
var days = [ | ||
'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun' | ||
] | ||
var date = new Date() | ||
return days[(date.getDay() + num) % 7] | ||
} | ||
|
||
const showDate = function () { | ||
jQuery('#details .header .date').html(getTodayDate()) | ||
jQuery('#main .clock').html(getTime()) | ||
var clock = setInterval(function () | ||
{ | ||
refreshClock() | ||
}, 60000) | ||
} | ||
|
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