fixed lockscreen up a little
This commit is contained in:
		| @@ -16,6 +16,11 @@ document.body.addEventListener('click', () => { | |||||||
| // Lock screen or show mode | // Lock screen or show mode | ||||||
| let screenState = 'lock'; | let screenState = 'lock'; | ||||||
|  |  | ||||||
|  | let cookieScreen = getCookie('screen'); | ||||||
|  | if (cookieScreen) { | ||||||
|  | 	screenState = cookieScreen; | ||||||
|  | } | ||||||
|  |  | ||||||
| function handleImage() { | function handleImage() { | ||||||
| 	if (screenState === 'lock') { | 	if (screenState === 'lock') { | ||||||
| 		fetch('https://staging.thegreydiamond.de/projects/photoPortfolio/api/getRand.php?uuid=01919dec-b2cd-7adc-8ca2-a071d1169cbc&unsplash=true&orientation=landscape') | 		fetch('https://staging.thegreydiamond.de/projects/photoPortfolio/api/getRand.php?uuid=01919dec-b2cd-7adc-8ca2-a071d1169cbc&unsplash=true&orientation=landscape') | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 4.7 MiB After Width: | Height: | Size: 637 KiB | 
| @@ -689,6 +689,16 @@ document.addEventListener('DOMContentLoaded', () => { | |||||||
| 	}); | 	}); | ||||||
|       }); |       }); | ||||||
|  |  | ||||||
|  | function setCookie(name, value, days) { | ||||||
|  | 	let expires = ""; | ||||||
|  | 	if(days) { | ||||||
|  | 		let date = new Date(); | ||||||
|  | 		date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); | ||||||
|  | 		expires = "; expires=" + date.toUTCString(); | ||||||
|  | 	} | ||||||
|  | 	document.cookie = name + "=" + value + expires + "; path=/"; | ||||||
|  | } | ||||||
|  |  | ||||||
| function getCookie(name) { | function getCookie(name) { | ||||||
| 	let value = "; " + document.cookie; | 	let value = "; " + document.cookie; | ||||||
| 	let parts = value.split("; " + name + "="); | 	let parts = value.split("; " + name + "="); | ||||||
|   | |||||||
| @@ -10,7 +10,8 @@ | |||||||
|     <div id="date"></div> |     <div id="date"></div> | ||||||
|  |  | ||||||
| </div> | </div> | ||||||
|  | <script src="/static/apiWrapper.js"></script> | ||||||
|  | <script src="/static/pageDriver.js"></script> | ||||||
| <script src="/static/js/lockscreenBgHandler.js"></script> | <script src="/static/js/lockscreenBgHandler.js"></script> | ||||||
|  |  | ||||||
| <%~ include("partials/base_foot.eta") %> | <%~ include("partials/base_foot.eta") %>	 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user