Skip to content

Commit

Permalink
Remove blur codes #200
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Apr 2, 2022
1 parent 3edf3f9 commit 134de3d
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 119 deletions.
59 changes: 1 addition & 58 deletions app/application/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const name_query = []

const description_state = settings.settings.codes_description
const copy_state = settings.settings.reset_after_copy
const blur_state = settings.settings.blur_codes
const search_state = settings.settings.search_history
const sort_number = settings.settings.sort

Expand Down Expand Up @@ -212,63 +211,7 @@ const generateCodeElements = (data) => {
// create div
const element = document.createElement("div")

// set div elements
if (blur_state === true && description_state === true) {
element.innerHTML = `
<div id="codes${i}" class="lg:w-2/3 md:w-11/12 bg-gray-800 mt-10 mb-10 pb-2 rounded-2xl mx-auto flex flex-col">
<div class="flex flex-row justify-center items-center">
<div class="flex flex-col flex-1 justify-center items-center">
<h3>${lang.text.name}</h3>
<h2 id="name${i}" tabindex="0" class="text-2xl font-normal mt-3">${lang.text.name}</h2>
</div>
<div class="flex flex-col flex-1 justify-center items-center">
<h3 class="relative -top-1">${lang.text.code}</h3>
<p id="code${i}" tabindex="0" class="input w-[126px] text-xl relative -top-2.5 select-all filter blur-sm hover:blur-0" id="code${i}">${lang.text.code}</p>
</div>
<div class="flex flex-col flex-1 justify-center items-center">
<h3>${lang.text.time}</h3>
<h2 id="time${i}" class="text-center text-2xl font-normal mt-3">${lang.text.time}</h2>
</div>
</div>
<div class="flex flex-col justify-center items-center">
<p tabindex="0" class="text-2xl bg-gray-700 px-3 py-1.5 rounded-2xl select-all mb-3" id="text${i}">Description</p>
<button onclick="copyCode(${i})" id="copy${i}" class="buttoni w-[194px] mb-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
</svg>
${lang.button.copy}
</button>
</div>
</div>
`
} else if (blur_state === true) {
element.innerHTML = `
<div id="codes${i}" class="lg:w-2/3 md:w-11/12 bg-gray-800 mt-10 mb-10 rounded-2xl mx-auto flex flex-col">
<div class="flex flex-row justify-center items-center">
<div class="flex flex-col flex-1 justify-center items-center">
<h3>${lang.text.name}</h3>
<h2 id="name${i}" tabindex="0" class="text-2xl font-normal mt-3">${lang.text.name}</h2>
</div>
<div class="flex flex-col flex-1 justify-center items-center">
<h3 class="relative -top-1">${lang.text.code}</h3>
<p id="code${i}" tabindex="0" class="input w-[126px] text-xl relative -top-2.5 select-all filter blur-sm hover:blur-0" id="code${i}">${lang.text.code}</p>
</div>
<div class="flex flex-col flex-1 justify-center items-center">
<h3>${lang.text.time}</h3>
<h2 id="time${i}" class="text-center text-2xl font-normal mt-3">${lang.text.time}</h2>
</div>
</div>
<div class="flex flex-col justify-center items-center">
<button onclick="copyCode(${i})" id="copy${i}" class="buttoni w-[194px] mb-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
</svg>
${lang.button.copy}
</button>
</div>
</div>
`
} else if (description_state === true) {
if (description_state === true) {
element.innerHTML = `
<div id="codes${i}" class="lg:w-2/3 md:w-11/12 bg-gray-800 mt-10 mb-10 pb-2 rounded-2xl mx-auto flex flex-col">
<div class="flex flex-row justify-center items-center">
Expand Down
15 changes: 1 addition & 14 deletions app/settings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
</div>
</div>
</div>
<!-- page -->
<div class="flex flex-1 overflow-hidden">
<!-- page -->
<div class="w-4/5 flex-1 overflow-y-scroll bg-gray-800">
<!-- build number -->
<div class="build sticky top-0 z-10 hidden w-full bg-black font-bold text-white">
Expand Down Expand Up @@ -291,19 +291,6 @@ <h4 data-loc>The saved codes description will be visible. You can copy it after
</div>
<br />
<hr />
<h3 data-loc>Blur codes</h3>
<h4 data-loc>Blur the saved codes. You can still copy the codes or hover over the codes to show them.</h4>
<div class="mx-auto flex h-[68px] w-72 items-center justify-center rounded-full bg-white">
<a href="#" onclick="blurCodes()">
<div class="pointer-events-none relative mr-2 inline-block w-10 select-none rounded-full border-2 border-gray-900 bg-gray-900 align-middle">
<input tabindex="-1" id="tgl4" type="checkbox" class="toggle" />
<label for="tgl4" class="toggle-bg block h-6 cursor-pointer overflow-hidden rounded-full bg-white"></label>
</div>
</a>
<span id="tgt4" class="text-xl text-black">-</span>
</div>
<br />
<hr />
<h3 data-loc>Search history</h3>
<h4 data-loc>Save the latest code you searched for. Works even after restart.</h4>
<div class="mx-auto flex h-[68px] w-72 items-center justify-center rounded-full bg-white">
Expand Down
42 changes: 0 additions & 42 deletions app/settings/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ const tgl1 = document.querySelector("#tgl1")
const tgt1 = document.querySelector("#tgt1")
const tgl3 = document.querySelector("#tgl3")
const tgt3 = document.querySelector("#tgt3")
const tgl4 = document.querySelector("#tgl4")
const tgt4 = document.querySelector("#tgt4")
const tgl5 = document.querySelector("#tgl5")
const tgt5 = document.querySelector("#tgt5")
const tgl6 = document.querySelector("#tgl6")
Expand Down Expand Up @@ -154,16 +152,6 @@ if (codes_description_state === true) {
tgl3.checked = false
}

// blur codes
let blur_codes_state = settings.settings.blur_codes
if (blur_codes_state === true) {
tgt4.textContent = "On"
tgl4.checked = true
} else {
tgt4.textContent = "Off"
tgl4.checked = false
}

// search history
let search_state = settings.settings.search_history
if (search_state === true) {
Expand Down Expand Up @@ -423,36 +411,6 @@ const codesDescription = () => {
reload()
}

/**
* Blur codes
*/
const blurCodes = () => {
const toggle = () => {
if (blur_codes_state === true) {
settings.settings.blur_codes = false

save()

tgt4.textContent = "Off"
tgl4.checked = false

blur_codes_state = false
} else {
settings.settings.blur_codes = true

save()

tgt4.textContent = "On"
tgl4.checked = true

blur_codes_state = true
}
}

toggle()
reload()
}

/**
* Save search results
*/
Expand Down
2 changes: 0 additions & 2 deletions languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ module.exports = {
"Default",
"Codes description",
"The saved codes description will be visible. You can copy it after clicking it.",
"Blur codes",
"Blur the saved codes. You can still copy the codes or hover over the codes to show them.",
"Search history",
"Save the latest code you searched for. Works even after restart.",
"Reset search after copy",
Expand Down
2 changes: 0 additions & 2 deletions languages/hu.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ module.exports = {
"Alapértelmezett",
"Kódok leírása",
"A mentett kódok leírása látható lesz. Kattintás után másolhatod a leírást.",
"Kódok elhomályosítása",
"A megjelenített kódok elhomályosítása. Ugyanúgy kitudod másolni vagy megjeleníteni a kódokat ha föléviszed az egeret.",
"Keresési előzmények",
"A legutóbbi keresés mentése. Újraindítás után is működik.",
"Keresés törlése másolás után",
Expand Down
1 change: 0 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ const settings_file = {
launch_on_startup: true,
close_to_tray: true,
codes_description: false,
blur_codes: false,
reset_after_copy: false,
search_history: true,
hardware_acceleration: false,
Expand Down

0 comments on commit 134de3d

Please sign in to comment.