Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion basicsite/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

DEBUG = True

ALLOWED_HOSTS = ['127.0.0.1']
ALLOWED_HOSTS = ['127.0.0.1', 'bs-local.com']

STATIC_URL = '/static/'
STATICFILES_DIRS = [
Expand Down
2 changes: 2 additions & 0 deletions mysite/all_urls/urls_textanalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ def urlpatterns():
all_views.views_textanalyzer.caesarCipher, name="caesarCipher"),
path('Analyzer/playfair-cipher-encoder-decoder/',
all_views.views_textanalyzer.playfCipher, name="playfCipher"),
path('Analyzer/password-generator/',
all_views.views_textanalyzer.password_generator, name="password_generator"),
]
return urlspatterns
7 changes: 7 additions & 0 deletions mysite/all_views/views_textanalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,10 @@ def playfCipher(request):
link_string1, link_string2 = SideMap.arrange(10, 1, 'AT')
param = {'link_string1': link_string1, 'link_string2': link_string2}
return render(request, '../templates/textAnalyzer/playfCipher.html', param)


def password_generator(request):
link_string1, link_string2 = SideMap.arrange(11, 1, 'AT')
param = {'link_string1': link_string1, 'link_string2': link_string2}
return render(request, '../templates/textAnalyzer/password_generator.html', param)

1 change: 1 addition & 0 deletions mysite/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def urlSideMapList():
['/Analyzer/Language-Identifier/', 'Language Identifier', 1, 'AT', 8],
['/Analyzer/Caesar-cipher-encoder-decoder/', 'Caesar Cipher encoder/decoder', 1, 'AT', 9],
['/Analyzer/playfair-cipher-encoder-decoder/', 'playfair Cipher encoder/decoder', 1, 'AT', 10],
['/Analyzer/password-generator/', 'Password Generator', 1, 'AT', 11],

