diff --git a/CHANGELOG.md b/CHANGELOG.md index a58a9cf..87e9253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,14 +65,18 @@ - [x] Obfuscate suggestions - [x] Fix broken tab cloak -### Next Update - - [x] Games +### Version 1.8 + - [x] Notifications for secret themes + - [x] Change 3kh0 theme to secret (type 3kh0 anywhere) + - [x] Games (1 for now) - [x] Update apps - [x] Blocklist - [x] New messages on start - [x] Fix no results - [x] Translate no results - [x] Upgrade dependencies + - [x] Update year on license + - [x] Fix search icon on Nebula theme ### Roadmap The roadmap has moved [here](https://github.com/orgs/Metallic-Web/projects/1/views/1). \ No newline at end of file diff --git a/LICENSE b/LICENSE index 9d0ff0a..4e8962c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Metallic +Copyright (c) 2023 Metallic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package-lock.json b/package-lock.json index dc0e4a6..fb6bad3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "metallic", - "version": "1.7", + "version": "1.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "metallic", - "version": "1.7", + "version": "1.8", "license": "MIT", "dependencies": { "@emotion/react": "^11.10.6", diff --git a/package.json b/package.json index 9d39d6e..e711d2d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metallic", - "version": "1.7", + "version": "1.8", "description": "A powerful web proxy build for speed and customization.", "repository": "https://github.com/Metallic-Web/Metallic.git", "license": "MIT", diff --git a/src/components/notifications.jsx b/src/components/notifications.jsx new file mode 100644 index 0000000..9cde6a5 --- /dev/null +++ b/src/components/notifications.jsx @@ -0,0 +1,56 @@ +import React from "react"; + +class NotificationBuilder { + removeNotification(element) { + setTimeout(function() { + element.style.opacity = 1 + }, 10) + setTimeout(function() { + element.style.opacity = 0 + setTimeout(function() { + element.remove() + }, 300) + }, 5000) + } + constructor() { + this.notifications = [] + } + create(config = {text: ""}) { + var notifications = document.getElementById("notifications") + + var notification = document.createElement("div") + notification.className = "notification" + + var notificationText = document.createElement("div") + notificationText.className = "notification-text" + notificationText.innerText = config.text + + notification.appendChild(notificationText) + + notifications.appendChild(notification) + + notifications.style.transition = "bottom 0.3s cubic-bezier(0.6, 0.4, 0, 1)" + notifications.setAttribute("new", "") + + setTimeout(function() { + notifications.style.transition = "none" + notifications.appendChild(notification) + notifications.removeAttribute("new") + notification.style.marginBottom = 0 + }, 300) + + this.removeNotification(notification) + + this.notifications.push(notification) + } +} + +var Notifications = new NotificationBuilder() + +function NotificationsMain() { + return ( +
+ ) +} + +export { NotificationsMain, Notifications }; \ No newline at end of file diff --git a/src/pages/app.jsx b/src/pages/app.jsx index de28119..f239c82 100644 --- a/src/pages/app.jsx +++ b/src/pages/app.jsx @@ -5,7 +5,9 @@ import "../style/index.css"; import "../proxy.jsx"; import Background from "../components/background.jsx"; import SettingsLayout from "../SettingsLayout.jsx"; -import { ObfuscateLayout } from "../components/obfuscate"; +import { ObfuscateLayout } from "../components/obfuscate.jsx"; +import { NotificationsMain, Notifications } from "../components/notifications.jsx" +import { useLocalAppearance } from "../settings.jsx"; var Home = React.lazy(() => import("./home.jsx")); var SettingsAppearance = React.lazy(() => import("./settings/appearance.jsx")); @@ -20,6 +22,32 @@ var Privacy = React.lazy(() => import("./privacy.jsx")); var Error = React.lazy(() => import("./error.jsx")); function App() { + const [localAppearance, setLocalAppearance] = useLocalAppearance(); + + var echoPattern = ['3', 'k', 'h', '0']; + var echoCurrent = 0; + + document.addEventListener('keydown', function (e) { + if (e.key !== echoPattern[echoCurrent]) { + return (echoCurrent = 0); + } + + echoCurrent++; + + if (echoPattern.length == echoCurrent) { + echoCurrent = 0; + if (localStorage.getItem("echo") !== "true") { + var appearance = localAppearance || "" + Notifications.create({ + text: "Unlocked 3kh0 theme" + }) + setLocalAppearance("echo") + localStorage.setItem("echo", "true") + return appearance; + } + } + }); + return ( <>