-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more styling, functionality and major improving to the user exp…
…erience
- Loading branch information
Showing
4 changed files
with
1,009 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,50 +3,100 @@ | |
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Regex Viewer</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> | ||
<title>Regex Pattern Generator</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> | ||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet"> | ||
<link rel="stylesheet" href="assets/css/app.css"> | ||
</head> | ||
<body> | ||
<div class="container py-5"> | ||
<h1 class="mb-3">Regex Pattern Viewer</h1> | ||
<form> | ||
<div class="mb-3"> | ||
<label for="patternType" class="form-label">Select Pattern Type:</label> | ||
<select id="patternType" class="form-select" onchange="updateCountriesAndLabel()"> | ||
<option value="">Please select</option> | ||
<option value="phoneNumbers">Phone Numbers</option> | ||
<option value="postalCodes">Postal Codes</option> | ||
<option value="VATNumbers">VAT Numbers</option> | ||
<option value="commonPatterns">Common Patterns</option> | ||
</select> | ||
<div class="page-container"> | ||
<!-- Header --> | ||
<header class="text-white mb-2 pb-2"> | ||
<div class="container d-flex justify-content-between align-items-center"> | ||
<h1 class="h3 mb-0">Regex Pattern Generator</h1> | ||
<a href="https://github.com/mnestorov/regex-patterns" target="_blank" class="text-white"> | ||
<i class="bi bi-github" style="font-size: 1.5rem;"></i> | ||
</a> | ||
</div> | ||
<div class="mb-3"> | ||
<label id="secondSelectLabel" for="country" class="form-label">Select Country:</label> | ||
<select id="country" class="form-select"> | ||
<option value="">Please select</option> | ||
</select> | ||
</header> | ||
<!-- Description Block --> | ||
<div class="container content bg-transparent text-center"> | ||
<hr class="dotted"> | ||
<p class="lead">Designed to help developers easily generate and understand regular expressions for various use cases.</p> | ||
<p class="">Select a pattern type, country, and programming language to see the corresponding regular expression and code example. You can also view a detailed explanation of how the regex works and export or copy the code for your project.</p> | ||
<hr> | ||
</div> | ||
<div class="container py-5 mt-4 content"> | ||
<form> | ||
<div class="mb-3"> | ||
<label for="patternType" class="form-label">Select Pattern Type:</label> | ||
<select id="patternType" class="form-select" onchange="updateCountriesAndLabel()"> | ||
<option value="">Please select</option> | ||
<option value="phoneNumbers">Phone Numbers</option> | ||
<option value="postalCodes">Postal Codes</option> | ||
<option value="VATNumbers">VAT Numbers</option> | ||
<option value="commonPatterns">Common Patterns</option> | ||
</select> | ||
</div> | ||
<div class="mb-3"> | ||
<label id="secondSelectLabel" for="country" class="form-label">Select Country:</label> | ||
<select id="country" class="form-select"> | ||
<option value="">Please select</option> | ||
</select> | ||
</div> | ||
<div class="mb-3"> | ||
<label for="programmingLanguage" class="form-label">Select Programming Language:</label> | ||
<select id="programmingLanguage" class="form-select"> | ||
<option value="">Please select</option> | ||
<option value="PHP">PHP</option> | ||
<option value="JavaScript">JavaScript</option> | ||
<option value="Python">Python</option> | ||
<option value="C#">C#</option> | ||
<option value="Java">Java</option> | ||
<option value="Ruby">Ruby</option> | ||
<option value="Go">Go</option> | ||
<option value="Swift">Swift</option> | ||
<option value="Perl">Perl</option> | ||
</select> | ||
</div> | ||
<button type="button" onclick="showPattern()" class="btn btn-primary"> | ||
<i class="bi bi-eye"></i> Show Pattern and Code | ||
</button> | ||
</form> | ||
<div id="regexDisplay" class="alert alert-success mt-3">Regex pattern will be displayed here.</div> | ||
<div class="accordion mt-3" id="explanationAccordion" style="display: none;"> | ||
<div class="accordion-item border border-3 border-warning rounded"> | ||
<h2 class="accordion-header" id="headingExplanation"> | ||
<button class="accordion-button text-bg-warning shadow-none" type="button" data-bs-toggle="collapse" data-bs-target="#collapseExplanation" aria-expanded="true" aria-controls="collapseExplanation"> | ||
<strong><i class="bi bi-info-circle"></i> Explanation of Regex Pattern</strong> | ||
</button> | ||
</h2> | ||
<div id="collapseExplanation" class="accordion-collapse collapse show" aria-labelledby="headingExplanation" data-bs-parent="#explanationAccordion"> | ||
<div class="accordion-body text-bg-dark" id="explanationBody"> | ||
<!-- Explanation content will be dynamically generated here --> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="mb-3"> | ||
<label for="programmingLanguage" class="form-label">Select Programming Language:</label> | ||
<select id="programmingLanguage" class="form-select"> | ||
<option value="">Please select</option> | ||
<option value="PHP">PHP</option> | ||
<option value="JavaScript">JavaScript</option> | ||
<option value="Python">Python</option> | ||
<option value="C#">C#</option> | ||
<option value="Java">Java</option> | ||
<option value="Ruby">Ruby</option> | ||
<option value="Go">Go</option> | ||
<option value="Swift">Swift</option> | ||
<option value="Perl">Perl</option> | ||
</select> | ||
<div id="codeExampleDisplay" class="alert alert-info mt-3">Code example will be displayed here.</div> | ||
<div id="actions" class="mt-3"> | ||
<button id="exportButton" type="button" class="btn btn-success" style="display: none;"> | ||
<i class="bi bi-download"></i> Export to File | ||
</button> | ||
<button id="copyButton" type="button" class="btn btn-success" style="display: none;"> | ||
<i class="bi bi-clipboard"></i> Copy to Clipboard | ||
</button> | ||
</div> | ||
<button type="button" onclick="showPattern()" class="btn btn-primary">Show Pattern and Code</button> | ||
</form> | ||
<div id="regexDisplay" class="alert alert-success mt-3">Regex pattern will be displayed here.</div> | ||
<div id="codeExampleDisplay" class="alert alert-info mt-3">Code example will be displayed here.</div> | ||
</div> | ||
<!-- Footer --> | ||
<footer class="text-center mt-4 pt-4"> | ||
<div class="container"> | ||
<p class="my-3">© 2024 - Developed by <a href="https://github.com/mnestorov/" target="_blank" class="text-decoration-none"><mark class="bg-primary text-white rounded">Martin Nestorov</mark></a></p> | ||
<p><small>Contributions are welcome so feel free to fork the project on GitHub and submit a pull request. <br> Your help in improving this tool is greatly appreciated.</small></p> | ||
</div> | ||
</footer> | ||
</div> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script> | ||
<script src="assets/js/app.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.