Commit 3d3f746e authored by Martin Cífka's avatar Martin Cífka
Browse files

improved html&css, added whitebalance

parent 05d83bba
Loading
Loading
Loading
Loading
Loading
+20 −7
Original line number Diff line number Diff line
<!DOCTYPE html>
<html>
    
    
    <head>
        <title>Mi Camera Photo</title>
        <link rel="stylesheet" type="text/css" href="style.css">
        <link rel="stylesheet" type="text/css" href="slider.css">
        <script src="jquery.min.js"></script>
        <script type="text/javascript" src="script.js"></script>
    </head>
@@ -13,21 +12,35 @@
    <body>
        <div class="box center">
            <h1>Mi Camera Photo</h1>
            <p>This is simple WebSocket form.</p>
            
            <span class="block">
            <span class="flex">
                <input type="button" id="buttonConnect"  onclick="buttonConnectClick()" value="Connect">
                <input type="button" id="buttonTurnOffApp" onclick="turnOffAppClick()" value="Turn off app" disabled="">
                <input type="button" id="buttonPowerOff" onclick="powerOffClick()" value="Power off" disabled="">
                <button type="button" id="buttonPowerOff" onclick="powerOffClick()" value="Power off" disabled="">
                    <svg version="1.1" class="svgIcon" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="31.182px" height="31.182px" viewBox="0 0 31.182 31.182">
                        <path d="M15.591,16.089c-0.781,0-1.417-0.635-1.417-1.417V3.074c0-0.783,0.636-1.418,1.417-1.418c0.783,0,1.418,0.635,1.418,1.418 v11.598C17.009,15.454,16.374,16.089,15.591,16.089z"/>
                        <path d="M15.591,29.524c-7.101,0-12.877-5.776-12.877-12.877c0-4.249,2.097-8.224,5.606-10.629c0.646-0.442,1.528-0.278,1.97,0.366 c0.443,0.646,0.278,1.528-0.367,1.972c-2.738,1.878-4.374,4.978-4.374,8.291c0,5.537,4.506,10.042,10.042,10.042 c5.537,0,10.042-4.505,10.042-10.042c0-3.314-1.636-6.414-4.375-8.292c-0.646-0.442-0.811-1.325-0.367-1.972 c0.442-0.646,1.323-0.811,1.971-0.366c3.511,2.405,5.606,6.38,5.606,10.63C28.468,23.748,22.691,29.524,15.591,29.524z"/>
                    </svg>
                </button>
            </span>
            
            <input type="checkbox" name="wifiOff" id="checkboxWifiOff" disabled="">
            <label for="wifiOff" id="label-WifiOff">Turn off Wifi when disconnecting</label>
            <!--
            <input type="checkbox" name="checkboxWifiOff" id="checkboxWifiOff" disabled=""> 
            <label for="checkboxWifiOff" id="label-chekboxWifiOff">Turn off Wifi when disconnecting</label>
            -->
            
            <label class="switch">
                <input id="checkboxWifiOff" type="checkbox" disabled><span class="slider"></span>
                <label for="checkboxWifiOff">Turn off Wifi when disconnecting</label>
            </label>
            
            
            <form id="wsForm" onsubmit="wsFormSubmit(); return false;">
                <input id="wsForm-data" type="text" placeholder="Data to send" disabled="">
                <input id="wsForm-submit" type="submit" value="Send" disabled="">
            </form>
            <a href="http://192.168.42.1:50422">Photos</a>
            <a href="rtsp://192.168.42.1/live">Live Stream</a>
        </div>
        <div id="notification-wrapper"><div id="notification" style="display: none;"></div></div>
    </body>
+0 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ function wsConnect()
    {
        notify("Connected, waiting for confirmation", false, 1000);
        connected = true;
        
    };

    ws.onmessage = function(event)
+69 −0
Original line number Diff line number Diff line
/* HTML Switch:
<label class="switch">
    <input id="someID" type="checkbox"><span class="slider"></span>
    <label for="someID">Some label</label>
</label>
*/

.switch{
    display: inline-block;
    padding-top: 5px;
    user-select:none;
    margin:5px;
    text-align: center;
}
.switch *{
    display: inline-block;
}

.switch>label {
    vertical-align: top;
    cursor: pointer;
}

.switch>input:not(:checked)+.slider+label {
    color: #bbb;
}
.switch>input:disabled+.slider+label {
    color: #777;
}

.switch>input { 
    display: none;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    cursor: pointer;
    width: 50px;
    height: 15px;
    background-color: #333;
    border-radius: 34px;
    top: 2px;
    margin-bottom: 5px;
    margin-right: 7px;
}

.slider::before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: -6px;
    bottom: -5.5px;
    background-color: #bbb;
    transition: .4s;
    border-radius: 50%;
}
.switch>input:disabled+.slider::before
{
    background-color: #777;
}

input:checked + .slider:before {
    transform: translateX(36px);
    background-color: #fff6cb;
}
+55 −13
Original line number Diff line number Diff line
@@ -3,10 +3,26 @@ body
    color: #fff6cb;
    background-color: #fffae0;
}

.block
a
{
    display: block;
  color: #fff6cb;
  margin: 2px;
}
a:hover
{
  color: white;
}
a:active
{
  color: #ffecdd;
}
form
{
    margin: 5px 0px 12px 0px;
}
.flex
{
    display: flex;
}

.box
@@ -15,7 +31,7 @@ body
    padding: 15px 30px 35px 30px;
    margin: auto;
    border-radius: 10px;
    min-width: 350px;
    min-width: 300px;
}

.center
@@ -24,14 +40,30 @@ body
  position: absolute;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -60%);
  transform: translate(-50%, -60%);
}

.svgIcon
{
    fill: #45535d;
    display: block;
}

#buttonPowerOff
{
    padding: 2px;
}
#buttonPowerOff > svg
{
    width: 26px;
    height: 26px;
}


#notification-wrapper
{
    text-align: center;
    position: absolute;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
@@ -51,6 +83,13 @@ body


/********** INPUT **********/
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover
{
  background-color: #fbf6e1;
}

button,
input[type="button"],
input[type="submit"]
@@ -68,12 +107,20 @@ input[type="submit"]
    border-radius: 3px;
}



button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="submit"]:disabled
{
    background-color: #888;
    color: #666;
    cursor: default;
}

input[type="checkbox" i]:disabled+label
{
    filter: brightness(0.8)contrast(0.3);
  color: #777;
}

#buttonConnect,#wsForm-turnOffApp
@@ -97,8 +144,3 @@ input[type="checkbox"] {
    position: relative;
    margin: 7px 5px;
}
 No newline at end of file
label
{
    position: relative;
    top: -5px;
}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public:
        CapturingSurroundexp = 15
    };
    
    enum class ParamWhitebalance
    enum class ParamWB
    {
        Auto = 0,
        Outdoor = 1, 
Loading