From 8995efd97e51e2a2626328e5ab000e00e22c2280 Mon Sep 17 00:00:00 2001 From: Subhajit-2023-44 Date: Fri, 25 Oct 2024 00:28:46 +0530 Subject: [PATCH] done --- client/index.html | 14 +++++++++ client/visi.css | 76 +++++++++++++++++++++++++++++++++++++++++++++++ client/visi.js | 21 +++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 client/visi.css create mode 100644 client/visi.js diff --git a/client/index.html b/client/index.html index 2b2c01d..c16aee3 100644 --- a/client/index.html +++ b/client/index.html @@ -61,4 +61,18 @@ src="https://cdn.gtranslate.net/widgets/latest/float.js" defer > + +

+ + +
+
Visitor
+
+
+ + + + + + diff --git a/client/visi.css b/client/visi.css new file mode 100644 index 0000000..5aaf71b --- /dev/null +++ b/client/visi.css @@ -0,0 +1,76 @@ +.visitor-counter { + position: fixed; + top: 590px; + left: 20px; + background-color: rgb(255 255 255); + height: 60px; + width: 118px; + color: #333; /* Darker text for better contrast */ + font-weight: 700; + font-size: 18px; + text-align: center; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + border-radius: 12px; /* Softer corners */ + backdrop-filter: blur(10px); /* Increased blur for a modern touch */ + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15), /* Slightly more pronounced shadow */ + 0 2px 4px rgba(0, 0, 0, 0.1); + z-index: 1000; + transition: all 0.3s ease; /* Smooth transition for hover effect */ + } + + .visitor-counter:hover { + transform: scale(1.05); /* Slightly enlarge on hover */ + box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Enhance shadow on hover */ + } + + .visitor-counter div:first-child { + margin-bottom: -3px; + font-size: 14px; /* Adjusted for clarity */ + letter-spacing: 1px; /* Increased spacing for readability */ + } + + .website-counter { + font-size: 24px; + font-family: 'Arial', sans-serif; /* Consistent font family */ + } + + @media screen and (max-width: 768px) { + .visitor-counter { + height: 100px; + width: 100px; + font-size: 16px; + } + + .website-counter { + font-size: 20px; + } + } + + @media screen and (max-width: 480px) { + .visitor-counter { + height: 80px; + width: 80px; + font-size: 14px; + } + + .website-counter { + font-size: 18px; + } + } + + .dark-mode .visitor-counter div { + color: #f0f0f0; /* Lighter text for dark mode */ + } + + .dark-mode .visitor-counter .website-counter { + color: #f0f0f0; /* Lighter color for consistency */ + } + + .dark-mode .visitor-counter { + background-color: rgba(0, 0, 0, 0.7); /* Darker background for dark mode */ + box-shadow: 0 6px 12px rgba(255, 255, 255, 0.1), + 0 2px 4px rgba(255, 255, 255, 0.05); + } \ No newline at end of file diff --git a/client/visi.js b/client/visi.js new file mode 100644 index 0000000..f065f95 --- /dev/null +++ b/client/visi.js @@ -0,0 +1,21 @@ +// Function to get the count from localStorage or initialize it +function getVisitorCount() { + return localStorage.getItem('visitorCount') || 0; + } + + // Function to increment and save the count + function incrementVisitorCount() { + let count = parseInt(getVisitorCount()) + 1; + localStorage.setItem('visitorCount', count); + return count; + } + + // Function to display the count + function displayVisitorCount() { + const counterElement = document.querySelector('.website-counter'); + const count = incrementVisitorCount(); + counterElement.textContent = count; + } + + // Call the display function when the page loads + document.addEventListener('DOMContentLoaded', displayVisitorCount);