diff options
author | David Phillips <dbphillipsnz@gmail.com> | 2016-03-14 15:21:52 +1300 |
---|---|---|
committer | David Phillips <dbphillipsnz@gmail.com> | 2016-03-14 15:21:52 +1300 |
commit | 00f2fc95a0db4e2f26c5d09ac292d0e682799744 (patch) | |
tree | 736b157886a34138a9d7e454c2539eb33429f47b | |
parent | b4607e0d51a1982272460e0ab9af359d92876f3f (diff) | |
parent | b0911b7b5556bfe621b6d42b51533c2264bae0f8 (diff) | |
download | petrichor-00f2fc95a0db4e2f26c5d09ac292d0e682799744.tar.xz |
Merge branch 'power-options' into develop
-rw-r--r-- | image/cancel.png | bin | 0 -> 1125 bytes | |||
-rw-r--r-- | image/reboot.png | bin | 0 -> 3790 bytes | |||
-rw-r--r-- | image/shutdown.png | bin | 0 -> 3477 bytes | |||
-rw-r--r-- | index.html | 25 | ||||
-rw-r--r-- | petrichor.css | 71 | ||||
-rw-r--r-- | petrichor.js | 10 |
6 files changed, 104 insertions, 2 deletions
diff --git a/image/cancel.png b/image/cancel.png Binary files differnew file mode 100644 index 0000000..4d6a0ca --- /dev/null +++ b/image/cancel.png diff --git a/image/reboot.png b/image/reboot.png Binary files differnew file mode 100644 index 0000000..52695ec --- /dev/null +++ b/image/reboot.png diff --git a/image/shutdown.png b/image/shutdown.png Binary files differnew file mode 100644 index 0000000..d2a7b96 --- /dev/null +++ b/image/shutdown.png @@ -20,7 +20,30 @@ <div id="message-container"> <span id="message-label"></span> </div> + <a id="mask" href="#" onclick="hide_element('power-confirm');hide_element('mask');"></a> + <div id="power-confirm" onclick="document.getElementById('mask').click();"> + <ul> + <li> + <a class="button" href="#" onclick="lightdm.shutdown();"> + <div class="icon" id="icon-shutdown"></div> + <span>Power off</span> + </a> + </li> + <li> + <a class="button" href="#" onclick="lightdm.restart();"> + <div class="icon" id="icon-reboot"></div> + <span>Restart</span> + </a> + </li> + <li> + <a class="button" href="#" onclick="hide_element('power-confirm');hide_element('mask');"> + <div class="icon" id="icon-cancel"></div> + <span>Cancel</span> + </a> + </li> + </ul> + </div> <select id="session-list" class="ease-opacity"></select> - <img id="shutdown" class="ease-opacity" src="iec5009.svg" onclick="lightdm.shutdown();" /> + <img id="shutdown" class="ease-opacity" src="iec5009.svg" onclick="show_element('power-confirm');show_element('mask');" /> </body> </html> diff --git a/petrichor.css b/petrichor.css index 72d1b6e..c752ff0 100644 --- a/petrichor.css +++ b/petrichor.css @@ -18,6 +18,75 @@ body,html transition: opacity ease 0.3s; } +#mask +{ + text-align: center; + transition: visibility 0s linear 0.15s, opacity 0.15s linear; + position: absolute; + top: 0px; + left: 0px; + right: 0px; + bottom: 0px; + background-color: rgba(0,0,0,0.7); + visibility: hidden; + opacity: 0; +} + +#power-confirm +{ + position: absolute; + left: 50%; + bottom: 50px; + visibility: hidden; + opacity: 0; +} + +#power-confirm > ul +{ + display: inline-block; + margin: 0px 0px 0px -50%; +} + +#power-confirm li +{ + text-align: center; + list-style: none; + display: inline-block; + margin-left: 2em; + margin-right: 2em; +} + +#power-confirm li a +{ + text-decoration: none; + color: inherit; + font-size: 1.5em; + display: inline-block; +} + +#power-confirm li div +{ + display: block; + height: 96px; + width: 96px; + border-radius: 48px; +} + +#icon-shutdown +{ + background: url('image/shutdown.png') #C33; +} + +#icon-reboot +{ + background: url('image/reboot.png') #33C; +} + +#icon-cancel +{ + background: url('image/cancel.png') #3C3; +} + #shutdown { position: absolute; @@ -106,7 +175,7 @@ a.user transition: visibility 0s linear 0.15s, opacity 0.15s linear; } -#password-container.shown, #message-container.shown +#password-container.shown, #message-container.shown, #mask.shown, #power-confirm.shown { visibility: visible; opacity: 1; diff --git a/petrichor.js b/petrichor.js index b5e06ed..fa4a100 100644 --- a/petrichor.js +++ b/petrichor.js @@ -2,6 +2,16 @@ password_prompt = false; selected_user = null; time_remaining = 0 +function show_element(id) +{ + document.getElementById(id).classList.add("shown"); +} + +function hide_element(id) +{ + document.getElementById(id).classList.remove("shown"); +} + function show_prompt(text, type) { password_prompt = true; |