['/Conversion/BinaryConverter/', 'Binary Converter', 2, 'CC', 0],
['/Conversion/DecimalConverter/', 'Decimal Converter', 2, 'CC', 1],
Expand Down
11 changes: 10 additions & 1 deletion mysite/templates/main_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ <h4 class="modal-title" id="ad-title">Calcont Whiteboard</h4>
</div>
</div>
</div>
{% block promo_banner %}
<div class="promo-banner text-center py-2 px-3"
style="background: #ffc107; color: #000; font-weight: 500; font-size: 0.9rem; line-height: 1.4;">
I have build new privacy first browser first file processer toolkit, please visit <a href="https://drop.calcont.in"
target="_blank" style="color: #000; text-decoration: underline; font-weight: 700;">drop.calcont.in</a>
</div>
{% endblock %}
<nav class="navbar navbar-expand-lg navbar-dark sticky-top" style="background-color: rgb(20, 20, 20)">
<a class="navbar-brand" href="/">
<img src="/static/Logo.png" class="brand" width="60" height="60" alt="" loading="lazy" />
Expand Down Expand Up @@ -262,6 +269,7 @@ <h4 class="modal-title" id="ad-title">Calcont Whiteboard</h4>
<a class="dropdown-item" href="/Analyzer/Caesar-cipher-encoder-decoder/ ">Caesar cipher encoder/decoder</a>
<a class="dropdown-item" href="/Analyzer/playfair-cipher-encoder-decoder/ ">Playfair cipher
encoder/decoder</a>
<a class="dropdown-item" href="/Analyzer/password-generator/">Password Generator</a>
</div>
</li>
<li class="nav-item dropdown">
Expand Down Expand Up @@ -403,7 +411,8 @@ <h4 class="modal-title" id="ad-title">Calcont Whiteboard</h4>
; (adsbygoogle = window.adsbygoogle || []).push({})
</script>
<script src="/static/js/utils.js"></script>
{# <script src="/static/js/main.js"></script>#}
{#
<script src="/static/js/main.js"></script>#}
{% block JS %}

{% endblock %}
Expand Down
487 changes: 249 additions & 238 deletions mysite/templates/textAnalyzer/Imagetotext.html

Large diffs are not rendered by default.

174 changes: 174 additions & 0 deletions mysite/templates/textAnalyzer/password_generator.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
{% extends 'main_index.html' %}
{% block MDesc %}
Generate secure, random passwords with our Password Generator tool. Customize length, uppercase, lowercase, numbers, and
symbols.
{% endblock %}
{% block MKW %}
password generator, secure password, random password maker, strong password generator, free password generator, online password generator, best password generator, generate strong password, create secure password, random secure password, strong random password, unhackable password generator, password creator tool, instant password generator, browser-based password generator, private password generator, local password generator, offline password generator, client-side password generator, password generator no data stored, password generator without storage, password generator with symbols, password generator with special characters, password generator with numbers, password generator with uppercase and lowercase, customizable password generator, password generator with length control, password generator without ambiguous characters, WiFi password generator, router password generator, password generator for Gmail, password generator for Instagram, password generator for Facebook, banking password generator, business password generator, enterprise password generator, secure admin password generator, database password generator, API key generator, secure token generator, random 12 character password, random 16 character password, 20 character password generator, 32 character strong password, how to generate a strong password, what is a secure password, best password length for security, create unhackable password
{% endblock %}
{% block Mr %}
{% now "d/m/Y" %}
{% endblock %}
{% block MAut %}
calcont
{% endblock %}
{% block title %} Password Generator - Create Secure Passwords
{% endblock %}
{% block body %}
<style>
.password-display-box {
background-color: #191717;
border: 3px solid black;
border-radius: 15px;
color: white;
font-size: 24px;
font-weight: bold;
letter-spacing: 2px;
text-align: center;
padding: 20px;
word-break: break-all;
position: relative;
}

.copy-btn {
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
color: white;
cursor: pointer;
}

.copy-btn:hover {
color: #007bff;
}

.generator-controls {
background-color: rgb(30, 30, 30);
box-shadow: 13px 4px 19px 7px rgb(19 17 17);
padding: 30px;
border-radius: 10px;
}

.slider-container {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}

.password-length-val {
background-color: #191717;
border: 2px solid black;
border-radius: 5px;
padding: 5px 15px;
font-weight: bold;
font-size: 18px;
}

.custom-range {
width: 100%;
}

.checkbox-group {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
}

@media (max-width: 768px) {
.generator-controls {
padding: 20px 15px;
}

.password-display-box {
font-size: 18px;
padding: 15px 40px 15px 15px;
}

.password-length-val {
font-size: 16px;
padding: 5px 10px;
}

h1 {
font-size: 1.8rem;
}
}

@media (max-width: 480px) {
.checkbox-group {
grid-template-columns: 1fr;
}
}
</style>

<div class="container text-light my-4">
<div class="row justify-content-center">
<div class="col-md-9 my-3">
<div class="generator-controls">
<h1 class="text-center font-weight-bold mb-4">Password Generator</h1>

<div class="password-display-box mb-4">
<span id="generated-password">Generating...</span>
<button class="copy-btn" id="copy-password-btn" title="Copy to clipboard">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
class="bi bi-copy" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z" />
</svg>
</button>
</div>

<div class="mb-4">
<label class="font-weight-bold" style="font-size: 1.2rem;">Password Length</label>
<div class="slider-container mt-2">
<input type="range" class="custom-range mr-4" min="1" max="50" value="16" id="password-length">
<span class="password-length-val" id="length-val">16</span>
</div>
</div>

<div class="checkbox-group mb-4 mt-4">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="include-uppercase" checked>
<label class="custom-control-label" for="include-uppercase"
style="font-size: 1.1rem;">Uppercase</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="include-lowercase" checked>
<label class="custom-control-label" for="include-lowercase"
style="font-size: 1.1rem;">Lowercase</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="include-numbers" checked>
<label class="custom-control-label" for="include-numbers"
style="font-size: 1.1rem;">Numbers</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="include-symbols" checked>
<label class="custom-control-label" for="include-symbols"
style="font-size: 1.1rem;">Symbols</label>
</div>
</div>

<button class="btn btn-primary btn-block py-3 font-weight-bold mt-4"
style="font-size: 1.2rem; border-radius: 10px;" id="generate-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor"
class="bi bi-arrow-clockwise mr-2" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" />
<path
d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" />
</svg>
Generate New Password
</button>

</div>
</div>
</div>
</div>
{% endblock %}
{% block JS %}
<script src="/static/js/textAnalyzers/password_generator.js"></script>
{% endblock %}
84 changes: 84 additions & 0 deletions staticfiles/js/textAnalyzers/password_generator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
document.addEventListener('DOMContentLoaded', () => {
const passwordDisplay = document.getElementById('generated-password');
const lengthSlider = document.getElementById('password-length');
const lengthVal = document.getElementById('length-val');
const uppercaseCb = document.getElementById('include-uppercase');
const lowercaseCb = document.getElementById('include-lowercase');
const numbersCb = document.getElementById('include-numbers');
const symbolsCb = document.getElementById('include-symbols');
const generateBtn = document.getElementById('generate-btn');
const copyBtn = document.getElementById('copy-password-btn');

const UPPERCASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
const LOWERCASE_CHARS = 'abcdefghijklmnopqrstuvwxyz';
const NUMBER_CHARS = '0123456789';
const SYMBOL_CHARS = '!@#$%^&*()_+~`|}{[]:;?><,./-=';

function generatePassword() {
let chars = '';
if (uppercaseCb.checked) chars += UPPERCASE_CHARS;
if (lowercaseCb.checked) chars += LOWERCASE_CHARS;
if (numbersCb.checked) chars += NUMBER_CHARS;
if (symbolsCb.checked) chars += SYMBOL_CHARS;

if (chars.length === 0) {
passwordDisplay.textContent = 'Please select at least one option';
return;
}

let password = '';
const length = parseInt(lengthSlider.value);

let requiredChars = [];
if (uppercaseCb.checked) requiredChars.push(UPPERCASE_CHARS[Math.floor(Math.random() * UPPERCASE_CHARS.length)]);
if (lowercaseCb.checked) requiredChars.push(LOWERCASE_CHARS[Math.floor(Math.random() * LOWERCASE_CHARS.length)]);
if (numbersCb.checked) requiredChars.push(NUMBER_CHARS[Math.floor(Math.random() * NUMBER_CHARS.length)]);
if (symbolsCb.checked) requiredChars.push(SYMBOL_CHARS[Math.floor(Math.random() * SYMBOL_CHARS.length)]);

// Always put one character of each requirement
for (let i = 0; i < requiredChars.length && i < length; i++) {
password += requiredChars[i];
}

for (let i = password.length; i < length; i++) {
const randomIndex = Math.floor(Math.random() * chars.length);
password += chars[randomIndex];
}

password = password.split('').sort(() => 0.5 - Math.random()).join('');

passwordDisplay.textContent = password;
}

// Event Listeners
lengthSlider.addEventListener('input', (e) => {
lengthVal.textContent = e.target.value;
generatePassword();
});

[uppercaseCb, lowercaseCb, numbersCb, symbolsCb].forEach(cb => {
cb.addEventListener('change', generatePassword);
});

generateBtn.addEventListener('click', generatePassword);

copyBtn.addEventListener('click', () => {
const textToCopy = passwordDisplay.textContent;
if (textToCopy === 'Please select at least one option' || textToCopy === 'Generating...') return;

navigator.clipboard.writeText(textToCopy).then(() => {
const originalHTML = copyBtn.innerHTML;
copyBtn.innerHTML = `
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#28a745" class="bi bi-check" viewBox="0 0 16 16">
<path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"/>
</svg>
`;
setTimeout(() => {
copyBtn.innerHTML = originalHTML;
}, 2000);
});
});

// Initial Generation
generatePassword();
});
Loading