π§Ή One Click System Cleaner App using Python – Clean Temp, Cache, and Log Files | FuzzuTech
Demo :
Click Video πππ
App Name: One Click System Cleaner – FuzzuTech
Tech Stack: Python, CustomTkinter, Tkinter, OS, Shutil
Purpose: Clean Temp Files, Cache, and Log Files with a Single Click
Highlights:
-
π» Dark Hacker GUI
-
π§Ή Clean Windows Cache, Chrome Cache, and .log files
-
π§ Useful for Developers, Coders, and PC Users
-
π§ Fully Offline Utility
-
⚡ Fast Execution | Smooth UI | 100% Python
✨ Created by [FuzzuTech] – Subscribe on YouTube for more Viral Python Projects!
π₯ Watch the full demo
π₯ Source Code Here
Code :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JS Image Compressor</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" />
<style>
body {
background: linear-gradient(to right, #667eea, #764ba2);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
color: #fff;
padding: 2rem;
text-align: center;
}
.drop-area {
border: 3px dashed #fff;
padding: 50px;
border-radius: 20px;
transition: background 0.3s;
cursor: pointer;
}
.drop-area.dragover {
background-color: rgba(255, 255, 255, 0.2);
}
img {
max-width: 100%;
margin-top: 20px;
border-radius: 10px;
}
.preview {
margin-top: 1rem;
}
.btn-compress {
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1 class="mb-4">π️ Online Image Compressor</h1>
<div class="drop-area" id="drop-area">
<p>Drag & Drop an image here or click to select</p>
<input type="file" id="fileElem" accept="image/*" hidden>
</div>
<div class="preview" id="preview"></div>
<button class="btn btn-light btn-compress" id="compressBtn" disabled>Compress & Download</button>
</div>
<script>
const dropArea = document.getElementById('drop-area');
const fileElem = document.getElementById('fileElem');
const preview = document.getElementById('preview');
const compressBtn = document.getElementById('compressBtn');
let selectedFile = null;
dropArea.addEventListener('click', () => fileElem.click());
fileElem.addEventListener('change', (e) => handleFiles(e.target.files));
dropArea.addEventListener('dragover', (e) => {
e.preventDefault();
dropArea.classList.add('dragover');
});
dropArea.addEventListener('dragleave', () => dropArea.classList.remove('dragover'));
dropArea.addEventListener('drop', (e) => {
e.preventDefault();
dropArea.classList.remove('dragover');
handleFiles(e.dataTransfer.files);
});
function handleFiles(files) {
if (files.length === 0) return;
const file = files[0];
if (!file.type.startsWith('image/')) return alert('Please drop an image file');
selectedFile = file;
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = (e) => {
preview.innerHTML = `<img src="${e.target.result}" id="previewImage"><p class="text-light mt-2">Original Size: ${(file.size / 1024).toFixed(2)} KB</p>`;
compressBtn.disabled = false;
};
}
compressBtn.addEventListener('click', () => {
if (!selectedFile) return;
const img = new Image();
img.src = URL.createObjectURL(selectedFile);
img.onload = () => {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const scale = 0.5;
canvas.width = img.width * scale;
canvas.height = img.height * scale;
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
canvas.toBlob((blob) => {
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'compressed-image.jpg';
a.click();
}, 'image/jpeg', 0.6);
};
});
</script>
</body>
</html>
Comments
Post a Comment