chore: init new SvelteKit project

This commit is contained in:
madkarmaa
2025-11-10 14:31:55 +01:00
parent 00760a0b02
commit 3906a58640
144 changed files with 1110 additions and 14686 deletions

View File

@@ -1,5 +0,0 @@
RV_API_URL=https://api.revanced.app
RV_STATUS_URL=https://status.revanced.app
RV_EMAIL=contact@revanced.app
RV_GOOGLE_TAG_MANAGER_ID=
RV_DMCA_GUID=

View File

@@ -1,15 +0,0 @@
.DS_Store
node_modules
/public
/images
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

View File

@@ -1,30 +0,0 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
};

View File

@@ -1,109 +0,0 @@
name: 🐞 Bug report
description: Report a bug or an issue.
title: 'bug: '
labels: ['Bug report']
body:
- type: markdown
attributes:
value: |
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="https://raw.githubusercontent.com/revanced/revanced-website/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="https://raw.githubusercontent.com/revanced/revanced-website/main/assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/revanced/revanced-website/main/assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-website/main/assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# ReVanced Website bug report
Before creating a new bug report, please keep the following in mind:
- **Do not submit a duplicate bug report**: Search for existing bug reports [here](https://github.com/ReVanced/revanced-website/issues?q=label%3A%22Bug+report%22).
- **Review the contribution guidelines**: Make sure your bug report adheres to it. You can find the guidelines [here](https://github.com/ReVanced/revanced-website/blob/main/CONTRIBUTING.md).
- **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app).
- type: textarea
attributes:
label: Bug description
description: |
- Describe your bug in detail
- Add steps to reproduce the bug if possible (Step 1. ... Step 2. ...)
- Add images and videos if possible
validations:
required: true
- type: textarea
attributes:
label: Error logs
description: Exceptions that unexpectedly happened during the development or production status of the website.
render: shell
- type: textarea
attributes:
label: Solution
description: If applicable, add a possible solution to the bug.
- type: textarea
attributes:
label: Additional context
description: Add additional context here.
- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Your bug report will be closed if you don't follow the checklist below.
options:
- label: I have checked all open and closed bug reports and this is not a duplicate.
required: true
- label: I have chosen an appropriate title.
required: true
- label: All requested information has been provided properly.
required: true

View File

@@ -1,5 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: 🗨 Discussions
url: https://github.com/revanced/revanced-suggestions/discussions
about: Have something unspecific to ReVanced Website in mind? Search for or start a new discussion!

View File

@@ -1,105 +0,0 @@
name: ⭐ Feature request
description: Create a detailed request for a new feature.
title: 'feat: '
labels: ['Feature request']
body:
- type: markdown
attributes:
value: |
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="https://raw.githubusercontent.com/revanced/revanced-website/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="https://raw.githubusercontent.com/revanced/revanced-website/main/assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/revanced/revanced-website/main/assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-website/main/assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# ReVanced Website feature request
Before creating a new feature request, please keep the following in mind:
- **Do not submit a duplicate feature request**: Search for existing feature requests [here](https://github.com/ReVanced/revanced-website/issues?q=label%3A%22Feature+request%22).
- **Review the contribution guidelines**: Make sure your feature request adheres to it. You can find the guidelines [here](https://github.com/ReVanced/revanced-website/blob/main/CONTRIBUTING.md).
- **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app).
- type: textarea
attributes:
label: Feature description
description: |
- Describe your feature in detail
- Add images, videos, links, examples, references, etc. if possible
- type: textarea
attributes:
label: Motivation
description: |
A strong motivation is necessary for a feature request to be considered.
- Why should this feature be implemented?
- What is the explicit use case?
- What are the benefits?
- What makes this feature important?
validations:
required: true
- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Your feature request will be closed if you don't follow the checklist below.
options:
- label: I have checked all open and closed feature requests and this is not a duplicate
required: true
- label: I have chosen an appropriate title.
required: true
- label: All requested information has been provided properly.
required: true

2
.github/config.yml vendored
View File

@@ -1,2 +0,0 @@
firstPRMergeComment: >
Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) to receive a role for your contribution.

View File

@@ -1,8 +0,0 @@
version: 2
updates:
- package-ecosystem: npm
labels: []
directory: /
target-branch: dev
schedule:
interval: monthly

View File

@@ -1,53 +0,0 @@
name: Deploy
on:
workflow_dispatch:
push:
branches:
- main
- dev
pull_request:
branches:
- dev
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: npm
- name: Install dependencies
run: npm i
- name: Build
env:
RV_API_URL: ${{ vars.RV_API_URL }}
RV_GOOGLE_TAG_MANAGER_ID: ${{ vars.RV_GOOGLE_TAG_MANAGER_ID }}
RV_DMCA_GUID: ${{ vars.RV_DMCA_GUID }}
RV_STATUS_URL: ${{ vars.RV_STATUS_URL }}
RV_EMAIL: ${{ vars.RV_EMAIL }}
run: npm run build
- name: Deploy
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy public --project-name=revanced-website
- name: Comment deployment URL
if: ${{ github.event_name == 'pull_request' }}
uses: thollander/actions-comment-pull-request@v2
with:
message: Deployed at ${{ steps.deploy.outputs.deployment-url }}.

View File

@@ -1,26 +0,0 @@
name: Open a PR to main
on:
push:
branches:
- dev
workflow_dispatch:
env:
MESSAGE: Merge branch `${{ github.head_ref || github.ref_name }}` to `main`
jobs:
pull-request:
name: Open pull request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Open pull request
uses: repo-sync/pull-request@v2
with:
destination_branch: 'main'
pr_title: 'chore: ${{ env.MESSAGE }}'
pr_body: 'This pull request will ${{ env.MESSAGE }}.'
pr_draft: true

26
.gitignore vendored
View File

@@ -1,9 +1,23 @@
.DS_Store
node_modules
/build
/public
# Output
.output
.vercel
.netlify
.wrangler
/.svelte-kit
/package
/build
# OS
.DS_Store
Thumbs.db
# Env
.env
/_docs_src
/static/docs
.env.*
!.env.example
!.env.test
# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

View File

@@ -1,14 +1,9 @@
.DS_Store
node_modules
/build
/public
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock
bun.lock
bun.lockb
# Miscellaneous
/static/

View File

@@ -3,5 +3,13 @@
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"]
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}

View File

