diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..2468f70 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,16 @@ +# Creative Commons Attribution 4.0 International License (CC BY 4.0) + +Copyright 2025 kay-who-codes + +You are free to: + +- **Share** — copy and redistribute the material in any medium, mode, or format for any purpose, even commercially. +- **Adapt** — remix, transform, and build upon the material for any purpose, even commercially. + +The above rights are granted on the following condition: + +- **Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. + +No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. + +[Full text of the license](https://creativecommons.org/licenses/by/4.0/) diff --git a/Non-App/Code Text Grabber v2.py b/Non-App/Code Text Grabber v2.py new file mode 100644 index 0000000..10a1b77 --- /dev/null +++ b/Non-App/Code Text Grabber v2.py @@ -0,0 +1,54 @@ +import os +import json +import pyperclip + +def collect_files_and_copy(): + # Get the script's current directory + current_dir = os.path.dirname(os.path.abspath(__file__)) + + # Initialise file contents + html_content = '' + css_content = '' + js_content = '' + json_extracts = '' + + # Loop through files in the current directory + for filename in os.listdir(current_dir): + file_path = os.path.join(current_dir, filename) + + # Skip the script itself + if filename == os.path.basename(__file__): + continue + + # Read the content of .html, .css, .js, and .json files + if filename.endswith('.html'): + with open(file_path, 'r', encoding='utf-8') as file: + html_content = file.read() + elif filename.endswith('.css'): + with open(file_path, 'r', encoding='utf-8') as file: + css_content = file.read() + elif filename.endswith('.js'): + with open(file_path, 'r', encoding='utf-8') as file: + js_content = file.read() + elif filename.endswith('.json'): + with open(file_path, 'r', encoding='utf-8') as file: + try: + json_data = json.load(file) + if isinstance(json_data, list) and json_data: + first_object = json_data[0] + last_object = json_data[-1] + json_extracts += (f"\n\nFor your reference, here's an extract of the .json data found in \"{filename}\":\n" + f"[\n{first_object},\n{last_object}\n]") + except json.JSONDecodeError: + print(f"Warning: Could not parse JSON file: {filename}") + + # Prepare the formatted text + formatted_text = (f".HTML: {html_content}\n\n.CSS: {css_content}\n\n.JS: {js_content}" + f"{json_extracts}") + + # Copy the formatted text to the clipboard + pyperclip.copy(formatted_text) + print("Formatted text has been copied to the clipboard.") + +# Run the function +collect_files_and_copy() diff --git a/Non-App/Update Log/App Update Logger.py b/Non-App/Update Log/App Update Logger.py new file mode 100644 index 0000000..3f591af --- /dev/null +++ b/Non-App/Update Log/App Update Logger.py @@ -0,0 +1,79 @@ +import os +from datetime import datetime +from tkinter import Tk, Label, Entry, Button, StringVar, messagebox + +# Get the directory of the current script +script_dir = os.path.dirname(os.path.abspath(__file__)) +file_path = os.path.join(script_dir, "Update Log.txt") + +def save_update(update_details): + update_number = 1 + current_datetime = datetime.now().strftime("%d %b %Y @ %H:%M") + + if os.path.exists(file_path): + with open(file_path, "r") as file: + content = file.read() + # Count the number of updates + update_number = content.count("App Update:") + 1 + + new_entry = ( + f"App Update: {update_number}\n" + f"Date of Update: {current_datetime}\n" + f"Details: {update_details}\n\n" + ) + + with open(file_path, "a") as file: + file.write(new_entry) + + messagebox.showinfo("Success", f"Update logged successfully as entry {update_number}.") + +def create_gui(): + def on_submit(event=None): + details = update_details.get() + if not details.strip(): + messagebox.showwarning("Input Error", "Please provide update details.") + return + save_update(details) + root.destroy() + + # GUI setup + root = Tk() + root.title("Update Logger") + root.geometry("400x200") + root.configure(bg="white") + + Label( + root, + text="Update details:", + bg="white", + fg="black", + font=("Arial", 12, "bold") + ).pack(pady=10) + + update_details = StringVar() + entry = Entry( + root, + textvariable=update_details, + font=("Arial", 12), + width=40, + bg="lightgrey" + ) + entry.pack(pady=5) + entry.focus_set() + + Button( + root, + text="Submit", + command=on_submit, + bg="blue", + fg="white", + font=("Arial", 12, "bold") + ).pack(pady=20) + + root.bind('', on_submit) + + root.mainloop() + +# Main Execution +if __name__ == "__main__": + create_gui() diff --git a/Non-App/Update Log/Update Log.txt b/Non-App/Update Log/Update Log.txt new file mode 100644 index 0000000..8861446 --- /dev/null +++ b/Non-App/Update Log/Update Log.txt @@ -0,0 +1,4 @@ +App Update: 1 +Date of Update: 01 Feb 2025 @ 12:06 +Details: Added more countries + diff --git a/index.html b/index.html index 7cb44fe..b4ee4ec 100644 --- a/index.html +++ b/index.html @@ -1,104 +1,19 @@ - - - - - - World Economic Clocks - - - - -
- -

