Browse Source

minor improvements to the simple theme

sisyphus
Dustin Falgout 8 years ago
parent
commit
e31680ee7b
  1. 118
      themes/simple/index.html

118
themes/simple/index.html

@ -6,14 +6,30 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
opacity: 1;
margin: 0; margin: 0;
background-color: #ffffff;
transition: opacity 2s, background-color 2s, background-position 2s;
transition-timing-function: ease-in;
} }
body { body {
background: linear-gradient(white, SlateGray); background: linear-gradient(transparent, SlateGray);
background-color: #ffffff;
font-family: 'sans-serif';
font-size: 24px; font-size: 24px;
} }
html.session_starting {
opacity: 0;
}
.session_starting body {
opacity: 0;
background-color: rgba(0, 0, 0, 0);
background-position-y: -100%;
}
.container { .container {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -35,6 +51,7 @@
.wrapper { .wrapper {
height: 85px; height: 85px;
width: 350px;
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
@ -53,10 +70,36 @@
text-align: center; text-align: center;
visibility: hidden; visibility: hidden;
} }
input#entry {
outline: none;
background: rgba(0, 0, 0, 0.05);
box-shadow: none;
box-sizing: border-box;
line-height: normal;
transition: .3s ease;
border: none !important;
padding: 14px 4% !important;
font-size: 16px;
color: #666;
background-color: #fff;
width: 100%;
font-weight: 400;
border-radius: 3px !important;
}
input#entry:focus {
background: rgba(0, 0, 0, 0.1);
color: rgba(0, 0, 0, 0.75);
}
input#entry:focus::placeholder {
color: rgba(255, 255, 255, 0.3);
}
</style> </style>
</head> </head>
<body> <body id="body">
<div class="container"> <div class="container">
<div class="topBox"> <div class="topBox">
<img onclick="javascript:lightdm.shutdown();" src="power_button.png"/> <img onclick="javascript:lightdm.shutdown();" src="power_button.png"/>
@ -64,7 +107,7 @@
<div class="inputBox"> <div class="inputBox">
<div class="wrapper"> <div class="wrapper">
<div id="prompt"></div> <div id="prompt"></div>
<form action="javascript: handle_input()"> <form action="javascript:handle_input();">
<input id="entry" /> <input id="entry" />
</form> </form>
</div> </div>
@ -72,49 +115,56 @@
<div class="messageBox" id="messages"></div> <div class="messageBox" id="messages"></div>
</div> </div>
<script> <script>
/*********************************************************************/ /*********************************************************/
/* Callbacks for lightdm-webkit-greeter */ /* Callbacks for the greeter */
/*********************************************************************/ /*********************************************************/
/** /**
* show_prompt callback. * show_prompt callback.
*/ */
function show_prompt(text, type) { window.show_prompt = function(text, type) {
// type is either "text" or "password" // type is either "text" or "password"
prompt = document.getElementById("prompt"); let prompt = document.getElementById("prompt"),
prompt.innerHTML = text; entry = document.getElementById("entry");
entry = document.getElementById("entry");
entry.value = ""; // clear entry entry.placeholder = text.charAt(0).toUpperCase() + text.slice(1, -1);
// clear entry
entry.value = "";
entry.type = type; entry.type = type;
entry.focus(); };
}
/** /**
* show_message callback. * show_message callback.
*/ */
function show_message(text, type) { window.show_message = function(text, type) {
if (text.length == 0) if (0 === text.length) {
return; return;
messages = document.getElementById("messages"); }
let messages = document.getElementById('messages');
messages.style.visibility = "visible"; messages.style.visibility = "visible";
// type is either "info" or "error" // type is either "info" or "error"
if (type == "error") { if (type == 'error') {
text = "<p style=\"color:red;\">" + text + "</p>"; text = `<p style="color:red;">${text}</p>`;
} }
messages.innerHTML = messages.innerHTML + text; messages.innerHTML = `${messages.innerHTML}${text}`;
} };
/** /**
* authentication_complete callback. * authentication_complete callback.
*/ */
function authentication_complete() { window.authentication_complete = function() {
console.log('fired!');
if (lightdm.is_authenticated) { if (lightdm.is_authenticated) {
lightdm.start_session_sync(); // Start default session // Start default session
// let body = document.getElementById('body');
document.documentElement.addEventListener('transitionend', lightdm.start_session_sync);
document.documentElement.className = 'session_starting';
} else { } else {
show_message("Authentication Failed", "error"); show_message("Authentication Failed", "error");
setTimeout(start_authentication, 3000); setTimeout(start_authentication, 3000);
} }
} };
/** /**
* autologin_timer_expired callback. * autologin_timer_expired callback.
@ -123,15 +173,15 @@
/* Stub. Does nothing. */ /* Stub. Does nothing. */
} }
/*********************************************************************/ /*******************************************************************/
/* Functions local to this greeter */ /* Functions local to this theme */
/*********************************************************************/ /*******************************************************************/
/** /**
* clear_messages * clear_messages
*/ */
function clear_messages() { function clear_messages() {
messages = document.getElementById("messages"); let messages = document.getElementById("messages");
messages.innerHTML = ""; messages.innerHTML = "";
messages.style.visibility = "hidden"; messages.style.visibility = "hidden";
} }
@ -139,18 +189,20 @@
/** /**
* Kickoff the authentication process * Kickoff the authentication process
*/ */
function start_authentication() { window.start_authentication = function() {
clear_messages(); clear_messages();
lightdm.start_authentication(); // start with null userid, have pam prompt for userid. // start without providing "user" to make the greeter prompt for "user"
} lightdm.authenticate();
};
/** /**
* handle the input from the entry field. * handle the input from the entry field.
*/ */
function handle_input() { window.handle_input = function() {
entry = document.getElementById("entry"); let entry = document.getElementById("entry");
lightdm.respond(entry.value); lightdm.respond(entry.value);
} };
</script> </script>
<!--<script src="../_vendor/js/mock.js"></script>--> <!--<script src="../_vendor/js/mock.js"></script>-->
<script> <script>

Loading…
Cancel
Save