Commit 45a45515 authored by Yuanle Song's avatar Yuanle Song
Browse files

add doc on how to implement an overlay

parent 0ed0f5cb
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -72,6 +72,21 @@ the parent DOM.

* current                                                             :entry:
** 
** 2017-01-28 UI tweaks
- "refresh page" is for debugging purpose, hide it somewhere.
- div title should put buttons across the row.
  I think there is a flex property for this.
- add about dialog. could put "refresh page" in this page. hidden by default.

- implementation notes
  - how to implement a pop up window (overlay)?
    see ./test-div-overlay.html

    how to cast a shadow to make it more like a window?

    ~/html/yxyAR/src/static/common.css
    box-shadow: 2px 2px 2px black;

** 2017-01-27 add an about dialog.
add "about" button beside "Reset All".

test-div-overlay.html

0 → 100644
+105 −0
Original line number Diff line number Diff line
<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>test pop up window (overlay) </title>
    <style type="text/css">
      #container {
	  width: 700px;
	  margin: 0 auto;
      }
      .overlay {
	  display: none;
      }
      #overlay1-container {
	  width: 700px;
	  height: 90vh;
	  /* background: rgba(0,0,0,0.4); */
	  /* background: rgba(135,206,235,0.8); */
	  background: rgba(65,105,225,0.2);
	  /* border: 1px skyblue solid; */
	  position: fixed;
	  top: 10px;
      }
      #overlay1-content {
	  width: 400px;
	  height: 300px;
	  /* border: 1px red solid; */
	  margin: 20px auto;
	  background: white;
	  box-shadow: 3px 3px 3px black;
      }
      #overlay1-content {
	  padding: 20px;
      }
      #close-overlay1 {
	  position: relative;
	  left: 100px;
      }
      #overlay2 {
	  width: 200px;
	  height: 150px;
	  border: 1px red solid;
	  position: fixed;
	  top: 10px;
	  background: white;
      }
    </style>
  </head>

  <body>
    <div id="container">
      <h3>My Page
	<a id="show-overlay1" href="#">overlay1</a>
	<a id="show-overlay2" href="#">overlay2</a>
      </h3>
      <p>This is the default page content</p>

      <div id="overlay1-container" class="overlay">
	<div id="overlay1-content">
	  <h3>This is overlay title <a id="close-overlay1" href="#">close</a></h3>
	  <p>This is overlay content</p>
	</div>
      </div>

      <div id="overlay2" class="overlay">
	<h3>This is overlay title <a id="close-overlay2" href="#">close</a></h3>
	<p>This is overlay content</p>
      </div>
    </div>

    <script type="text/javascript" src="vendor/jquery.min.js"></script>
    <script type="text/javascript">
      $('#show-overlay1').click(function (evt) {
	  $('#overlay1-container').show();
	  return false;
      });
      $('#show-overlay2').click(function (evt) {
	  $('#overlay2').show();
	  return false;
      });
      $('#close-overlay1').click(function (evt) {
	  $('#overlay1-container').hide();
	  return false;
      });
      $('#close-overlay2').click(function (evt) {
	  $('#overlay2').hide();
	  return false;
      });
      $('#overlay1-container').click(function (evt) {
	  $('#overlay1-container').hide();
      });
      $('#overlay1-content').click(function (evt) {
	  // do nothing.
	  return false;
      });

      // page init
      $('#overlay1-container').show();
      // $('#overlay2').show();
    </script>
  </body>

</html>