Commit 361a7b6

Ansari <ansari_official@yahoo.com>
2025-07-21 13:08:58
new script format
1 parent 10ee471
assets/common.css
@@ -0,0 +1,216 @@
+@import url('https://fonts.googleapis.com/css2?family=PT+Mono&display=swap');
+
+* {
+    box-sizing: border-box;
+    margin: 0;
+    padding:0;
+  }
+
+:root{
+  --lightGold: #d4af37;
+  --gold: rgb(250 204 21);
+}
+
+body{
+    display: flex;
+    flex-direction: column;
+    min-height: 100vh;
+    background-color: black;
+    font-family: "PT Mono", monospace;
+    color: white;
+    overflow: hidden;
+    justify-content: center;
+    align-items: center;
+}
+
+li:not(:last-child) {
+  margin-bottom: 10px;
+}
+
+input {
+    margin: 10px;
+    padding:5px;
+    border: solid 0.1px grey;
+    background-color: black;
+    border-radius: 3px;
+    width: 100%;
+    color: white;
+    max-width: 250px;
+    text-align: center;
+}
+
+input:focus {
+    outline: none;
+}
+
+input::-webkit-outer-spin-button,
+input::-webkit-inner-spin-button {
+    -webkit-appearance: none;
+    margin: 0;
+}
+
+
+.footer{
+    position: absolute;
+    bottom: 0;
+    margin-bottom: 30px;
+    text-align: center;
+    padding: 10px;
+    font-size: 16px;
+    font-family: "Source Code Pro", monospace;
+    font-optical-sizing: auto;
+    font-weight: 500px;
+    font-style: normal;
+    font-spacing: 10px;
+    color: white;
+    opacity: 70%;
+    left: 50%;
+    transform: translateX(-50%);
+    display:flex;
+    flex-direction: column;
+    justify-content: center;
+    gap: 14px;
+}
+
+.footer label{
+    opacity: 50%;
+    cursor: pointer;
+}
+
+.footer label:hover{
+    color: white;
+    opacity: 100%;
+}
+
+.arrow{
+    position:relative;
+    width:30px;
+    height: 30px;
+    cursor:pointer;
+    overflow:hidden;
+    cursor: pointer;
+    opacity: 50%;
+  }
+  
+  .arrow:hover{
+    opacity: 100%;
+  }
+  
+  .arrow:after{
+    position:absolute;
+    display:block;
+    content:"";
+    color:white;
+    width: 20px;
+    height: 15px;
+    top:-1px;
+    border-bottom:solid 2px;
+    transform:translatex(4px);
+  }
+  
+  .arrow:before{
+    position:absolute;
+    display:block;
+    content:"";
+    color:white;
+    width: 8px;
+    height: 8px;
+    border-top:solid 2px;
+    border-left:solid 2px;
+    top:50%;
+    left:2px;
+    transform-origin:0% 0%;
+    transform:rotatez(-45deg);
+  }
+
+  .modal {
+    opacity: 0;
+    visibility: hidden;
+    position: fixed;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    text-align: left;
+    background: rgba(0,0,0);
+    transition: opacity .3s ease;
+    z-index: 100;
+  }
+  
+  .modal__bg {
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    cursor: pointer;
+  }
+  
+  .modal-state {
+    display: none;
+  }
+  
+  .modal-state:checked + .modal {
+    opacity: 1;
+    visibility: visible;
+  }
+  
+  .modal-state:checked + .modal .modal__inner {
+    top: 0;
+  }
+  
+  .modal__inner {
+    transition: bottom .3s ease;
+    position: absolute;
+    top: -20%;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    height: fit-content;
+    width: 20%;
+    min-width: 300px;
+    margin: auto;
+    overflow: auto;
+    background: black;
+    border: solid 1px grey;
+    border-radius: 5px;
+    padding: 1em 2em;
+  }
+  .modal__p{
+    margin-top: 20px;
+    color: white;
+    display: flex;
+    flex-direction: column;
+  }
+  
+  .modal__close {
+    position: absolute;
+    right: 1em;
+    top: 1em;
+    width: 1.1em;
+    height: 1.1em;
+    cursor: pointer;
+  }
+  
+  .modal__close:after,
+  .modal__close:before {
+    content: '';
+    position: absolute;
+    width: 2px;
+    height: 1.5em;
+    background: #ccc;
+    display: block;
+    transform: rotate(45deg);
+    left: 50%;
+    margin: -3px 0 0 -1px;
+    top: 0;
+  }
+  
+  .modal__close:hover:after,
+  .modal__close:hover:before {
+    background: #aaa;
+  }
+  
+  .modal__close:before {
+    transform: rotate(-45deg);
+  }
\ No newline at end of file
assets/common.js
@@ -0,0 +1,26 @@
+function getDeviceType() {
+    const ua = navigator.userAgent;
+
+    if (/mobile/i.test(ua)) {
+        return "Mobile";
+    } else if (/tablet/i.test(ua)) {
+        return "Tablet";
+    } else {
+        return "Desktop";
+    }
+}
+
+if (getDeviceType() !== "Desktop") {
+    if (location.pathname !== "/") {
+        location.href = "/";
+    }
+}
+
+document.addEventListener("DOMContentLoaded", () => {
+    if (getDeviceType() !== "Desktop") {
+        const warning = document.getElementById("warning");
+        if (warning) {
+            warning.checked = true;
+        }
+    }
+});
\ No newline at end of file
assets/favicon.png
Binary file
VPN and Proxy/OVPN.py
@@ -1,91 +0,0 @@
-import os
-import requests
-import base64
-import time 
-def clrsc():
-    if os.name == 'nt':
-        os.system("cls")
-    else:
-        os.system("clear")
-
-def main():
-    print(Blue+"""             __/\__
-            `==/\==`
-  ____________/__\____________
- /__\u001b[31mAuthor : The_Robin_Hood\u001b[36m__\\ 
-/_____________________________\\     
-   __||__||__/.--.\__||__||__
-  /__|___|___( >< )___|___|__\\
-            _/`--`\_
-           (/------\)"""+Reset)
-    print(Yellow+"Choose Country : ")
-    for index,i in enumerate(Countries):
-        print(Green+f"\n{index+1}. {i}"+Reset)
-        pairs = list(zip(labels, Collection[i]))[:-1]
-        for (l, d) in pairs[1:4]:
-            if l =='Score':
-                continue
-            print (l + ': ' + d)
-        print (pairs[4][0] + ': ' + str(round(float(pairs[4][1]) / 10**6)) + ' MBps')
-
-    try:
-        Choosen = int(input("\n>>"))
-    except KeyboardInterrupt:
-        exit()
-    except:
-        clrsc()
-        print(Red+" * Select Appropriate Number *\n"+Reset)
-        main()
-        exit()
-        
-
-    path = f"{Countries[Choosen-1]}.ovpn"
-    print(Green+f"\nSaving as {path}"+Reset)
-    try:
-        with open(path,'x') as file:
-            pass
-    except:
-        pass
-    with open(path,'rb+') as file:
-        file.write(base64.b64decode(Collection[Countries[Choosen-1]][-1]))
-    time.sleep(3)
-    clrsc()
-
-
-vpn_data = requests.get('http://www.vpngate.net/api/iphone/').text.replace('\r','')
-servers = [line.split(',') for line in vpn_data.split('\n')]
-labels = servers[1]
-labels[0] = labels[0][1:]
-servers = [s for s in servers[2:] if len(s) > 1]
-Countries = [s[5] for s in servers]
-available =set()
-
-for Country in Countries :
-    available.add(Country)
-
-Available_Countries = list(available)
-Collection = {}
-
-for country in Available_Countries:
-    desired = [s for s in servers if country.lower() in s[5].lower()]
-    found = len(desired)
-    if found == 0:
-        continue
-    OpenVPN_Keys = [s for s in desired if len(s[-1]) > 0]
-
-    Best = sorted(OpenVPN_Keys, key=lambda s: float(s[2].replace(',','.')), reverse=True)[0]
-    Collection[country]=Best
-
-Countries = list(Collection.keys())
-
-Reset= '\u001b[0m'
-Red= '\u001b[31m.'
-Green= '\u001b[32m'
-Yellow= '\u001b[33m'
-Blue= '\u001b[36m'
-
-
-clrsc()
-main()
-
-
VPN and Proxy/Proxylist.py
@@ -1,22 +0,0 @@
-import requests
-from lxml.html import fromstring
-def get_proxies():
-    url = 'https://free-proxy-list.net/'
-    response = requests.get(url)
-    parser = fromstring(response.text)
-    proxies = set()
-    for i in parser.xpath('//tbody/tr')[:10]:
-        if i.xpath('.//td[7][contains(text(),"yes")]'):
-            proxy = ":".join([i.xpath('.//td[1]/text()')[0], i.xpath('.//td[2]/text()')[0]])
-            proxies.add(proxy)
-    return proxies
-proxies = list(get_proxies())
-for proxy in proxies:
-    print(proxy)
-    try:  
-        prx = {"http": f'http://{proxy}', "https": f'http://{proxy}'}
-        headers = {'User-Agent': 'Mozilla/5.0 (Linux; Android 7.0; SM-G930V Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36'}
-        response = requests.get('https://httpbin.org/ip',proxies=prx,timeout = 3)
-        print(response.code)
-    except:
-        pass
\ No newline at end of file
VPN and Proxy/Readme.md
@@ -1,5 +0,0 @@
-# OVPN.py 
-It chooses the best server from the certain country and generates the OVPN file
-
-# ProxyList.py
-It Gives Free proxies which is tested by httpbin  
common.sh
@@ -0,0 +1,318 @@
+#!/bin/bash
+
+# ============================================================================
+# Common Functions Library
+# ============================================================================
+# Usage: source common_functions.sh
+# This file contains reusable functions for bash scripts
+
+# Colors for better visual feedback
+export RED='\033[0;31m'
+export GREEN='\033[0;32m'
+export BLUE='\033[0;34m'
+export YELLOW='\033[1;33m'
+export CYAN='\033[0;36m'
+export MAGENTA='\033[0;35m'
+export WHITE='\033[1;37m'
+export NC='\033[0m'
+
+# Animation characters - different styles available
+export SPINNER_DOTS="⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"
+export SPINNER_CIRCLE="◐◓◑◒"
+export SPINNER_BLOCKS="⣾⣽⣻⢿⡿⣟⣯⣷"
+
+# Default spinner style
+SPINNER="$SPINNER_DOTS"
+
+# Logging functions
+timestamp() {
+    date "+%Y-%m-%d %H:%M:%S"
+}
+
+log_info() {
+    echo -e "${BLUE}[$(timestamp)] [ INFO  ]${NC} $1"
+}
+
+log_success() {
+    echo -e "${GREEN}[$(timestamp)] [SUCCESS]${NC} $1"
+}
+
+log_warning() {
+    echo -e "${YELLOW}[$(timestamp)] [ WARN  ]${NC} $1"
+}
+
+log_error() {
+    echo -e "${RED}[$(timestamp)] [ ERROR ]${NC} $1"
+}
+
+log_debug() {
+    if [ "${DEBUG:-}" = "true" ]; then
+        echo -e "${CYAN}[$(timestamp)] [ DEBUG ]${NC} $1"
+    fi
+}
+
+set_spinner_style() {
+    case "$1" in
+        "dots") SPINNER="$SPINNER_DOTS" ;;
+        "circle") SPINNER="$SPINNER_CIRCLE" ;;
+        "blocks") SPINNER="$SPINNER_BLOCKS" ;;
+        *) SPINNER="$SPINNER_DOTS" ;;
+    esac
+}
+
+show_spinner() {
+    local pid=$1
+    local message="$2"
+    local i=0
+    
+    printf "${BLUE}%s${NC} " "$message"
+    
+    while kill -0 $pid 2>/dev/null; do
+        printf "\r${BLUE}%s${NC} %s" "$message" "${SPINNER:$i:1}"
+        i=$(( (i + 1) % ${#SPINNER} ))
+        sleep 0.1
+    done
+    
+    wait $pid
+    local exit_code=$?
+    
+    if [ $exit_code -eq 0 ]; then
+        printf "\r${BLUE}%s${NC} ${GREEN}✓${NC}\n" "$message"
+        return 0
+    else
+        printf "\r${BLUE}%s${NC} ${RED}✗${NC}\n" "$message"
+        return 1
+    fi
+}
+
+# jus execute the cmd given with spinner
+execute_step() {
+    local command="$1"
+    local message="$2"
+    local allow_failure="${3:-false}"
+    
+    # command in background, suppress all output
+    eval "$command" >/dev/null 2>&1 &
+    local pid=$!
+    
+    if show_spinner $pid "$message"; then
+        return 0
+    else
+        if [ "$allow_failure" = "true" ]; then
+            log_warning "$message failed (continuing anyway)"
+            return 1
+        else
+            log_error "$message failed"
+            exit 1
+        fi
+    fi
+}
+
+# same as above but finally spits the output
+execute_with_output() {
+    local command="$1"
+    local message="$2"
+    local temp_file
+    temp_file=$(mktemp)
+    
+    eval "$command" > "$temp_file" 2>&1 &
+    local pid=$!
+    
+    if show_spinner $pid "$message"; then
+        cat "$temp_file"
+        rm -f "$temp_file"
+        return 0
+    else
+        echo -e "${RED}Command output:${NC}"
+        cat "$temp_file"
+        rm -f "$temp_file"
+        return 1
+    fi
+}
+
+# display header - success - message 
+show_box() {
+    local title="$1"
+    local width="${2:-40}"
+    local color="${3:-YELLOW}"
+    local details="$4"
+
+    local color_code="${!color:-$YELLOW}"
+
+    echo
+    printf "${color_code}╔"
+    printf "═%.0s" $(seq 1 $((width - 2)))
+    printf "╗${NC}\n"
+
+    local padding=$(( (width - ${#title} - 2) / 2 ))
+    printf "${color_code}║"
+    printf " %.0s" $(seq 1 $padding)
+    printf "%s" "$title"
+    printf " %.0s" $(seq 1 $((width - ${#title} - padding - 2)))
+    printf "║${NC}\n"
+
+    printf "${color_code}╚"
+    printf "═%.0s" $(seq 1 $((width - 2)))
+    printf "╝${NC}\n"
+
+    if [ -n "$details" ]; then
+        echo
+        echo "$details"
+    fi
+
+    echo
+}
+
+command_exists() {
+    command -v "$1" >/dev/null 2>&1
+}
+
+ensure_directory() {
+    local dir="$1"
+    local message="${2:-Creating directory: $dir}"
+    
+    if [ ! -d "$dir" ]; then
+        printf "${BLUE}%s${NC} " "$message"
+        if mkdir -p "$dir" 2>/dev/null; then
+            printf "${GREEN}✓${NC}\n"
+        else
+            printf "${RED}✗${NC}\n"
+            log_error "Failed to create directory: $dir"
+            return 1
+        fi
+    fi
+}
+
+backup_file() {
+    local file="$1"
+    local backup_suffix="${2:-.bak}"
+    
+    if [ -f "$file" ]; then
+        local backup_file="${file}${backup_suffix}"
+        printf "${BLUE}Backing up %s${NC} " "$(basename "$file")"
+        if cp "$file" "$backup_file" 2>/dev/null; then
+            printf "${GREEN}✓${NC}\n"
+        else
+            printf "${RED}✗${NC}\n"
+            return 1
+        fi
+    fi
+}
+
+show_progress() {
+    local current="$1"
+    local total="$2" 
+    local message="${3:-Progress}"
+    local width=24
+    
+    local percentage=$((current * 100 / total))
+    local filled=$((current * width / total))
+    local empty=$((width - filled))
+    
+    printf "\r${BLUE}%s${NC} [" "$message"
+    printf "${GREEN}█%.0s${NC}" $(seq 1 $filled)
+    printf "░%.0s" $(seq 1 $empty)
+    printf "] %d%%" "$percentage"
+    
+    if [ "$current" -eq "$total" ]; then
+        printf " ${GREEN}✓${NC}\n"
+    fi
+}
+
+ask_yes_no() {
+    local question="$1"
+    local default="${2:-n}"
+    local response
+    
+    while true; do
+        if [ "$default" = "y" ]; then
+            printf "${YELLOW}%s [Y/n]: ${NC}" "$question"
+        else
+            printf "${YELLOW}%s [y/N]: ${NC}" "$question"
+        fi
+        
+        read -r response
+        response=${response:-$default}
+        
+        case "$response" in
+            [Yy]|[Yy][Ee][Ss]) return 0 ;;
+            [Nn]|[Nn][Oo]) return 1 ;;
+            *) echo -e "${RED}Please answer yes or no.${NC}" ;;
+        esac
+    done
+}
+
+setup_cleanup_trap() {
+    local cleanup_function="$1"
+
+    if ! command_exists "$cleanup_function"; then
+        log_error "Cleanup function '$cleanup_function' does not exist"
+        return 1
+    fi
+    
+    cleanup_handler() {
+        echo
+        log_warning "Script ended. Running cleanup..."
+        "$cleanup_function"
+        exit 1
+    }
+    
+    trap cleanup_handler INT TERM 
+}
+
+validate_url() {
+    local url="$1"
+    if [[ $url =~ ^https?:// ]]; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+check_disk_space() {
+    local required_mb="$1"
+    local path="${2:-.}"
+    
+    if command_exists df; then
+        local available_kb
+        available_kb=$(df "$path" | awk 'NR==2 {print $4}')
+        local available_mb=$((available_kb / 1024))
+        
+        if [ "$available_mb" -lt "$required_mb" ]; then
+            log_warning "Low disk space: ${available_mb}MB available, ${required_mb}MB required"
+            return 1
+        fi
+    fi
+    return 0
+}
+
+# ========= THIS FUNCTION IS FOR SPECIFIC PURPOSE OF SHOWING PROGRESS BAR AT TOP==========
+initialize_progress_bar(){
+    printf "\033[${progress_line};1H"
+    show_progress "$current_step" "$total_steps"
+    echo -e "\n\n"
+}
+
+run_step() {
+    local cmd="$1"
+    local msg="$2"
+    execute_step "$cmd" "$msg"
+    ((current_step++))
+    printf "\033[s"                  # Save cursor
+    printf "\033[${progress_line};1H"
+    show_progress "$current_step" "$total_steps"
+    printf "\033[u"                  # Restore cursor
+}
+# ================================================
+
+
+init_common_functions() {
+    set_spinner_style "dots"
+    export -f show_spinner show_box show_progress
+    export -f log_info log_success log_warning log_error log_debug
+    export -f execute_step execute_with_output command_exists 
+    export -f ensure_directory backup_file ask_yes_no validate_url
+    export -f check_disk_space
+}
+
+init_common_functions
\ No newline at end of file
index.html
@@ -1,89 +1,68 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Simple Scripts</title>
-    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css">
-    <link rel="preconnect" href="https://fonts.googleapis.com">
-    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
-    <link href="https://fonts.googleapis.com/css2?family=Caveat&display=swap" rel="stylesheet">
-    <style>
-        .custom-scrollbar {
-            scrollbar-width: 1px;
-            scrollbar-color: transparent;
-            scroll-margin: 0px;
-        }
-
-        .custom-scrollbar::-webkit-scrollbar {
-            width: 1px;
-        }
-
-        .custom-scrollbar::-webkit-scrollbar-track {
-            background-color: transparent;
-        }
-
-        .custom-scrollbar::-webkit-scrollbar-thumb {
-            border-radius: 5px;
-            height: 1px;
-            width: 1px;
-            scrollbar-width: thin;
-            background-color: rgba(255, 255, 255, 0.3);
-        }
-    </style>
-</head>
-
-
-<body class="bg-gray-800 font-sans text-white">
-    <div class="container mx-auto py-8">
-        <h1 class="text-5xl text-center mb-8" style="font-family: 'Caveat', cursive;">Simple Scripts</h1>
-        <div class="snippet bg-gray-700 p-4 mb-8" id="root">
-        </div>
-    </div>
-    <script>
-        async function copyToClipboard(text) {
-            try {
-                await navigator.clipboard.writeText(text);
-                console.log('Copied to clipboard');
-            } catch (err) {
-                console.error('Failed to copy: ', err);
-            }
-        }
-
-        async function getText() {
-            const scriptList = await fetch("./scripts.json").then((res) => res.json());
-            const rootElement = document.getElementById("root");
-            scriptList.forEach(async (script) => {
-                const response = await fetch(`./${script.filename}`);
-                const data = await response.text();
-                const snippetContainer = document.createElement("div");
-                snippetContainer.className = "snippet p-4 mb-8";
-                const heading = document.createElement("h2");
-                heading.className = "text-xl mb-4 font-semibold";
-                heading.textContent = script.title;
-                const description = document.createElement("p");
-                description.className = "text-gray-400 mb-4";
-                description.textContent = script.description;
-                const pre = document.createElement("pre");
-                pre.className = "bg-gray-900 p-4 border border-gray-700 relative overflow-x-auto custom-scrollbar";
-                const button = document.createElement("button");
-                button.className = "bg-gray-700 hover:bg-gray-600 text-white font-bold py-2 px-2 rounded absolute top-2 right-2";
-                button.innerHTML = `<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3"><path d="M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>`;
-                button.addEventListener("click", () => copyToClipboard(data));
-                const code = document.createElement("code");
-                code.className = "text-gray-300";
-                code.textContent = data;
-                pre.appendChild(button);
-                pre.appendChild(code);
-                snippetContainer.appendChild(heading);
-                snippetContainer.appendChild(description);
-                snippetContainer.appendChild(pre);
-                rootElement.appendChild(snippetContainer);
-            });
-        }
-        getText();
-    </script>
-</body>
-
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Scripts</title>
+    <script src="https://cdn.tailwindcss.com"></script>
+    <link rel="icon" href="/assets/favicon.png" type="image/png">
+    <link rel="stylesheet" href="./assets/common.css">
+    <script src="./assets/common.js"></script>
+</head>
+
+<body class="h-screen flex items-center justify-center bg-black flex flex-col font-black">
+
+    <!-- Warning Modal Section  -->
+    <input class="modal-state" id="warning" type="checkbox" />
+    <div class="modal">
+        <div class="modal__inner">
+            <h2 style="text-align: center;">Warning</h2>
+            <p class="modal__p">
+                Kindly use a desktop or laptop for a better experience.
+            </p>
+        </div>
+    </div>
+
+    <h1 class="text-white text-[30px]">
+        .Scripts.
+    </h1>
+    <div class="flex flex-col text-white gap-x-[200px] gap-y-2 p-10">
+    </div>
+
+    <!-- Footer -->
+    <div class="footer">
+        <div style="display: flex; align-items: center;gap:25px">
+            <a href="https://github.com/The-Robin-Hood/scripts" target="_blank">
+                <?xml version="1.0" ?><svg height="40px" version="1.1" viewBox="0 0 60 60" width="40px"
+                    xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
+                    xmlns:xlink="http://www.w3.org/1999/xlink">
+                    <title />
+                    <defs />
+                    <g fill="none" fill-rule="evenodd" id="black" stroke="none" stroke-width="1">
+                        <g id="github">
+                            <path
+                                d="M30,60 C46.5685433,60 60,46.5685433 60,30 C60,13.4314567 46.5685433,0 30,0 C13.4314567,0 0,13.4314567 0,30 C0,46.5685433 13.4314567,60 30,60 Z"
+                                fill="#000000" />
+                            <path
+                                d="M25.4252739,47.5168887 C25.4252739,47.0671729 25.4094072,45.8772272 25.4003405,44.2968305 C20.2651779,45.440294 19.1817051,41.7588994 19.1817051,41.7588994 C18.3419003,39.5719093 17.1314934,38.9897191 17.1314934,38.9897191 C15.4552838,37.8148801 17.2584274,37.8392833 17.2584274,37.8392833 C19.111438,37.9729198 20.0861102,39.7903759 20.0861102,39.7903759 C21.7328529,42.6827342 24.4064015,41.8483777 25.4592741,41.3638002 C25.6270084,40.1401549 26.1041445,39.3057984 26.6311475,38.8328415 C22.5318575,38.3552363 18.2217663,36.7306815 18.2217663,29.4771257 C18.2217663,27.4109894 18.941437,25.7213595 20.1223771,24.3977773 C19.9331093,23.9190101 19.2984391,21.9946447 20.3037115,19.3881523 C20.3037115,19.3881523 21.8541203,18.8791716 25.3799404,21.3287864 C26.8521487,20.9092841 28.4320244,20.6977898 30.0028333,20.6908175 C31.5702423,20.6977898 33.1489846,20.9092841 34.624593,21.3287864 C38.1481464,18.8791716 39.6962885,19.3881523 39.6962885,19.3881523 C40.7038276,21.9934827 40.0702907,23.917848 39.8798896,24.3977773 C41.0630963,25.7213595 41.7771004,27.4109894 41.7771004,29.4771257 C41.7771004,36.7492744 37.4602091,38.349426 33.3473191,38.8177347 C34.0114562,39.4022491 34.6007929,40.5573331 34.6007929,42.3236588 C34.6007929,44.8546176 34.5769927,46.8963506 34.5769927,47.5168887 C34.5769927,48.0235453 34.9101946,48.6115458 35.8474666,48.4267788 C43.176775,45.9190612 48.4615385,38.8281932 48.4615385,30.4683597 C48.4615385,20.0133386 40.1949581,11.5384615 29.9994333,11.5384615 C19.8050419,11.5384615 11.5384615,20.0133386 11.5384615,30.4683597 C11.5395949,38.8305174 16.8288917,45.9260335 24.1650001,48.4291029 C25.0875387,48.6022493 25.4252739,48.017735 25.4252739,47.5168887 Z"
+                                fill="#FFFFFF" />
+                        </g>
+                    </g>
+                </svg>
+            </a>
+            <a href="https://x.com/ansariwtf" target="_blank">
+                <?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18"
+                    viewBox="0 0 1200 1227" fill="none">
+                    <g clip-path="url(#clip0_1_2)">
+                        <path
+                            d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"
+                            fill="white" />
+                    </g>
+                </svg>
+            </a>
+        </div>
+    </div>
+</body>
+
 </html>
\ No newline at end of file
old.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Simple Scripts</title>
+    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css">
+    <link rel="preconnect" href="https://fonts.googleapis.com">
+    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+    <link href="https://fonts.googleapis.com/css2?family=Caveat&display=swap" rel="stylesheet">
+    <style>
+        .custom-scrollbar {
+            scrollbar-width: 1px;
+            scrollbar-color: transparent;
+            scroll-margin: 0px;
+        }
+
+        .custom-scrollbar::-webkit-scrollbar {
+            width: 1px;
+        }
+
+        .custom-scrollbar::-webkit-scrollbar-track {
+            background-color: transparent;
+        }
+
+        .custom-scrollbar::-webkit-scrollbar-thumb {
+            border-radius: 5px;
+            height: 1px;
+            width: 1px;
+            scrollbar-width: thin;
+            background-color: rgba(255, 255, 255, 0.3);
+        }
+    </style>
+</head>
+
+
+<body class="bg-gray-800 font-sans text-white">
+    <div class="container mx-auto py-8">
+        <h1 class="text-5xl text-center mb-8" style="font-family: 'Caveat', cursive;">Simple Scripts</h1>
+        <div class="snippet bg-gray-700 p-4 mb-8" id="root">
+        </div>
+    </div>
+    <script>
+        async function copyToClipboard(text) {
+            try {
+                await navigator.clipboard.writeText(text);
+                console.log('Copied to clipboard');
+            } catch (err) {
+                console.error('Failed to copy: ', err);
+            }
+        }
+
+        async function getText() {
+            const scriptList = await fetch("./scripts.json").then((res) => res.json());
+            const rootElement = document.getElementById("root");
+            scriptList.forEach(async (script) => {
+                const response = await fetch(`./${script.filename}`);
+                const data = await response.text();
+                const snippetContainer = document.createElement("div");
+                snippetContainer.className = "snippet p-4 mb-8";
+                const heading = document.createElement("h2");
+                heading.className = "text-xl mb-4 font-semibold";
+                heading.textContent = script.title;
+                const description = document.createElement("p");
+                description.className = "text-gray-400 mb-4";
+                description.textContent = script.description;
+                const pre = document.createElement("pre");
+                pre.className = "bg-gray-900 p-4 border border-gray-700 relative overflow-x-auto custom-scrollbar";
+                const button = document.createElement("button");
+                button.className = "bg-gray-700 hover:bg-gray-600 text-white font-bold py-2 px-2 rounded absolute top-2 right-2";
+                button.innerHTML = `<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3"><path d="M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>`;
+                button.addEventListener("click", () => copyToClipboard(data));
+                const code = document.createElement("code");
+                code.className = "text-gray-300";
+                code.textContent = data;
+                pre.appendChild(button);
+                pre.appendChild(code);
+                snippetContainer.appendChild(heading);
+                snippetContainer.appendChild(description);
+                snippetContainer.appendChild(pre);
+                rootElement.appendChild(snippetContainer);
+            });
+        }
+        getText();
+    </script>
+</body>
+
+</html>
\ No newline at end of file
termux-vscode.sh
@@ -1,63 +1,91 @@
 #!/bin/bash
 
-# Function to display a spinning wheel loading animation
-loading_animation() {
-    local spinstr='|/-\'
-    while ps -p $1 > /dev/null; do
-        printf "[%c] " "$spinstr"
-        spinstr=${spinstr#?}${spinstr%???}
-        sleep 0.1
-        printf "\b\b\b\b"
-    done
-    printf "    \b\b\b\b"
+# check curl exist or not
+if ! command -v curl >/dev/null 2>&1; then
+    echo "Install curl and run the script"
+    exit 1
+fi
+
+COMMON_SCRIPT_URL="https://scripts.ansari.wtf/common.sh"
+
+# source <(curl -s $COMMON_SCRIPT_URL)
+source "./common.sh"
+
+cleanup() {
+    echo
+    echo -e "${YELLOW}Setup interrupted. Cleaning up...${NC}"
+    pkill -f code-server 2>/dev/null
+    exit 1
 }
 
-# Function to execute a command with a loading animation and status message
-execute_with_loading_animation() {
-    local command="$1"
-    local description="$2"
-    local success_message="$3"
+setup_config() {
+    local config_dir="$HOME/.config/code-server"
+    local config_file="$config_dir/config.yaml"
 
-    echo $description
+    mkdir -p "$config_dir"
+    rm -f "$config_file"
 
-    # Run the command in the background
-    $command > /dev/null 2>&1 &
+    cat > "$config_file" << 'EOF'
+bind-addr: 0.0.0.0:8000
+auth: none
+cert: false
+EOF
+    return 0
+}
 
-    local pid=$!
-    loading_animation $pid
+wait_for_service() {
+    local max_attempts=30
+    local attempt=0
 
-    if [ $? -eq 0 ]; then
-        printf "$success_message\n"
-    else
-        printf "\n%s failed.\n" "$description"
-    fi
+    printf "${BLUE}Starting code-server${NC} "
+
+    while [ $attempt -lt $max_attempts ]; do
+        if curl -s http://localhost:8000 >/dev/null 2>&1; then
+            printf "${GREEN}✓${NC}\n"
+            return 0
+        fi
+
+        printf "%s" "${SPINNER:$((attempt % ${#SPINNER})):1}"
+        sleep 1
+        printf "\b"
+        attempt=$((attempt + 1))
+    done
+
+    printf "${RED}✗${NC}\n"
+    echo -e "${RED}Timeout: Code-server failed to start${NC}"
+    return 1
 }
 
-clear
-# Update the packages without displaying output
-execute_with_loading_animation "pkg update -y" "Updating Packages" "Packages updated successfully"
 
-# Install tur-repo without displaying output
-execute_with_loading_animation "pkg install tur-repo -y" "\nInstalling tur-repo" "tur-repo installed successfully"
+main(){
+    clear
+    show_box "Termux VSCode Setup"
 
-# Install code-server, git, and python3 without displaying output
-execute_with_loading_animation "pkg install code-server git python3 -y" "\nInstalling code-server, git, and python3" "Packages installed successfully"
+    total_steps=5
+    current_step=0
+    progress_line=5
 
+    initialize_progress_bar
+    setup_cleanup_trap cleanup
 
-# change the config.yaml file
-mkdir -p ~/.config/code-server
-rm -rf ~/.config/code-server/config.yaml
-cat <<end > ~/.config/code-server/config.yaml
-bind-addr: 0.0.0.0:8000
-auth: none
-cert: false
-end
-
-# clear 
-echo "\nInitializing code-server. This might take few seconds...\n"
-mkdir -p .code-server-logs
-code-server > .code-server-logs/code-server.log 2>&1 &
-# wait for code-server to start
-sleep 10
-# open the browser
-termux-open-url http://localhost:8000
\ No newline at end of file
+    run_step "pkg update -y" "Updating package list"
+    run_step "yes '' | pkg upgrade -y" "Upgrading packages"
+    run_step "pkg install tur-repo -y" "Installing tur-repo"
+    run_step "pkg install code-server git python3 -y" "Installing code-server, git, and python3"
+    run_step "setup_config" "Setting up code-server configuration"
+
+    log_info "Creating LOG directory"
+    mkdir -p "$HOME/.code-server-logs"
+    log_info "Starting code-server"
+    code-server > "$HOME/.code-server-logs/code-server.log" 2>&1 &
+
+    if wait_for_service; then
+        show_box "Code-server is running" 40 "GREEN" "Access your code-server at http://localhost:8000"
+        if command_exists "termux-open-url"; then
+            log_info "Opening in browser"
+            termux-open-url http://localhost:8000
+        fi
+    else
+        exit 1
+    fi
+}
\ No newline at end of file