Note - Double Click to Copy Code Contact Us!

Smart-Parking

Tech Doubility
Smart-Parking 



  HTML CODE
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Smart Parking System</title>
  5. <link rel="stylesheet" type="text/css" href="style.css">
  6. </head>
  7. <body>
  8. <h1>Smart Parking System</h1>
  9. <div class="parking-lot">
  10. <div class="parking-space" id="parking-space-1"></div>
  11. <div class="parking-space" id="parking-space-2"></div>
  12. <div class="parking-space" id="parking-space-3"></div>
  13. <!-- Add more parking spaces as needed -->
  14. </div>
  15. <script src="script.js"></script>
  16. </body>
  17. </html>
CSS CODE
  1. body {
  2. text-align: center;
  3. }
  4.  
  5. .parking-lot {
  6. display: flex;
  7. justify-content: center;
  8. margin-top: 50px;
  9. }
  10.  
  11. .parking-space {
  12. width: 100px;
  13. height: 100px;
  14. margin: 10px;
  15. background-color: green;
  16. display: inline-block;
  17. border: 1px solid black;
  18. }
  19.  
  20. .parking-space.occupied {
  21. background-color: red;
  22. }
JAVASCRIPT CODE
  1. // Simulating parking data, where 0 represents an available parking space and 1 represents an occupied space
  2. var parkingData = [0, 1, 0];
  3.  
  4. window.addEventListener("DOMContentLoaded", function() {
  5. // Get parking spaces
  6. var parkingSpaces = document.getElementsByClassName("parking-space");
  7.  
  8. // Update parking spaces based on the parking data
  9. for (var i = 0; i < parkingSpaces.length; i++) {
  10. if (parkingData[i] === 1) {
  11. parkingSpaces[i].classList.add("occupied");
  12. }
  13. }
  14. });
PYTHON CODE
  1. from flask import Flask, render_template
  2.  
  3. app = Flask(__name__)
  4.  
  5. @app.route("/")
  6. def index():
  7. return render_template("index.html")
  8.  
  9. if __name__ == "__main__":
  10. app.run()

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.