Skip to content

Commit 3599798

Browse files
committed
Version 1.8
1 parent 944fe29 commit 3599798

10 files changed

Lines changed: 155 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,18 @@
6565
- [x] Obfuscate suggestions
6666
- [x] Fix broken tab cloak
6767

68-
### Next Update
69-
- [x] Games
68+
### Version 1.8
69+
- [x] Notifications for secret themes
70+
- [x] Change 3kh0 theme to secret (type 3kh0 anywhere)
71+
- [x] Games (1 for now)
7072
- [x] Update apps
7173
- [x] Blocklist
7274
- [x] New messages on start
7375
- [x] Fix no results
7476
- [x] Translate no results
7577
- [x] Upgrade dependencies
78+
- [x] Update year on license
79+
- [x] Fix search icon on Nebula theme
7680

7781
### Roadmap
7882
The roadmap has moved [here](https://github.com/orgs/Metallic-Web/projects/1/views/1).

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Metallic
3+
Copyright (c) 2023 Metallic
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "metallic",
3-
"version": "1.7",
3+
"version": "1.8",
44
"description": "A powerful web proxy build for speed and customization.",
55
"repository": "https://github.com/Metallic-Web/Metallic.git",
66
"license": "MIT",

src/components/notifications.jsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import React from "react";
2+
3+
class NotificationBuilder {
4+
removeNotification(element) {
5+
setTimeout(function() {
6+
element.style.opacity = 1
7+
}, 10)
8+
setTimeout(function() {
9+
element.style.opacity = 0
10+
setTimeout(function() {
11+
element.remove()
12+
}, 300)
13+
}, 5000)
14+
}
15+
constructor() {
16+
this.notifications = []
17+
}
18+
create(config = {text: ""}) {
19+
var notifications = document.getElementById("notifications")
20+
21+
var notification = document.createElement("div")
22+
notification.className = "notification"
23+
24+
var notificationText = document.createElement("div")
25+
notificationText.className = "notification-text"
26+
notificationText.innerText = config.text
27+
28+
notification.appendChild(notificationText)
29+
30+
notifications.appendChild(notification)
31+
32+
notifications.style.transition = "bottom 0.3s cubic-bezier(0.6, 0.4, 0, 1)"
33+
notifications.setAttribute("new", "")
34+
35+
setTimeout(function() {
36+
notifications.style.transition = "none"
37+
notifications.appendChild(notification)
38+
notifications.removeAttribute("new")
39+
notification.style.marginBottom = 0
40+
}, 300)
41+
42+
this.removeNotification(notification)
43+
44+
this.notifications.push(notification)
45+
}
46+
}
47+
48+
var Notifications = new NotificationBuilder()
49+
50+
function NotificationsMain() {
51+
return (
52+
<div id="notifications"></div>
53+
)
54+
}
55+
56+
export { NotificationsMain, Notifications };

src/pages/app.jsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import "../style/index.css";
55
import "../proxy.jsx";
66
import Background from "../components/background.jsx";
77
import SettingsLayout from "../SettingsLayout.jsx";
8-
import { ObfuscateLayout } from "../components/obfuscate";
8+
import { ObfuscateLayout } from "../components/obfuscate.jsx";
9+
import { NotificationsMain, Notifications } from "../components/notifications.jsx"
10+
import { useLocalAppearance } from "../settings.jsx";
911

1012
var Home = React.lazy(() => import("./home.jsx"));
1113
var SettingsAppearance = React.lazy(() => import("./settings/appearance.jsx"));
@@ -20,6 +22,32 @@ var Privacy = React.lazy(() => import("./privacy.jsx"));
2022
var Error = React.lazy(() => import("./error.jsx"));
2123

2224
function App() {
25+
const [localAppearance, setLocalAppearance] = useLocalAppearance();
26+
27+
var echoPattern = ['3', 'k', 'h', '0'];
28+
var echoCurrent = 0;
29+
30+
document.addEventListener('keydown', function (e) {
31+
if (e.key !== echoPattern[echoCurrent]) {
32+
return (echoCurrent = 0);
33+
}
34+
35+
echoCurrent++;
36+
37+
if (echoPattern.length == echoCurrent) {
38+
echoCurrent = 0;
39+
if (localStorage.getItem("echo") !== "true") {
40+
var appearance = localAppearance || ""
41+
Notifications.create({
42+
text: "Unlocked 3kh0 theme"
43+
})
44+
setLocalAppearance("echo")
45+
localStorage.setItem("echo", "true")
46+
return appearance;
47+
}
48+
}
49+
});
50+
2351
return (
2452
<>
2553
<ObfuscateLayout />
@@ -122,6 +150,7 @@ function App() {
122150
}
123151
/>
124152
</Routes>
153+
<NotificationsMain />
125154
</>
126155
);
127156
}

src/pages/home.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { getLink } from "../util.jsx";
1010
import { useLocalAppearance } from "../settings.jsx";
1111
import { useTranslation } from 'react-i18next';
1212
import { renderToStaticMarkup } from 'react-dom/server';
13+
import { Notifications } from "../components/notifications.jsx"
1314

1415
function Home() {
1516
const { t } = useTranslation("home");
@@ -84,6 +85,9 @@ function Home() {
8485
var appearance = localAppearance || ""
8586
try {
8687
if (new URL(e.target.value).hostname === window.atob("cG9ybmh1Yi5jb20=")) {
88+
Notifications.create({
89+
text: "Unlocked Hub theme"
90+
})
8791
setLocalAppearance("hub")
8892
localStorage.setItem("hub", "true")
8993
return appearance;

src/pages/settings/appearance.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,6 @@ function Appearance() {
161161
<ThemeOption type="nebelung">
162162
<Obfuscate>Nebelung</Obfuscate>
163163
</ThemeOption>
164-
<ThemeOption type="echo">
165-
<Obfuscate>3kh0</Obfuscate>
166-
</ThemeOption>
167164
<ThemeOption type="fracital">
168165
<Obfuscate>Fracital</Obfuscate>
169166
</ThemeOption>
@@ -176,6 +173,12 @@ function Appearance() {
176173
<ThemeOption type="tsunami">
177174
<Obfuscate>Tsunami</Obfuscate>
178175
</ThemeOption>
176+
{ localStorage.getItem("echo") === "true" ? (
177+
<ThemeOption type="echo">
178+
<Obfuscate>3kh0</Obfuscate>
179+
</ThemeOption>
180+
) : ""
181+
}
179182
{ localStorage.getItem("hub") === "true" ? (
180183
<ThemeOption type="hub">
181184
<Obfuscate>Hub</Obfuscate>

src/style/appearance.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ body[appearance="nebula"] .search {
341341
color: var(--text);
342342
}
343343

344+
body[appearance="nebula"] .searchicon {
345+
color: var(--highlight);
346+
}
347+
344348
body[appearance="nebula"] .navitem {
345349
background: transparent;
346350
color: var(--highlight);

src/style/style.css

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,3 +563,48 @@ a {
563563
padding: 0 0.1em;
564564
margin-left: 0.1em;
565565
}
566+
567+
#notifications {
568+
position: fixed;
569+
bottom: 1rem;
570+
left: 50%;
571+
max-width: calc(100% - 60px);
572+
transform: translate3d(-50%, 0, 0);
573+
transition: bottom 0.3s cubic-bezier(0.6, 0.4, 0, 1);
574+
display: flex;
575+
flex-direction: column;
576+
align-items: center;
577+
pointer-events: none;
578+
}
579+
580+
#notifications[new] {
581+
bottom: calc(64px + 30px);
582+
}
583+
584+
.notification {
585+
opacity: 0;
586+
max-width: 100%;
587+
padding: 0 20px;
588+
display: flex;
589+
align-items: center;
590+
height: 50px;
591+
border-radius: 30px;
592+
margin-top: 14px;
593+
background: var(--highlight);
594+
color: var(--text-contrast);
595+
transition: opacity 0.3s cubic-bezier(0.6, 0.4, 0, 1);
596+
user-select: none;
597+
min-width: 150px;
598+
margin-bottom: -64px;
599+
width: fit-content;
600+
pointer-events: all;
601+
}
602+
603+
.notification-text {
604+
font-size: 15px;
605+
white-space: nowrap;
606+
overflow: hidden;
607+
text-overflow: ellipsis;
608+
width: 100%;
609+
text-align: center;
610+
}

0 commit comments

Comments
 (0)