🏴󠁧󠁢󠁥󠁮󠁧󠁿 London:

- -
- - - - - + + + + + + World Economic Clocks + + + + +
+ +

🏴󠁧󠁢󠁥󠁮󠁧󠁿 London:

+ +
+ + + + \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..26a6247 --- /dev/null +++ b/script.js @@ -0,0 +1,60 @@ +// Predefined offsets relative to GMT +const countries = [ + { name: "🇺🇸 USA", city: "Los Angeles", tz: "America/Los_Angeles", offsetGMT: -8 }, + { name: "🇧🇷 Brazil", city: "São Paulo", tz: "America/Sao_Paulo", offsetGMT: -3 }, + { name: "🇺🇸 USA", city: "New York", tz: "America/New_York", offsetGMT: -5 }, + { name: "🇨🇦 Canada", city: "Toronto", tz: "America/Toronto", offsetGMT: -5 }, + { name: "🇩🇪 Germany", city: "Berlin", tz: "Europe/Berlin", offsetGMT: 1 }, + { name: "🇫🇷 France", city: "Paris", tz: "Europe/Paris", offsetGMT: 1 }, + { name: "🇮🇹 Italy", city: "Rome", tz: "Europe/Rome", offsetGMT: 1 }, + { name: "🇷🇺 Russia", city: "Moscow", tz: "Europe/Moscow", offsetGMT: 3 }, + { name: "🇦🇪 UAE", city: "Dubai", tz: "Asia/Dubai", offsetGMT: 4 }, + { name: "🇮🇳 India", city: "Delhi", tz: "Asia/Kolkata", offsetGMT: 5.5 }, + { name: "🇨🇳 China", city: "Beijing", tz: "Asia/Shanghai", offsetGMT: 8 }, + { name: "🇯🇵 Japan", city: "Tokyo", tz: "Asia/Tokyo", offsetGMT: 9 }, + { name: "🇦🇺 Australia", city: "Sydney", tz: "Australia/Sydney", offsetGMT: 11 }, + { name: "🇦🇶 Antarctica", city: "Rothera Station", tz: "Antarctica/Rothera", offsetGMT: -3 }, + { name: "🇿🇦 South Africa", city: "Cape Town", tz: "Africa/Johannesburg", offsetGMT: 2 }, + { name: "🇬🇷 Greece", city: "Athens", tz: "Europe/Athens", offsetGMT: 2 } +]; + + +function updateTime() { + const now = new Date(); + + // Get London time + const londonTime = now.toLocaleTimeString("en-GB", { timeZone: "Europe/London", hour: "2-digit", minute: "2-digit", second: "2-digit" }); + document.getElementById("london-time").innerText = londonTime; + + // Get London's GMT offset dynamically in case of daylight savings + const londonOffset = new Date().getTimezoneOffset() / -60; // Offset in hours + + // Sort countries from earliest to latest based on actual GMT offset + const sortedCountries = countries + .map(country => { + const time = now.toLocaleTimeString("en-GB", { timeZone: country.tz, hour: "2-digit", minute: "2-digit" }); + const offset = country.offsetGMT - londonOffset; + return { ...country, time, offset }; + }) + .sort((a, b) => a.offset - b.offset); // Sort by actual offset + + const beforeLondon = []; + const afterLondon = []; + + sortedCountries.forEach(country => { + const offsetText = country.offset > 0 ? `+${country.offset}` : country.offset; + const countryHTML = `
${country.name} ${offsetText} (${country.city}): ${country.time}
`; + + if (country.offset < 0) { + beforeLondon.push(countryHTML); + } else { + afterLondon.push(countryHTML); + } + }); + + document.getElementById("before-london").innerHTML = beforeLondon.join(""); + document.getElementById("after-london").innerHTML = afterLondon.join(""); +} + +updateTime(); +setInterval(updateTime, 1000); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..e52d837 --- /dev/null +++ b/style.css @@ -0,0 +1,29 @@ +body { + font-family: Arial, sans-serif; + text-align: center; + background-color: #121212; + color: #fff; + margin: 20px; +} + +h1 { + font-size: 2.5em; + margin: 20px 0; + color: #f1c40f; +} + +.time-container { + display: flex; + flex-direction: column; + align-items: center; + gap: 10px; +} + +.country-time { + font-size: 1.5em; + padding: 10px; + border-radius: 8px; + background: #222; + width: 350px; + text-align: center; +} \ No newline at end of file