This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
from flask_socketio import SocketIO, emit | |
app = Flask(__name__) | |
socketio = SocketIO(app) | |
values = { | |
'slider1': 25, | |
'slider2': 0, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Synchronized Slider</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"> | |
<script src="https://code.jquery.com/jquery-3.3.1.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.1.1/socket.io.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Synchronized Slider</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"> | |
<script src="https://code.jquery.com/jquery-3.3.1.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.1.1/socket.io.js"></script> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
from flask_socketio import SocketIO, emit | |
# Creating a flask app and using it to instantiate a socket object | |
app = Flask(__name__) | |
socketio = SocketIO(app) | |
# values['slider1'] and values['slider2'] store the current value of the sliders | |
# This is done to prevent data loss on page reload by client. | |
values = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
text-align: center; | |
font-family: 'Inconsolata', monospace; | |
} | |
h1 { | |
font-family: 'Luckiest Guy', cursive; | |
font-size: 70px; | |
margin: 0.2em; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Variable to store number of rows, column of table and input color | |
var input_rows; | |
var input_cols; | |
var input_color = "#000000"; | |
//Make Grid function | |
function makeGrid() { | |
var table = document.getElementById("pixel_canvas"); | |
//Clearing the table | |
while(table.rows.length > 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Pixel Art Maker!</title> | |
</head> | |
<body> | |
<h1>Pixel Art Maker</h1> | |
<h2>Choose Grid Size</h2> | |
<form id="sizePicker"> | |
<label>Grid Height: |