1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 background-color: #ffffff;
12 transition: opacity 2s, background-color 2s, background-position 2s;
13 transition-timing-function: ease-in;
17 background: linear-gradient(transparent, SlateGray);
18 background-color: #ffffff;
19 font-family: 'sans-serif';
23 html.session_starting {
27 .session_starting body {
29 background-color: rgba(0, 0, 0, 0);
30 background-position-y: -100%;
36 display: -webkit-flex;
38 -webkit-flex-direction: column;
39 flex-direction: column;
42 .topBox, .inputBox, .messageBox {
66 box-sizing: border-box;
76 background: rgba(0, 0, 0, 0.05);
78 box-sizing: border-box;
81 border: none !important;
82 padding: 14px 4% !important;
85 background-color: #fff;
88 border-radius: 3px !important;
92 background: rgba(0, 0, 0, 0.1);
93 color: rgba(0, 0, 0, 0.75);
96 input#entry:focus::placeholder {
97 color: rgba(255, 255, 255, 0.3);
110 font-family: "Noto Sans";
112 .splash-screen-text {
126 box-shadow: inset 0 0 100px black;
130 <script src="js/jquery-3.4.1.min.js"></script>
132 var adjustBackground = function() {
133 // if the image is larger than the screen center it
134 // if the image is too small, perseve the aspect ratio and scale up
135 // once both the height and the width are large enough, center the image
139 <div class="container">
140 <div id="splash-screen">
141 <div class="vignette">
142 <img class="splash-screen-img blur" src="images/splash-screen.jpg">
144 <div class="splash-screen-text">
145 <div id="clock">12:48</div>
149 <img onclick="javascript:lightdm.shutdown();" src="power_button.png"/>
151 <div class="inputBox">
152 <div class="wrapper">
153 <div id="prompt"></div>
154 <form action="javascript:handle_input();">
159 <div class="messageBox" id="messages"></div>
162 /*********************************************************/
163 /* Callbacks for the greeter */
164 /*********************************************************/
167 * show_prompt callback.
169 window.show_prompt = function(text, type) {
170 // type is either "text" or "password"
171 let prompt = document.getElementById("prompt"),
172 entry = document.getElementById("entry");
174 entry.placeholder = text.charAt(0).toUpperCase() + text.slice(1, -1);
182 * show_message callback.
184 window.show_message = function(text, type) {
185 if (0 === text.length) {
188 let messages = document.getElementById('messages');
189 messages.style.visibility = "visible";
190 // type is either "info" or "error"
191 if (type == 'error') {
192 text = `<p style="color:red;">${text}</p>`;
194 messages.innerHTML = `${messages.innerHTML}${text}`;
198 * authentication_complete callback.
200 var ac = function(session_key) {
201 if (lightdm.is_authenticated) {
202 // Start default session
203 document.documentElement.addEventListener('transitionend', () => lightdm.start_session_sync(session_key));
204 document.documentElement.className = 'session_starting';
206 window.show_message("Authentication Failed", "error");
207 setTimeout(window.start_authentication, 3000);
212 * autologin_timer_expired callback.
214 function autologin_timer_expired(username) {
215 /* Stub. Does nothing. */
218 /*******************************************************************/
219 /* Functions local to this theme */
220 /*******************************************************************/
225 function clear_messages() {
226 let messages = document.getElementById("messages");
227 messages.innerHTML = "";
228 messages.style.visibility = "hidden";
232 * Kickoff the authentication process
234 window.start_authentication = function() {
236 // start without providing "user" to make the greeter prompt for "user"
237 lightdm.authenticate();
241 * handle the input from the entry field.
243 window.handle_input = function() {
244 // let entry = document.getElementById("entry");
245 // lightdm.respond(entry.value);
248 function login(username, password, callback) {
249 // set default values
250 username = username || lightdm.select_user;
251 password = password || "";
252 // session_key = session_key || lightdm.sessions[0].key;
254 var auth_cb = function() {
255 lightdm.respond(password);
257 var auth_complete_cb = function() {
258 if (typeof callback == "function")
259 callback(lightdm.is_authenticated);
261 window.show_prompt = auth_cb;
262 window.authentication_complete = auth_complete_cb;
265 lightdm.authenticate(username);
270 //TODO: make sure that lightdm is not referenced until pages has finished loading
271 setTimeout(() => login("jay", "", () => {
272 for(var x = 0; x < lightdm.sessions.length; x++){
273 window.show_message(lightdm.sessions[x].key, "info");