Bladeren bron

Init upload

yeungalan 5 jaren geleden
bovenliggende
commit
6a01435af6

+ 38 - 0
Mirror (fork)/README.txt

@@ -0,0 +1,38 @@
+
+
+  __  __ _____ _____  _____   ____  _____  
+ |  \/  |_   _|  __ \|  __ \ / __ \|  __ \ 
+ | \  / | | | | |__) | |__) | |  | | |__) |
+ | |\/| | | | |  _  /|  _  /| |  | |  _  / 
+ | |  | |_| |_| | \ \| | \ \| |__| | | \ \ 
+ |_|  |_|_____|_|  \_\_|  \_\\____/|_|  \_\
+                                           
+                                           
+=================================================================
+ArOZ Mirror - ArOZ Online BETA Expansion Module
+
+# Introduction
+The ArOZ Mirror is an alternative to another open source project
+"MagicMirror?"
+https://magicmirror.builders/
+
+# Functions
+- Display current weather information
+- Display current date and time
+- Nope, there is no more functions
+
+# Localization
+The ArOZ Mirror copy one of the div from the page
+https://www.timeanddate.com/weather/ + <country name>
+In the case where the php hasn't defined the targeted country name,
+the system will read the country name from "location.txt".
+Hence, to change the location of the displayed location, you can update
+the country name from the location.txt and change it to your location.
+
+# Location Keys
+For a list of usable locations keywords, please visit:
+https://www.timeanddate.com/weather/?sort=1
+
+
+(C)IMUS Laboratory 2017-2018
+Licensed under MIT

+ 1 - 0
Mirror (fork)/description.txt

@@ -0,0 +1 @@
+-The Weather Mirror-<br>Tell you more about the outside world.

BIN
Mirror (fork)/img/385123-200.png


BIN
Mirror (fork)/img/Thumbs.db


BIN
Mirror (fork)/img/bg/1.jpeg


BIN
Mirror (fork)/img/bg/2.jpeg


BIN
Mirror (fork)/img/bg/3.jpeg


BIN
Mirror (fork)/img/bg/4.jpeg


BIN
Mirror (fork)/img/bg/5.jpeg


BIN
Mirror (fork)/img/bg/6.jpeg


BIN
Mirror (fork)/img/bg/7.jpeg


BIN
Mirror (fork)/img/bg/8.jpeg


BIN
Mirror (fork)/img/bg/9.jpeg


BIN
Mirror (fork)/img/function_icon.png


BIN
Mirror (fork)/img/function_icon.psd


BIN
Mirror (fork)/img/function_icon_old.png


BIN
Mirror (fork)/img/pexels-photo.jpg


BIN
Mirror (fork)/img/small_icon.png


BIN
Mirror (fork)/img/small_icon.psd


+ 64 - 0
Mirror (fork)/index.php

@@ -0,0 +1,64 @@
+<?php
+include '../auth.php';
+?>
+<!--
+2018/1/21 Aroz Mirror Edit Project
+
+
+-->
+<html>
+<head>
+<title>ArOZ Mirror</title>
+<meta charset="UTF-8">
+<link rel="stylesheet" href="../script/tocas/tocas.css">
+<script src="../script/tocas/tocas.js"></script>
+<script src="../script/jquery.min.js"></script>
+</head>
+<body>
+<br><br><br><br><br>
+<div class="ts text container">
+<div id="maindiv" class="ts segment">
+    <h4><i class="caution sign icon"></i>ArOZ Module Warning</h4>
+	<h6>Module Directory: <?php echo basename(__DIR__);?></h6>
+    <p>This function might need Internet Access permission.
+	<br>If you proceed to the module, it means you have agreed to give the module the following permissions:</p>
+	<div class="ts secondary segment">
+		<p><i class="checkmark icon"></i>Internet Connection Permission</p>
+		<p><i class="checkmark icon"></i>Read System Time</p>
+		<p><i class="checkmark icon"></i>Write data into localStorage</p>
+		<p><i class="checkmark icon"></i>Responsible for all internet fee accounting to the module's internet access.</p>
+	</div>
+    <p>ArOZ Online BETA System cannot ensure your data is secured during the connection.
+	<br>Please use this module with your own risk.
+	<br>You can always change your mind by removing the setting in localStorage within your browser.
+	</p>
+	<p>Click the confirm button below to proceed.</p>
+	<a onClick="ConfirmBtn();" class="ts small basic positive button">Confirm</a>
+	<a href="../" class="ts small basic negative button">Cancel</a>
+</div>
+</div>
+<script>
+//This script is used to store the informatio of if the user confirmed before or not.
+if (localStorage.getItem("Mirror.Confirm") == null){
+	//The user has never confirm before
+}else if(localStorage.getItem("Mirror.Confirm") == 'true'){
+	$('#maindiv').html("<h4>Standby!</h4><br>Loading Weather Information from the network...<br>If you get stuck in this page, check if your network connection is working or not :)");
+	if(navigator.onLine) {
+		window.location.href = "main.php";
+	}else{
+		$('#maindiv').html("<h4>Something went Wrong!</h4><br>You need internet access to use this module.");
+	}
+	
+	
+}
+
+function ConfirmBtn(){
+	localStorage.setItem("Mirror.Confirm",'true');
+	window.location.href="main.php";
+}
+
+
+</script>
+
+</body>
+</html>

