mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Easter egg special Manon
This commit is contained in:
		
							
								
								
									
										1
									
								
								assets/3rdparty/clippy.js/Agents/Merlin/agent.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								assets/3rdparty/clippy.js/Agents/Merlin/agent.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								assets/3rdparty/clippy.js/Agents/Merlin/map.png
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/3rdparty/clippy.js/Agents/Merlin/map.png
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 1013 KiB  | 
							
								
								
									
										1
									
								
								assets/3rdparty/clippy.js/Agents/Merlin/sounds-mp3.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								assets/3rdparty/clippy.js/Agents/Merlin/sounds-mp3.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										1
									
								
								assets/3rdparty/clippy.js/Agents/Merlin/sounds-ogg.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								assets/3rdparty/clippy.js/Agents/Merlin/sounds-ogg.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										62
									
								
								assets/3rdparty/clippy.js/clippy.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								assets/3rdparty/clippy.js/clippy.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,62 @@
 | 
				
			|||||||
 | 
					.clippy, .clippy-balloon {
 | 
				
			||||||
 | 
					    position: fixed;
 | 
				
			||||||
 | 
					    z-index: 1000;
 | 
				
			||||||
 | 
					    cursor: pointer;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.clippy-balloon {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    background: #FFC;
 | 
				
			||||||
 | 
					    color: black;
 | 
				
			||||||
 | 
					    padding: 8px;
 | 
				
			||||||
 | 
					    border: 1px solid black;
 | 
				
			||||||
 | 
					    border-radius: 5px;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.clippy-content {
 | 
				
			||||||
 | 
					    max-width: 200px;
 | 
				
			||||||
 | 
					    min-width: 120px;
 | 
				
			||||||
 | 
					    font-family: "Microsoft Sans", sans-serif;
 | 
				
			||||||
 | 
					    font-size: 10pt;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.clippy-tip {
 | 
				
			||||||
 | 
					    width: 10px;
 | 
				
			||||||
 | 
					    height: 16px;
 | 
				
			||||||
 | 
					    background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAgCAMAAAAlvKiEAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAlQTFRF///MAAAA////52QwgAAAAAN0Uk5T//8A18oNQQAAAGxJREFUeNqs0kEOwCAIRFHn3//QTUU6xMyyxii+jQosrTPkyPEM6IN3FtzIRk1U4dFeKWQiH6pRRowMVKEmvronEynkwj0uZJgR22+YLopPSo9P34wJSamLSU7lSIWLJU7NkNomNlhqxUeAAQC+TQLZyEuJBwAAAABJRU5ErkJggg==) no-repeat;
 | 
				
			||||||
 | 
					    position: absolute;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.clippy-top-left .clippy-tip {
 | 
				
			||||||
 | 
					    top: 100%;
 | 
				
			||||||
 | 
					    margin-top: 0px;
 | 
				
			||||||
 | 
					    left: 100%;
 | 
				
			||||||
 | 
					    margin-left: -50px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.clippy-top-right .clippy-tip {
 | 
				
			||||||
 | 
					    top: 100%;
 | 
				
			||||||
 | 
					    margin-top: 0px;
 | 
				
			||||||
 | 
					    left: 0;
 | 
				
			||||||
 | 
					    margin-left: 50px;
 | 
				
			||||||
 | 
					    background-position: -10px 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.clippy-bottom-right .clippy-tip {
 | 
				
			||||||
 | 
					    top: 0;
 | 
				
			||||||
 | 
					    margin-top: -16px;
 | 
				
			||||||
 | 
					    left: 0;
 | 
				
			||||||
 | 
					    margin-left: 50px;
 | 
				
			||||||
 | 
					    background-position: -10px -16px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.clippy-bottom-left .clippy-tip {
 | 
				
			||||||
 | 
					    top: 0;
 | 
				
			||||||
 | 
					    margin-top: -16px;
 | 
				
			||||||
 | 
					    left: 100%;
 | 
				
			||||||
 | 
					    margin-left: -50px;
 | 
				
			||||||
 | 
					    background-position: 0px -16px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								assets/3rdparty/clippy.js/clippy.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								assets/3rdparty/clippy.js/clippy.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										70
									
								
								assets/js/components/manon.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								assets/js/components/manon.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,70 @@
 | 
				
			|||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Manon's special (hidden) features
 | 
				
			||||||
 | 
					 * 
 | 
				
			||||||
 | 
					 * @author Pierre Hubert
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Check if it is Manon's birthday
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					async function checkManonBirthday() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Manon's feature only
 | 
				
			||||||
 | 
						if(userID() !== 150)
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						const date = new Date();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if(date.getMonth() != 4 && date.getDay() != 8)//TODO: replace
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Load clippy
 | 
				
			||||||
 | 
						const css = document.createElement("link");
 | 
				
			||||||
 | 
						css.rel = "stylesheet";
 | 
				
			||||||
 | 
						css.type = "text/css";
 | 
				
			||||||
 | 
						css.href = ComunicWeb.__config.assetsURL + "3rdparty/clippy.js/clippy.css"
 | 
				
			||||||
 | 
						document.head.appendChild(css);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						const js = document.createElement("script");
 | 
				
			||||||
 | 
						js.type = "text/javascript";
 | 
				
			||||||
 | 
						js.src = ComunicWeb.__config.assetsURL + "3rdparty/clippy.js/clippy.min.js"
 | 
				
			||||||
 | 
						document.body.appendChild(js);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						await new Promise((res, rej) => js.addEventListener("load", res));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						// Configure clippy
 | 
				
			||||||
 | 
						clippy.BASE_PATH = ComunicWeb.__config.assetsURL + "3rdparty/clippy.js/Agents/";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Load Merlin
 | 
				
			||||||
 | 
						const agent = await new Promise((res, rej) => clippy.load('Merlin', res));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Wait for Manon
 | 
				
			||||||
 | 
						await new Promise((res, rej) => window.addEventListener("mousedown", res, {once: true}));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Show the agent
 | 
				
			||||||
 | 
						agent.show();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						agent.play("Announce");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						agent.speak("Joyeux anniversaire Manon ! Que cette nouvelle année qui commence pour toi t'apporte la joie !", true);
 | 
				
			||||||
 | 
						setTimeout(() => agent.stopCurrent(), 8000);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						agent.play("Pleased", 6000, () => agent.hide());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Do the check on first page load only
 | 
				
			||||||
 | 
					document.addEventListener("wsOpen", () => {
 | 
				
			||||||
 | 
						setTimeout(() => checkManonBirthday(), 1000);
 | 
				
			||||||
 | 
					}, {
 | 
				
			||||||
 | 
						once: true
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
@@ -472,6 +472,7 @@ class Dev {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			//Pacman component (easter egg)
 | 
								//Pacman component (easter egg)
 | 
				
			||||||
			"js/components/pacman.js",
 | 
								"js/components/pacman.js",
 | 
				
			||||||
 | 
								"js/components/manon.js",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//User scripts
 | 
							//User scripts
 | 
				
			||||||
		"js/user/loginTokens.js",
 | 
							"js/user/loginTokens.js",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user