Skip to content

Commit

Permalink
Replace uikit with css on before-navigate
Browse files Browse the repository at this point in the history
Also fix formatting
  • Loading branch information
NotAProton committed Apr 29, 2023
1 parent 57e01e6 commit 395f672
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 51 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"singleQuote": true
"singleQuote": true,
"bracketSameLine": true
}
2 changes: 1 addition & 1 deletion src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"message": "Options"
},
"optionsLink": {
"message": "Change FastForward' options."
"message": "Change FastForward's options."
},
"optionsEnabled": {
"message": "Enable website bypasses."
Expand Down
3 changes: 0 additions & 3 deletions src/html/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ document.documentElement.setAttribute(
'dir',
brws.i18n.getMessage('@@bidi_dir')
);
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.className = 'uk-light uk-background-secondary';
}
12 changes: 6 additions & 6 deletions src/html/before-navigate.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
<title data-message="beforeNavigate"></title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<script src="./base.js"></script>
</head>
<body>
<div class="uk-margin-top uk-margin-bottom uk-margin-left uk-margin-right">
<h1 data-message="beforeNavigate"></h1>
<section>
<h2 data-message="beforeNavigate"></h2>
<p id="destination"></p>
<div id="timer" class="uk-alert uk-alert-primary uk-hidden">
<div id="timer">
<p></p>
</div>
<p id="options-link">
<span data-message="beforeNavigateOptions"></span>
<a
href="options.html#option-navigation-delay"
target="_blank"
data-message="optionsLink"
></a>
data-message="optionsLink"></a>
</p>
</div>
</section>

<script src="./i18n.js"></script>
<script src="./before-navigate.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions src/html/before-navigate.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ function escapeHtml(unsafe) {
const destinationElement = document.querySelector('#destination');
destinationElement.innerHTML = brws.i18n.getMessage(
'beforeNavigateDestination',
`<a href="${escapeHtml(targetUrl)}"><code> ${escapeHtml(
`<br><a href="${escapeHtml(
targetUrl
)} </a></code>`
)}" class="link link-preview"><code> ${escapeHtml(targetUrl)} </a></code>`
);