+ 398 - 0
Mirror (fork)/main.php

@@ -0,0 +1,398 @@
+<?php
+include '../auth.php';
+?>
+<html>
+<head>
+<?php
+//header("Content-Type: text/plain");
+  $bg = array('1.jpeg','2.jpeg','3.jpeg','4.jpeg','5.jpeg','6.jpeg','7.jpeg','8.jpeg','9.jpeg'); // array of filenames
+
+  $i = rand(0, count($bg)-1); // generate random number size of the array
+  $selectedBg = "$bg[$i]"; // set variable equal to which random filename was chosen
+?>
+<title>ArOZ Mirror</title>
+<link rel="stylesheet" href="../script/tocas/tocas.css">
+<script src="../script/tocas/tocas.js"></script>
+<script src="../script/jquery.min.js"></script>
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/weather-icons/2.0.9/css/weather-icons-wind.min.css">
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/weather-icons/2.0.9/css/weather-icons.min.css">
+<style>
+  h1 { margin:0 0 10px 0; }
+  .wrapper { position: relative; height:200px; width:300px; margin:20px 0; overflow:hidden; }
+  .content { position:absolute; bottom:0; width:100%; }
+  .content div { padding:10px;}
+  
+  body{
+background: url(img/bg/<?php echo $selectedBg; ?>) no-repeat;
+    background-size:     cover;                      /* <------ */
+    background-repeat:   no-repeat;
+}
+
+</style>
+<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
+
+<!-- style="background-color:black;color:white;" -->
+</head>
+<body style="color:white;">
+<div id="time" align="right" style="position: fixed; top: 10%; right: 5%; width: auto; height: 300px;">
+<div id="dayOfWeek" style="font-size: 5vh;height:5vh;"></div>
+<div id="CurrentDate" style="font-size: 4vh;height:4vh;"></div>
+<div id="CurrentTime" style="font-size: 3vh;height:3vh;"></div>
+</div>
+
+<div id="weather" align="left" style="position: fixed; top: 10%; left: 5%; width: auto; height: 500px;">
+
+<div style="font-size: 4vh;height:4vh;" id="country" style="text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black !important;"></div>
+<div style="font-size: 2vh;height:2vh;">
+   <div class="h1"></div>
+   <p id="city" style="font-size: 3vh;"></p>
+   <br>
+   <P><i class="wi wi-night-sleet"  style="font-size:80px" id="weathericon"></i></p>
+   <div class="h2" id="temp" style="text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;"></div>
+   <p id="description" style="text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;"></p>
+   <!-- <br class="clear"> -->
+   <p id="forecast_details" style="text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;"></p>
+   <p id="wind_details" style="text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;"></p>
+</div>
+</div>
+
+</body>
+<script>
+$( document ).ready(function() {
+    var t = setInterval(updateTime,1000);
+	//show(22.302242, 114.174052);
+	setTimeout(getLocation(),1500);
+});
+
+function updateTime(){
+	var currentdate = new Date(); 
+	$("#dayOfWeek").html(GetDay());
+	$("#CurrentTime").html(zeroFill(currentdate.getHours(),2) + ":"+ zeroFill(currentdate.getMinutes(),2) + ":"  + zeroFill(currentdate.getSeconds(),2));
+	//$("#CurrentDate").html(currentdate.getDate() + "/" + (currentdate.getMonth()+1) + "/" + currentdate.getFullYear());
+	$("#CurrentDate").html(GetMonthName() + " " + currentdate.getDate() +", " + currentdate.getFullYear());
+}
+
+function GetDay(){
+	var d = new Date();
+	var weekday = new Array(7);
+	weekday[0] =  "Sunday";
+	weekday[1] = "Monday";
+	weekday[2] = "Tuesday";
+	weekday[3] = "Wednesday";
+	weekday[4] = "Thursday";
+	weekday[5] = "Friday";
+	weekday[6] = "Saturday";
+
+	var n = weekday[d.getDay()];
+	return n;
+}
+
+function GetMonthName(){
+	var monthNames = ["January", "February", "March", "April", "May", "June","July", "August", "September", "October", "November", "December"];
+	var d = new Date();
+	return(monthNames[d.getMonth()]);
+}
+function zeroFill( number, width )
+{
+  width -= number.toString().length;
+  if ( width > 0 )
+  {
+    return new Array( width + (/\./.test( number ) ? 2 : 1) ).join( '0' ) + number;
+  }
+  return number + ""; // always return a string
+}
+</script>
+
+<script>
+function getLocation() {
+    if (navigator.geolocation) {
+			navigator.geolocation.getCurrentPosition(showPosition);	
+    } else { 
+        console.log("Geolocation is not supported by this browser.");}
+    }
+function showPosition(position) {
+    console.log("Latitude: " + position.coords.latitude + "Longitude: " + position.coords.longitude);
+	show(position.coords.latitude , position.coords.longitude);
+}
+function show(lt , ln){
+	$.getJSON( "https://fcc-weather-api.glitch.me/api/current?lat=" + lt.toFixed(5) + "&lon=" + ln.toFixed(5), function( data ) {
+		if(typeof data.sys.country !== "undefined"){
+			$( "#country" ).text(ISO3166[data.sys.country]);
+		}
+		if(typeof data.name !== "undefined"){
+			$( "#city" ).text(data.name);
+		}
+		if(typeof data.weather[0].id !== "undefined"){
+			$( "#weathericon").attr('class',"wi wi-owm-" + data.weather[0].id);
+		}
+		if(typeof data.main.temp !== "undefined"){
+			$( "#temp" ).text(data.main.temp + " °C");
+		}
+		if(typeof data.weather[0].main !== "undefined"){
+			$( "#description" ).text(data.weather[0].main);
+		}
+		if(typeof data.main.temp_max !== "undefined" && typeof data.main.temp_min !== "undefined"){
+			$( "#forecast_details" ).html('Forecast: ' + data.main.temp_max + ' / ' + data.main.temp_min + '&nbsp;°C');
+		}
+		if(typeof data.wind.speed !== "undefined"){
+			$( "#wind_details" ).html('Wind: ' + data.wind.speed + ' km/h');
+		}
+		if(typeof data.wind.deg !== "undefined"){
+			$( "#wind_details" ).append(' <span class="comp sa20" ><i class="wi wi-wind towards-' + data.wind.deg + '-deg"></i></span> from ' + data.wind.deg + 'degree');
+		}
+	});
+}
+
+var ISO3166 = {
+	"AF": "Afghanistan",
+	"AX": "land Islands",
+	"AL": "Albania",
+	"DZ": "Algeria",
+	"AS": "American Samoa",
+	"AD": "Andorra",
+	"AO": "Angola",
+	"AI": "Anguilla",
+	"AQ": "Antarctica",
+	"AG": "Antigua and Barbuda",
+	"AR": "Argentina",
+	"AM": "Armenia",
+	"AW": "Aruba",
+	"AU": "Australia",
+	"AT": "Austria",
+	"AZ": "Azerbaijan",
+	"BS": "Bahamas",
+	"BH": "Bahrain",
+	"BD": "Bangladesh",
+	"BB": "Barbados",
+	"BY": "Belarus",
+	"BE": "Belgium",
+	"BZ": "Belize",
+	"BJ": "Benin",
+	"BM": "Bermuda",
+	"BT": "Bhutan",
+	"BO": "Bolivia",
+	"BQ": "Bonaire",
+	"BA": "Bosnia and Herzegovina",
+	"BW": "Botswana",
+	"BV": "Bouvet Island",
+	"BR": "Brazil",
+	"IO": "British Indian Ocean Territory",
+	"BN": "Brunei Darussalam",
+	"BG": "Bulgaria",
+	"BF": "Burkina Faso",
+	"BI": "Burundi",
+	"KH": "Cambodia",
+	"CM": "Cameroon",
+	"CA": "Canada",
+	"CV": "Cape Verde",
+	"KY": "Cayman Islands",
+	"CF": "Central African Republic",
+	"TD": "Chad",
+	"CL": "Chile",
+	"CN": "China",
+	"CX": "Christmas Island",
+	"CC": "Cocos (Keeling) Islands",
+	"CO": "Colombia",
+	"KM": "Comoros",
+	"CG": "Congo",
+	"CD": "Congo",
+	"CK": "Cook Islands",
+	"CR": "Costa Rica",
+	"CI": "Cte d'Ivoire",
+	"HR": "Croatia",
+	"CU": "Cuba",
+	"CW": "Curaao",
+	"CY": "Cyprus",
+	"CZ": "Czech Republic",
+	"DK": "Denmark",
+	"DJ": "Djibouti",
+	"DM": "Dominica",
+	"DO": "Dominican Republic",
+	"EC": "Ecuador",
+	"EG": "Egypt",
+	"SV": "El Salvador",
+	"GQ": "Equatorial Guinea",
+	"ER": "Eritrea",
+	"EE": "Estonia",
+	"ET": "Ethiopia",
+	"FK": "Falkland Islands (Malvinas)",
+	"FO": "Faroe Islands",
+	"FJ": "Fiji",
+	"FI": "Finland",
+	"FR": "France",
+	"GF": "French Guiana",
+	"PF": "French Polynesia",
+	"TF": "French Southern Territories",
+	"GA": "Gabon",
+	"GM": "Gambia",
+	"GE": "Georgia",
+	"DE": "Germany",
+	"GH": "Ghana",
+	"GI": "Gibraltar",
+	"GR": "Greece",
+	"GL": "Greenland",
+	"GD": "Grenada",
+	"GP": "Guadeloupe",
+	"GU": "Guam",
+	"GT": "Guatemala",
+	"GG": "Guernsey",
+	"GN": "Guinea",
+	"GW": "Guinea-Bissau",
+	"GY": "Guyana",
+	"HT": "Haiti",
+	"HM": "Heard Island and McDonald Islands",
+	"VA": "Holy See (Vatican City State)",
+	"HN": "Honduras",
+	"HK": "Hong Kong",
+	"HU": "Hungary",
+	"IS": "Iceland",
+	"IN": "India",
+	"ID": "Indonesia",
+	"IR": "Iran",
+	"IQ": "Iraq",
+	"IE": "Ireland",
+	"IM": "Isle of Man",
+	"IL": "Israel",
+	"IT": "Italy",
+	"JM": "Jamaica",
+	"JP": "Japan",
+	"JE": "Jersey",
+	"JO": "Jordan",
+	"KZ": "Kazakhstan",
+	"KE": "Kenya",
+	"KI": "Kiribati",
+	"KP": "Korea",
+	"KR": "Korea",
+	"KW": "Kuwait",
+	"KG": "Kyrgyzstan",
+	"LA": "Lao People's Democratic Republic",
+	"LV": "Latvia",
+	"LB": "Lebanon",
+	"LS": "Lesotho",
+	"LR": "Liberia",
+	"LY": "Libya",
+	"LI": "Liechtenstein",
+	"LT": "Lithuania",
+	"LU": "Luxembourg",
+	"MO": "Macao",
+	"MK": "Macedonia",
+	"MG": "Madagascar",
+	"MW": "Malawi",
+	"MY": "Malaysia",
+	"MV": "Maldives",
+	"ML": "Mali",
+	"MT": "Malta",
+	"MH": "Marshall Islands",
+	"MQ": "Martinique",
+	"MR": "Mauritania",
+	"MU": "Mauritius",
+	"YT": "Mayotte",
+	"MX": "Mexico",
+	"FM": "Micronesia",
+	"MD": "Moldova",
+	"MC": "Monaco",
+	"MN": "Mongolia",
+	"ME": "Montenegro",
+	"MS": "Montserrat",
+	"MA": "Morocco",
+	"MZ": "Mozambique",
+	"MM": "Myanmar",
+	"NA": "Namibia",
+	"NR": "Nauru",
+	"NP": "Nepal",
+	"NL": "Netherlands",
+	"NC": "New Caledonia",
+	"NZ": "New Zealand",
+	"NI": "Nicaragua",
+	"NE": "Niger",
+	"NG": "Nigeria",
+	"NU": "Niue",
+	"NF": "Norfolk Island",
+	"MP": "Northern Mariana Islands",
+	"NO": "Norway",
+	"OM": "Oman",
+	"PK": "Pakistan",
+	"PW": "Palau",
+	"PS": "Palestine",
+	"PA": "Panama",
+	"PG": "Papua New Guinea",
+	"PY": "Paraguay",
+	"PE": "Peru",
+	"PH": "Philippines",
+	"PN": "Pitcairn",
+	"PL": "Poland",
+	"PT": "Portugal",
+	"PR": "Puerto Rico",
+	"QA": "Qatar",
+	"RE": "Runion",
+	"RO": "Romania",
+	"RU": "Russian Federation",
+	"RW": "Rwanda",
+	"BL": "Saint Barthlemy",
+	"SH": "Saint Helena",
+	"KN": "Saint Kitts and Nevis",
+	"LC": "Saint Lucia",
+	"MF": "Saint Martin (French part)",
+	"PM": "Saint Pierre and Miquelon",
+	"VC": "Saint Vincent and the Grenadines",
+	"WS": "Samoa",
+	"SM": "San Marino",
+	"ST": "Sao Tome and Principe",
+	"SA": "Saudi Arabia",
+	"SN": "Senegal",
+	"RS": "Serbia",
+	"SC": "Seychelles",
+	"SL": "Sierra Leone",
+	"SG": "Singapore",
+	"SX": "Sint Maarten (Dutch part)",
+	"SK": "Slovakia",
+	"SI": "Slovenia",
+	"SB": "Solomon Islands",
+	"SO": "Somalia",
+	"ZA": "South Africa",
+	"GS": "South Georgia and the South Sandwich Islands",
+	"SS": "South Sudan",
+	"ES": "Spain",
+	"LK": "Sri Lanka",
+	"SD": "Sudan",
+	"SR": "Suriname",
+	"SJ": "Svalbard and Jan Mayen",
+	"SZ": "Swaziland",
+	"SE": "Sweden",
+	"CH": "Switzerland",
+	"SY": "Syrian Arab Republic",
+	"TW": "Taiwan",
+	"TJ": "Tajikistan",
+	"TZ": "Tanzania",
+	"TH": "Thailand",
+	"TL": "Timor-Leste",
+	"TG": "Togo",
+	"TK": "Tokelau",
+	"TO": "Tonga",
+	"TT": "Trinidad and Tobago",
+	"TN": "Tunisia",
+	"TR": "Turkey",
+	"TM": "Turkmenistan",
+	"TC": "Turks and Caicos Islands",
+	"TV": "Tuvalu",
+	"UG": "Uganda",
+	"UA": "Ukraine",
+	"AE": "United Arab Emirates",
+	"GB": "United Kingdom",
+	"US": "United States",
+	"UM": "United States Minor Outlying Islands",
+	"UY": "Uruguay",
+	"UZ": "Uzbekistan",
+	"VU": "Vanuatu",
+	"VE": "Venezuela",
+	"VN": "Viet Nam",
+	"VG": "Virgin Islands",
+	"VI": "Virgin Islands",
+	"WF": "Wallis and Futuna",
+	"EH": "Western Sahara",
+	"YE": "Yemen",
+	"ZM": "Zambia",
+	"ZW": "Zimbabwe"
+}
+</script>
+</html>