schedule

by frogggeee McFrogggeee

HTML

<!DOCTYPE html>
<html>

  <head>
    <style>
      /*#start1 {
  margin-top: 0px;
  padding-left: 3px;
  width: 40px;
  height: 20px;
  opacity: 1;
  margin-bottom: -12.5px;
  border-radius: 3px;
  background: #ccffdc;
  border: 0px solid;
  border-color: green;
}
#bar1 {
	height: 9px;
    width: 300px;
    background: black;
    cursor: n-resize;
    margin-bottom: -14px;
    opacity:0;
    margin-left: 45px;
}
#info {
  margin-left: -2px;
  width: 200;
}
#sep1 {
  margin-left: 43px;
  margin-top: 0px;
	height: 1.5px;
    width: 250px;
    background: green;
    margin-bottom: 0px;
    opacity: .5;
}*/

    </style>
  </head>

  <body>

    <h1>schedule</h1>
    <button type="button" onclick="add()">+</button> <br>
    <!--<p id="start1">10:15</p>
<div id="sep1"></div>
<div id="back1">
  <p id="info1">info</p>
</div>
<div id="bar1"></div>-->


  </body>
  <script>
    let mY = 0;
    let mX = 0;
    let mouse = false;
    let elements = 0;
    let times = [];

    /*document.getElementById("back1").style = "border-radius: 7px;background: #ccffdc;padding-top: 3px; padding-left: 6px;width: 300px;height: 80px;opacity: 1;margin-bottom: -3px;";
    let element = document.getElementById("bar1");
    addEventListener("selectstart", event => event.preventDefault());
    document.addEventListener("mousedown", function (e) {
    	mouse = true;
    })
    document.addEventListener("mouseup", function (e) {
    	mouse = false;
    })
    document.addEventListener("mousemove", function (e) {
    	mY = e.pageY;
    })

    element.addEventListener("mousedown", function (e) {
    changeHeight(1);
    });
    document.getElementById("bar1").addEventListener("mousedown", function (e) {
    changeHeight(1);
    });
    function changeHeight(id) {
    let og = document.getElementById("back"+id).style.height.split("px").join("")*1;
    let start = mY;
    let setY = setInterval(function(){
    	document.getElementById("back"+id).style.height = ((mY-start)+og)+"px"; 
      if...