Skip to content

Instantly share code, notes, and snippets.

@downthecrop
Last active March 4, 2020 09:41
Show Gist options
  • Save downthecrop/e33535901166bc1dbf0f371ffa6faf96 to your computer and use it in GitHub Desktop.
Save downthecrop/e33535901166bc1dbf0f371ffa6faf96 to your computer and use it in GitHub Desktop.
AndroidLeopard 12 Hour Clock LockHTML
<html>
<head>
<title>Android Leopard</title>
<link rel="stylesheet" href="css/style.css">
<script src="https://kit.fontawesome.com/c94c624931.js"></script>
<script src="config.js"></script>
</head>
<body id="body" onload="updateTime();">
<div id="container" class="container">
<div id="mainTime"><span id="time" class="time">14:58</span></div>
<div id="FooterSize" class="section2">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><div id="x1" class="date"><i class="fas fa-calendar-alt"></i> <span id="date">4th</span></div></td>
<td><div id="x2" class="battery"><i class="fas fa-car-battery"></i> <span id="battery">97<span>%</div></td>
<td><div id="x3" class="temp"><i class="fas fa-thermometer-full"></i> <span id="temp">36</span>&deg;</div></td>
</tr>
</table>
</div>
<div class="mainsal" id="mainsal">Good <span id="salutation" class="salutation">Morning</span></div>
</div>
<script type="text/javascript">
var whatCondition = ["Tornado", "Tropical Storm", "Hurricane", "Thunderstorm", "Thunderstorm", "Snow", "Sleet", "Sleet", "Freezing Drizzle", "Drizzle", "Freezing Rain", "Showers", "Showers", "Flurries", "Snow", "Snow", "Snow", "Hail", "Sleet", "Dust", "Fog", "Haze", "Smoky", "Blustery", "Windy", "Cold", "Cloudy", "Cloudy", "Cloudy", "Cloudy", "Cloudy", "Clear", "Sunny", "Fair", "Fair", "Sleet", "Hot", "Thunderstorms", "Thunderstorms", "Thunderstorms", "Showers", "Heavy Snow", "Light Snow", "Heavy Snow", "Partly Cloudy", "Thunderstorm", "Snow", "Thunderstorm", "Unknown"]
function mainUpdate(type){
if (type == "weather"){
document.getElementById('temp').innerHTML = weather.temperature;
} else if (type == "battery"){
document.getElementById('battery').innerHTML = batteryPercent;
}
}
function ordinal_suffix_of(i) {
var j = i % 10,
k = i % 100;
if (j == 1 && k != 11) {
return i + "st";
}
if (j == 2 && k != 12) {
return i + "nd";
}
if (j == 3 && k != 13) {
return i + "rd";
}
return i + "th";
}
function updateTime(){
var weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var amorpm = " PM";
var currentTime = new Date();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var day = currentTime.getDate();
var monthIndex = currentTime.getMonth();
var year = currentTime.getFullYear();
var day_of_week = weekdays[currentTime.getDay()];
if (hours < 12) {
document.getElementById('salutation').innerHTML = "Morning";
} else if (hours < 18) {
document.getElementById('salutation').innerHTML = "Afternoon";
} else {
document.getElementById('salutation').innerHTML = "Evening";
}
if (minutes < 10){
minutes = "0" + minutes
}
var myHours = hours;
if (myHours > 12){
myHours -= 12;
}
var t_str = myHours + ":" + minutes;
document.getElementById('date').innerHTML = ordinal_suffix_of(day);
document.getElementById('time').innerHTML = t_str;
}
setInterval(updateTime, 1000);
document.getElementById('container').style.color = WidgetColor;
document.getElementById('x1').style.color = WidgetColor;
document.getElementById('x2').style.color = WidgetColor;
document.getElementById('x3').style.color = WidgetColor;
document.getElementById('mainTime').style.zoom = TimeSize/100;
document.getElementById('FooterSize').style.zoom = FooterSize/100;
document.getElementById('mainsal').style.zoom = SalutationSize/100;
</script>
</body>
</html>
@downthecrop
Copy link
Author

File location: /var/mobile/Library/LockHTML/AndroidLeopard

Replace LockBackground.html with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment