├── light.db ├── static ├── images │ ├── on.png │ └── off.png └── css │ └── register.css ├── .gitattributes ├── README.md ├── .gitignore ├── run.py └── templates └── invol.html /light.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ranajoy-dutta/Invochain/Remote-upload/light.db -------------------------------------------------------------------------------- /static/images/on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ranajoy-dutta/Invochain/Remote-upload/static/images/on.png -------------------------------------------------------------------------------- /static/images/off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ranajoy-dutta/Invochain/Remote-upload/static/images/off.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # For Demo - Files have been hosted at Demo 2 | 3 | ## These files require python support to run offline. Functionality can also be seen at the above link. 4 | 5 | ## Steps to run offline :- 6 | > 1. Install Python 3.6 7 | > 2. Install flask (in cmd -> 'pip install flask') 8 | > 3. Place all the files in the python root folder. 9 | > 4. RUN run.py or open it in IDLE and then run. 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /run.py: -------------------------------------------------------------------------------- 1 | import sqlite3 as sql 2 | from flask import Flask, render_template,redirect,url_for 3 | 4 | app = Flask(__name__) 5 | 6 | @app.route('/') 7 | def index(): 8 | conn = sql.connect("light.db") 9 | cur = conn.cursor() 10 | val = cur.execute("select * from status") 11 | val = str(cur.fetchone())[2:-3] 12 | print(val) 13 | cur.close() 14 | conn.close() 15 | return render_template("invol.html",flag=val) 16 | 17 | @app.route('/switchh') 18 | def switchh(): 19 | conn = sql.connect("light.db") 20 | cur = conn.cursor() 21 | val = cur.execute("select * from status") 22 | val = str(cur.fetchone())[2:-3] 23 | if val=="1": 24 | cur.execute("update status set flag = '0'") 25 | conn.commit() 26 | elif val=="0": 27 | cur.execute("update status set flag = '1'") 28 | conn.commit() 29 | cur.close() 30 | conn.close() 31 | return redirect(url_for('index')); 32 | 33 | if __name__=='__main__': 34 | app.run(debug=True) 35 | -------------------------------------------------------------------------------- /templates/invol.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Light 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | {% if flag == "1" %} 13 | Light On 14 | {% else %} 15 | Light Off 16 | {% endif %} 17 |
18 | 28 |
29 | 30 |
31 | 32 |
33 | Bulb status is being fetched from Database 34 |
35 | 36 | -------------------------------------------------------------------------------- /static/css/register.css: -------------------------------------------------------------------------------- 1 | 2 | * { 3 | margin: 0px; 4 | padding: 0px; 5 | box-sizing: border-box; 6 | } 7 | 8 | body, html { 9 | height: 100%; 10 | font-family: sans-serif; 11 | background-color: black; 12 | overflow: hidden; 13 | } 14 | a { 15 | font-family: sans-serif; 16 | font-size: 14px; 17 | line-height: 1.7; 18 | color: #666666; 19 | margin: 0px; 20 | transition: all 0.4s; 21 | text-decoration: none; 22 | } 23 | .text-center {text-align: center;} 24 | a:focus { 25 | outline: none; 26 | } 27 | a:hover { 28 | text-decoration: none; 29 | color: #a64bf4; 30 | } 31 | img{ 32 | border-radius: 30px; 33 | margin: 0; 34 | padding: 0; 35 | width:40%; 36 | height:40%; 37 | } 38 | button { 39 | outline: none; 40 | border: none; 41 | background: transparent; 42 | } 43 | 44 | button:hover { 45 | cursor: pointer; 46 | } 47 | .container-login100 { 48 | width: 100%; 49 | min-height: 100vh; 50 | display: flex; 51 | flex-wrap: wrap; 52 | justify-content: center; 53 | align-items: center; 54 | padding: 15px; 55 | background-repeat: no-repeat; 56 | background-position: center; 57 | background-size: cover; 58 | } 59 | .wrap-input100 { 60 | width: 100%; 61 | position: relative; 62 | border-bottom: 2px solid #d9d9d9; 63 | } 64 | 65 | .label-input100 { 66 | font-family: Poppins-Regular; 67 | font-size: 14px; 68 | color: #333333; 69 | line-height: 1.5; 70 | padding-left: 7px; 71 | } 72 | 73 | .has-val.input100 + .focus-input100::before { 74 | width: 100%; 75 | } 76 | 77 | .input100:focus + .focus-input100::after { 78 | color: #a64bf4; 79 | } 80 | 81 | .has-val.input100 + .focus-input100::after { 82 | color: #a64bf4; 83 | } 84 | .container-login100-form-btn { 85 | display: flex; 86 | flex-wrap: wrap; 87 | justify-content: center; 88 | } 89 | .wrap-login100-form-btn { 90 | width: 100%; 91 | display: block; 92 | position: relative; 93 | z-index: 1; 94 | border-radius: 25px; 95 | overflow: hidden; 96 | margin: 0 auto; 97 | box-shadow: 0 5px 30px 0px rgba(3, 216, 222, 0.2); 98 | } 99 | 100 | .login100-form-bgbtn { 101 | position: absolute; 102 | z-index: -1; 103 | width: 300%; 104 | height: 100%; 105 | background: #a64bf4; 106 | background: -webkit-linear-gradient(right, #00dbde, #fc00ff, #00dbde, #fc00ff); 107 | background: -o-linear-gradient(right, #00dbde, #fc00ff, #00dbde, #fc00ff); 108 | background: -moz-linear-gradient(right, #00dbde, #fc00ff, #00dbde, #fc00ff); 109 | background: linear-gradient(right, #00dbde, #fc00ff, #00dbde, #fc00ff); 110 | top: 0; 111 | left: -100%; 112 | transition: all 0.4s; 113 | } 114 | 115 | .login100-form-btn { 116 | font-family: Poppins-Medium; 117 | font-size: 16px; 118 | color: #fff; 119 | line-height: 1.2; 120 | text-transform: uppercase; 121 | display: flex; 122 | justify-content: center; 123 | align-items: center; 124 | padding: 0 20px; 125 | width: 100%; 126 | height: 50px; 127 | } 128 | 129 | .wrap-login100-form-btn:hover .login100-form-bgbtn { 130 | left: 0; 131 | } 132 | .m1 {margin-bottom: 23px;} 133 | 134 | .alert-validate::before { 135 | content: attr(data-validate); 136 | position: absolute; 137 | max-width: 70%; 138 | background-color: #fff; 139 | border: 1px solid #c80000; 140 | border-radius: 2px; 141 | padding: 4px 25px 4px 10px; 142 | bottom: calc((100% - 20px) / 2); 143 | transform: translateY(50%); 144 | right: 2px; 145 | pointer-events: none; 146 | font-family: Poppins-Regular; 147 | color: #c80000; 148 | font-size: 13px; 149 | line-height: 1.4; 150 | text-align: left; 151 | visibility: hidden; 152 | opacity: 0; 153 | transition: opacity 0.4s; 154 | } 155 | 156 | .alert-validate::after { 157 | content: "\f06a"; 158 | font-family: FontAwesome; 159 | display: block; 160 | position: absolute; 161 | color: #c80000; 162 | font-size: 16px; 163 | bottom: calc((100% - 20px) / 2); 164 | transform: translateY(50%); 165 | right: 8px; 166 | } 167 | 168 | .alert-validate:hover:before { 169 | visibility: visible; 170 | opacity: 1; 171 | } 172 | 173 | @media (max-width: 992px) { 174 | .alert-validate::before { 175 | visibility: visible; 176 | opacity: 1; 177 | } 178 | } 179 | .login100-social-item { 180 | font-size: 25px; 181 | color: #fff; 182 | display: flex; 183 | justify-content: center; 184 | align-items: center; 185 | width: 50px; 186 | height: 50px; 187 | border-radius: 50%; 188 | margin: 5px; 189 | } 190 | 191 | .login100-social-item:hover { 192 | color: #fff; 193 | background-color: #333333; 194 | } 195 | 196 | @media (max-width: 576px) { 197 | .wrap-login100 { 198 | padding-left: 15px; 199 | padding-right: 15px; 200 | } 201 | img{ 202 | margin: 35vw 0 0 0; 203 | width:70%; 204 | height:70%; 205 | } 206 | } 207 | 208 | .container-mid{ 209 | margin: 5% 25%; 210 | text-align: center; 211 | } 212 | .msg{ 213 | color: white; 214 | text-align: center; 215 | font-size: 216 | } --------------------------------------------------------------------------------