Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
reafactor(clean): clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamadreza1388 committed Sep 11, 2024
1 parent effe28c commit bf98684
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 14 deletions.
25 changes: 23 additions & 2 deletions salam-online.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,18 @@
</svg>
</button>
<button class="refactor"><span class="title">تمیز کردن</span>
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M11.4096 5.50506C13.0796 3.83502 13.9146 3 14.9522 3C15.9899 3 16.8249 3.83502 18.4949 5.50506C20.165 7.1751 21 8.01013 21 9.04776C21 10.0854 20.165 10.9204 18.4949 12.5904L14.3017 16.7837L7.21634 9.69828L11.4096 5.50506Z" fill="#ffffff"></path> <path d="M6.1557 10.759L13.2411 17.8443L12.5904 18.4949C12.2127 18.8727 11.8777 19.2077 11.5734 19.5H21C21.4142 19.5 21.75 19.8358 21.75 20.25C21.75 20.6642 21.4142 21 21 21H9C7.98423 20.9747 7.1494 20.1393 5.50506 18.4949C3.83502 16.8249 3 15.9899 3 14.9522C3 13.9146 3.83502 13.0796 5.50506 11.4096L6.1557 10.759Z" fill="#ffffff"></path> </g></svg>
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path
d="M11.4096 5.50506C13.0796 3.83502 13.9146 3 14.9522 3C15.9899 3 16.8249 3.83502 18.4949 5.50506C20.165 7.1751 21 8.01013 21 9.04776C21 10.0854 20.165 10.9204 18.4949 12.5904L14.3017 16.7837L7.21634 9.69828L11.4096 5.50506Z"
fill="#ffffff"></path>
<path
d="M6.1557 10.759L13.2411 17.8443L12.5904 18.4949C12.2127 18.8727 11.8777 19.2077 11.5734 19.5H21C21.4142 19.5 21.75 19.8358 21.75 20.25C21.75 20.6642 21.4142 21 21 21H9C7.98423 20.9747 7.1494 20.1393 5.50506 18.4949C3.83502 16.8249 3 15.9899 3 14.9522C3 13.9146 3.83502 13.0796 5.50506 11.4096L6.1557 10.759Z"
fill="#ffffff"></path>
</g>
</svg>
</button>
<button class="save"><span class="title">ذخیره کد</span>
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand All @@ -56,7 +67,17 @@
</button>
</div>
<a href="https://api.salamlang.ir/auth" class="login"><span class="title">ورود به سایت</span>
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M2.00098 11.999L16.001 11.999M16.001 11.999L12.501 8.99902M16.001 11.999L12.501 14.999" stroke="#ffffff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M9.00195 7C9.01406 4.82497 9.11051 3.64706 9.87889 2.87868C10.7576 2 12.1718 2 15.0002 2L16.0002 2C18.8286 2 20.2429 2 21.1215 2.87868C22.0002 3.75736 22.0002 5.17157 22.0002 8L22.0002 16C22.0002 18.8284 22.0002 20.2426 21.1215 21.1213C20.3531 21.8897 19.1752 21.9862 17 21.9983M9.00195 17C9.01406 19.175 9.11051 20.3529 9.87889 21.1213C10.5202 21.7626 11.4467 21.9359 13 21.9827" stroke="#ffffff" stroke-width="1.5" stroke-linecap="round"></path> </g></svg>
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path d="M2.00098 11.999L16.001 11.999M16.001 11.999L12.501 8.99902M16.001 11.999L12.501 14.999"
stroke="#ffffff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
<path
d="M9.00195 7C9.01406 4.82497 9.11051 3.64706 9.87889 2.87868C10.7576 2 12.1718 2 15.0002 2L16.0002 2C18.8286 2 20.2429 2 21.1215 2.87868C22.0002 3.75736 22.0002 5.17157 22.0002 8L22.0002 16C22.0002 18.8284 22.0002 20.2426 21.1215 21.1213C20.3531 21.8897 19.1752 21.9862 17 21.9983M9.00195 17C9.01406 19.175 9.11051 20.3529 9.87889 21.1213C10.5202 21.7626 11.4467 21.9359 13 21.9827"
stroke="#ffffff" stroke-width="1.5" stroke-linecap="round"></path>
</g>
</svg>
</a>
</header>

Expand Down
6 changes: 3 additions & 3 deletions script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,14 @@ const save_code = () => {
if (login !== "") {
let xhr = new XMLHttpRequest();

xhr.onload = function () {
xhr.onload = function () {
if (JSON.parse(xhr.response).status === true) {
Swal.fire({
icon: "success",
title: "لطفا اطلاعات را درست وارد نمایید",
text: "فیلد عنوان نباید خالی باشد",
});
}else {
} else {
Swal.fire({
icon: "error",
title: "کد نمیتواند خالی باشد.",
Expand All @@ -290,7 +290,7 @@ const save_code = () => {
title: login,
code: elm_code.value
}));
}else {
} else {
Swal.fire({
icon: "error",
title: "لطفا اطلاعات را درست وارد نمایید",
Expand Down
19 changes: 10 additions & 9 deletions style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ button:hover {
}

.save>svg,
.execute>svg ,
.execute>svg,
.refactor>svg,
.login>svg {
width: 25px;
Expand All @@ -165,12 +165,12 @@ button:hover {
width: 20px;
}

.refactor{
.refactor {
background-color: rgb(39 110 246);
color: white;
}

.login{
.login {
display: none;
background-color: #FF6100;
color: white;
Expand Down Expand Up @@ -304,20 +304,20 @@ div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel)::af
content: "باشه";
}

.swal2-input{
.swal2-input {
border-radius: 10px;
}

div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm).save_btn_after::after{
div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm).save_btn_after::after {
content: "ذخیره";
}

div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel)::after{
div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel)::after {
background-color: rgb(39 110 246);
content: "کنسل";
}

div:where(.swal2-container) div:where(.swal2-actions){
div:where(.swal2-container) div:where(.swal2-actions) {
flex-direction: row-reverse;
gap: 10px;
}
Expand Down Expand Up @@ -410,10 +410,11 @@ div:where(.swal2-container) div:where(.swal2-actions){
}

@media screen and (max-width: 600px) {
span.title{
span.title {
display: none;
}
.setting_modal{

.setting_modal {
width: 96%;
}
}

0 comments on commit bf98684

Please sign in to comment.