brws.storage.local.get('options', (result) => {
Expand Down
16 changes: 9 additions & 7 deletions src/html/crowd-bypassed.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,31 @@
<title data-message="crowdBypassed"></title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<script src="base.js"></script>
</head>
<body>
<div class="uk-margin-top uk-margin-bottom uk-margin-left uk-margin-right">
<h1 data-message="crowdBypassed"></h1>
<section>
<h2 data-message="crowdBypassed"></h1>
<p id="crowd-bypass-info"></p>
<div id="timer" class="uk-alert uk-alert-primary uk-hidden">
<div id="timer">
<p></p>
</div>
<p data-message="tempDisableCrowdBypassDesc"></p>
<button id="temp-disable-crowd">
<span data-message="tempDisableCrowdBypassButton"></span>
</button>
<br />
<p>
<p id="options-link">
<span data-message="crowdBypassedOptions"></span>
<a
href="options.html#option-crowd-open-delay"
target="_blank"
data-message="optionsLink"
></a>
data-message="optionsLink"></a>
</p>
</div>

</section>

<script src="i18n.js"></script>
<script src="crowd-bypassed.js"></script>
</body>
Expand Down
5 changes: 4 additions & 1 deletion src/html/crowd-bypassed.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ function escapeHtml(unsafe) {
function updateDestinationMessage() {
let msg = brws.i18n.getMessage(
'crowdBypassedInfo',
'<a><code>'.concat(escapeHtml(targetUrl), '</a></code>')
`<br><a href="${escapeHtml(
targetUrl
)}" class="link link-preview"><code> ${escapeHtml(targetUrl)} </a></code>`
);
document.querySelector('#crowd-bypass-info').innerHTML = msg;
}
Expand All @@ -36,6 +38,7 @@ tempDisableCrowdButton.addEventListener('click', () => {
brws.storage.local.set({ tempDisableCrowd: 'true' });
// Create an alarm that will trigger after 10 minutes
brws.alarms.create('enableCrowdBypass', { delayInMinutes: 10 });
history.back();
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<a href="https://discord.gg/RSAf7b5njt" target="_blank" data-message="support"></a>
</p>
</div>
<form id="options-form" style="font-size: 1rem">
<form id="options-form">
<section>
<h2 data-message="options"></h2>
<label class="ffInput"><input type="checkbox" id="navigationDelayToggle"><span class="checkmark"></span></label>
Expand Down
129 changes: 100 additions & 29 deletions src/html/style.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
* {
font-family: "Montserrat", sans-serif;
font-family: 'Montserrat', sans-serif;
}

:root {
--ff-aqua: #00C0FA;
--ff-blue: #4261ED;
--ff-purple: #6717CC;
--ff-lightred: #FF4D4D;
--ff-aqua: #00c0fa;
--ff-blue: #4261ed;
--ff-purple: #6717cc;
--ff-lightred: #ff4d4d;
--ff-lightpurplebg: rgb(194, 162, 235);
--ff-text: #fff;
--ff-background: #111;
Expand All @@ -18,13 +18,14 @@
}

body {
background-color: var(--ff-background);;
background-color: var(--ff-background);
margin: 0px;
padding: 0px;
display: flex;
flex-direction: column;
min-height: 100vh;
color: var(--ff-text);
font-size: 1rem;
}

/*================header css================*/
Expand All @@ -49,7 +50,13 @@ body {

nav {
background-color: var(--ff-module-background);
border-image: linear-gradient(135deg, var(--ff-aqua) 0%, var(--ff-blue) 50%, var(--ff-purple) 100%) 0 0 1 0;
border-image: linear-gradient(
135deg,
var(--ff-aqua) 0%,
var(--ff-blue) 50%,
var(--ff-purple) 100%
)
0 0 1 0;
border-bottom: 3px solid;
justify-content: space-between;
height: 89px;
Expand All @@ -63,14 +70,15 @@ nav ul {
padding-right: 15px;
}

nav .spacer{
nav .spacer {
flex: 1;
}

nav a {
nav a,
#options-link > a {
color: var(--ff-link);
text-decoration: none;
transition: color .15s ease-in-out;
transition: color 0.15s ease-in-out;
font-weight: 600;
padding: 10px;
font-size: 1rem;
Expand All @@ -84,19 +92,19 @@ nav a.active {
color: var(--ff-text);
}

nav a.active:hover {
nav a.active {
color: var(--ff-text);
}

nav a:hover {
nav a:hover,
#options-link > a:hover {
color: var(--ff-link-hover);
}

nav a:hover:disabled {
color: var(--ff-link);
}


/*=================content css================*/

section {
Expand All @@ -112,7 +120,12 @@ section {

h1 {
font-size: calc(150% + 3vw);
background-image: linear-gradient(135deg, var(--ff-aqua) 0%, var(--ff-blue) 50%, var(--ff-purple) 100%);
background-image: linear-gradient(
135deg,
var(--ff-aqua) 0%,
var(--ff-blue) 50%,
var(--ff-purple) 100%
);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
Expand All @@ -125,7 +138,12 @@ h1 {

h2 {
font-size: calc(100% + 2vw);
background-image: linear-gradient(135deg, var(--ff-aqua) 0%, var(--ff-blue) 50%, var(--ff-purple) 100%);
background-image: linear-gradient(
135deg,
var(--ff-aqua) 0%,
var(--ff-blue) 50%,
var(--ff-purple) 100%
);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
Expand All @@ -145,14 +163,25 @@ h2 {

.ffInput {
border: 2px solid;
border-image: linear-gradient(135deg, var(--ff-aqua) 0%, var(--ff-blue) 50%, var(--ff-purple) 100%) 1;
border-image: linear-gradient(
135deg,
var(--ff-aqua) 0%,
var(--ff-blue) 50%,
var(--ff-purple) 100%
)
1;
display: inline-block;
text-decoration: none;
background-image: linear-gradient(135deg, var(--ff-aqua) 0%, var(--ff-blue) 50%, var(--ff-purple) 100%);
background-image: linear-gradient(
135deg,
var(--ff-aqua) 0%,
var(--ff-blue) 50%,
var(--ff-purple) 100%
);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
transition: padding .15s ease-in-out, margin .15s ease-in-out;
transition: padding 0.15s ease-in-out, margin 0.15s ease-in-out;
margin-bottom: -2px;
margin-top: 0.5vh;
outline: none;
Expand All @@ -161,7 +190,7 @@ h2 {

::placeholder {
-webkit-text-fill-color: initial;
color: rgba(0,0,0,0.25);
color: rgba(0, 0, 0, 0.25);
}

@-moz-document url-prefix() {
Expand All @@ -170,14 +199,13 @@ h2 {
}
}

code {
background-color: var(--ff-module-background);
color: var(--ff-aqua);
}

.link {
text-decoration: none;
background-image: linear-gradient(135deg, var(--ff-aqua) 0%, var(--ff-blue) 100%);
background-image: linear-gradient(
135deg,
var(--ff-aqua) 0%,
var(--ff-blue) 100%
);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
Expand Down Expand Up @@ -215,7 +243,7 @@ label.ffInput:hover {
}

label.ffInput .checkmark:after {
content: "";
content: '';
position: absolute;
display: none;
}
Expand All @@ -234,7 +262,7 @@ label.ffInput input:checked ~ .checkmark:after {
transform: rotate(45deg);
}

.ffInput[type=number] {
.ffInput[type='number'] {
width: 34px;
}

Expand All @@ -243,7 +271,7 @@ textarea.ffInput {
width: -webkit-fill-available;
height: 80px;
resize: vertical;
transition: all .15s linear, background 1s linear;
transition: all 0.15s linear, background 1s linear;
}

.invalid {
Expand All @@ -254,4 +282,47 @@ textarea.ffInput {
text-align: right;
padding-right: 20px;
color: var(--ff-link);
}
}

/*=================crowd-bypassed and before-navigate css================*/

code {
color: var(--ff-aqua);
-webkit-text-fill-color: var(--ff-aqua);
background-color: var(--ff-module-background);
font-family: monospace;
}

button {
border: 2px solid;
border-image: linear-gradient(
135deg,
var(--ff-aqua) 0%,
var(--ff-blue) 50%,
var(--ff-purple) 100%
)
1;
background-color: transparent;
border-radius: 0;
padding: 0.5vh 1vw;
display: inline-block;
text-decoration: none;
margin-bottom: 0.5vh;
margin-top: 0.5vh;
outline: none;
color: var(--ff-aqua);
transition: background-color 0.1s ease-in-out;
}

button:hover {
background-color: #222;
cursor: pointer;
}

a .link-preview:hover {
text-decoration: underline;
}

#options-link > a {
padding: 0;
}

0 comments on commit 395f672

Please sign in to comment.