@@ -1,97 +0,0 @@
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# 👋 Contribution guidelines
This document describes how to contribute to ReVanced Website.
## 📖 Resources to help you get started
* Our [backlog](https://github.com/orgs/ReVanced/projects/12) is where we keep track of what we're working on
* [Issues](https://github.com/ReVanced/revanced-website/issues) are where we keep track of bugs and feature requests
## 🙏 Submitting a feature request
Features can be requested by opening an issue using the
[feature request issue template](https://github.com/ReVanced/revanced-website/issues/new?assignees=&labels=feature-request&projects=&template=feature-issue.yml&title=feat%3A+%3Ctitle%3E).
> [!NOTE]
> Requests can be accepted or rejected at the discretion of maintainers of ReVanced Website.
> Good motivation has to be provided for a request to be accepted.
## 🐞 Submitting a bug report
If you encounter a bug while using the ReVanced Website, open an issue using the
[bug report issue template](https://github.com/ReVanced/revanced-website/issues/new?assignees=&labels=bug&projects=&template=bug-issue.yml&title=bug%3A+%3Ctitle%3E).
## 📝 How to contribute
1. Before contributing, it is recommended to open an issue to discuss your change
with the maintainers of ReVanced Website. This will help you determine whether your change is acceptable
and whether it is worth your time to implement it
2. Development happens on the `dev` branch. Fork the repository and create your branch from `dev`
3. Commit your changes
4. Submit a pull request to the `dev` branch of the repository and reference issues
that your pull request closes in the description of your pull request
5. Our team will review your pull request and provide feedback. Once your pull request is approved,
it will be merged into the `dev` branch and will be included in the next release of ReVanced Website
❤️ Thank you for considering contributing to ReVanced Website,
ReVanced

674
LICENSE
View File

@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

118
README.md
View File

@@ -1,108 +1,38 @@
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# sv
# 🌐 ReVanced Website
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
![Deployment status](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-website/deploy.yml)
![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)
## Creating a project
This repository contains the source code of ReVanced Website.
If you're seeing this, you've probably already done this step. Congrats!
## ❓ About
```sh
# create a new project in the current directory
npx sv create
ReVanced Website is the front page of ReVanced.
It is built using Svelte and uses [ReVanced API](https://github.com/ReVanced/revanced-api) as a data source.
# create a new project in my-app
npx sv create my-app
```
## 💪 Features
## Developing
Discover what the ReVanced Website offers:
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
- 👥 **View contributors:** Explore the people who make this project possible.
- 🔧 **Browse first-party patches:** Access a comprehensive list of official ReVanced Patches.
- ❤️ **Explore donation options:** Find ways to support the project through donations.
- 🌐 **Connect with the community:** Follow us on social media and stay updated.
- 🔽 **Get ReVanced Manager:** Download the latest version of ReVanced Manager with ease.
```sh
npm run dev
## 🚀 How to get started
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
ReVanced Website can be deployed locally using `npm run dev` or preview the build using `npm run preview`.
## Building
## 📚 Everything else
To create a production version of your app:
### 📙 Contributing
```sh
npm run build
```
Thank you for considering contributing to ReVanced Website. You can find the contribution guidelines [here](CONTRIBUTING.md).
You can preview the production build with `npm run preview`.
### 🛠️ Building
To build ReVanced Website, [Node.js](https://nodejs.org/en/download) and Git must be installed.
Follow the steps below to build ReVanced Website:
1. Run `git clone git@github.com:ReVanced/revanced-website.git` to clone the repository
2. Create `.env` file based on [`.env.example`](.env.example)
3. Run `npm i` to install the dependencies
4. Run `npm run build` to build the project
## 📜 Licence
ReVanced Website is licensed under the GPLv3 license. Please see the [license file](LICENSE) for more information.
[tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3) you may copy, distribute and modify ReVanced Website as long as you track changes/dates in source files.
Any modifications to ReVanced Website must also be made available under the GPL,
along with build & install instructions.
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 800 800" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g id="Logo"><g id="Ring"><circle id="Ring-Background" serif:id="Ring Background" cx="400" cy="400" r="400" style="fill:#1b1b1b;"/><path id="Ring1" serif:id="Ring" d="M400,0c220.766,0 400,179.234 400,400c-0,220.766 -179.234,400 -400,400c-220.766,-0 -400,-179.234 -400,-400c0,-220.766 179.234,-400 400,-400Zm-0,36c200.897,-0 364,163.103 364,364c0,200.897 -163.103,364 -364,364c-200.897,0 -364,-163.103 -364,-364c-0,-200.897 163.103,-364 364,-364Z" style="fill:url(#_Linear1);"/></g><g id="Shape"><path id="V-Shape" serif:id="V Shape" d="M538.74,269.872c1.481,-3.382 1.157,-7.283 -0.863,-10.373c-2.021,-3.091 -5.464,-4.954 -9.156,-4.954c-5.148,0 -10.435,0 -14.165,0c-3.1,0 -5.907,1.834 -7.153,4.672c-12.468,28.396 -78.273,178.273 -100.25,228.328c-1.246,2.838 -4.053,4.671 -7.154,4.671c-3.1,0 -5.907,-1.833 -7.153,-4.671c-21.977,-50.055 -87.782,-199.932 -100.25,-228.328c-1.246,-2.838 -4.053,-4.672 -7.153,-4.672c-3.73,0 -9.017,0 -14.164,0c-3.693,0 -7.135,1.863 -9.156,4.954c-2.02,3.09 -2.344,6.991 -0.863,10.373c23.557,53.766 101.872,232.519 117.871,269.034c1.743,3.979 5.674,6.549 10.018,6.549c6.293,-0 15.408,-0 21.701,-0c4.344,-0 8.275,-2.57 10.018,-6.549c15.999,-36.515 94.315,-215.268 117.872,-269.034Z" style="fill:#fff;"/><path id="Diamond" d="M408.119,395.312c-1.675,2.901 -4.77,4.688 -8.119,4.688c-3.349,-0 -6.444,-1.787 -8.119,-4.688c-16.997,-29.44 -56.156,-97.264 -73.153,-126.704c-1.675,-2.901 -1.675,-6.474 0,-9.375c1.675,-2.901 4.77,-4.688 8.119,-4.688c33.995,0 112.311,0 146.306,0c3.349,0 6.444,1.787 8.119,4.688c1.675,2.901 1.675,6.474 -0,9.375c-16.997,29.44 -56.156,97.264 -73.153,126.704Z" style="fill:url(#_Linear2);"/></g></g><defs><linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(4.89859e-14,800,-800,4.89859e-14,400.001,3.31681e-10)"><stop offset="0" style="stop-color:#f04e98;stop-opacity:1"/><stop offset="0.5" style="stop-color:#5f65d4;stop-opacity:1"/><stop offset="1" style="stop-color:#4e98f0;stop-opacity:1"/></linearGradient><linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.77155e-14,289.317,-282.535,1.73003e-14,400,254.545)"><stop offset="0" style="stop-color:#f04e98;stop-opacity:1"/><stop offset="0.5" style="stop-color:#5f65d4;stop-opacity:1"/><stop offset="1" style="stop-color:#4e98f0;stop-opacity:1"/></linearGradient></defs></svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

41
eslint.config.js Normal file
View File

@@ -0,0 +1,41 @@
import prettier from 'eslint-config-prettier';
import { fileURLToPath } from 'node:url';
import { includeIgnoreFile } from '@eslint/compat';
import js from '@eslint/js';
import svelte from 'eslint-plugin-svelte';
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import ts from 'typescript-eslint';
import svelteConfig from './svelte.config.js';
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
export default defineConfig(
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs.recommended,
prettier,
...svelte.configs.prettier,
{
languageOptions: {
globals: { ...globals.browser, ...globals.node }
},
rules: {
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'no-undef': 'off'
}
},
{
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: ['.svelte'],
parser: ts.parser,
svelteConfig
}
}
}
);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 KiB

4634
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,52 +1,35 @@
{
"name": "revanced-website",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"package": "svelte-kit package",
"preview": "sirv ./public --no-clear",
"vite:preview": "vite preview",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check --plugin-search-dir=. . && eslint .",
"format": "prettier --write --plugin-search-dir=. .",
"postbuild": "npx svelte-sitemap -d https://revanced.app -r true -c daily -o public "
"format": "prettier --write .",
"lint": "prettier --check . && eslint ."
},
"devDependencies": {
"@sveltejs/adapter-static": "3.0.6",
"@sveltejs/kit": "2.9.0",
"@sveltejs/vite-plugin-svelte": "3.1.1",
"@typescript-eslint/eslint-plugin": "8.16.0",
"@typescript-eslint/parser": "8.16.0",
"eslint": "9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "2.46.1",
"fuse.js": "^7.0.0",
"imagetools-core": "7.0.2",
"prettier": "3.4.1",
"prettier-plugin-svelte": "3.3.2",
"qrious": "^4.0.2",
"sass": "1.81.0",
"sirv-cli": "3.0.0",
"svelte": "4.2.18",
"svelte-check": "4.1.0",
"svelte-meta-tags": "3.1.2",
"svelte-sitemap": "^2.6.0",
"svooltip": "^0.8.2",
"tslib": "2.8.1",
"typescript": "5.7.2",
"vite": "5.3.3",
"vite-imagetools": "7.0.4"
},
"type": "module",
"dependencies": {
"@tanstack/query-core": "^4.36.1",
"@tanstack/query-persist-client-core": "^4.36.1",
"@tanstack/query-sync-storage-persister": "^4.36.1",
"@tanstack/svelte-query": "^4.36.1",
"datetrigger": "^1.1.1",
"moment": "^2.30.1",
"svelte-material-icons": "^3.0.5"
"@eslint/compat": "^1.4.0",
"@eslint/js": "^9.38.0",
"@sveltejs/adapter-static": "^3.0.10",
"@sveltejs/kit": "^2.47.1",
"@sveltejs/vite-plugin-svelte": "^6.2.1",
"@types/node": "^22",
"eslint": "^9.38.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-svelte": "^3.12.4",
"globals": "^16.4.0",
"prettier": "^3.6.2",
"prettier-plugin-svelte": "^3.4.0",
"svelte": "^5.41.0",
"svelte-check": "^4.3.3",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.1",
"vite": "^7.1.10"
}
}

2576
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

2
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,2 @@
onlyBuiltDependencies:
- esbuild

29
src/app.d.ts vendored
View File

@@ -1,22 +1,13 @@
/// <reference types="@sveltejs/kit" />
// See https://kit.svelte.dev/docs/types#app
// See https://svelte.dev/docs/kit/types#app.d.ts
// for information about these interfaces
// and what to do when importing types
declare namespace App {
// interface Locals {}
// interface Platform {}
// interface Session {}
// interface Stuff {}
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}
declare module '*&as=picture' {
/**
* actual types
* taken from https://github.com/JonasKruckenberg/imagetools/issues/160#issuecomment-1009292026
* - code https://github.com/JonasKruckenberg/imagetools/blob/main/packages/core/src/output-formats.ts
* - docs https://github.com/JonasKruckenberg/imagetools/blob/main/docs/guide/getting-started.md#metadata
*/
const out;
export default out;
}
export {};

View File

@@ -2,26 +2,10 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta
name="robots"
content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1"
/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- OpenGraph -->
<meta property="og:type" content="website" />
<meta property="og:image" content="/logo.png" />
<!-- Twitter -->
<meta name="twitter:image" itemprop="image" content="/logo.png" />
<meta name="twitter:card" content="summary" />
%sveltekit.head%
</head>
<body style="background-color: var(--background-one)">
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@@ -1,197 +0,0 @@
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700;800&display=swap');
* {
box-sizing: inherit;
margin: 0;
padding: 0;
font-family: var(--main-font);
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
transition:
color 0.5s ease-in-out,
background-color 0.5s ease-in-out,
fill 0.5s ease-in-out;
}
html {
margin: 0;
padding: 0;
font-size: 100%;
box-sizing: border-box;
overflow-y: scroll;
}
body {
margin: 0;
padding: 0;
}
html,
body {
max-width: 100%;
}
.wrapper {
margin-inline: auto;
width: min(90%, 80rem);
margin-top: 2.6rem;
}
:root {
--main-font: 'Manrope', sans-serif;
--mono-font: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
--text-one: hsl(calc(var(--hue, 206) + 0), 100%, 94%);
--surface-one: hsl(calc(var(--hue, 206) + 0), 100%, 94%);
--primary: hsl(calc(var(--hue, 206) + 0), 100%, 81%);
--secondary: hsl(calc(var(--hue, 206) + 2), 75%, 82%);
--tertiary: hsla(calc(var(--hue, 206) - 1), 91%, 69%, 0.15);
--background-one: hsl(calc(var(--hue, 206) + 46), 10%, 11%);
--surface-two: hsl(calc(var(--hue, 206) + 46), 10%, 11%);
--surface-three: hsl(calc(var(--hue, 206) + 4), 14%, 17%);
--surface-four: hsl(calc(var(--hue, 206) + 6), 19%, 19%);
--text-two: hsl(calc(var(--hue, 206) + 6), 19%, 19%);
--border: hsl(calc(var(--hue, 206) + 15), 17%, 26%);
--surface-five: hsl(calc(var(--hue, 206) + 15), 17%, 26%);
--text-three: hsl(calc(var(--hue, 206) + 20), 48%, 18%);
--text-four: hsl(calc(var(--hue, 206) + 2), 30%, 75%);
--surface-six: hsl(calc(var(--hue, 206) + 2), 30%, 75%);
--surface-seven: hsl(calc(var(--hue, 206) + 24), 9%, 13%);
--surface-eight: hsl(calc(var(--hue, 206) + 34), 9%, 13.5%);
--surface-nine: hsl(calc(var(--hue, 206) + 24), 9.5%, 17.5%);
--red-one: hsl(333, 84%, 62%);
--red-two: hsl(357, 74%, 60%);
--red-three: hsl(2, 68%, 83%);
--yellow-one: hsl(59, 100%, 72%);
--bezier-one: ease-out;
--drop-shadow-one: 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12),
0px 2px 4px -1px rgba(0, 0, 0, 0.2);
}
::selection {
background-color: var(--tertiary);
}
mark {
background-color: var(--secondary);
}
/*-----headings-----*/
h1 {
color: var(--text-one);
line-height: 4rem;
font-size: 3.5rem;
font-weight: 700;
letter-spacing: -0.025em;
}
h2 {
color: var(--text-four);
font-size: 2.5rem;
letter-spacing: -0.04rem;
font-weight: 600;
}
h3 {
font-size: 1.25rem;
color: var(--secondary);
font-weight: 600;
}
h4 {
color: var(--secondary);
font-weight: 400;
font-size: 1rem;
letter-spacing: 0.02rem;
line-height: 2rem;
}
h5 {
color: var(--text-four);
font-weight: 400;
font-size: 0.9rem;
letter-spacing: 0.02rem;
}
h6 {
color: var(--text-four);
font-weight: 500;
font-size: 0.85rem;
}
p {
color: var(--text-four);
font-weight: 400;
font-size: 1rem;
letter-spacing: 0.02rem;
line-height: 1.75rem;
}
@media (max-width: 768px) {
h1 {
font-size: 2.6rem;
line-height: 3.75rem;
}
h2 {
font-size: 2rem;
}
}
/*---------------*/
::-webkit-scrollbar {
width: 5px;
background-color: transparent;
}
::-webkit-scrollbar-thumb {
background-color: var(--primary);
background-clip: content-box;
border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
background-color: var(--surface-five);
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid var(--border);
}
textarea {
resize: vertical;
field-sizing: content;
}
input,
textarea {
padding: 1rem;
border-radius: 12px;
border: 1px solid var(--border);
background-color: transparent;
color: var(--secondary);
}
input:focus,
textarea:focus {
outline: 1px solid var(--primary);
}

View File

@@ -1,42 +0,0 @@
import { navigating, page } from '$app/stores';
import { derived, type Readable } from 'svelte/store';
export interface RouterEvent {
// URL of the current page or the page we are navigating to.
target_url: URL;
// Are we navigating?
navigating: boolean;
}
function makeStore(): Readable<RouterEvent> {
// This stuff will run both client side and server side.
if (typeof location === 'undefined') {
// `location` does not exist on the server.
// Return a derived store based on `page` for SSR.
// Server will never navigate so this is fine.
return derived(page, ($page) => {
return { navigating: false, target_url: $page.url };
});
}
// On client.
let current = new URL(location.href);
// Return store that responds to navigation events.
// The `navigating` store immediately "pushes" `null`.
// This in turn causes this derived store to immediately "push" the current URL.
return derived(navigating, ($nav) => {
let navigating = false;
// $nav is null when navigation finishes.
if ($nav != null && $nav.to != null) {
current = $nav.to.url;
navigating = true;
}
return { navigating, target_url: current };
});
}
// Do not subscribe to it outside of components!
export default makeStore();

View File

@@ -1,248 +0,0 @@
import * as settings from './settings';
// API Endpoints
import type {
Patch,
Contributable,
Release,
TeamMember,
DonationPlatform,
CryptoWallet,
Social,
About,
ResponseAnnouncement,
Announcement,
Tags
} from '$lib/types';
import { get_access_token, is_logged_in, UnauthenticatedError } from '$lib/auth';
export type ContributorsData = { contributables: Contributable[] };
export type PatchesData = { patches: Patch[]; packages: string[] };
export type ReleaseData = { release: Release };
export type TeamData = { members: TeamMember[] };
export type AboutData = { about: About };
export type DonationData = { wallets: CryptoWallet[]; platforms: DonationPlatform[] };
export type SocialsData = { socials: Social[] };
export type AnnouncementsData = { announcements: ResponseAnnouncement[] };
type GetAnnouncementsOptions = Partial<{
tags: string[];
count: number;
cursor: number;
}>;
export function build_url(endpoint: string) {
// //////v4/contributors -> v4/contributors
endpoint = endpoint.replace(/^\/+/, '');
// v4/contributors -> contributors
if (endpoint.startsWith(settings.API_VERSION)) endpoint = endpoint.split('/').slice(1).join('/');
return `${settings.api_base_url()}/${settings.API_VERSION}/${endpoint}`;
}
function build_headers() {
const access_token_data = get_access_token();
return {
'Content-Type': 'application/json',
Authorization: access_token_data ? `Bearer ${access_token_data.token}` : ''
};
}
async function get_json(endpoint: string) {
return await fetch(build_url(endpoint)).then((r) => r.json());
}
async function post_json(endpoint: string, body?: any) {
if (!is_logged_in()) throw new UnauthenticatedError();
const headers = build_headers();
return await fetch(build_url(endpoint), {
method: 'POST',
headers,
body: body ? JSON.stringify(body) : ''
}).then((r) => {
return r.headers.get('content-length') === '0' ? null : r.json();
});
}
async function patch_json(endpoint: string, body?: any) {
if (!is_logged_in()) throw new UnauthenticatedError();
const headers = build_headers();
return await fetch(build_url(endpoint), {
method: 'PATCH',
headers,
body: body ? JSON.stringify(body) : ''
}).then((r) => {
return r.headers.get('content-length') === '0' ? null : r.json();
});
}
async function delete_json(endpoint: string, body?: any) {
if (!is_logged_in()) throw new UnauthenticatedError();
const headers = build_headers();
return await fetch(build_url(endpoint), {
method: 'DELETE',
headers,
body: body ? JSON.stringify(body) : ''
}).then((r) => {
return r.headers.get('content-length') === '0' ? null : r.json();
});
}
async function contributors(): Promise<ContributorsData> {
const json = await get_json('v4/contributors');
return { contributables: json };
}
async function manager(): Promise<ReleaseData> {
const json = await get_json('v4/manager');
return { release: json };
}
async function patches(): Promise<PatchesData> {
const json = await get_json('v4/patches/list');
const packagesWithCount: { [key: string]: number } = {};
for (const patch of json) {
if (!patch.compatiblePackages) continue;
patch.compatiblePackages = Object.keys(patch.compatiblePackages).map((name) => ({
name,
versions: patch.compatiblePackages[name]
}));
}
// gets packages and patch count
for (const { compatiblePackages } of json) {
if (!compatiblePackages) continue;
for (const pkg of compatiblePackages) {
packagesWithCount[pkg.name] = (packagesWithCount[pkg.name] || 0) + 1;
}
}
// sort packages by patch count to get most relevant apps on top
const packages = Object.keys(packagesWithCount);
packages.sort((a, b) => packagesWithCount[b] - packagesWithCount[a]);
return { patches: json, packages };
}
async function team(): Promise<TeamData> {
const json = await get_json('v4/team');
return { members: json };
}
async function about(): Promise<AboutData> {
const json = await get_json('v4/about');
return { about: json };
}
async function announcements(options: GetAnnouncementsOptions = {}): Promise<AnnouncementsData> {
const url = new URL(build_url('announcements'));
if (options.tags && options.tags.length > 0) url.searchParams.set('tags', options.tags.join(','));
if (options.count) url.searchParams.set('count', String(options.count));
if (options.cursor) url.searchParams.set('cursor', String(options.cursor));
const announcements = (await get_json('announcements')) as ResponseAnnouncement[];
return { announcements };
}
async function get_announcement_by_id(id: number): Promise<{ announcement: ResponseAnnouncement }> {
return { announcement: (await get_json(`announcements/${id}`)) as ResponseAnnouncement };
}
async function announcementTags(): Promise<{ tags: Tags }> {
return { tags: (await get_json(`announcements/tags`)) as Tags };
}
function show_error_alert(res: Response) {
alert(`A ${res.status < 500 ? 'user' : 'server'} error occurred. Please try again.`);
}
export async function create_announcement(announcement: Announcement) {
await post_json('announcements', announcement).catch(show_error_alert);
}
export async function update_announcement(id: number, announcement: Announcement) {
await patch_json(`announcements/${id}`, announcement).catch(show_error_alert);
}
export async function delete_announcement(id: number) {
await delete_json(`announcements/${id}`).catch(show_error_alert);
}
export async function archive_announcement(id: number) {
await post_json(`announcements/${id}/archive`).catch(show_error_alert);
}
export async function unarchive_announcement(id: number) {
await post_json(`announcements/${id}/unarchive`).catch(show_error_alert);
}
export const admin = {
create_announcement,
update_announcement,
delete_announcement,
archive_announcement,
unarchive_announcement
};
async function ping(): Promise<boolean> {
try {
const res = await fetch(`${settings.api_base_url()}/v4/ping`, { method: 'HEAD' });
return res.ok;
} catch (error) {
return false;
}
}
export const staleTime = 5 * 60 * 1000;
export const queries = {
manager: () => ({
queryKey: ['manager'],
queryFn: manager,
staleTime
}),
patches: () => ({
queryKey: ['patches'],
queryFn: patches,
staleTime
}),
contributors: () => ({
queryKey: ['contributors'],
queryFn: contributors,
staleTime
}),
team: () => ({
queryKey: ['team'],
queryFn: team,
staleTime
}),
about: () => ({
queryKey: ['info'],
queryFn: about,
staleTime
}),
announcements: () => ({
queryKey: ['announcements'],
queryFn: () => announcements(),
staleTime
}),
announcementById: (id: number) => ({
queryKey: ['announcementById', id],
queryFn: () => get_announcement_by_id(id)
}),
announcementTags: () => ({
queryKey: ['announcementTags'],
queryFn: () => announcementTags(),
staleTime
}),
ping: () => ({
queryKey: ['ping'],
queryFn: ping,
staleTime
})
};

View File

@@ -1,64 +0,0 @@
import { browser } from '$app/environment';
import { RV_API_URL, RV_EMAIL, RV_STATUS_URL } from '$env/static/public';
export const default_api_url = RV_API_URL;
export const default_status_url = RV_STATUS_URL;
export const default_email = RV_EMAIL;
const URL_KEY = 'revanced_api_url';
const STATUS_KEY = 'revanced_status_url';
const EMAIL_KEY = 'revanced_email';
export const API_VERSION = 'v4';
// Get base URL
export function api_base_url(): string {
if (browser) {
const apiUrl = localStorage.getItem(URL_KEY) || default_api_url;
return apiUrl;
}
return default_api_url;
}
export function status_url(): string {
if (browser) {
return localStorage.getItem(STATUS_KEY) || default_status_url;
}
return default_status_url;
}
export function email(): string {
if (browser) {
return localStorage.getItem(EMAIL_KEY) || default_email;
}
return default_email;
}
// (re)set base URL.
export function set_api_base_url(url?: string) {
if (!url) {
localStorage.removeItem(URL_KEY);
} else {
localStorage.setItem(URL_KEY, url);
}
set_about_info(api_base_url());
}
export function set_about_info(apiUrl: string) {
if (!localStorage.getItem(STATUS_KEY) || !localStorage.getItem(EMAIL_KEY)) {
fetch(`${apiUrl}/v4/about`)
.then((response) => (response.ok ? response.json() : null))
.then((data) => {
if (data?.status) {
localStorage.setItem(STATUS_KEY, data.status);
localStorage.setItem(EMAIL_KEY, data.contact.email);
console.log('Status is now:', localStorage.getItem(STATUS_KEY));
console.log('Email is now:', localStorage.getItem(EMAIL_KEY));
}
});
}
}

View File

@@ -1,61 +0,0 @@
<script lang="ts">
import { read_announcements } from '$lib/stores';
import Banner from '$layout/Banners/Banner.svelte';
import { goto } from '$app/navigation';
import { createQuery } from '@tanstack/svelte-query';
import { queries } from '$data/api';
import moment from 'moment';
const query = createQuery(queries.announcements());
$: latestUnreadAnnouncement = (() => {
const announcements = $query.data?.announcements ?? [];
const nonArchived = announcements.filter(
(a) => !a.archived_at || moment(a.archived_at).isAfter(moment())
);
const announcement = nonArchived[0];
return announcement && !$read_announcements.has(announcement.id) ? announcement : undefined;
})();
function setAsRead() {
if (!latestUnreadAnnouncement) return;
read_announcements.update((set) => {
const updated = new Set(set);
updated.add(latestUnreadAnnouncement.id);
return updated;
});
}
function handleClick() {
if (!latestUnreadAnnouncement) return;
goto(`/announcements/${latestUnreadAnnouncement.id}`);
setAsRead();
}
function handleClose() {
if (!latestUnreadAnnouncement) return;
setAsRead();
}
function getBannerLevel(level: number | undefined): 'info' | 'caution' {
if (!level || level == 0) return 'info';
return 'caution';
}
</script>
{#if latestUnreadAnnouncement}
<Banner
title={'We have an announcement'}
description={`You can read more about "${latestUnreadAnnouncement.title}" in our latest post.`}
level={getBannerLevel(latestUnreadAnnouncement.level)}
buttonText="Read more"
buttonOnClick={handleClick}
onDismiss={handleClose}
/>
{/if}

View File

@@ -1,105 +0,0 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import Close from 'svelte-material-icons/Close.svelte';
import ArrowRight from 'svelte-material-icons/ArrowRight.svelte';
import Button from '$lib/components/Button.svelte';
export let title: string;
export let description: string | undefined = undefined;
export let buttonText: string | undefined = undefined;
export let buttonOnClick: any | undefined = undefined;
export let level: 'info' | 'caution' = 'info';
export let permanent: boolean = false;
export let onDismiss: () => void = () => {};
const dispatch = createEventDispatcher();
let closed: boolean = false;
function getVariant(level: string): 'default' | 'onDangerBackground' {
return level === 'caution' ? 'onDangerBackground' : 'default';
}
const dismiss = () => {
if (onDismiss) onDismiss();
closed = true;
dispatch('dismissed');
};
</script>
{#if !closed}
<div class="banner {level}" class:permanent>
<div class="text">
<h1 id="title">{title}</h1>
<h2 id="description">{description}</h2>
</div>
<div class="actions">
{#if !permanent}
<Button type={'icon'} icon={Close} on:click={dismiss} />
{/if}
{#if buttonText && buttonOnClick}
<Button variant={getVariant(level)} on:click={buttonOnClick}>
{buttonText}
<ArrowRight />
</Button>
{/if}
</div>
</div>
{/if}
<style lang="scss">
#title {
line-height: 26px;
color: currentColor;
font-size: 20px;
}
#description {
line-height: 20px;
color: currentColor;
font-size: 14px;
}
.banner {
display: flex;
justify-content: space-between;
box-sizing: border-box;
gap: 1.3rem;
width: 100%;
margin: 0;
padding: 24px 40px;
border-radius: 0;
font-size: 0.87rem;
&.info {
background-color: var(--surface-four);
color: var(--text-one);
#description {
color: var(--text-four);
}
}
&.caution {
background-color: var(--red-three);
color: #601410;
}
@media (max-width: 768px) {
flex-direction: column;
padding: 1.1rem 1.3rem;
}
.text {
display: flex;
flex-direction: column;
flex: 1;
gap: 0.55rem;
word-wrap: break-word;
}
.actions {
display: flex;
justify-content: end;
gap: 1rem;
}
}
</style>

View File

@@ -1,18 +0,0 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { email } from '$data/api/settings';
import Banner from '$layout/Banners/Banner.svelte';
export let statusUrl: string | null = null;
const handleClick = () => statusUrl && goto(statusUrl);
</script>
<Banner
title="API service is currently down"
description="Some features of the site might be impacted. If this issue persists, reach out to {email()}."
buttonText={statusUrl ? 'Check status' : undefined}
buttonOnClick={statusUrl ? handleClick : undefined}
level="caution"
permanent
/>

View File

@@ -1,59 +0,0 @@
<script lang="ts">
import Button from '$lib/components/Button.svelte';
import Dialog from '$layout/Dialogs/Dialog.svelte';
import { onMount } from 'svelte';
import { allowAnalytics } from '$lib/stores';
import { RV_GOOGLE_TAG_MANAGER_ID } from '$env/static/public';
let showConsentDialog = false;
function enableAnalytics() {
//@ts-ignore
window.dataLayer = [
{
'gtm.start': new Date().getTime(),
event: 'gtm.js'
}
];
var firstScript = document.getElementsByTagName('script')[0];
var script = document.createElement('script');
script.async = true;
script.src = 'https://www.googletagmanager.com/gtm.js?id=' + RV_GOOGLE_TAG_MANAGER_ID;
//@ts-ignore
firstScript.parentNode.insertBefore(script, firstScript);
}
function handleConsent(allowed: boolean) {
localStorage.setItem('analytics', allowed.toString());
allowAnalytics.set(allowed);
showConsentDialog = false;
if (allowed) enableAnalytics();
}
onMount(() => {
const savedConsent = localStorage.getItem('analytics');
if (savedConsent !== null) {
const allowed = savedConsent === 'true';
allowAnalytics.set(allowed);
if (allowed) enableAnalytics();
} else {
showConsentDialog = true;
}
});
</script>
<Dialog bind:dialogOpen={showConsentDialog} notDismissible>
<svelte:fragment slot="title">It's your choice</svelte:fragment>
<svelte:fragment slot="description">
We use analytics to improve your experience on this site. By clicking "Allow", you allow us to
collect anonymous data about your visit.
</svelte:fragment>
<svelte:fragment slot="buttons">
<Button type="text" on:click={() => handleConsent(false)}>Deny</Button>
<Button type="filled" on:click={() => handleConsent(true)}>Allow</Button>
</svelte:fragment>
</Dialog>

View File

@@ -1,145 +0,0 @@
<script lang="ts">
import Button from '$lib/components/Button.svelte';
import Dialog from '$layout/Dialogs/Dialog.svelte';
import CircleMultipleOutline from 'svelte-material-icons/CircleMultipleOutline.svelte';
import ChevronUp from 'svelte-material-icons/ChevronUp.svelte';
import QRCode from '$lib/components/QRCode.svelte';
import WalletOutline from 'svelte-material-icons/WalletOutline.svelte';
import Snackbar from '$lib/components/Snackbar.svelte';
export let dialogOpen: boolean;
export let wallets;
let qrCodeValue = '';
let qrCodeDialogueName = '';
let qrCodeDialogue = false;
let addressSnackbar = false;
async function copyToClipboard(walletAddress: string) {
addressSnackbar = true;
qrCodeDialogue = false;
try {
await navigator.clipboard.writeText(walletAddress);
} catch (error) {
console.error('Failed to copy crypto wallet:', error);
}
}
</script>
<Dialog bind:dialogOpen>
<svelte:fragment slot="icon">
<CircleMultipleOutline size="32px" color="var(--surface-six)" />
</svelte:fragment>
<svelte:fragment slot="title">Cryptocurrencies</svelte:fragment>
<svelte:fragment slot="description">
<hr style="margin: 1rem 0;" />
<div class="wallets">
{#each wallets as wallet}
<button
on:click={() => {
qrCodeValue = wallet.address;
qrCodeDialogueName = wallet.currency_code;
qrCodeDialogue = !qrCodeDialogue;
// when the user clicks a wallet the crypto wallet goes away
// because multi page dialogues aren't implemented yet oops
dialogOpen = false;
}}
>
<div class="wallet-name">
<img
src="/donate/crypto/{wallet.currency_code}.svg"
onerror="this.onerror=null; this.src='/donate/fallback.svg'"
alt={`${wallet.network} icon.'`}
/>
{`${wallet.network} (${wallet.currency_code})`}
</div>
<div id="arrow">
<ChevronUp size="20px" color="var(--surface-six)" />
</div>
</button>
{/each}
</div>
</svelte:fragment>
<svelte:fragment slot="buttons">
<Button type="filled" on:click={() => (dialogOpen = false)}>Close</Button>
</svelte:fragment>
</Dialog>
<Dialog bind:dialogOpen={qrCodeDialogue}>
<svelte:fragment slot="icon">
<WalletOutline size="32px" color="var(--surface-six)" />
</svelte:fragment>
<svelte:fragment slot="title">{qrCodeDialogueName} Wallet</svelte:fragment>
<svelte:fragment slot="description">
<div class="qr-code-body">
{qrCodeValue}
<QRCode codeValue={qrCodeValue} />
</div>
</svelte:fragment>
<svelte:fragment slot="buttons">
<Button
type="text"
on:click={() => {
qrCodeDialogue = false;
dialogOpen = true;
}}>Back</Button
>
<Button type="filled" on:click={() => copyToClipboard(qrCodeValue)}>Copy Address</Button>
</svelte:fragment>
</Dialog>
<Snackbar bind:open={addressSnackbar}>
<svelte:fragment slot="text">Address copied to clipboard</svelte:fragment>
</Snackbar>
<style lang="scss">
.wallets {
// i just guessed this
width: clamp(200px, 75vw, 375px);
#arrow {
height: 20px;
transform: rotate(90deg);
}
button {
width: 100%;
font-size: 0.9rem;
background-color: transparent;
border: none;
color: var(--text-four);
cursor: pointer;
text-align: left;
display: flex;
justify-content: space-between;
background-color: var(--surface-seven);
padding: 0.75rem 1.25rem;
transition: filter 0.4s var(--bezier-one);
&:hover {
filter: brightness(85%);
}
}
.wallet-name {
display: flex;
align-items: center;
gap: 0.5rem;
// crypto icon
img {
height: 24px;
width: 24px;
}
}
}
.qr-code-body {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
word-break: break-word;
text-align: center;
}
</style>

View File

@@ -1,177 +0,0 @@
<script lang="ts">
import { fade } from 'svelte/transition';
import { quadInOut } from 'svelte/easing';
import ArrowLeft from 'svelte-material-icons/ArrowLeft.svelte';
export let dialogOpen = false;
export let fullscreen = false;
export let notDismissible = false;
let element: HTMLDialogElement;
let y = 0;
function parseScroll() {
y = element.scrollTop;
}
</script>
{#if dialogOpen}
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="overlay"
on:click={() => {
if (!notDismissible) dialogOpen = !dialogOpen;
}}
on:keypress={() => {
if (!notDismissible) dialogOpen = !dialogOpen;
}}
transition:fade={{ easing: quadInOut, duration: 150 }}
/>
<dialog
class:fullscreen
class:scrolled={y > 10}
aria-modal="true"
bind:this={element}
on:scroll={parseScroll}
transition:fade={{ easing: quadInOut, duration: 150 }}
>
<div class="title" class:hasIcon={$$slots.icon}>
{#if fullscreen}
<button id="back-button" on:click={() => (dialogOpen = !dialogOpen)}>
<ArrowLeft size="24px" color="var(--surface-six)" />
</button>
{/if}
{#if $$slots.icon}
<slot name="icon" />
{/if}
{#if $$slots.title}
<h3>
<slot name="title" />
</h3>
{/if}
</div>
{#if $$slots.description}
<p>
<slot name="description" />
</p>
{/if}
<div class="slot"><slot /></div>
{#if $$slots.buttons}
<div class="buttons">
<slot name="buttons" />
</div>
{/if}
</dialog>
{/if}
<style lang="scss">
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 6;
}
dialog {
position: fixed;
width: min(85%, 425px);
max-height: 75%;
overflow-y: scroll;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: none;
border-radius: 26px;
background-color: var(--surface-seven);
display: flex;
gap: 5%;
white-space: normal;
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
z-index: 7;
padding: 32px;
box-shadow:
0px 4px 5px 0px rgba(0, 0, 0, 0.14),
0px 1px 10px 0px rgba(0, 0, 0, 0.12),
0px 2px 4px -1px rgba(0, 0, 0, 0.2);
scrollbar-width: none;
-ms-overflow-style: none;
&::-webkit-scrollbar {
display: none;
}
#back-button {
cursor: pointer;
}
.hasIcon {
flex-direction: column;
}
.title {
display: flex;
align-items: center;
gap: 1rem;
width: 100%;
background-color: var(--surface-seven);
}
.buttons {
display: flex;
gap: 2rem;
justify-content: flex-end;
width: 100%;
}
&.fullscreen {
padding: 0;
max-height: 100%;
width: 100%;
border-radius: 0;
&.scrolled .title {
border-bottom: 1px solid var(--border);
}
.slot {
padding: 0 32px 32px;
}
.title {
justify-content: flex-start;
position: sticky;
padding: 32px;
padding-bottom: 0.75rem;
top: 0;
left: 0;
}
}
}
button {
padding: 0;
margin: 0;
border: none;
background-color: transparent;
display: flex;
align-items: center;
}
.slot {
display: flex;
flex-direction: column;
align-content: center;
width: 100%;
}
</style>

View File

@@ -1,25 +0,0 @@
<script lang="ts">
import Button from '$lib/components/Button.svelte';
import Query from '$lib/components/Query.svelte';
import Dialog from '$layout/Dialogs/Dialog.svelte';
import { queries } from '$data/api';
import { createQuery } from '@tanstack/svelte-query';
export let dialogOpen: boolean;
export let warning: string;
const query = createQuery(queries.manager());
</script>
<Dialog bind:dialogOpen>
<svelte:fragment slot="title">Warning</svelte:fragment>
<svelte:fragment slot="description">{warning} Do you still want to download?</svelte:fragment>
<svelte:fragment slot="buttons">
<Query {query} let:data>
<Button type="text" href={data.release.download_url} on:click={() => (dialogOpen = false)}>
Okay
</Button>
</Query>
<Button type="text" on:click={() => (dialogOpen = false)}>Cancel</Button>
</svelte:fragment>
</Dialog>

View File

@@ -1,66 +0,0 @@
<script lang="ts">
import Divider from '$lib/components/Divider.svelte';
import { email } from '$data/api/settings';
import Dialog from '$layout/Dialogs/Dialog.svelte';
import Button from '$lib/components/Button.svelte';
import Input from '$lib/components/Input.svelte';
export let showEmailDialog: boolean;
let enableInputSeconds = 15;
let keyword: string = '';
let interval: number | undefined;
function closeDialog() {
showEmailDialog = false;
clearInterval(interval);
interval = undefined;
enableInputSeconds = 15;
keyword = '';
}
$: if (showEmailDialog && !interval && enableInputSeconds != 0) {
interval = setInterval(() => {
if (enableInputSeconds <= 0) {
clearInterval(interval);
return;
}
enableInputSeconds -= 1;
}, 1000);
}
</script>
<Dialog bind:dialogOpen={showEmailDialog} notDismissible>
<svelte:fragment slot="title">Abuse notice</svelte:fragment>
<svelte:fragment slot="description">
<p>
This E-Mail address is <b>not</b> for support, help, bug reports or feature requests. It must
have a subject and body and have the keyword <span style="user-select: none;">'Reficio'</span>
in either, otherwise your mail will be
<b>ignored</b>.
</p>
<br />
{#if enableInputSeconds == 0}
<span>Enter the keyword, then click "Send".</span>
<br />
<br />
<Input placeholder="Keyword" type="text" bind:value={keyword}></Input>
{:else}
<span>Read above and wait <b>{enableInputSeconds}</b> seconds.</span>
{/if}
</svelte:fragment>
<svelte:fragment slot="buttons">
{#if keyword.toLowerCase() === 'reficio'}
<Button type="text"><a href="mailto:{email()}">Send</a></Button>
{/if}
<Button type="filled" on:click={closeDialog}>Close</Button>
</svelte:fragment>
</Dialog>
<style>
a {
text-decoration: none;
color: var(--text-four);
font-weight: 600;
}
</style>

View File

@@ -1,76 +0,0 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
export let src: string;
export let alt: string;
const dispatch = createEventDispatcher();
function closeDialog() {
dispatch('close');
}
function handleKeydown(event: KeyboardEvent) {
if (event.key === 'Escape') closeDialog();
}
</script>
<svelte:window on:keydown={handleKeydown} />
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="dialog-overlay" on:click={closeDialog} transition:fade={{ duration: 175 }}>
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="dialog-content" on:click|stopPropagation transition:fade={{ duration: 175 }}>
<button class="close-button" on:click={closeDialog}>×</button>
<img {src} {alt} />
</div>
</div>
<style>
.dialog-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.85);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
padding: 2rem;
box-sizing: border-box;
}
.dialog-content {
position: relative;
max-width: 90vw;
max-height: 90vh;
}
img {
max-width: 100%;
max-height: 90vh;
object-fit: contain;
}
.close-button {
position: absolute;
top: -1rem;
right: -2rem;
background: none;
border: none;
color: white;
font-size: 2rem;
cursor: pointer;
padding: 0.5rem;
line-height: 1;
z-index: 1001;
}
.close-button:hover {
color: #ddd;
}
</style>

View File

@@ -1,85 +0,0 @@
<script lang="ts">
import { login } from '$lib/auth';
import Input from '$lib/components/Input.svelte';
import Button from '$lib/components/Button.svelte';
import Dialog from '$layout/Dialogs/Dialog.svelte';
import { passed_login_with_creds } from '$lib/stores';
export let dialogOpen: boolean;
let loginForm: HTMLFormElement;
let wrong_credentials = false;
async function handle_login(e: SubmitEvent) {
const data = new FormData(e.target as HTMLFormElement);
const username = data.get('username') as string;
const password = data.get('password') as string;
const success = await login(username, password);
dialogOpen = !success;
passed_login_with_creds.set(success);
wrong_credentials = !success;
}
</script>
<Dialog bind:dialogOpen>
<div class="container">
<h2>Login</h2>
<p>This login is reserved for site administrators. Go back!</p>
{#if wrong_credentials}
<p style="color: var(--red-one)">Username or password do not match. Try again.</p>
{/if}
<form on:submit|preventDefault={handle_login} bind:this={loginForm}>
<div>
<Input placeholder="Username" required />
<Input
placeholder="Password"
type="password"
onkeydown={(event) => event.key === 'Enter' && loginForm.requestSubmit()}
required
/>
</div>
</form>
</div>
<svelte:fragment slot="buttons">
<Button type="text" on:click={() => (dialogOpen = !dialogOpen)}>Cancel</Button>
<!-- first paragraph of https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit -->
<Button type="filled" on:click={() => loginForm.requestSubmit()}>Login</Button>
</svelte:fragment>
</Dialog>
<style lang="scss">
.container {
display: flex;
flex-direction: column;
gap: 1rem;
position: relative;
h2 {
color: var(--primary);
}
form {
display: flex;
gap: 1rem;
div:has(input) {
display: flex;
flex-direction: column;
gap: 1rem;
margin-bottom: 1rem;
width: 100%;
}
div:has(svg) {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
}
}
}
</style>

View File

@@ -1,28 +0,0 @@
<script lang="ts">
import { fromNow } from '$util/fromNow';
import { admin_login, passed_login_with_creds } from '$lib/stores';
import Button from '$lib/components/Button.svelte';
import Dialog from '$layout/Dialogs/Dialog.svelte';
</script>
<Dialog bind:dialogOpen={$passed_login_with_creds}>
<svelte:fragment slot="title">Successfully logged in!</svelte:fragment>
<div>
This session will expire in
<span>{$admin_login.logged_in ? fromNow($admin_login.expires) : '...'}</span>
</div>
<svelte:fragment slot="buttons">
<Button type="filled" on:click={() => passed_login_with_creds.set(false)}>OK</Button>
</svelte:fragment>
</Dialog>
<style lang="scss">
div {
color: var(--text-one);
span {
color: var(--primary);
}
}
</style>

View File

@@ -1,40 +0,0 @@
<script lang="ts">
import Package from '../../routes/patches/Package.svelte';
import Dialog from '$layout/Dialogs/Dialog.svelte';
export let dialogOpen: boolean;
export let searchTerm: string;
export let data;
export let selectedPkg;
</script>
<Dialog bind:dialogOpen fullscreen>
<svelte:fragment slot="title">Packages</svelte:fragment>
<div class="mobile-packages">
<!-- svelte-ignore a11y-no-static-element-interactions -->
<span
on:click={() => (dialogOpen = !dialogOpen)}
on:keypress={() => (dialogOpen = !dialogOpen)}
>
<Package {selectedPkg} name="All packages" bind:searchTerm />
</span>
{#each data.packages as pkg}
<!-- svelte-ignore a11y-no-static-element-interactions -->
<span
on:click={() => (dialogOpen = !dialogOpen)}
on:keypress={() => (dialogOpen = !dialogOpen)}
>
<Package {selectedPkg} name={pkg} bind:searchTerm />
</span>
{/each}
</div>
</Dialog>
<style lang="scss">
.mobile-packages {
margin-bottom: -1px;
overflow: hidden;
border-radius: 12px;
border: 1px solid var(--border);
}
</style>

View File

@@ -1,35 +0,0 @@
<script lang="ts">
import { set_access_token } from '$lib/auth';
import { admin_login } from '$lib/stores';
import Button from '$lib/components/Button.svelte';
import Dialog from '$layout/Dialogs/Dialog.svelte';
export let loginOpen: boolean;
$: session_expired = $admin_login.logged_in_previously && !$admin_login.logged_in;
function reset_session() {
set_access_token();
session_expired = !session_expired;
}
</script>
<Dialog dialogOpen={session_expired}>
<svelte:fragment slot="title">Expired session</svelte:fragment>
<div>
This session has expired, log in again to renew or lose all access to administrative power.
</div>
<svelte:fragment slot="buttons">
<Button type="text" on:click={reset_session}>OK</Button>
<Button type="filled" on:click={() => (reset_session(), (loginOpen = !loginOpen))}>
Login
</Button>
</svelte:fragment>
</Dialog>
<style>
div {
color: var(--text-four);
}
</style>

View File

@@ -1,117 +0,0 @@
<script lang="ts">
import { fromNow } from '$util/fromNow';
import { admin_login } from '$lib/stores';
import { api_base_url, set_api_base_url, default_api_url } from '$data/api/settings';
import { useQueryClient } from '@tanstack/svelte-query';
import Button from '$lib/components/Button.svelte';
import Dialog from '$layout/Dialogs/Dialog.svelte';
import Replay from 'svelte-material-icons/Replay.svelte';
import Cog from 'svelte-material-icons/Cog.svelte';
export let loginOpen: boolean;
export let dialogOpen: boolean;
const client = useQueryClient();
let url = api_base_url();
function reload() {
location.reload();
}
function clear_and_reload() {
client.clear();
// `client.clear()` does technically do this for us, but it takes a while.
localStorage.clear();
reload();
}
function save() {
set_api_base_url(url);
reload();
}
function reset() {
url = default_api_url;
}
</script>
<Dialog bind:dialogOpen>
<svelte:fragment slot="icon">
<Cog size="24px" color="var(--surface-six)" />
</svelte:fragment>
<svelte:fragment slot="title">Settings</svelte:fragment>
<div id="settings-content">
<p>Configure the API for this website.</p>
<div class="input-wrapper">
<input name="api-url" id="api-url" type="text" bind:value={url} />
<button id="button-reset" on:click={reset} aria-label="Reset Button">
<Replay size="24px" color="var(--surface-six)" />
</button>
</div>
</div>
<svelte:fragment slot="buttons">
<div class="buttons-container">
<Button
type="text"
disabled={$admin_login.logged_in}
on:click={() => ((loginOpen = !loginOpen), (dialogOpen = !dialogOpen))}
>
{$admin_login.logged_in ? `Logged in for ${fromNow($admin_login.expires)}` : 'Login'}
</Button>
<div class="buttons">
<Button type="text" on:click={clear_and_reload} label="Reset Button">Reset</Button>
<Button type="text" on:click={save} label="Save Button">Save</Button>
</div>
</div>
</svelte:fragment>
</Dialog>
<style lang="scss">
input {
width: 100%;
position: relative;
padding-right: 3rem;
margin-top: 1rem;
}
#button-reset {
position: absolute;
right: 12px;
top: 30px;
}
button {
background-color: transparent;
border: none;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}
.input-wrapper {
margin-bottom: 0.75rem;
display: flex;
justify-content: space-between;
position: relative;
}
.buttons-container {
width: 100%;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
gap: 1rem;
.buttons {
display: flex;
justify-content: flex-end;
flex-wrap: wrap;
gap: 2rem;
}
}
</style>

View File

@@ -1,193 +0,0 @@
<script lang="ts">
import { fly } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import { queries } from '$data/api';
import { createQuery } from '@tanstack/svelte-query';
import Query from '$lib/components/Query.svelte';
import FooterSection from './FooterSection.svelte';
import { RV_DMCA_GUID } from '$env/static/public';
import { onMount } from 'svelte';
import Divider from '$lib/components/Divider.svelte';
import Button from '$lib/components/Button.svelte';
import EmailDialog from '$layout/Dialogs/EmailDialog.svelte';
const aboutQuery = createQuery(queries.about());
let location: string;
let showEmailDialog = false;
onMount(() => {
// DMCA Protection Badge
location = document.location.href;
});
</script>
<EmailDialog bind:showEmailDialog />
<Divider horizontalPadding={'15px'} />
<footer in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<div class="top">
<section class="main-content">
<img src="/logo.svg" class="logo-image" alt="ReVanced Logo" />
<Query query={aboutQuery} let:data>
<div>
<p>
{data.about.about}
</p>
</div>
</Query>
</section>
<section class="links-container">
<FooterSection title="Pages">
<li><a href="/">Home</a></li>
<li><a href="/download">Download</a></li>
<li><a href="/patches">Patches</a></li>
<li><a href="/contributors">Contributors</a></li>
<li><a href="/donate">Donate</a></li>
</FooterSection>
<Query query={aboutQuery} let:data>
{#if data}
<FooterSection title="Socials">
{#each data.about.socials as { name, url }}
<li>
<a href={url} target="_blank" rel="noreferrer">{name}</a>
</li>
{/each}
</FooterSection>
{/if}
</Query>
</section>
</div>
<div class="bottom">
<div id="logo-name"><span>Re</span>Vanced</div>
<Button type="text" style="color: var(--text-four); font-weight: 600;">
<a href="/donate">Donate</a>
</Button>
<Button
type="text"
style="color: var(--text-four); font-weight: 600;"
on:click={() => (showEmailDialog = true)}
>
E-Mail
</Button>
<!-- DMCA Protection Badge -->
<a
href="//www.dmca.com/Protection/Status.aspx?ID={RV_DMCA_GUID}&refurl={location}"
title="DMCA.com Protection Status"
class="dmca-badge"
>
<img
src="https://images.dmca.com/Badges/dmca-badge-w150-5x1-08.png?ID={RV_DMCA_GUID}"
alt="DMCA.com Protection Status"
/>
</a>
</div>
</footer>
<style lang="scss">
footer {
max-width: min(87%, 100rem);
padding: 5rem 0rem;
margin: 0 auto;
.top {
display: flex;
gap: 8rem;
justify-content: space-between;
margin-bottom: 4rem;
@media (max-width: 1050px) {
flex-direction: column;
gap: 2rem;
}
}
.bottom {
display: flex;
gap: 2rem;
align-items: center;
a {
text-decoration: none;
color: var(--text-four);
font-weight: 600;
}
@media (max-width: 768px) {
flex-wrap: wrap;
gap: 1rem;
}
}
}
.dmca-badge {
display: flex;
align-items: center;
}
#logo-name {
font-size: 1.4rem;
color: var(--text-one);
font-weight: 600;
span {
color: var(--primary);
}
}
li {
list-style: none;
color: var(--text-four);
font-size: 0.9rem;
font-weight: 500;
a {
color: var(--primary);
font-weight: 600;
font-size: 0.95rem;
}
}
.main-content {
display: flex;
flex-direction: column;
gap: 1.5rem;
align-items: flex-start;
}
.logo-image {
height: 2.5rem;
}
a {
text-decoration: none;
&:hover {
text-decoration: underline var(--secondary);
color: var(--text-one);
}
}
.links-container {
display: flex;
gap: 10rem;
margin-top: 1rem;
@media (max-width: 1050px) {
display: grid;
gap: 2rem;
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}
@media (max-width: 768px) {
display: flex;
flex-direction: column;
gap: initial;
}
}
</style>

View File

@@ -1,35 +0,0 @@
<script lang="ts">
export let title: string;
</script>
<div>
<span>
{title}
</span>
<ul>
<slot />
</ul>
</div>
<style lang="scss">
span {
display: flex;
margin: 1.5rem 0;
font-size: 0.9rem;
font-weight: 600;
color: var(--text-four);
}
ul {
display: flex;
flex-direction: column;
margin: 1.25rem 0rem;
gap: 1rem;
}
@media (max-width: 768px) {
div:not(:last-child) {
border-bottom: 1px solid var(--border);
}
}
</style>

View File

@@ -1,23 +0,0 @@
<script>
import Picture from '$lib/components/Picture.svelte';
import manager_screenshot from '$images/manager.png?w=1233;822;411&format=avif;webp;png&as=picture';
</script>
<div class="hero-img">
<Picture data={manager_screenshot} alt="Screenshot of ReVanced Manager" />
</div>
<style lang="scss">
.hero-img {
height: max(100vh, 600px);
padding: 0.5rem 0.5rem;
border-radius: 1.75rem;
background-color: var(--surface-seven);
user-select: none;
:global(img) {
height: 100%;
border-radius: 1.75rem;
}
}
</style>

View File

@@ -1,92 +0,0 @@
<script>
import { queries } from '$data/api';
import { createQuery } from '@tanstack/svelte-query';
import Query from '$lib/components/Query.svelte';
import TrayArrowDown from 'svelte-material-icons/TrayArrowDown.svelte';
import FileDocumentOutline from 'svelte-material-icons/FileDocumentOutline.svelte';
import Button from '$lib/components/Button.svelte';
import SocialButton from './SocialButton.svelte';
const aboutQuery = createQuery(queries.about());
export let socialsVisibility = true;
</script>
<section class="hero">
<h1>Continuing the <br />legacy of <span>Vanced.</span></h1>
<p>
Customize your mobile experience through ReVanced <br /> by applying patches to your applications.
</p>
<div class="buttons-container">
<div class="hero-buttons internal-buttons">
<Button type="filled" icon={TrayArrowDown} href="download">Download</Button>
<Button type="tonal" icon={FileDocumentOutline} href="patches">View patches</Button>
</div>
<div class="hero-buttons social-buttons" style:opacity={socialsVisibility ? '100%' : '0'}>
<Query query={aboutQuery} let:data>
{#if data}
{#each data.about.socials.filter((s) => s.name != 'Website') as social}
<SocialButton {social} />
{/each}
{/if}
</Query>
</div>
</div>
</section>
<style lang="scss">
.hero {
display: flex;
flex-direction: column;
gap: 1rem;
@media (min-width: 1100px) {
padding-top: 10vh;
}
h1 {
color: var(--text-one);
}
span {
color: var(--primary);
}
.buttons-container {
display: flex;
flex-direction: column;
gap: 2.5rem;
.social-buttons {
max-width: 30rem;
position: absolute;
bottom: 1rem;
transition: opacity 0.1s var(--bezier-one);
@media (max-width: 450px) {
justify-content: center;
left: 0;
}
@media (max-height: 600px), (max-width: 450px) and (max-height: 780px) {
position: static;
opacity: 100% !important;
}
}
.hero-buttons {
flex-wrap: wrap;
display: flex;
user-select: none;
gap: 1rem;
@media (max-width: 450px) {
&.internal-buttons {
flex-direction: column;
gap: 1rem;
}
}
}
}
}
</style>

View File

@@ -1,40 +0,0 @@
<script lang="ts">
import type { Social } from '$lib/types';
export let social: Social;
</script>
<a href={social.url} rel="noreferrer" target="_blank">
<img src="socials/{social.name.toLowerCase()}.svg" alt={social.name} />
</a>
<style lang="scss">
a {
display: flex;
justify-content: center;
border: 0;
width: 60px;
height: 60px;
padding: 14px;
cursor: pointer;
border-radius: 200px;
transition: transform 0.4s var(--bezier-one);
background-color: var(--surface-four);
color: var(--text-one);
user-select: none;
&:hover {
transform: translateY(-5%);
}
img {
transition: filter 0.4s var(--bezier-one);
width: 30px;
}
&:hover img {
filter: brightness(1.2);
}
}
</style>

View File

@@ -1,96 +0,0 @@
<script lang="ts">
import { queries } from '$data/api';
import { dev_log } from '$util/dev';
import RouterEvents from '$data/RouterEvents';
import { useQueryClient } from '@tanstack/svelte-query';
const client = useQueryClient();
export let href: string;
export let queryKey: null | keyof typeof queries | Array<keyof typeof queries> = null;
export let label: string;
function prefetch() {
if (queryKey !== null) {
if (Array.isArray(queryKey)) {
queryKey.forEach((key) => {
const query = (queries[key] as Function)();
dev_log('Prefetching', query);
client.prefetchQuery(query as any);
});
} else {
const query = (queries[queryKey] as Function)();
dev_log('Prefetching', query);
client.prefetchQuery(query as any);
}
}
}
</script>
<li
class:selected={href === '/' + $RouterEvents.target_url.pathname.split('/')[1]}
class:unclickable={$RouterEvents.target_url.pathname === href}
>
<a data-sveltekit-preload-data on:mouseenter={prefetch} {href} aria-label={label}>
<span><slot /></span>
</a>
</li>
<style lang="scss">
li {
list-style: none;
position: relative;
transition-timing-function: var(--bezier-one);
transition-duration: 0.25s;
border-radius: 10px;
&.selected {
background-color: var(--tertiary);
color: var(--primary);
span {
color: var(--primary);
}
}
&.unclickable {
pointer-events: none;
}
:hover {
color: var(--text-one);
background-color: var(--surface-three);
}
}
a {
text-decoration: none;
user-select: none;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
padding: 10px 16px;
}
span {
display: flex;
justify-content: center;
font-weight: 400;
font-size: 0.9rem;
letter-spacing: 0.02rem;
color: var(--text-four);
}
@media (max-width: 768px) {
a {
padding: 0.75rem 1.25rem;
justify-content: left;
}
span {
font-size: 1rem;
font-weight: 500;
}
}
</style>

View File

@@ -1,359 +0,0 @@
<script lang="ts">
import { onMount } from 'svelte';
import { horizontalSlide } from '$util/horizontalSlide';
import { fade } from 'svelte/transition';
import { expoOut } from 'svelte/easing';
import { createQuery } from '@tanstack/svelte-query';
import Navigation from '$layout/Navbar/NavButton.svelte';
import Query from '$lib/components/Query.svelte';
import AnnouncementBanner from '$layout/Banners/AnnouncementBanner.svelte';
import Cog from 'svelte-material-icons/Cog.svelte';
import { status_url } from '$data/api/settings';
import RouterEvents from '$data/RouterEvents';
import { queries } from '$data/api';
import StatusBanner from '$layout/Banners/StatusBanner.svelte';
import SettingsDialog from '$layout/Dialogs/SettingsDialog.svelte';
import LoginDialog from '$layout/Dialogs/LoginDialog.svelte';
import LoginSuccessfulDialog from '$layout/Dialogs/LoginSuccessfulDialog.svelte';
import SessionExpiredDialog from '$layout/Dialogs/SessionExpiredDialog.svelte';
const ping = createQuery(queries.ping());
const statusUrl = status_url();
let menuOpen = false;
const dialogs: Record<string, boolean> = {
settings: false,
login: false
};
let scrollY: number;
onMount(() => {
return RouterEvents.subscribe((event) => {
if (event.navigating) menuOpen = false;
});
});
</script>
<svelte:window bind:scrollY />
<span class="banner" class:hide={menuOpen}>
<Query query={ping} let:data>
{#if !data}
<StatusBanner {statusUrl} />
{/if}
</Query>
<AnnouncementBanner />
</span>
<nav class:scrolled={scrollY > 10}>
<a class="menu-btn skiptab-btn" href="#skiptab">Skip navigation</a>
<button
class="menu-btn mobile-only"
on:click={() => (menuOpen = !menuOpen)}
class:open={menuOpen}
aria-label="Menu"
>
<span class="menu-btn__burger" />
</button>
<a href="/" id="logo"><img src="/logo.svg" alt="ReVanced Logo" /></a>
{#key menuOpen}
<div
id="nav-wrapper-container"
class:desktop-only={!menuOpen}
transition:horizontalSlide={{ direction: 'inline', easing: expoOut, duration: 400 }}
>
<div class="nav-wrapper">
<div id="main-navigation">
<ul class="nav-buttons">
<Navigation href="/" label="Home">Home</Navigation>
<Navigation queryKey="manager" href="/download" label="Download">Download</Navigation>
<Navigation queryKey="patches" href="/patches" label="Patches">Patches</Navigation>
<span class="mobile-only">
<Navigation
queryKey={['announcements', 'announcementTags']}
href="/announcements"
label="Announcements"
>
Announcements
</Navigation>
</span>
<Navigation queryKey="contributors" href="/contributors" label="Contributors">
Contributors
</Navigation>
<Navigation queryKey={['about', 'team']} href="/donate" label="Donate"
>Donate</Navigation
>
</ul>
</div>
<div id="secondary-navigation">
<span class="desktop-only">
<Navigation
queryKey={['announcements', 'announcementTags']}
href="/announcements"
label="Announcements"
>
<svg
xmlns="http://www.w3.org/2000/svg"
height="24px"
viewBox="0 -960 960 960"
width="24px"
fill="currentColor"
>
<path
d="M720-440v-80h160v80H720Zm48 280-128-96 48-64 128 96-48 64Zm-80-480-48-64 128-96 48 64-128 96ZM200-200v-160h-40q-33 0-56.5-23.5T80-440v-80q0-33 23.5-56.5T160-600h160l200-120v480L320-360h-40v160h-80Zm360-146v-268q27 24 43.5 58.5T620-480q0 41-16.5 75.5T560-346Z"
/>
</svg>
</Navigation>
</span>
<button
on:click={() => (dialogs.settings = !dialogs.settings)}
class:selected={dialogs.settings}
aria-label="Settings"
>
<Cog size="20px" color={dialogs.settings ? 'var(--primary)' : 'var(--surface-six)'} />
</button>
</div>
</div>
</div>
{/key}
{#if menuOpen}
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="overlay mobile-only"
transition:fade={{ duration: 350 }}
on:click={() => (menuOpen = !menuOpen)}
on:keypress={() => (menuOpen = !menuOpen)}
/>
{/if}
</nav>
<SettingsDialog bind:dialogOpen={dialogs.settings} bind:loginOpen={dialogs.login} />
<LoginDialog bind:dialogOpen={dialogs.login} />
<LoginSuccessfulDialog />
<SessionExpiredDialog bind:loginOpen={dialogs.login} />
<style lang="scss">
#secondary-navigation {
display: flex;
gap: 1rem;
button {
border-radius: 10px;
padding: 10px 16px;
&:hover {
background-color: var(--surface-three);
}
&.selected {
background-color: var(--tertiary);
}
}
}
#logo {
padding: 0.5rem;
}
button {
background-color: transparent;
border: none;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}
nav {
position: sticky;
top: 0;
z-index: 5;
display: flex;
align-items: center;
justify-content: space-between;
gap: 2rem;
height: 70px;
padding: 1rem 2rem;
width: 100%;
background-color: var(--surface-eight);
}
img {
height: 22px;
}
.nav-buttons {
display: flex;
gap: 1rem;
}
.scrolled {
box-shadow: var(--drop-shadow-one);
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 3;
}
.nav-wrapper {
display: flex;
width: 100%;
justify-content: space-between;
}
@media (min-width: 768px) {
.nav-wrapper {
align-items: center;
}
}
.banner.hide {
display: none;
}
#nav-wrapper-container {
width: 100%;
}
@media (max-width: 768px) {
#nav-wrapper-container {
overflow: hidden;
position: fixed;
width: 20rem;
top: 0;
left: 0;
height: 100%;
background-color: var(--surface-eight);
z-index: 4;
}
.nav-wrapper {
flex-direction: column;
gap: 0.5rem;
height: 100%;
margin: 0 auto;
width: 20rem;
border-radius: 0px 24px 24px 0px;
padding: 1rem;
padding-top: 6rem;
}
.desktop-only {
display: none !important;
}
nav {
justify-content: normal;
}
.nav-buttons {
flex-direction: column;
gap: 0.5rem;
width: 100%;
}
#secondary-navigation {
z-index: 4;
padding: 16px;
}
}
@media (min-width: 768px) {
.mobile-only {
display: none !important;
}
}
/* Hamburger mmm yum */
.menu-btn {
user-select: none;
position: relative;
display: flex;
height: 50px;
z-index: 6;
justify-content: center;
align-items: center;
cursor: pointer;
&__burger {
display: flex;
flex-wrap: wrap;
&,
&::before,
&::after {
width: 24px;
height: 2px;
background: var(--surface-six);
transition: all 0.3s var(--bezier-one);
}
&::before,
&::after {
content: '';
position: absolute;
}
&::before {
transform: translateY(-6.5px);
}
&::after {
transform: translateY(6.5px);
}
}
/* ANIMATION */
&.open {
.menu-btn__burger {
transform: translateX(-10px);
background: transparent;
box-shadow: none;
&::before {
transform: rotate(45deg) translate(10px, -10px);
}
&::after {
transform: rotate(-45deg) translate(10px, 10px);
}
}
}
}
.skiptab-btn {
position: fixed;
left: -300px;
border-radius: 100px;
text-decoration: none;
background-color: var(--primary);
z-index: 2;
color: var(--text-three);
font-weight: 600;
font-size: 0.95rem;
padding: 16px 24px;
&:focus {
left: 12px;
}
}
</style>

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="107" height="128" viewBox="0 0 107 128"><title>svelte-logo</title><path d="M94.157 22.819c-10.4-14.885-30.94-19.297-45.792-9.835L22.282 29.608A29.92 29.92 0 0 0 8.764 49.65a31.5 31.5 0 0 0 3.108 20.231 30 30 0 0 0-4.477 11.183 31.9 31.9 0 0 0 5.448 24.116c10.402 14.887 30.942 19.297 45.791 9.835l26.083-16.624A29.92 29.92 0 0 0 98.235 78.35a31.53 31.53 0 0 0-3.105-20.232 30 30 0 0 0 4.474-11.182 31.88 31.88 0 0 0-5.447-24.116" style="fill:#ff3e00"/><path d="M45.817 106.582a20.72 20.72 0 0 1-22.237-8.243 19.17 19.17 0 0 1-3.277-14.503 18 18 0 0 1 .624-2.435l.49-1.498 1.337.981a33.6 33.6 0 0 0 10.203 5.098l.97.294-.09.968a5.85 5.85 0 0 0 1.052 3.878 6.24 6.24 0 0 0 6.695 2.485 5.8 5.8 0 0 0 1.603-.704L69.27 76.28a5.43 5.43 0 0 0 2.45-3.631 5.8 5.8 0 0 0-.987-4.371 6.24 6.24 0 0 0-6.698-2.487 5.7 5.7 0 0 0-1.6.704l-9.953 6.345a19 19 0 0 1-5.296 2.326 20.72 20.72 0 0 1-22.237-8.243 19.17 19.17 0 0 1-3.277-14.502 17.99 17.99 0 0 1 8.13-12.052l26.081-16.623a19 19 0 0 1 5.3-2.329 20.72 20.72 0 0 1 22.237 8.243 19.17 19.17 0 0 1 3.277 14.503 18 18 0 0 1-.624 2.435l-.49 1.498-1.337-.98a33.6 33.6 0 0 0-10.203-5.1l-.97-.294.09-.968a5.86 5.86 0 0 0-1.052-3.878 6.24 6.24 0 0 0-6.696-2.485 5.8 5.8 0 0 0-1.602.704L37.73 51.72a5.42 5.42 0 0 0-2.449 3.63 5.79 5.79 0 0 0 .986 4.372 6.24 6.24 0 0 0 6.698 2.486 5.8 5.8 0 0 0 1.602-.704l9.952-6.342a19 19 0 0 1 5.295-2.328 20.72 20.72 0 0 1 22.237 8.242 19.17 19.17 0 0 1 3.277 14.503 18 18 0 0 1-8.13 12.053l-26.081 16.622a19 19 0 0 1-5.3 2.328" style="fill:#fff"/></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,134 +0,0 @@
import { browser } from '$app/environment';
import { build_url } from '$data/api';
export type AuthToken = {
token: string;
expires: number;
};
type JwtPayload = {
exp: number;
iss: string;
iat: number;
};
export class UnauthenticatedError extends Error {
constructor() {
super('Unauthenticated. Cannot perform admin operations.');
}
}
// Get access token.
export function get_access_token(): AuthToken | null {
if (!browser) return null;
const data = localStorage.getItem('revanced_api_access_token');
if (data) return JSON.parse(data) as AuthToken;
return null;
}
// (Re)set access token.
export function set_access_token(token?: AuthToken) {
if (!token) localStorage.removeItem('revanced_api_access_token');
else localStorage.setItem('revanced_api_access_token', JSON.stringify(token));
}
// Parse a JWT token
export function parseJwt(token: string): JwtPayload {
const base64Url = token.split('.')[1];
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
const jsonPayload = decodeURIComponent(
atob(base64)
.split('')
.map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))
.join('')
);
return JSON.parse(jsonPayload) as JwtPayload;
}
// Check if the admin is authenticated
export function is_logged_in(): boolean {
const token = get_access_token();
if (!token) return false;
return Date.now() < token.expires;
}
async function digest_fetch(
url: string,
username: string,
password: string,
options: RequestInit = {}
): Promise<Response> {
// Helper function to convert ArrayBuffer to Hex string
function bufferToHex(buffer: ArrayBuffer): string {
return Array.from(new Uint8Array(buffer))
.map((b) => b.toString(16).padStart(2, '0'))
.join('');
}
// Generate SHA-256 digest
async function sha256(message: string): Promise<string> {
const encoder = new TextEncoder();
const data = encoder.encode(message);
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
return bufferToHex(hashBuffer);
}
// Perform an initial request to get the `WWW-Authenticate` header
const initialResponse = await fetch(url, {
method: options.method || 'GET',
headers: options.headers || {}
});
if (!initialResponse.ok && initialResponse.status !== 401)
throw new Error(`Initial request failed with status: ${initialResponse.status}`);
if (initialResponse.ok && initialResponse.status === 200) return initialResponse;
const authHeader = initialResponse.headers.get('Www-Authenticate');
if (!authHeader || !authHeader.startsWith('Digest '))
throw new Error('No Digest authentication header found');
// Parse the `WWW-Authenticate` header to extract the fields
const authParams = authHeader
.replace('Digest ', '')
.split(',')
.reduce((acc: Record<string, string>, item) => {
const [key, value] = item.trim().split('=');
acc[key] = value.replace(/"/g, '');
return acc;
}, {});
const { realm, nonce, algorithm } = authParams;
const method = options.method || 'GET';
const uri = new URL(url).pathname;
// https://ktor.io/docs/server-digest-auth.html#flow
const HA1 = await sha256(`${username}:${realm}:${password}`);
const HA2 = await sha256(`${method}:${uri}`);
const responseHash = await sha256(`${HA1}:${nonce}:${HA2}`);
// Build the Authorization header
const authHeaderDigest = `Digest username="${username}", realm="${realm}", nonce="${nonce}", uri="${uri}", algorithm=${algorithm}, response="${responseHash}"`;
// Perform the final request with the Authorization header
const finalResponse = await fetch(url, {
...options,
headers: {
...options.headers,
Authorization: authHeaderDigest
}
});
return finalResponse;
}
export async function login(username: string, password: string) {
const res = await digest_fetch(build_url('token'), username, password);
if (!res.ok) return false;
const data = await res.json();
const payload = parseJwt(data.token);
set_access_token({ token: data.token, expires: payload.exp * 1000 });
return true;
}

View File

@@ -1,112 +0,0 @@
<script lang="ts">
import ToolTip from './ToolTip.svelte';
export let type: 'filled' | 'tonal' | 'text' | 'outlined' | 'icon' = 'filled';
export let variant: 'default' | 'danger' | 'onDangerBackground' = 'default';
export let functionType: typeof HTMLButtonElement.prototype.type = 'button';
export let icon: any | undefined = undefined;
export let iconSize = 20;
export let iconColor = 'currentColor';
export let href: string = '';
export let target: string = '';
export let label: string = '';
export let disabled: boolean = false;
export let toolTipText: string | undefined = undefined;
export let style: string = '';
$: type = $$slots.default ? type : 'icon';
</script>
<ToolTip content={toolTipText} html={false}>
{#if href}
<a {href} {target} aria-label={label} class={`${type} ${variant}`} class:disabled>
<svelte:component this={icon} size={iconSize} color={iconColor} />
<slot />
</a>
{:else}
<button
on:click
class={`${type} ${variant}`}
style="{style}"
class:disabled
aria-label={label}
type={functionType}
{disabled}
>
<svelte:component this={icon} size={iconSize} color={iconColor} />
<slot />
</button>
{/if}
</ToolTip>
<style lang="scss">
a,
button {
min-width: max-content;
font-size: 0.95rem;
text-decoration: none;
color: var(--text-one);
font-weight: 600;
border: none;
border-radius: 100px;
display: flex;
justify-content: center;
align-items: center;
gap: 0.5rem;
cursor: pointer;
transition:
transform 0.4s var(--bezier-one),
filter 0.4s var(--bezier-one);
user-select: none;
padding: 16px 24px;
&:hover:not(.disabled) {
filter: brightness(85%);
}
&.disabled {
filter: grayscale(100%);
cursor: not-allowed;
}
&.filled {
background-color: var(--primary);
color: var(--text-three);
}
&.tonal {
background-color: var(--surface-four);
}
&.text {
background-color: transparent;
color: var(--primary);
font-weight: 500;
padding: 0;
}
&.outlined {
border: 2px solid var(--primary);
background-color: transparent;
}
&.icon {
&:hover {
filter: brightness(75%);
}
background-color: transparent;
color: currentColor;
padding: 0;
}
&.danger {
background-color: var(--red-one);
color: var(--surface-four);
}
&.onDangerBackground {
background-color: #ffd3d3;
color: #601410;
}
}
</style>

View File

@@ -1,30 +0,0 @@
<script>
export let horizontalPadding;
</script>
<svg
style:padding-inline={horizontalPadding}
aria-hidden="true"
width="100%"
height="8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<pattern id="a" width="91" height="8" patternUnits="userSpaceOnUse">
<path
d="M114 4c-5.067 4.667-10.133 4.667-15.2 0S88.667-.667 83.6 4 73.467 8.667 68.4 4 58.267-.667 53.2 4 43.067 8.667 38 4 27.867-.667 22.8 4 12.667 8.667 7.6 4-2.533-.667-7.6 4s-10.133 4.667-15.2 0S-32.933-.667-38 4s-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0"
stroke-linecap="square"
/>
</pattern>
<rect width="100%" height="100%" fill="url(#a)" />
</svg>
<style lang="scss">
svg {
margin: 1.5rem 0;
path {
stroke: var(--border);
}
}
</style>

View File

@@ -1,42 +0,0 @@
<script>
import Check from 'svelte-material-icons/Check.svelte';
import ChevronDown from 'svelte-material-icons/ChevronDown.svelte';
export let dropdown = false;
export let check = false;
export let selected = false;
</script>
<button class:selected on:click>
{#if check}
<Check size="18px" color="var(--surface-six)" />
{/if}
<slot />
{#if dropdown}
<ChevronDown size="18px" color="var(--surface-six)" />
{/if}
</button>
<style lang="scss">
button {
font-family: var(--font-two);
border: none;
border: 1.5px solid var(--border);
background-color: transparent;
color: var(--text-four);
height: 32px;
padding: 0 16px;
border-radius: 8px;
font-size: 0.85rem;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
&.selected {
background-color: var(--tertiary);
color: var(--primary);
}
}
</style>

View File

@@ -1,82 +0,0 @@
<script lang="ts">
import ImageDialog from '$layout/Dialogs/ImageDialog.svelte';
export let images: string[];
export let columns: number = 3;
export let gap: string = '1rem';
let selectedImage: { src: string; alt: string } | null = null;
function openDialog(image: string, index: number) {
selectedImage = {
src: image,
alt: `Gallery image ${index + 1}`
};
}
function closeDialog() {
selectedImage = null;
}
</script>
<div class="gallery" style="--columns: {columns}; --gap: {gap}">
{#each images as image, i}
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
<div class="image-container">
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
<img
src={image}
alt={`Gallery image ${i + 1}`}
loading="lazy"
on:click={() => openDialog(image, i)}
on:keydown={(e) => e.key === 'Enter' && openDialog(image, i)}
tabindex="0"
/>
</div>
{/each}
</div>
{#if selectedImage}
<ImageDialog src={selectedImage.src} alt={selectedImage.alt} on:close={closeDialog} />
{/if}
<style>
.gallery {
display: grid;
grid-template-columns: repeat(var(--columns), 1fr);
gap: var(--gap);
width: 100%;
padding: 1rem;
}
.image-container {
aspect-ratio: 4 / 3;
overflow: hidden;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
cursor: pointer;
}
img:hover {
transform: scale(1.05);
}
@media (max-width: 768px) {
.gallery {
--columns: 2;
}
}
@media (max-width: 480px) {
.gallery {
--columns: 1;
}
}
</style>

View File

@@ -1,32 +0,0 @@
<script lang="ts">
import { JsonLd } from 'svelte-meta-tags';
let _title: string = '';
$: title = _title === '' ? 'ReVanced' : `ReVanced - ${_title}`;
export { _title as title };
export let description: string = 'Continuing the legacy of Vanced.';
export let schemas: any[] | undefined;
</script>
<svelte:head>
<title>{title}</title>
<meta name="description" content={description} />
<meta name="theme-color" content="#9FD5FF" />
<!-- OpenGraph -->
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<!-- Twitter -->
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
{#if schemas}
{#each schemas as schema}
<JsonLd {schema} />
{/each}
{/if}
</svelte:head>

View File

@@ -1,65 +0,0 @@
<script lang="ts">
export let placeholder: string;
export let required: boolean = false;
export let value: any = '';
export let type: string = 'text';
export let onenter: () => void = () => {};
export let onexit: () => void = () => {};
export let oninput: () => void = () => {};
export let onkeydown: (event: KeyboardEvent) => void = (event) => {};
const set_type = (node: HTMLInputElement) => {
node.type = type;
};
</script>
<div class="input-wrapper">
<input
id={placeholder.toLowerCase()}
name={placeholder.toLowerCase()}
{required}
use:set_type
on:focus={onenter}
on:blur={onexit}
on:input={oninput}
on:keydown={onkeydown}
bind:value
/>
<label for={placeholder.toLowerCase()}>{placeholder}</label>
</div>
<style lang="scss">
.input-wrapper {
width: auto;
height: auto;
position: relative;
label {
position: absolute;
top: 29%;
left: 1rem;
transition: all 0.2s ease-in-out;
color: var(--surface-six);
pointer-events: none;
padding: 0;
margin: 0;
font-size: 1rem;
}
input {
font-size: 1rem;
width: 100%;
height: 100%;
&:focus + label,
&:valid + label {
top: -0.65rem;
font-size: 0.85rem;
background-color: var(--surface-seven);
color: var(--text-one);
padding: 0 0.3rem;
}
}
}
</style>

View File

@@ -1,13 +0,0 @@
<script lang="ts">
// See: https://github.com/JonasKruckenberg/imagetools/blob/main/docs/directives.md#picture
import type { Picture } from 'vite-imagetools';
export let data: Picture;
export let alt: string;
</script>
<picture>
{#each Object.entries(data.sources) as [format, srcset]}
<source {srcset} type="image/{format}" />
{/each}
<img {alt} src={data.img.src} />
</picture>

View File

@@ -1,25 +0,0 @@
<script lang="ts">
import { onMount } from 'svelte';
import QRious from 'qrious/dist/qrious';
export let codeValue: string;
export let squareSize: number = 150;
onMount(() => {
new QRious({
element: document.getElementById('qrcode'),
value: codeValue,
size: squareSize
});
});
</script>
<canvas id="qrcode" />
<style>
canvas {
border-radius: 0.5rem;
background-color: white;
padding: 0.25rem;
}
</style>

View File

@@ -1,27 +0,0 @@
<script lang="ts">
import type { CreateQueryResult } from '@tanstack/svelte-query';
import { isRestoring } from '../../routes/+layout.svelte';
// I might try to get this merged into tanstack query.
// So basically, this is how you do generics here.
//https://github.com/sveltejs/language-tools/issues/273#issuecomment-1003496094
type T = $$Generic;
interface $$Slots {
default: {
// slot name
data: T;
};
}
// TODO: errors
export let query: CreateQueryResult<T, any>;
</script>
{#if !$isRestoring}
{#if $query.isSuccess}
<slot data={$query.data} />
{:else if $query.isError}
<slot name="error" />
{/if}
{/if}

View File

@@ -1,102 +0,0 @@
<script lang="ts">
import { fade } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import Close from 'svelte-material-icons/Close.svelte';
import Magnify from 'svelte-material-icons/Magnify.svelte';
export let title: string;
export let searchTerm: string | null;
export let displayedTerm: string | undefined;
function clear() {
searchTerm = '';
displayedTerm = '';
const url = new URL($page.url);
url.searchParams.delete('s');
goto(url.pathname + url.search);
}
</script>
<div class="search-container">
<div id="search">
<Magnify size="24px" color="var(--surface-six)" />
</div>
{#if searchTerm}
<div
id="clear"
on:click={clear}
on:keypress={clear}
transition:fade={{ easing: quintOut, duration: 250 }}
>
<Close size="24px" color="var(--surface-six)" />
</div>
{/if}
<input
type="text"
class:clear={searchTerm}
placeholder={title}
bind:value={searchTerm}
on:keyup
/>
</div>
<style lang="scss">
#search {
/* umm dont ask */
position: absolute;
z-index: 1;
left: 16px;
top: 14px;
height: 24px;
}
#clear {
position: absolute;
right: 16px;
top: 14px;
z-index: 1;
height: 24px;
cursor: pointer;
}
.search-container {
position: relative;
}
input {
position: relative;
display: flex;
padding: 1rem 3.25rem;
width: 100%;
color: var(--secondary);
font-weight: 500;
font-size: 0.92rem;
border-radius: 100px;
border: none;
background-color: var(--surface-nine);
outline: none;
transition: background-color 0.3s var(--bezier-one);
&:hover {
background-color: var(--surface-five);
}
&:focus::placeholder {
color: var(--primary);
}
&:focus {
background-color: var(--surface-two);
}
}
input::placeholder {
color: var(--text-four);
font-size: 0.9rem;
font-weight: 500;
transition: all 0.2s var(--bezier-one);
}
</style>

View File

@@ -1,44 +0,0 @@
<script lang="ts">
import { backIn, expoOut } from 'svelte/easing';
import { slide } from 'svelte/transition';
export let open = false;
export let dismissTime = 3000;
let timeout: ReturnType<typeof setTimeout>;
$: if (open) {
clearTimeout(timeout);
timeout = setTimeout(() => (open = false), dismissTime);
}
</script>
{#if open}
<div id="snackbar" in:slide={{ duration: 400, easing: expoOut }} out:slide={{ duration: 300, easing: backIn }}>
<slot name="text" />
</div>
{/if}
<style>
#snackbar {
display: flex;
align-items: center;
position: fixed;
bottom: 2rem;
left: 2rem;
padding: 0.5rem 1rem;
border-radius: 0.25rem;
min-width: 12.5rem;
max-width: 35rem;
height: 3rem;
background: var(--surface-one);
color: var(--text-two);
box-shadow: var(--drop-shadow-one);
font-size: 14px;
font-weight: 500;
z-index: 10;
}
</style>

View File

@@ -1,30 +0,0 @@
<div id="spinner" />
<style lang="scss">
@keyframes spinner {
to {
transform: rotate(360deg);
}
}
#spinner {
position: fixed;
top: 50%;
left: 50%;
width: 50px;
height: 50px;
transform: translate(-50%, -50%);
&:before {
content: '';
box-sizing: border-box;
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
border: 4.5px solid transparent;
border-top-color: var(--primary);
animation: spinner 0.6s linear infinite;
}
}
</style>

View File

@@ -1,16 +0,0 @@
<script lang="ts">
export let viewBoxHeight: number;
export let viewBoxWidth = viewBoxHeight;
export let svgHeight: number;
export let svgWidth = svgHeight;
</script>
<svg
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="none"
viewBox="0 0 {viewBoxHeight} {viewBoxWidth}"
style:height={svgHeight + 'px'}
style:width={svgWidth + 'px'}
>
<slot />
</svg>

View File

@@ -1,33 +0,0 @@
<script lang="ts">
import { tooltip } from 'svooltip';
import '../styles/ToolTip.scss';
export let content: string | undefined;
export let html: boolean = false;
</script>
{#if content}
<div
use:tooltip={{
content: content,
html: html
}}
>
<slot />
</div>
{:else}
<slot />
{/if}
<style>
:root {
--svooltip-bg: var(--surface-three);
--svooltip-text: var(--text-four);
--svooltip-padding: 0.75rem 1rem;
--svooltip-weight: bold;
--svooltip-text-size: 16px;
--svooltip-shadow: var(--drop-shadow-one);
--svooltip-arrow-size: 0;
--svooltip-roundness: 12px;
}
</style>

View File

@@ -1,64 +0,0 @@
<script>
export let visibility = true;
</script>
<svg
class="wave"
viewBox="0 0 1440 500"
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="none"
style="opacity: {visibility ? '100%' : '0'}; height: {visibility ? '40vh' : '0px'}"
>
<path class="wave" />
</svg>
<style>
svg {
transition: opacity 0.1s var(--bezier-one);
position: absolute;
bottom: -1px;
z-index: -1;
width: 100%;
}
@media (max-height: 780px) {
svg {
opacity: 0 !important;
}
}
.wave {
animation: wave-anim 30s;
animation-timing-function: cubic-bezier(0.5, 0, 0.5, 1);
animation-iteration-count: infinite;
fill: var(--primary);
}
@keyframes wave-anim {
0% {
d: path(
'M0 500C0 500 0 250 0 250 176.5333 300.1333 353.0667 350.2667 496 325 638.9333 299.7333 748.2667 199.0667 900 174 1051.7333 148.9333 1245.8667 199.4667 1440 250 1440 250 1440 500 1440 500Z'
);
}
25% {
d: path(
'M0 500C0 500 0 250 0 250 154.1333 219.2 308.2667 188.4 449 209 589.7333 229.6 717.0667 301.6 880 317 1042.9333 332.4 1241.4667 291.2 1440 250 1440 250 1440 500 1440 500Z'
);
}
50% {
d: path(
'M0 500C0 500 0 250 0 250 132.8 242.9333 265.6 235.8667 414 246 562.4 256.1333 726.4 283.4667 900 287 1073.6 290.5333 1256.8 270.2667 1440 250 1440 250 1440 500 1440 500Z'
);
}
75% {
d: path(
'M0 500C0 500 0 250 0 250 151.3333 206.6667 302.6667 163.3333 472 176 641.3333 188.6667 828.6667 257.3333 993 279 1157.3333 300.6667 1298.6667 275.3333 1440 250 1440 250 1440 500 1440 500Z'
);
}
100% {
d: path(
'M0 500C0 500 0 250 0 250 176.5333 300.1333 353.0667 350.2667 496 325 638.9333 299.7333 748.2667 199.0667 900 174 1051.7333 148.9333 1245.8667 199.4667 1440 250 1440 250 1440 500 1440 500Z'
);
}
}
</style>

1
src/lib/index.ts Normal file
View File

@@ -0,0 +1 @@
// place files you want to import through the `$lib` alias in this folder.

View File

@@ -1,74 +0,0 @@
import { readable, writable } from 'svelte/store';
import { is_logged_in, get_access_token } from './auth';
import { browser } from '$app/environment';
type AdminLoginInfo =
| {
logged_in: true;
expires: number;
logged_in_previously: boolean;
}
| {
logged_in: false;
expires: undefined;
logged_in_previously: boolean;
};
const admin_login_info = (): AdminLoginInfo => {
if (is_logged_in())
return {
logged_in: true,
expires: get_access_token()!.expires,
logged_in_previously: !!get_access_token()?.token
};
else
return {
logged_in: false,
expires: undefined,
logged_in_previously: !!get_access_token()?.token
};
};
export const admin_login = readable<AdminLoginInfo>(admin_login_info(), (set) => {
const checkLoginStatus = () => set(admin_login_info());
checkLoginStatus();
const interval = setInterval(checkLoginStatus, 100);
return () => clearInterval(interval);
});
export const read_announcements = writable<Set<number>>(new Set(), (set) => {
if (!browser) return;
const key = 'read_announcements';
const data = localStorage.getItem(key);
const parsedArray = data ? JSON.parse(data) : [];
const currentState = new Set(parsedArray);
const updateStoreState = () => {
set(currentState);
};
const handleLocalStorageUpdate = (e: StorageEvent) => {
if (e.key === key) updateStoreState();
};
window.addEventListener('storage', handleLocalStorageUpdate);
updateStoreState();
return () => {
window.removeEventListener('storage', handleLocalStorageUpdate);
localStorage.setItem(key, JSON.stringify(Array.from(currentState)));
};
});
read_announcements.subscribe((value) => {
if (!browser) return;
localStorage.setItem('read_announcements', JSON.stringify(Array.from(value)));
});
export const passed_login_with_creds = writable(false); // will only change when the user INPUTS the credentials, not if the session is just valid
export const allowAnalytics = writable(false);

View File

@@ -1,12 +0,0 @@
@use 'svooltip/styles.scss' as SvoolTip;
.svooltip a {
text-decoration: none;
color: var(--text-four);
pointer-events: all;
&:hover {
text-decoration: underline var(--secondary);
color: var(--secondary);
}
}

View File

@@ -1,107 +0,0 @@
export type ResponseAnnouncement = {
archived_at?: string;
attachments?: string[];
author?: string;
tags?: string[];
content?: string;
created_at: string;
id: number;
level?: number;
title: string;
};
export type Announcement = Omit<ResponseAnnouncement, 'id'>;
export type Tags = { name: string }[];
export interface Contributor {
name: string;
avatar_url: string;
url: string;
contributions: number;
}
export interface Contributable {
name: string;
url: string;
contributors: Contributor[];
}
export interface Patch {
name: string;
description: string;
use: boolean;
compatiblePackages: CompatiblePackage[] | null;
options: PatchOption[];
}
export interface CompatiblePackage {
name: string;
versions: string[] | null;
}
export interface PatchOption {
key: string;
title: string | null;
description: string;
required: boolean;
type: string;
default: any | null;
values: any[] | null;
}
export interface Release {
version: string;
created_at: string;
description: string;
download_url: string;
}
export interface TeamMember {
name: string;
avatar_url: string;
url: string;
bio?: string;
gpg_key: GpgKey;
}
export interface GpgKey {
id: string;
url: string;
}
export interface CryptoWallet {
network: string;
currency_code: string;
address: string;
preferred: boolean;
}
export interface DonationPlatform {
name: string;
url: string;
preferred: boolean;
}
export interface Social {
name: string;
url: string;
preferred: boolean;
}
interface Donations {
wallets: CryptoWallet[];
links: DonationPlatform[];
}
interface Contact {
email: string;
}
export interface About {
name: string;
about: string;
contact: Contact;
socials: Social[];
donations: Donations;
}

View File

@@ -1,36 +0,0 @@
<script lang="ts">
import Meta from '$lib/components/Head.svelte';
import { page } from '$app/stores';
import Button from '$lib/components/Button.svelte';
$: status = $page.status;
</script>
<Meta title={status.toString()} />
<section class="wrapper">
<h1>{status}</h1>
{#if status == 404}
<p>This page received a cease and desist letter from a multi-billion dollar tech company.</p>
<br />
<Button type="filled" href="/">Return home</Button>
{:else}
<p>
{$page.error?.message}
</p>
{/if}
</section>
<style>
section {
display: flex;
flex-direction: column;
width: fit-content;
text-align: center;
margin-top: 10rem;
}
h1 {
color: var(--primary);
}
</style>

View File

@@ -1,79 +1,11 @@
<script lang="ts" context="module">
import { writable } from 'svelte/store';
// There might be a better place to put this, but I am not entirely sure...
export const isRestoring = writable(false);
</script>
<script lang="ts">
import '../app.scss';
import { derived } from 'svelte/store';
import { onMount } from 'svelte';
import { browser } from '$app/environment';
import favicon from '$lib/assets/favicon.svg';
import { QueryClient } from '@tanstack/query-core';
import { persistQueryClient } from '@tanstack/query-persist-client-core';
import { QueryClientProvider } from '@tanstack/svelte-query';
import { createSyncStoragePersister } from '@tanstack/query-sync-storage-persister';
import { DateTriggerEventHandler } from 'datetrigger';
import NavHost from '$layout/Navbar/NavHost.svelte';
import Spinner from '$lib/components/Spinner.svelte';
import ConsentDialog from '$layout/Dialogs/ConsentDialog.svelte';
import { staleTime } from '$data/api';
import RouterEvents from '$data/RouterEvents';
import { events as themeEvents } from '$util/themeEvents';
import FooterHost from '$layout/Footer/FooterHost.svelte';
import { api_base_url, set_about_info } from '$data/api/settings';
const queryClient = new QueryClient({
defaultOptions: {
queries: {
enabled: browser,
cacheTime: staleTime
}
}
});
// Just like the set/clearInterval example found here: https://svelte.dev/docs#run-time-svelte-store-derived
const show_loading_animation = derived(
RouterEvents,
($event, set) => {
if ($event.navigating) {
// Wait 250 ms before showing the animation.
const timeout = setTimeout(() => set(true), 250);
return () => clearTimeout(timeout);
} else {
set(false);
}
},
false
);
onMount(() => {
set_about_info(api_base_url());
new DateTriggerEventHandler(themeEvents);
isRestoring.set(true);
const [unsubscribe, promise] = persistQueryClient({
queryClient,
persister: createSyncStoragePersister({ storage: localStorage })
});
promise.then(() => isRestoring.set(false));
return unsubscribe;
});
let { children } = $props();
</script>
<ConsentDialog />
<svelte:head>
<link rel="icon" href={favicon} />
</svelte:head>
<QueryClientProvider client={queryClient}>
<NavHost />
<div id="skiptab">
{#if $show_loading_animation}
<Spinner />
{:else}
<slot />
{/if}
</div>
<FooterHost />
</QueryClientProvider>
{@render children()}

View File

@@ -1 +0,0 @@
export const prerender = true;

View File

@@ -1,179 +1,2 @@
<script>
import HeroImage from '$layout/Hero/HeroImage.svelte';
import Home from '$layout/Hero/HeroSection.svelte';
import Head from '$lib/components/Head.svelte';
import Wave from '$lib/components/Wave.svelte';
import { onMount } from 'svelte';
let bottomVisibility = true;
const checkVisibility = () => {
const wave = document.querySelector('.wave');
bottomVisibility = !(wave && wave.getBoundingClientRect().bottom < window.innerHeight - 1);
};
onMount(() => {
checkVisibility(); // Initial check
});
</script>
<Head
schemas={[
{
'@context': 'https://schema.org',
'@type': 'Organization',
url: 'https://revanced.app/',
logo: 'https://revanced.app/logo.png'
},
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://revanced.app/'
}
]
},
{
'@context': 'https://schema.org',
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'What is ReVanced?',
acceptedAnswer: {
'@type': 'Answer',
text: 'ReVanced is an <b>open-source patcher</b> for <b>Android apps</b>. With ReVanced we <b>continue the legacy of Vanced</b>.'
}
},
{
'@type': 'Question',
name: 'How to get ReVanced?',
acceptedAnswer: {
'@type': 'Answer',
text: 'You can follow <a href="https://github.com/revanced/revanced-manager/tree/main/docs">ReVanced Manager documentation</a> to use <b>ReVanced Manager</b> or the <a href="https://github.com/revanced/revanced-cli/tree/main/docs">ReVanced CLI documentation</a> to use <b>ReVanced CLI</b>.'
}
},
{
'@type': 'Question',
name: 'How does it work?',
acceptedAnswer: {
'@type': 'Answer',
text: 'ReVanced uses a technique called <b>patching</b>. It patches <b>your choice of an app</b> and adds <b>new features</b> to it. Thanks to the <b>modularity of ReVanced</b>, you can choose <b>any combination of features you want</b> to use.'
}
},
{
'@type': 'Question',
name: 'Does ReVanced support non-rooted devices?',
acceptedAnswer: {
'@type': 'Answer',
text: '<b>Yes</b>! ReVanced supports <b>non-root and rooted devices</b>.'
}
},
{
'@type': 'Question',
name: 'Is ReVanced affiliated with Vanced?',
acceptedAnswer: {
'@type': 'Answer',
text: 'ReVanced is <b>not affiliated</b> with Vanced.'
}
},
{
'@type': 'Question',
name: 'How can I help?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Since we are an <b>open-source community</b> and depend on outside help, you can always check out our <a href="https://github.com/revanced">GitHub repositories</a> and <b>contribute to ReVanced</b> by creating an issue or pull requests.'
}
}
]
},
{
'@context': 'https://schema.org',
'@type': 'SoftwareApplication',
name: 'ReVanced Manager',
operatingSystem: 'ANDROID',
applicationCategory: 'UtilitiesApplication',
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.0',
ratingCount: '100'
},
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD'
}
},
{
'@context': 'https://schema.org',
'@type': 'SoftwareApplication',
name: 'ReVanced CLI',
operatingSystem: 'All',
applicationCategory: 'UtilitiesApplication',
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.0',
ratingCount: '30'
},
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD'
}
}
]}
/>
<svelte:window on:scroll={checkVisibility} on:resize={checkVisibility} />
<main class:visibility={!bottomVisibility}>
<div class="content">
<Home socialsVisibility={bottomVisibility} />
<div class="hero-img-container">
<HeroImage />
</div>
</div>
</main>
<Wave visibility={bottomVisibility} />
<style lang="scss">
.content {
display: flex;
align-items: flex-start;
justify-content: space-evenly;
width: min(87%, 80rem);
gap: 1rem;
}
main {
overflow: hidden;
padding: 5rem 0;
min-height: max(100vh, 600px);
display: flex;
flex-direction: column;
align-items: center;
@media (max-height: 600px), (max-width: 450px) and (max-height: 780px) {
min-height: initial;
}
@media (max-width: 335px) {
padding: 2rem 0 !important;
}
&.visibility {
min-height: initial;
}
}
.hero-img-container {
z-index: 0;
@media (max-width: 1100px) {
display: none;
}
}
</style>
<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>

View File

@@ -1,195 +0,0 @@
<script lang="ts">
import { createQuery } from '@tanstack/svelte-query';
import { derived, readable, type Readable } from 'svelte/store';
import { building } from '$app/environment';
import { page } from '$app/stores';
import { fly, slide } from 'svelte/transition';
import { quintIn, quintOut } from 'svelte/easing';
import Query from '$lib/components/Query.svelte';
import AnnouncementCard from './AnnouncementCard.svelte';
import { queries } from '$data/api';
import TagsHost from './TagsHost.svelte';
import Search from '$lib/components/Search.svelte';
import { onMount } from 'svelte';
import type { ResponseAnnouncement } from '$lib/types';
import { admin_login, read_announcements } from '$lib/stores';
import Button from '$lib/components/Button.svelte';
import moment from 'moment';
import { debounce } from '$util/debounce';
import createFilter from '$util/filter';
import ChevronDown from 'svelte-material-icons/ChevronDown.svelte';
import Create from 'svelte-material-icons/Plus.svelte';
let expanded = false;
const searchParams: Readable<URLSearchParams> = building
? readable(new URLSearchParams())
: derived(page, ($page) => $page.url.searchParams);
let searchTerm = $searchParams.get('s') || '';
let displayedTerm = '';
$: query = createQuery(queries.announcements());
$: tagsQuery = createQuery(queries.announcementTags());
$: selectedTags = $searchParams.getAll('tag');
const update = () => {
displayedTerm = searchTerm;
const url = new URL(window.location.href);
url.pathname = '/announcements';
searchTerm ? url.searchParams.set('s', searchTerm) : url.searchParams.delete('s');
};
const archivedAnnouncements = (announcements: ResponseAnnouncement[]) =>
announcements.filter((a) => a.archived_at && moment(a.archived_at).isBefore(moment()));
const activeAnnouncements = (announcements: ResponseAnnouncement[]) =>
announcements.filter((a) => !a.archived_at || moment(a.archived_at).isAfter(moment()));
const filterAnnouncements = (
announcements: ResponseAnnouncement[],
search: string,
tags: string[]
): ResponseAnnouncement[] => {
const announcementFilter = createFilter(announcements, {
searcherOptions: { keys: ['title', 'content'] },
additionalFilter: (a: ResponseAnnouncement, tags: string[]) =>
tags.length === 0 || tags.some((tag) => a.tags?.includes(tag))
});
return announcementFilter(tags, search);
};
onMount(() => {
debounce(update)();
if ($read_announcements.size === 0) {
query.subscribe((data) => {
read_announcements.update((set) => {
const updated = new Set(set);
data.data?.announcements.forEach((a) => updated.add(a.id));
return updated;
});
});
}
});
</script>
<div class="search">
<div class="search-contain">
<!-- Must bind both variables: we get searchTerm from the text input, -->
<div class="search-bar">
<Search
bind:searchTerm
bind:displayedTerm
title="Search for announcements"
on:keyup={debounce(update)}
/>
</div>
{#if $admin_login.logged_in}
<Button type="filled" icon={Create} href="/announcements/create">Create</Button>
{/if}
</div>
</div>
<main class="wrapper" in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<Query query={tagsQuery} let:data>
<TagsHost tags={data.tags} />
</Query>
<Query {query} let:data>
{#if activeAnnouncements(filterAnnouncements(data.announcements, displayedTerm, selectedTags)).length}
<div class="cards">
{#each activeAnnouncements(filterAnnouncements(data.announcements, displayedTerm, selectedTags)) as announcement}
<div in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<AnnouncementCard {announcement} />
</div>
{/each}
</div>
{/if}
{#if archivedAnnouncements(filterAnnouncements(data.announcements, displayedTerm, selectedTags)).length}
<div
role="button"
class="expand-archived"
aria-expanded={expanded}
on:click={() => (expanded = !expanded)}
on:keypress={() => (expanded = !expanded)}
tabindex="0"
>
<h4>Archive</h4>
<div id="arrow" style:transform={expanded ? 'rotate(-180deg)' : 'rotate(0deg)'}>
<ChevronDown size="24px" color="var(--surface-six)" />
</div>
</div>
{#if expanded}
<div
class="cards"
in:slide={{ easing: quintIn, duration: 250 }}
out:slide={{ easing: quintOut, duration: 250 }}
>
{#each archivedAnnouncements(filterAnnouncements(data.announcements, displayedTerm, selectedTags)) as announcement}
<AnnouncementCard {announcement} />
{/each}
</div>
{/if}
{/if}
</Query>
</main>
<style lang="scss">
main {
display: flex;
flex-direction: column;
gap: 1rem;
}
.expand-archived {
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
user-select: none;
padding-inline: 0.25rem;
#arrow {
height: 1.5rem;
transition: all 0.2s var(--bezier-one);
}
}
.search {
padding-top: 0.6rem;
padding-bottom: 1.25rem;
background-color: var(--surface-eight);
.search-contain {
display: flex;
justify-content: center;
gap: 1rem;
margin-inline: auto;
width: min(90%, 80rem);
.search-bar {
flex: 1;
}
}
}
.cards {
display: grid;
grid-template-columns: repeat(3, 1fr);
width: 100%;
gap: 16px;
@media (max-width: 768px) {
display: flex;
flex-direction: column;
}
}
</style>

View File

@@ -1,161 +0,0 @@
<script lang="ts">
import moment from 'moment';
import { onMount } from 'svelte';
import type { ResponseAnnouncement } from '$lib/types';
import NewHeader from './NewHeader.svelte';
import { queries } from '$data/api';
import { dev_log } from '$util/dev';
import { useQueryClient } from '@tanstack/svelte-query';
import { read_announcements } from '$lib/stores';
import TagsHost from './TagsHost.svelte';
import Content from './[slug]/Content.svelte';
import ToolTip from '$lib/components/ToolTip.svelte';
import { relativeTime } from '$util/relativeTime';
import Archive from 'svelte-material-icons/ArchiveOutline.svelte';
export let announcement: ResponseAnnouncement;
const client = useQueryClient();
$: isRead = $read_announcements.has(announcement.id);
function prefetch() {
const query = queries['announcementById'](announcement.id);
dev_log('Prefetching', query);
client.prefetchQuery(query);
}
function setAnnouncementRead() {
read_announcements.update((set) => {
const updated = new Set(set);
updated.add(announcement.id);
return updated;
});
}
function generateSlug(title: string) {
return title
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '');
}
</script>
<!-- svelte-ignore a11y-no-static-element-interactions -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<a
data-sveltekit-preload-data
on:mouseenter={prefetch}
href={`/announcements/${announcement.id}-${generateSlug(announcement.title)}`}
on:click={setAnnouncementRead}
>
<div
class="card"
class:attachment={announcement.attachments && announcement.attachments.length > 0}
>
{#if isRead !== undefined && !isRead}
<NewHeader />
{/if}
{#if announcement.attachments && announcement.attachments.length > 0}
<img
src={announcement.attachments[0]}
class={isRead === undefined || isRead ? '' : 'no-border-radius'}
alt="Banner"
onerror="this.style.display='none'"
/>
{/if}
<div class="content">
<div class="header">
<h3>{announcement.title}</h3>
<span>
{relativeTime(announcement.created_at)}
{#if announcement.archived_at && moment(announcement.archived_at).isBefore(moment())}
<ToolTip
content={`This announcement was archived ${relativeTime(announcement.archived_at)}`}
>
<Archive size="24" />
</ToolTip>
{/if}
</span>
</div>
<div class="footer">
{#if announcement.content}
<Content content={announcement.content} clamp={true} />
{/if}
{#if announcement.tags && announcement.tags.length > 0}
<hr />
<TagsHost tags={announcement.tags.map((tag) => ({ name: tag }))} clickable={false} />
{/if}
</div>
</div>
</div>
</a>
<style lang="scss">
a {
text-decoration: inherit;
}
.card {
&.attachment {
grid-row: span 2;
}
&:hover {
background-color: var(--surface-four);
filter: none;
}
display: flex;
flex-direction: column;
height: 100%;
background-color: var(--surface-seven);
border: 1px solid var(--border);
border-radius: 12px;
img {
height: 150px;
object-fit: cover;
width: 100%;
border-radius: 12px 12px 0px 0px;
&.no-border-radius {
border-radius: 0;
}
}
.content {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 12px;
height: 100%;
padding: 12px 16px;
color: var(--text-four);
.header,
.footer {
display: flex;
flex-direction: column;
overflow-wrap: anywhere;
span {
display: flex;
gap: 4px;
img {
height: 24px;
width: 24px;
}
}
}
.footer {
gap: 12px;
}
}
}
</style>

View File

@@ -1,14 +0,0 @@
<span>NEW</span>
<style>
span {
text-align: center;
background-color: var(--surface-four);
color: var(--primary);
font-weight: bold;
padding: 4px 0;
border-radius: 12px 12px 0 0;
pointer-events: none;
letter-spacing: 0.05em;
}
</style>

View File

@@ -1,64 +0,0 @@
<script lang="ts">
import Check from 'svelte-material-icons/Check.svelte';
export let tag: string;
export let clickable: boolean = true;
export let selected: boolean = false;
export let onClick: (event?: MouseEvent) => void = () => {};
selected = clickable && selected;
</script>
<button class:selected class:clickable on:click={clickable ? onClick : () => {}}>
{#if selected && clickable}
<div class="icon">
<Check />
</div>
{/if}
{tag}
</button>
<style lang="scss">
button {
display: flex;
justify-content: center;
align-items: center;
gap: 8px;
height: 32px;
padding: 0 12px;
border-radius: 8px;
border: none;
background-color: var(--tertiary);
color: var(--text-four);
letter-spacing: 0.02rem;
font-size: 0.85rem;
user-select: none;
transition: all 0.2s var(--bezier-one);
&.clickable {
background-color: transparent;
border: 1px solid var(--border);
&.selected {
border-color: transparent;
background-color: var(--tertiary);
color: var(--primary);
.icon {
display: inherit;
margin-left: -6px;
transition: none;
}
}
&:hover {
background-color: var(--surface-three);
}
}
}
</style>

View File

@@ -1,85 +0,0 @@
<script lang="ts">
import TagChip from './TagChip.svelte';
import { derived } from 'svelte/store';
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import type { Tags } from '$lib/types';
import Button from '$lib/components/Button.svelte';
import ChevronDown from 'svelte-material-icons/ChevronDown.svelte';
export let tags: Tags;
export let expandable: boolean = false;
export let clickable: boolean = true;
let showAllTags = expandable ? false : true;
const searchParams = derived(page, ($page) => $page.url.searchParams);
$: selectedTags = $searchParams.getAll('tag');
$: displayedTags = (() => {
if (showAllTags) return tags.map((tag) => tag.name);
if (selectedTags.length > 0) {
return [tags[0]?.name, ...selectedTags.filter((tag) => tag !== tags[0]?.name)];
}
return tags.length > 0 ? [tags[0]?.name] : [];
})();
const handleClick = (tag: string) => {
const url = new URL(window.location.href);
const params = new URLSearchParams(url.search);
if (params.getAll('tag').includes(tag)) params.delete('tag', tag);
else params.append('tag', tag);
url.search = params.toString();
goto(url.pathname + url.search);
window.scrollTo({ top: 0, behavior: 'smooth' });
};
</script>
<div>
{#each displayedTags as tag}
<TagChip
{tag}
selected={$searchParams.getAll('tag').includes(tag)}
onClick={() => handleClick(tag)}
{clickable}
/>
{/each}
{#if expandable && tags.length > 1}
<li>
<Button type="text" on:click={() => (showAllTags = !showAllTags)}>
<div
class="expand-arrow"
style:transform={showAllTags ? 'rotate(90deg)' : 'rotate(-90deg)'}
>
<ChevronDown size="24px" color="var(--surface-six)" />
</div>
</Button>
</li>
{/if}
</div>
<style lang="scss">
div {
display: flex;
align-items: center;
flex-wrap: wrap;
white-space: nowrap;
gap: 4px;
li {
display: flex;
align-items: center;
}
.expand-arrow {
transition: all 0.2s var(--bezier-one);
user-select: none;
height: 1.5rem;
}
}
</style>

View File

@@ -1 +0,0 @@
export const prerender = false;

View File

@@ -1,48 +0,0 @@
<script lang="ts">
import { fly } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import { createQuery } from '@tanstack/svelte-query';
import { queries } from '$data/api';
import { page } from '$app/stores';
import Announcement from './Announcement.svelte';
import Query from '$lib/components/Query.svelte';
let announcementIdNumber: number | undefined = undefined;
let isCreating: boolean = false;
$: {
const lastSegment = $page.url.pathname.split('/').pop();
isCreating = lastSegment === 'create';
announcementIdNumber = isCreating ? undefined : Number(lastSegment.split('-')[0]);
}
$: query = announcementIdNumber
? createQuery(queries.announcementById(announcementIdNumber))
: null;
$: announcement = $query?.data?.announcement || undefined;
$: slug = announcement?.title
? announcement.title
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '')
: '';
$: {
const slugPathname = `/announcements/${announcementIdNumber}-${slug}`;
if (slug && $page.url.pathname !== slugPathname) {
window.history.replaceState(null, '', slugPathname);
}
}
</script>
<main class="wrapper" in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
{#if query}
<Query {query}>
<Announcement {isCreating} {announcement} {announcementIdNumber} {query} />
</Query>
{:else}
<Announcement {isCreating} {announcement} {announcementIdNumber} />
{/if}
</main>

View File

@@ -1,177 +0,0 @@
<script lang="ts">
import { useQueryClient, type CreateQueryResult } from '@tanstack/svelte-query';
import { admin, queries } from '$data/api';
import { goto } from '$app/navigation';
import Button from '$lib/components/Button.svelte';
import Dialog from '$layout/Dialogs/Dialog.svelte';
import type { Announcement, ResponseAnnouncement } from '$lib/types';
import moment from 'moment';
import { isValidUrl } from '$util/isValidUrl';
import Delete from 'svelte-material-icons/DeleteOutline.svelte';
import Edit from 'svelte-material-icons/PencilOutline.svelte';
import Archive from 'svelte-material-icons/ArchiveArrowDownOutline.svelte';
import Close from 'svelte-material-icons/Close.svelte';
import Check from 'svelte-material-icons/Check.svelte';
import Show from 'svelte-material-icons/EyeOutline.svelte';
import Hide from 'svelte-material-icons/EyeOffOutline.svelte';
import Unarchive from 'svelte-material-icons/ArchiveArrowUpOutline.svelte';
import { formatUTC } from '$util/formatUtc';
export let isEditing: boolean;
export let isCreating: boolean;
export let isPreviewing: boolean;
export let archivedAtInput: string | undefined;
export let showDeleteConfirm: boolean;
export let announcementIdNumber: number | undefined;
export let draftInputs: Announcement;
export let query: CreateQueryResult<{ announcement: ResponseAnnouncement }, unknown> | undefined;
const client = useQueryClient();
const toggleArchived = () => {
if (archivedAtInput) archivedAtInput = undefined;
else archivedAtInput = moment().format('YYYY-MM-DDTHH:mm');
};
const isValid = () => {
const hasEmptyTitle = !draftInputs.title;
const hasEmptyAttachments = draftInputs.attachments?.some((a) => !isValidUrl(a));
if (hasEmptyTitle || hasEmptyAttachments) {
alert(
`${[hasEmptyTitle && 'Title', hasEmptyAttachments && 'Attachments']
.filter(Boolean)
.join(' and ')} must be filled properly`
);
return false;
}
return true;
};
const sanitize = (draftInputs: Announcement) => {
return {
...draftInputs,
content: draftInputs.content?.trim() || undefined,
tags: draftInputs.tags && draftInputs.tags.length > 0 ? draftInputs.tags : undefined,
archived_at: draftInputs.archived_at?.trim() || undefined,
attachments:
draftInputs.attachments && draftInputs.attachments?.length > 0
? draftInputs.attachments
: undefined,
author: draftInputs.author?.trim() || undefined,
level: draftInputs.level ?? undefined
};
};
const save = async () => {
if (!isValid()) return;
Object.assign(draftInputs, {
created_at: formatUTC(draftInputs.created_at),
archived_at: formatUTC(draftInputs.archived_at)
});
await admin.update_announcement(announcementIdNumber!, sanitize(draftInputs));
await $query?.refetch();
isEditing = false;
};
const createAnnouncement = async () => {
if (!isValid()) return;
Object.assign(draftInputs, {
created_at: formatUTC(draftInputs.created_at),
archived_at: formatUTC(draftInputs.archived_at)
});
await admin.create_announcement(sanitize(draftInputs));
await client.invalidateQueries(queries.announcements());
goto('/announcements', { invalidateAll: true });
};
const deleteAnnouncement = async () => {
admin.delete_announcement(announcementIdNumber!);
await client.invalidateQueries(queries['announcements']());
goto('/announcements', { invalidateAll: true });
};
const handleUnload = (e: BeforeUnloadEvent) => {
if (isEditing) {
e.preventDefault();
e.returnValue = '';
}
};
</script>
<svelte:window on:beforeunload={handleUnload} />
<Dialog bind:dialogOpen={showDeleteConfirm}>
<svelte:fragment slot="title">Confirm?</svelte:fragment>
<svelte:fragment slot="description">Do you want to delete this announcement?</svelte:fragment>
<svelte:fragment slot="buttons">
<Button type="text" on:click={() => (showDeleteConfirm = !showDeleteConfirm)}>Cancel</Button>
<Button type="filled" on:click={deleteAnnouncement}>OK</Button>
</svelte:fragment>
</Dialog>
<div>
{#if isEditing || isCreating}
<Button
toolTipText={isPreviewing ? 'Hide preview' : 'Show preview'}
icon={isPreviewing ? Hide : Show}
iconColor="var(--secondary)"
on:click={() => (isPreviewing = !isPreviewing)}
/>
<Button
toolTipText={archivedAtInput ? 'Disable archive field' : 'Enable archive field'}
icon={archivedAtInput ? Unarchive : Archive}
iconColor="var(--secondary)"
on:click={toggleArchived}
/>
{#if isEditing}
<Button
toolTipText="Cancel editing"
icon={Close}
iconColor="var(--secondary)"
on:click={() => {
isPreviewing = false;
isEditing = false;
}}
/>
{/if}
<Button
toolTipText={isEditing ? 'Save changes' : 'Create announcement'}
icon={Check}
iconColor="var(--secondary)"
on:click={isEditing ? save : createAnnouncement}
/>
{:else}
<Button
toolTipText="Delete announcement"
icon={Delete}
iconColor="var(--secondary)"
on:click={() => (showDeleteConfirm = !showDeleteConfirm)}
/>
<Button
toolTipText="Edit announcement"
icon={Edit}
iconColor="var(--secondary)"
on:click={() => (isEditing = !isEditing)}
/>
{/if}
</div>
<style>
div {
display: flex;
gap: 1rem;
color: var(--secondary);
}
</style>

View File

@@ -1,121 +0,0 @@
<script lang="ts">
import { admin_login } from '$lib/stores';
import Title from './Title.svelte';
import Divider from '$lib/components/Divider.svelte';
import AdminButtons from './AdminButtons.svelte';
import Author from './Author.svelte';
import Date from './Date.svelte';
import Content from './Content.svelte';
import Attachments from './Attachments.svelte';
import Tags from './Tags.svelte';
import type { Announcement, ResponseAnnouncement } from '$lib/types';
import type { CreateQueryResult } from '@tanstack/svelte-query';
export let isCreating: boolean;
export let announcement: Announcement | undefined;
export let announcementIdNumber: number | undefined;
export let query: CreateQueryResult<{ announcement: ResponseAnnouncement }, unknown> | undefined =
undefined;
let isPreviewing = false;
let isEditing = false;
let showDeleteConfirm = false;
const draftInputs: Announcement = {
...announcement,
id: undefined
};
</script>
<div class="card">
<div class="header">
<div>
<Title
{isCreating}
{isEditing}
{isPreviewing}
title={announcement?.title}
bind:titleInput={draftInputs.title}
/>
<h4>
<Date
{isCreating}
{isEditing}
{isPreviewing}
createdAt={announcement?.created_at}
archivedAt={announcement?.archived_at}
bind:archivedAtInput={draftInputs.archived_at}
bind:createdAtInput={draftInputs.created_at}
/>
<Author
{isCreating}
{isEditing}
{isPreviewing}
author={announcement?.author}
bind:authorInput={draftInputs.author}
/>
</h4>
<Tags {isCreating} {isEditing} {isPreviewing} bind:tagsInput={draftInputs.tags} />
</div>
{#if $admin_login.logged_in}
<AdminButtons
{isCreating}
bind:isEditing
bind:isPreviewing
bind:showDeleteConfirm
bind:archivedAtInput={draftInputs.archived_at}
{draftInputs}
{announcementIdNumber}
{query}
/>
{/if}
</div>
<Divider />
<Content
{isCreating}
{isEditing}
{isPreviewing}
content={announcement?.content}
bind:contentInput={draftInputs.content}
/>
<Attachments
{isCreating}
{isEditing}
{isPreviewing}
attachments={announcement?.attachments}
bind:attachmentsInput={draftInputs.attachments}
/>
</div>
<style lang="scss">
.card {
background-color: var(--surface-eight);
display: flex;
flex-direction: column;
padding: 2rem;
margin-bottom: 3rem;
border-radius: 1rem;
}
.header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
gap: 2rem;
}
@media (max-width: 768px) {
.card {
background-color: initial;
padding: 0;
border-radius: 0;
}
}
</style>

View File

@@ -1,154 +0,0 @@
<script lang="ts">
import Button from '$lib/components/Button.svelte';
import Divider from '$lib/components/Divider.svelte';
import Gallery from '$lib/components/Gallery.svelte';
import { isValidUrl } from '$util/isValidUrl';
import Create from 'svelte-material-icons/Plus.svelte';
import Delete from 'svelte-material-icons/DeleteOutline.svelte';
export let isEditing: boolean;
export let isCreating: boolean;
export let isPreviewing: boolean;
export let attachments: string[] | undefined;
export let attachmentsInput: string[] | undefined;
let newAttachment: string | null = null;
const isValidAnnouncement = (attachment: string | null) => {
return attachment && attachment && isValidUrl(attachment);
};
const addAttachment = (attachment: string | null) => {
if (!isValidAnnouncement(attachment)) return;
attachmentsInput = [...(attachmentsInput ?? []), attachment ? attachment : ''];
return true;
};
const removeAttachment = (index: number) => {
if (!attachmentsInput) return;
attachmentsInput = attachmentsInput.filter((_, i) => i !== index);
};
$: displayAttachments = isPreviewing ? attachmentsInput : attachments;
</script>
{#if (isEditing || isCreating) && !isPreviewing}
<Divider />
<div class="attachments-wrapper">
{#if attachmentsInput}
{#each attachmentsInput as attachment, index}
<div class="attachments">
<input
bind:value={attachmentsInput[index]}
class:empty={!attachment || (attachment && !isValidUrl(attachment))}
placeholder="Attachment URL"
/>
<button
class:last={index == attachmentsInput.length - 1}
on:click={() => removeAttachment(index)}
>
<Delete size="24" color="var(--text-four)" />
</button>
</div>
{/each}
{/if}
<span id="new-attachment">
<input
bind:value={newAttachment}
class:empty={!isValidAnnouncement(newAttachment)}
on:blur={() => {
addAttachment(newAttachment);
newAttachment = null;
}}
on:keydown={(event) => {
if (event.key === 'Enter' && addAttachment(newAttachment)) newAttachment = null;
}}
/>
<span>
<Button icon={Create} />
</span>
</span>
</div>
{:else if displayAttachments && displayAttachments?.length > 0}
<Divider />
<Gallery images={displayAttachments} />
{/if}
<style lang="scss">
button {
display: flex;
justify-content: center;
background-color: transparent;
border: none;
cursor: pointer;
}
input {
width: 100%;
padding-right: 40px;
letter-spacing: 0.02rem;
font-size: 0.85rem;
transition: all 0.2s var(--bezier-one);
&:focus {
outline: none;
border: 1px solid var(--primary);
}
&.empty {
border: 1px solid var(--red-one);
}
}
#new-attachment {
display: inline-flex;
align-items: center;
position: relative;
input {
width: 52px;
border: 1px solid var(--border);
padding-right: 0;
&:focus {
width: 100%;
+ span {
display: none;
}
&.empty {
border: 1px solid var(--red-one);
}
}
}
span {
pointer-events: none;
position: absolute;
left: 15.5px;
}
}
.attachments-wrapper {
display: flex;
flex-direction: column;
width: 100%;
gap: 1rem;
.attachments {
display: flex;
justify-content: center;
align-items: center;
position: relative;
gap: 1rem;
button {
position: absolute;
right: 10px;
top: 14px;
}
}
}
</style>

View File

@@ -1,38 +0,0 @@
<script lang="ts">
export let isEditing: boolean;
export let isCreating: boolean;
export let isPreviewing: boolean;
export let author: string | undefined;
export let authorInput: string | undefined;
$: displayAuthor = isPreviewing ? authorInput : author;
</script>
{#if (isEditing || isCreating) && !isPreviewing}
·
<input
bind:value={authorInput}
class:empty={!authorInput?.trim()}
placeholder="Enter author name"
/>
{:else if displayAuthor}
·
<span>
{displayAuthor}
</span>
{/if}
<style lang="scss">
input {
&,
&:focus {
border: none;
outline: none;
border-radius: 0;
}
padding: 0;
font-size: 1rem;
letter-spacing: 0.02rem;
}
</style>

View File

@@ -1,112 +0,0 @@
<script lang="ts">
export let isEditing: boolean = false;
export let isCreating: boolean = false;
export let isPreviewing: boolean = false;
export let content: string | undefined;
export let contentInput: string | undefined = undefined;
export let clamp: boolean = false;
$: displayContent = isPreviewing ? contentInput : content;
</script>
{#if (isEditing || isCreating) && !isPreviewing}
<textarea bind:value={contentInput} class:empty={!content?.trim()} placeholder="Enter content" />
{:else if displayContent}
<div class:clamp>
{@html displayContent}
</div>
{/if}
<style lang="scss">
textarea {
&,
&:focus {
border: none;
outline: none;
border-radius: 0;
}
padding: 0;
font-size: 1rem;
letter-spacing: 0.02rem;
}
div {
color: var(--text-four);
&.clamp {
display: -webkit-inline-box;
line-clamp: 3;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
:global(a) {
pointer-events: none;
}
:global(h1),
:global(h2),
:global(h3),
:global(h4),
:global(h5),
:global(h6) {
color: var(--secondary);
line-height: 1.75rem;
margin: 0;
}
}
:global(a) {
color: var(--primary);
font-weight: 600;
font-size: 0.95rem;
text-decoration: none;
&:hover {
text-decoration: underline var(--secondary);
color: var(--text-one);
}
}
:global(h2),
:global(h3),
:global(h4),
:global(h5),
:global(h6) {
color: var(--secondary);
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
:global(h1) {
font-size: 1.8rem;
}
:global(h2) {
font-size: 1.6rem;
}
:global(h3) {
font-size: 1.4rem;
}
:global(h4) {
font-size: 1.2rem;
}
:global(h5) {
font-size: 1.1rem;
}
:global(h6) {
font-size: 1rem;
}
:global(li) {
list-style-position: inside;
font-size: 0.9rem;
font-weight: 500;
}
}
</style>

View File

@@ -1,71 +0,0 @@
<script lang="ts">
import { relativeTime } from '$util/relativeTime';
import moment from 'moment';
import ArrowRight from 'svelte-material-icons/ArrowRight.svelte';
export let isEditing: boolean;
export let isCreating: boolean;
export let isPreviewing: boolean;
export let createdAt: string | undefined;
export let createdAtInput: string | undefined;
export let archivedAt: string | undefined;
export let archivedAtInput: string | undefined;
if (createdAtInput) {
createdAtInput = moment(createdAtInput).format('YYYY-MM-DDTHH:mm');
} else {
createdAtInput = moment().format('YYYY-MM-DDTHH:mm');
}
$: displayCreatedAt = isPreviewing ? createdAtInput : createdAt;
$: displayArchivedAt = (() => {
const date = isPreviewing ? archivedAtInput : archivedAt;
return date && moment(date).isBefore() ? date : null;
})();
</script>
{#if (isEditing || isCreating) && !isPreviewing}
<span>
<input type="datetime-local" max="9999-12-31T23:59" bind:value={createdAtInput} />
{#if archivedAtInput}
<ArrowRight size="24" />
<input type="datetime-local" max="9999-12-31T23:59" bind:value={archivedAtInput} />
{/if}
</span>
{:else if displayCreatedAt}
<span>
{relativeTime(displayCreatedAt)}
{#if displayArchivedAt}
<ArrowRight size="24" />
{relativeTime(displayArchivedAt)}
{/if}
</span>
{/if}
<style lang="scss">
span {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
column-gap: 1rem;
}
input {
&,
&:focus {
border: none;
outline: none;
border-radius: 0;
}
&::-webkit-calendar-picker-indicator {
filter: invert(88%) sepia(60%) saturate(4731%) hue-rotate(173deg) brightness(91%)
contrast(111%);
}
padding: 0;
font-size: 1rem;
letter-spacing: 0.02rem;
}
</style>

View File

@@ -1,117 +0,0 @@
<script lang="ts">
import Button from '$lib/components/Button.svelte';
import TagChip from '../TagChip.svelte';
import { createQuery } from '@tanstack/svelte-query';
import { queries } from '$data/api';
import Query from '$lib/components/Query.svelte';
import Create from 'svelte-material-icons/Plus.svelte';
export let isEditing: boolean;
export let isCreating: boolean;
export let isPreviewing: boolean;
export let tagsInput: string[];
$: query = createQuery(queries.announcementTags());
$: tags = $query.data?.tags || [];
let newTag: string | null;
function handleTag(tag: string | null) {
if (!tag) return;
if (tags.some((t) => t.name === tag)) {
if (tagsInput?.includes(tag)) {
tagsInput = tagsInput.filter((t) => t !== tag);
if (!$query.data?.tags.some((t) => t.name === tag)) {
tags = tags.filter((t) => t.name !== tag);
}
} else {
tagsInput = [...(tagsInput || []), tag];
}
} else {
tags = [...tags, { name: tag }];
tagsInput = [...(tagsInput || []), tag];
}
newTag = null;
}
</script>
{#if (isEditing || isCreating) && !isPreviewing}
<Query {query}>
<div>
{#each tags as tag}
<TagChip
tag={tag.name}
selected={tagsInput && tagsInput.includes(tag.name)}
onClick={() => handleTag(tag.name)}
/>
{/each}
<div id="new-tag">
<input
bind:value={newTag}
class:empty={!newTag}
on:blur={() => handleTag(newTag)}
on:keydown={(event) => {
if (event.key === 'Enter') handleTag(newTag);
}}
/>
<span>
<Button icon={Create} iconColor="var(--text-four)" />
</span>
</div>
</div>
</Query>
{/if}
<style lang="scss">
div {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 4px;
}
#new-tag {
display: inline-flex;
position: relative;
input {
&,
&:focus {
border: none;
outline: none;
}
&:focus {
width: 100%;
+ span {
display: none;
}
}
width: 38px;
}
span {
pointer-events: none;
position: absolute;
left: 9px;
top: 6px;
}
}
input {
height: 32px;
border-radius: 8px;
background-color: var(--tertiary);
color: var(--text-four);
letter-spacing: 0.02rem;
font-size: 0.85rem;
transition: all 0.2s var(--bezier-one);
}
</style>

View File

@@ -1,41 +0,0 @@
<script lang="ts">
export let isEditing: boolean;
export let isCreating: boolean;
export let isPreviewing: boolean;
export let title: string | undefined;
export let titleInput: string;
$: displayTitle = isPreviewing ? titleInput : title;
</script>
{#if (isEditing || isCreating) && !isPreviewing}
<input bind:value={titleInput} class:empty={!titleInput?.trim()} placeholder="Enter title" />
{:else if displayTitle}
<h1>
{displayTitle}
</h1>
{/if}
<style lang="scss">
h1 {
font-size: 2.5rem;
}
input {
&,
&:focus {
border: none;
outline: none;
border-radius: 0;
}
width: 100%;
padding: 0;
color: var(--text-one);
font-size: 2.5rem;
font-weight: 700;
line-height: 4rem;
letter-spacing: -0.025em;
}
</style>

View File

@@ -1,119 +0,0 @@
<script lang="ts">
import { fly } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import ContributorHost from './ContributorSection.svelte';
import Head from '$lib/components/Head.svelte';
import Query from '$lib/components/Query.svelte';
import { queries } from '$data/api';
import { createQuery } from '@tanstack/svelte-query';
const query = createQuery(queries.contributors());
</script>
<Head
title="Contributors of ReVanced"
description="ReVanced is made possible by the community. Check out the people who have contributed to the project and how you can contribute too."
schemas={[
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://revanced.app/'
},
{
'@type': 'ListItem',
position: 2,
name: 'Contributors',
item: 'https://revanced.app/contributors'
}
]
}
]}
/>
<div class="wrapper">
<div class="text-container" in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<h2>Made possible by the community.</h2>
<p>
Want to show up here? <span>
<a href="https://github.com/revanced" target="_blank" rel="noreferrer"
>Become a contributor
</a>
</span>
</p>
</div>
<div class="repos">
<Query {query} let:data>
{#each data.contributables as { name, url, contributors }}
<div in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<ContributorHost {name} {url} {contributors} />
</div>
{/each}
</Query>
</div>
</div>
<style>
.wrapper {
margin-bottom: 5rem;
}
.repos {
display: flex;
flex-direction: column;
gap: 2rem;
}
h2 {
text-align: center;
color: var(--text-three);
margin-bottom: 0.3rem;
}
p {
text-align: center;
color: var(--text-three);
}
.text-container {
display: flex;
align-items: center;
flex-direction: column;
margin-bottom: 2rem;
background-color: var(--primary);
padding: 2.5rem 1.75rem;
border-radius: 20px;
}
a {
text-decoration: none;
color: var(--text-three);
}
a::after {
padding-left: 5px;
content: '→';
position: absolute;
transition: all 0.3s var(--bezier-one);
}
a:hover {
text-decoration: underline var(--text-three);
}
a:hover::after {
transform: translateX(5px);
}
@media (max-width: 768px) {
.text-container {
padding: 2rem 1.75rem;
}
}
</style>

View File

@@ -1,65 +0,0 @@
<script lang="ts">
export let name: string;
export let pfp: string;
export let url: string;
let alt = `${name}'s profile picture`;
</script>
<a href={url} rel="noreferrer" target="_blank">
<img src={pfp} {alt} />
<h5>{name}</h5>
</a>
<style lang="scss">
a {
color: var(--text-one);
text-decoration: none;
cursor: pointer;
padding: 0.9rem 1rem;
width: 100%;
transition: background-color 0.3s var(--bezier-one);
display: flex;
gap: 1rem;
align-items: center;
border-right: 1px solid var(--border);
border-bottom: 1px solid var(--border);
&:hover {
background: var(--surface-three);
text-decoration: underline var(--primary);
color: var(--text-one);
}
}
h5 {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 0.25rem 0;
}
img {
border-radius: 50%;
height: 32px;
width: 32px;
background-color: var(--surface-four);
transition: transform 0.4s var(--bezier-one);
user-select: none;
}
@media (max-width: 768px) {
h5 {
display: none;
}
img {
height: 42px;
width: 42px;
}
a {
width: max-content;
background-color: transparent;
border: none;
}
}
</style>

View File

@@ -1,101 +0,0 @@
<script lang="ts">
import { slide } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import type { Contributor } from '$lib/types';
import ContributorButton from './ContributorPerson.svelte';
import ChevronUp from 'svelte-material-icons/ChevronUp.svelte';
export let contributors: Contributor[];
export let name: string;
export let url: string;
let expanded = true;
let bots = ['semantic-release-bot', 'revanced-bot'];
</script>
<div class="container">
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="title"
class:closed={!expanded}
on:click={() => (expanded = !expanded)}
on:keypress={() => (expanded = !expanded)}
>
<a href={url} rel="noreferrer" target="_blank" on:click|stopPropagation>
<h4>{name}</h4>
</a>
<div id="arrow" style:transform={expanded ? 'rotate(0deg)' : 'rotate(180deg)'}>
<ChevronUp size="24px" color="var(--surface-six)" />
</div>
</div>
{#if expanded}
<div class="contributors" transition:slide={{ easing: quintOut, duration: 500 }}>
{#each contributors as { name, avatar_url, url }}
{#if !bots.includes(name)}
<ContributorButton {name} pfp={avatar_url} {url} />
{/if}
{/each}
</div>
{/if}
</div>
<style lang="scss">
.container {
border-radius: 20px;
overflow: hidden;
border: 1px solid var(--border);
.title {
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
background-color: var(--surface-seven);
padding: 0.75rem 1.25rem;
border-bottom: 1px solid var(--border);
transition: all 0.2s var(--bezier-one);
&:hover {
background-color: var(--surface-three);
}
&.closed {
border-bottom: none;
}
a {
display: flex;
text-decoration: none;
width: max-content;
border-radius: 8px;
&:hover {
text-decoration: underline var(--primary);
color: var(--text-one);
}
}
#arrow {
transition: all 0.2s var(--bezier-one);
user-select: none;
}
}
.contributors {
margin-right: -1px;
margin-bottom: -1px;
display: grid;
justify-items: center;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
@media (max-width: 768px) {
padding: 0.75rem;
gap: 0.25rem;
grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
}
}
}
</style>

View File

@@ -1,221 +0,0 @@
<script lang="ts">
import { fly } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import { queries } from '$data/api';
import { createQuery } from '@tanstack/svelte-query';
import Head from '$lib/components/Head.svelte';
import Query from '$lib/components/Query.svelte';
import CryptoDialog from '$layout/Dialogs/CryptoDialog.svelte';
import DonateHeartAnimation from './DonateHeartAnimation.svelte';
import TeamMember from './TeamMember.svelte';
import { supportsWebP } from '$util/supportsWebP';
const teamQuery = createQuery(queries.team());
const aboutQuery = createQuery(queries.about());
let cryptoDialogue = false;
const shuffle = <T,>(array: T[]) =>
array
.map((value) => ({ value, sort: Math.random() }))
.sort((a, b) => a.sort - b.sort)
.map(({ value }) => value);
</script>
<Head
title="Donate to ReVanced"
description="Donate to ReVanced with a variety of donation methods, including cryptocurrencies in order to allow us to maintain our servers and develop new features."
schemas={[
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://revanced.app/'
},
{
'@type': 'ListItem',
position: 2,
name: 'Download',
item: 'https://revanced.app/donate'
}
]
}
]}
/>
<main class="wrapper" in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<section>
<div>
<h2>🎉 Support <span style="color: var(--primary);">ReVanced</span></h2>
<p>
ReVanced offers a variety of patches, including ad-blocking, custom themes, and innovative
features. All of which is completely open source and free of charge. Donating will allow
ReVanced maintain our servers and develop new features.
</p>
</div>
<div id="heart">
<DonateHeartAnimation
backgroundImageUrl="/revanced-logo-background.svg"
foregroundImageUrl="/icons/heart.svg"
alt="ReVanced Logo"
/>
</div>
</section>
<h3>Donate</h3>
<Query query={aboutQuery} let:data>
<div class="donate-cards">
{#if data.about.donations.links}
{#each data.about.donations.links as link}
<a class="donate-card" target="_blank" rel="noreferrer" href={link.url}>
<!-- not using <img/> because we want the image height to always be 200px -->
<div
style="background-image: url('/donate/card-images/{link.name}.{supportsWebP()
? 'webp'
: 'png'}'), url('/donate/card-images/fallback.svg');"
role="img"
aria-label="{link.name} preview image"
/>
<span>{link.name}</span>
</a>
{/each}
{/if}
{#if data.about.donations.wallets}
<button class="donate-card" on:click={() => (cryptoDialogue = !cryptoDialogue)}>
<div
style="background-image: url('/donate/card-images/Cryptocurrencies.{supportsWebP()
? 'webp'
: 'png'}'), url('/donate/card-images/fallback.svg');"
role="img"
aria-label="Cryptocurrencies preview image"
/>
<span>Cryptocurrencies</span>
</button>
{/if}
</div>
</Query>
<Query query={teamQuery} let:data>
<h3>Meet the team</h3>
{#if data.members.length > 0}
<section class="team">
<!-- randomize team members because equality -->
{#each shuffle(data.members) as member, i}
<TeamMember {member} {i} />
{/each}
</section>
{/if}
</Query>
</main>
<Query query={aboutQuery} let:data>
<CryptoDialog bind:dialogOpen={cryptoDialogue} wallets={data.about.donations.wallets} />
</Query>
<style lang="scss">
main {
display: flex;
flex-direction: column;
margin-bottom: 5rem;
section {
display: flex;
justify-content: center;
align-items: center;
@media (max-width: 768px) {
flex-direction: column-reverse;
}
}
}
h2 {
margin-bottom: 0.5rem;
color: var(--text-one);
}
h3 {
margin-bottom: 1.5rem;
}
p {
margin-bottom: 2rem;
width: 60%;
@media (max-width: 1200px) {
width: 90%;
}
@media (max-width: 768px) {
width: 100%;
}
}
@media (max-width: 768px) {
#heart {
display: none;
}
}
.donate-cards {
display: flex;
gap: 1rem;
margin-bottom: 3rem;
@media (max-width: 768px) {
flex-direction: column;
}
}
.donate-card {
text-decoration: none;
background-color: var(--surface-nine);
border-radius: 1.5rem;
width: 100%;
cursor: pointer;
text-align: left;
border: none;
overflow: hidden;
transition:
0.3s border-radius var(--bezier-one),
0.3s background-color var(--bezier-one);
&:hover {
background-color: var(--tertiary);
}
&:active {
border-radius: 2.75rem;
}
span {
display: block;
color: var(--text-four);
font-size: 1.05rem;
font-weight: 500;
padding: 1.5rem;
}
div {
height: 200px;
background-size: cover;
background-position: center;
max-width: 100%;
}
}
.team {
width: 100%;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(325px, 1fr));
justify-content: space-between;
align-items: stretch;
gap: 1rem;
}
</style>

View File

@@ -1,358 +0,0 @@
<script lang="ts">
import { onMount } from 'svelte';
export let backgroundImageUrl: string;
export let foregroundImageUrl: string;
export let alt: string;
let showHeart: (e: MouseEvent, behind: boolean) => void = (_e, _behind) => {};
onMount(() => {
const background = document.getElementById('pulsating-image')!;
let lastHeartTime = 0;
showHeart = (e, behind) => {
const rect = background.getBoundingClientRect();
if (Date.now() - lastHeartTime < 100) return;
lastHeartTime = Date.now();
const heart = document.createElement('img');
heart.src = foregroundImageUrl;
heart.style.position = 'absolute';
let x = e.clientX - rect.left - heart.width;
let y = e.clientY - rect.top - heart.height;
x += Math.floor(Math.random() * 30) - 15;
y += Math.floor(Math.random() * 30) - 15;
heart.style.left = `${x}px`;
heart.style.top = `${y}px`;
heart.style.height = '50px';
heart.style.width = '50px';
if (behind) heart.style.zIndex = '-1';
const animations = [
'float-up',
'float-scale-rotate-left',
'float-scale-rotate-right',
'float-scale-rotate-right-2',
'float-scale-rotate-left-2'
];
heart.classList.add(animations[Math.floor(Math.random() * animations.length)]);
heart.classList.add('float');
background.appendChild(heart);
setTimeout(() => {
heart.remove();
}, 1000);
};
let interval: number | undefined;
function showHeartRandom() {
const rect = background.getBoundingClientRect();
const x = rect.left + Math.floor(Math.random() * rect.width);
const y = rect.top + Math.floor(Math.random() * rect.height);
showHeart!({ clientX: x, clientY: y } as MouseEvent, true);
interval = setTimeout(showHeartRandom, Math.random() * 300);
}
showHeartRandom();
return () => clearTimeout(interval);
});
</script>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
id="pulsating-image"
on:mousemove={(e) => showHeart(e, false)}
on:mousedown={(e) => showHeart(e, false)}
>
<div id="pulsating-image-rotate">
<div id="pulsating-image-hover">
<div id="background" style:background-image="url({backgroundImageUrl})">
<img id="heart-secondary" src={foregroundImageUrl} {alt} />
<img id="heart-primary" src={foregroundImageUrl} {alt} />
</div>
</div>
</div>
</div>
<style lang="scss">
:root {
overflow-x: hidden;
}
:global(.float) {
pointer-events: none;
opacity: 0;
filter: blur(0);
}
:global(.float-up) {
animation: floatUp 1s ease-out forwards;
@keyframes floatUp {
0% {
transform: translateY(0px);
}
50% {
opacity: 0.3;
filter: blur(0);
}
100% {
transform: translateY(-40px);
opacity: 0;
filter: blur(5px);
}
}
}
:global(.float-scale-rotate-left) {
animation: floatScaleRotateLeft 1s ease-out forwards;
@keyframes floatScaleRotateLeft {
0% {
transform: translateY(0px) scale(1.2);
}
50% {
opacity: 0.3;
filter: blur(0);
}
100% {
transform: translateY(-20px) scale(0.5) rotate(-45deg);
opacity: 0;
filter: blur(5px);
}
}
}
:global(.float-scale-rotate-right) {
animation: floatScaleRotateRight 1s ease-out forwards;
@keyframes floatScaleRotateRight {
0% {
transform: translateY(0px) scale(1.2);
}
50% {
opacity: 0.3;
filter: blur(0);
}
100% {
transform: translateY(-20px) scale(0.5) rotate(45deg);
opacity: 0;
filter: blur(5px);
}
}
}
:global(.float-scale-rotate-right-2) {
animation: floatScaleRotateRight2 1s ease-out forwards;
@keyframes floatScaleRotateRight2 {
0% {
transform: translateY(0px) scale(1.8);
}
50% {
opacity: 0.3;
filter: blur(0);
}
100% {
transform: translateY(-30px) scale(1) rotate(50deg);
opacity: 0;
filter: blur(5px);
}
}
}
:global(.float-scale-rotate-left-2) {
animation: floatScaleRotateLeft2 1s ease-out forwards;
@keyframes floatScaleRotateLeft2 {
0% {
transform: translateY(0px) scale(1.8);
opacity: 0.3;
}
50% {
opacity: 0.3;
filter: blur(0);
}
100% {
transform: translateY(-30px) scale(1) rotate(-50deg);
opacity: 0;
filter: blur(5px);
}
}
}
#pulsating-image {
user-select: none;
border-radius: 100%;
cursor: pointer;
filter: brightness(1);
transition:
transform 0.4s ease,
filter 0.2s ease;
&:hover {
transform: scale(1.05);
}
&:active {
filter: brightness(1.3);
transform: scaleY(0.95) rotate(5deg);
}
#pulsating-image-rotate {
animation: rotate 1.25s infinite;
@keyframes rotate {
32% {
transform: rotate(-5deg);
}
50% {
transform: rotate(4deg);
}
80% {
transform: rotate(-3deg);
}
}
#pulsating-image-hover {
height: 225px;
width: 225px;
transition: all 0.2s ease;
&:hover {
animation: wiggle 1s;
@keyframes wiggle {
0% {
transform: rotate(0);
}
25% {
transform: rotate(5deg);
}
50% {
transform: rotate(-5deg);
}
75% {
transform: rotate(5deg);
}
100% {
transform: rotate(0deg);
}
}
}
#background {
border-radius: 100%;
box-shadow: 0 0 0 1rem black;
pointer-events: none;
display: flex;
background-repeat: no-repeat;
justify-content: center;
align-items: center;
animation: pulse-size 1.25s infinite;
will-change: transform;
height: 100%;
width: 100%;
#heart-secondary {
animation: pulse-fade 1.25s infinite ease-out;
opacity: 0.5;
will-change: transform, filter;
filter: opacity(0);
transform: scale(0.8);
@keyframes pulse-fade {
30% {
transform: scale(0.7);
filter: blur(0rem) opacity(0.7);
}
100% {
transform: scale(1.8);
filter: blur(1rem) opacity(0);
}
}
}
#heart-primary {
animation:
double-pulse-size 1.25s infinite,
pulse-glow 1.25s infinite;
@keyframes double-pulse-size {
0% {
transform: scale(0.7) rotate(0);
}
13% {
transform: scale(0.84);
}
16% {
transform: scale(0.82);
}
30% {
transform: scale(0.7);
}
50% {
transform: scale(0.8);
}
100% {
transform: scale(0.7);
}
}
& {
filter: drop-shadow(0 0 0 var(--red-one));
}
@keyframes pulse-glow {
33% {
filter: drop-shadow(0 0 0rem var(--red-one));
}
45% {
filter: drop-shadow(0 0 0.5rem var(--red-one));
}
80% {
filter: drop-shadow(0 0 0.5rem var(--red-one));
}
}
}
#heart-primary,
#heart-secondary {
position: absolute;
height: 50%;
will-change: transform, box-shadow;
}
& {
box-shadow: 0 0 0 0 #000000;
}
@keyframes pulse-size {
0% {
transform: scale(0.7);
filter: brightness(1);
}
32% {
box-shadow: 0 0 50px 3px #000000;
transform: scale(0.64) scaleY(0.95);
}
38% {
box-shadow: 0 0 0 0 #000000;
filter: brightness(1.2);
}
50% {
transform: scale(0.78);
}
100% {
box-shadow: 0 0 0 0 #000000;
filter: brightness(1);
transform: scale(0.7);
}
}
}
}
}
}
</style>

View File

@@ -1,126 +0,0 @@
<script lang="ts">
import { fly } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import type { TeamMember } from '$lib/types';
import ToolTip from '$lib/components/ToolTip.svelte';
import CheckDecagramOutline from 'svelte-material-icons/CheckDecagramOutline.svelte';
export let member: TeamMember;
export let i: number;
const transitionOptions = {
y: 10,
easing: quintOut,
duration: 750,
delay: 50 * i
};
</script>
<div class="member">
<a href={member.url} rel="noreferrer" target="_blank" in:fly|global={transitionOptions}>
<img src={member.avatar_url} alt="{member.name}'s profile picture." />
</a>
<div class="member-text">
<div class="member-title">
<a href={member.url} rel="noreferrer" target="_blank" in:fly|global={transitionOptions}>
<h4>{member.name}</h4>
</a>
{#if member.gpg_key}
<div class="verified-badge">
<ToolTip
content="<p>GPG key ID:</p> <a class='gpg-url' href={member.gpg_key
.url} rel='noreferrer' target='_blank'>{member.gpg_key.id}</a>"
html={true}
>
<div class="desktop">
<a href={member.gpg_key.url} rel="noreferrer" target="_blank">
<CheckDecagramOutline size="20px" color="var(--secondary)" />
</a>
</div>
<div class="mobile">
<CheckDecagramOutline size="20px" color="var(--secondary)" />
<h5>GPG key</h5>
</div>
</ToolTip>
</div>
{/if}
</div>
{#if member.bio}
<h6>{member.bio}</h6>
{/if}
</div>
</div>
<style lang="scss">
a {
text-decoration: none;
}
.member {
width: 100%;
color: var(--text-one);
border: 1px solid var(--border);
padding: 1rem;
border-radius: 12px;
display: flex;
gap: 1rem;
transition: 0.3s background-color var(--bezier-one);
&:hover {
background-color: var(--surface-seven);
}
}
.member-text {
display: flex;
flex-direction: column;
word-break: break-word;
.member-title {
display: flex;
align-items: center;
gap: 0.5rem;
.verified-badge {
display: flex;
align-items: center;
fill: var(--secondary) !important;
line-height: 16px;
height: 16px;
.mobile {
display: none;
}
@media (max-width: 768px) {
.desktop {
display: none;
}
.mobile {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 0.25rem;
}
}
}
}
}
img {
border-radius: 50%;
height: 64px;
width: 64px;
transition: transform 0.4s var(--bezier-one);
user-select: none;
margin-bottom: 1rem;
@media (max-width: 768px) {
margin-bottom: 0;
height: 48px;
width: 48px;
}
}
</style>

View File

@@ -1,139 +0,0 @@
<script lang="ts">
import { queries } from '$data/api';
import { fly } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import { createQuery } from '@tanstack/svelte-query';
import manager_screenshot from '$images/manager.png?format=avif;webp;png&as=picture';
import TrayArrowDown from 'svelte-material-icons/TrayArrowDown.svelte';
import Head from '$lib/components/Head.svelte';
import Query from '$lib/components/Query.svelte';
import Button from '$lib/components/Button.svelte';
import Picture from '$lib/components/Picture.svelte';
import DownloadCompatibilityWarningDialog from '$layout/Dialogs/DownloadCompatibilityWarningDialog.svelte';
import { onMount } from 'svelte';
const query = createQuery(queries.manager());
let warning: string;
let warningDialogue = false;
let userAgent: string;
let isAndroid: boolean;
let androidVersionMatch: RegExpExecArray | null;
let androidVersion: number;
onMount(() => {
userAgent = navigator.userAgent;
androidVersionMatch = /Android\s([\d.]+)/i.exec(userAgent);
androidVersion = androidVersionMatch ? parseInt(androidVersionMatch[1]) : 0;
isAndroid = !!androidVersion;
});
function handleClick() {
if (!isAndroid) {
warning = 'Your device is not running Android.';
warningDialogue = true;
} else if (androidVersion < 8) {
warning = `Your device is running ${androidVersion}. ReVanced only supports Android versions 8 and above.`;
warningDialogue = true;
}
}
</script>
<Head
title="Download ReVanced"
description="Download ReVanced Manager to patch your favourite apps, right on your device."
schemas={[
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://revanced.app/'
},
{
'@type': 'ListItem',
position: 2,
name: 'Download',
item: 'https://revanced.app/download'
}
]
}
]}
/>
<main class="wrapper center" in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<h2>ReVanced <span>Manager</span></h2>
<p>Patch your favourite apps, right on your device.</p>
<div class="buttons">
<Query {query} let:data>
{#if !isAndroid || androidVersion < 8}
<Button on:click={handleClick} icon={TrayArrowDown} type="filled">
{data.release.version}
</Button>
{:else}
<Button
on:click={handleClick}
icon={TrayArrowDown}
type="filled"
href={data.release.download_url}
>
{data.release.version}
</Button>
{/if}
</Query>
<Button type="tonal" href="https://github.com/revanced/revanced-manager" target="_blank">
View source
</Button>
</div>
<div class="screenshot">
<Picture data={manager_screenshot} alt="Manager Screenshot" />
</div>
</main>
<DownloadCompatibilityWarningDialog bind:dialogOpen={warningDialogue} {warning} />
<style>
.center {
display: flex;
flex-direction: column;
align-items: center;
}
h2 {
text-align: center;
color: var(--text-one);
}
p {
text-align: center;
margin-bottom: 1.5rem;
}
.screenshot :global(img) {
margin-top: 2.5rem;
margin-bottom: 2.5rem;
height: 50rem;
width: auto;
padding: 0.5rem 0.5rem;
border-radius: 2rem;
background-color: var(--surface-seven);
user-select: none;
}
.buttons {
display: flex;
gap: 1rem;
}
span {
color: var(--primary);
}
</style>

View File

@@ -1,221 +0,0 @@
<script lang="ts">
import { building } from '$app/environment';
import { fly } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import { derived, readable, type Readable } from 'svelte/store';
import { page } from '$app/stores';
import type { CompatiblePackage, Patch } from '$lib/types';
import { createQuery } from '@tanstack/svelte-query';
import { queries } from '$data/api';
import Head from '$lib/components/Head.svelte';
import PackageMenu from './PackageMenu.svelte';
import Package from './Package.svelte';
import PatchItem from './PatchItem.svelte';
import Search from '$lib/components/Search.svelte';
import FilterChip from '$lib/components/FilterChip.svelte';
import MobilePatchesPackagesDialog from '$layout/Dialogs/MobilePatchesPackagesDialog.svelte';
import Query from '$lib/components/Query.svelte';
import Fuse from 'fuse.js';
import { onMount } from 'svelte';
import createFilter from '$util/filter';
import { debounce } from '$util/debounce';
const query = createQuery(queries.patches());
let searchParams: Readable<URLSearchParams>;
if (building) {
searchParams = readable(new URLSearchParams());
} else {
searchParams = derived(page, ($page) => $page.url.searchParams);
}
$: selectedPkg = $searchParams.get('pkg');
let searchTerm = $searchParams.get('s') || '';
let mobilePackages = false;
let showAllVersions = false;
function filterPatches(patches: Patch[], pkg: string, search?: string): Patch[] {
const patchFilter = createFilter(patches, {
searcherOptions: {
keys: ['name', 'description', 'compatiblePackages.name', 'compatiblePackages.versions']
},
additionalFilter: (patch: Patch, pkg: string): boolean => {
if (!pkg) return true;
return (
patch.compatiblePackages?.some(
(compatiblePackage: CompatiblePackage) =>
compatiblePackage.name === pkg || compatiblePackage.versions?.includes(pkg)
) || false
);
}
});
return patchFilter(pkg, search);
}
// Make sure we don't have to filter the patches after every key press
let displayedTerm = '';
const update = () => {
displayedTerm = searchTerm;
const url = new URL(window.location.href);
url.pathname = '/patches';
if (searchTerm) {
url.searchParams.set('s', searchTerm);
} else {
url.searchParams.delete('s');
}
window.history.pushState(null, '', url);
};
onMount(update);
</script>
<Head
title="Patches for ReVanced"
description="Browse our rich collection of patches for ReVanced you can use to patch your favourite apps."
schemas={[
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://revanced.app/'
},
{
'@type': 'ListItem',
position: 2,
name: 'Patches',
item: 'https://revanced.app/patches'
}
]
}
]}
/>
<div class="search">
<div class="search-contain">
<!-- Must bind both variables: we get searchTerm from the text input, -->
<Search
bind:searchTerm
bind:displayedTerm
title="Search for patches"
on:keyup={debounce(update)}
/>
</div>
</div>
<main>
<div class="filter-chips" in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<FilterChip
selected={!!selectedPkg}
dropdown
on:click={() => (mobilePackages = !mobilePackages)}
>
{selectedPkg || 'Packages'}
</FilterChip>
</div>
<Query {query} let:data>
<MobilePatchesPackagesDialog
bind:dialogOpen={mobilePackages}
bind:searchTerm
{data}
{selectedPkg}
/>
<aside in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<PackageMenu>
<span class="packages">
<Package {selectedPkg} name="All packages" bind:searchTerm />
{#each data.packages as pkg}
<Package {selectedPkg} name={pkg} bind:searchTerm />
{/each}
</span>
</PackageMenu>
</aside>
<div class="patches-container">
{#each filterPatches(data.patches, selectedPkg || '', displayedTerm) as patch}
{#key selectedPkg || displayedTerm}
<div in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<PatchItem {patch} bind:showAllVersions />
</div>
{/key}
{/each}
</div>
</Query>
</main>
<style>
main {
display: grid;
grid-template-columns: 300px 3fr;
width: min(90%, 80rem);
margin-inline: auto;
gap: 1.5rem;
}
.search {
padding-top: 0.6rem;
padding-bottom: 1.25rem;
background-color: var(--surface-eight);
}
.search-contain {
width: min(90%, 80rem);
margin-inline: auto;
}
.patches-container {
overflow: hidden;
border-radius: 20px;
margin-top: 1.5rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
width: 100%;
position: sticky;
z-index: 1;
min-height: calc(100vh - 6rem);
margin-bottom: 3rem;
}
.filter-chips {
display: none;
}
@media (max-width: 768px) {
main {
grid-template-columns: none;
flex-direction: column;
gap: 0;
}
aside {
display: none;
}
.patches-container {
margin-top: 1rem;
margin-bottom: 1.5rem;
gap: 0.75rem;
}
.filter-chips {
display: flex;
flex-wrap: wrap;
margin-top: 1rem;
gap: 0.75rem;
padding-bottom: 0rem;
}
}
</style>

Some files were not shown because too many files have changed in this diff Show More