diff --git a/src/app.css b/src/app.css index 7bbfeaf..8732f17 100644 --- a/src/app.css +++ b/src/app.css @@ -31,11 +31,17 @@ body { margin-inline: auto; width: min(90%, 95rem); margin-top: 4rem; + padding-bottom: 2rem; display: flex; flex-direction: column; justify-content: space-between; } +@media screen and (max-width: 768px) { + .wrapper { + margin-top: 2rem; + } +} :root { --white: #fff; diff --git a/src/lib/components/atoms/Button.svelte b/src/lib/components/atoms/Button.svelte index 6f0f191..f5eabdf 100644 --- a/src/lib/components/atoms/Button.svelte +++ b/src/lib/components/atoms/Button.svelte @@ -5,9 +5,10 @@ export let maxWidth = false; export let icon = ''; export let target = ''; + export let unclickable = false; - +
{#if icon} {icon} @@ -22,6 +23,10 @@ border-radius: 16px; } + .unclickable { + pointer-events: none; + cursor:not-allowed; + } div, .button-secondary { min-width: max-content; diff --git a/src/lib/components/atoms/LogoOption.svelte b/src/lib/components/atoms/LogoOption.svelte index eb411eb..ef1cf97 100644 --- a/src/lib/components/atoms/LogoOption.svelte +++ b/src/lib/components/atoms/LogoOption.svelte @@ -1,9 +1,10 @@
- {file} + {filename}

{name}

-
{file}
+
{filename}
@@ -69,8 +70,8 @@ color: var(--accent-color); } - div:hover:not(.clicked) { - background-color: var(--grey-two); + div:hover { + filter: brightness(0.85); } img { diff --git a/src/lib/documentation.scss b/src/lib/documentation.scss deleted file mode 100644 index e366c09..0000000 --- a/src/lib/documentation.scss +++ /dev/null @@ -1,45 +0,0 @@ -#markup-content { - /* Defaults for text */ - color: var(--white); - font-weight: 300; - font-size: 1rem; - letter-spacing: 0.02rem; - padding: 100px 30px 0px 30px; - - a { - text-decoration: none; - color: var(--white); - border-bottom: 1.5px solid var(--accent-color); - padding: 0px 5px; - transition: all 0.4s var(--bezier-one); - } - - a:hover { - background-color: var(--accent-color); - border-radius: 6px; - color: var(--grey-four); - } - - code { - background-color: var(--grey-six); - border-radius: 4px; - padding: 2px; - } - - h4 { - margin-bottom: 0.5rem; - } - - h5 { - color: var(--accent-color); - } - - /* Markup processors output this for bold text, but css spec is goofy aah */ - strong { - font-weight: bold; - } - - ul { - padding-left: 2rem; - } -} diff --git a/src/lib/documentation.server.ts b/src/lib/documentation.server.ts deleted file mode 100644 index 76525dd..0000000 --- a/src/lib/documentation.server.ts +++ /dev/null @@ -1,210 +0,0 @@ -import { is_tree } from './documentation.shared'; -import type { Document, DocsTree, DocsTreeNode, DocumentInfo } from './documentation.shared'; - -import { browser, prerendering } from '$app/environment'; - -import fs, { existsSync as exists } from 'fs'; -import path from 'path'; - - -import { parse as parse_md } from 'marked'; -import AsciiDocProcessor from 'asciidoctor' - -// This file does not work in a browser. -if (browser) { - throw Error('SvelteKit has skill issues'); -} - -/// Constants - -const supported_formats: Map Document> = new Map(); - -supported_formats.set("md", markup => { - let lines = markup.split('\n'); - - // Get and remove the first line. - const first_line = lines.splice(0, 1)[0]; - // Remove `# `. - const title = first_line.substring(2); - - // Convert the rest to html - const content = parse_md(lines.join('\n')); - - return { title, content }; -}); - -const asciidoctor = AsciiDocProcessor(); -const adoc_fn = markup => { - // Get first line. - const first_line = markup.split('\n')[0]; - // Remove `= `. - const title = first_line.substring(2); - - // Convert it to html. Unlike markdown, we do not need to remove the first title heading. - // NOTE: Maybe consider change the safe mode value. - const content = asciidoctor.convert(markup, { doctype: "book" }) - - return { title, content }; -} - -supported_formats.set("adoc", adoc_fn) -supported_formats.set("asciidoc", adoc_fn) - -const supported_filetypes = [...supported_formats.keys()]; - -let docs_folder = process.env.REVANCED_DOCS_FOLDER; -if (docs_folder === undefined) { - if (prerendering) { console.warn("Using testing docs in production build") } - docs_folder = "testing-docs"; -} - -const ignored_items = ["assets"]; - -/// Utility functions - -function is_directory(item: string) { - return fs.lstatSync(item).isDirectory(); -} - -function get_ext(fname: string) { - // Get extname and remove the first dot. - return path.extname(fname).substring(1); -} - -function get_slug_of_node(node: DocsTreeNode): string { - if (is_tree(node)) { - return node.index.slug; - } - - return node.slug; -} - -/// Important functions - -// Get a document. Returns null if it does not exist. -export function get(slug: string): Document|null { - let target = path.join(docs_folder, slug); - // Handle index (readme) file for folder. - if (exists(target) && is_directory(target)) { - target += "/README"; - } - - const dir = path.dirname(target); - if (!exists(dir)) { - return null; - } - - let full_path, ext, found = false; - // We are looking for the file `${target}.(any_supported_extension)`. Try to find it. - for (const item of fs.readdirSync(dir)) { - full_path = path.join(dir, item); - // Get file extension - ext = get_ext(item); - - // Unsupported/unrelated file. - if (!supported_formats.has(ext)) { - continue; - } - - const desired_path = `${target}.${ext}`; // Don't grab some other random supported file. - if (!is_directory(full_path) && desired_path == full_path) { - // We found it. - found = true; - break; - } - } - - if (!found) { - return null; - } - - // Process the file and return. - return supported_formats.get(ext)(fs.readFileSync(full_path, 'utf-8')); -} - -// Get file information -function process_file(fname: string): DocumentInfo { - // Remove docs folder prefix and file extension suffix, then split it. - const parts = fname - .substring(`${docs_folder}/`.length, fname.length - (get_ext(fname).length + 1)) - .split("/"); - - // Remove `README` suffix if present. - const last_part_index = parts.length - 1; - if (parts[last_part_index] == "README") { - parts.pop(); - } - - const slug = parts.join("/"); - const title = get(slug).title; - - return { slug, title }; -} - -// Returns a document tree. -function process_folder(dir: string): DocsTree|null { - let tree: DocsTree = { - index: null, - nodes: [] - }; - - // List everything in the directory. - const items = fs.readdirSync(dir); - - for (const item of items) { - if (ignored_items.includes(item) || [".", "_"].includes(item[0])) { - continue; - } - - const itemPath = path.join(dir, item); - - const is_dir = is_directory(itemPath); - let is_index_file = false; - - if (!is_dir) { - // Ignore files we cannot process. - if (!supported_formats.has(get_ext(item))) { - continue; - } - - for (const ext of supported_filetypes) { - if (item == `README.${ext}`) { - is_index_file = true; - } - } - } - - const node = is_dir ? process_folder(itemPath) : process_file(itemPath); - if (node === null) { - console.error(`The ${itemPath} directory does not have a README/index file! ignoring...`) - continue; - } - - if (is_index_file) { - tree.index = node; - } else { - tree.nodes.push(node); - } - } - - if (tree.index === null) { - return null; - } - - // `numeric: true` because we want to be able to specify - // the order if necessary by prepending a number to the file name. - tree.nodes.sort( - (a, b) => get_slug_of_node(a).localeCompare(get_slug_of_node(b), "en", { numeric: true }) - ); - - return tree; -} - -// Returns the document tree. -export function index_content(): DocsTree { - const tree = process_folder(docs_folder); - if (tree === null) { - throw new Error("Root must have index (README) file.") - } - return tree; -} diff --git a/src/lib/documentation.shared.ts b/src/lib/documentation.shared.ts deleted file mode 100644 index 8042562..0000000 --- a/src/lib/documentation.shared.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// Types - -export interface Document { - title: string; - // HTML - content: string; -} - -export interface DocumentInfo { - title: string; - slug: string; -} - -// A tree representing the `docs` folder. -export interface DocsTree { - // index.whatever - index: DocumentInfo; - // Everything except index.whatever - nodes: DocsTreeNode[]; -} - -export type DocsTreeNode = DocsTree | DocumentInfo; - -/// Functions - -export function is_tree(node: DocsTreeNode) { - return node.hasOwnProperty('nodes'); -} diff --git a/src/routes/polling/+page.svelte b/src/routes/polling/+page.svelte index e719a43..aedf53c 100644 --- a/src/routes/polling/+page.svelte +++ b/src/routes/polling/+page.svelte @@ -1,13 +1,16 @@ - ReVanced | Contributors - - + ReVanced · Logo Poll + +
- {#if logos.length > 0} - - - - - {/if} + {#each logos.slice(min, max) as { id, gdrive_direct_url, name, filename }} + {#key currentPage} + + {/key} + {/each}
-
- - + +
@@ -69,7 +83,6 @@ color: var(--grey-four); } - h2 { font-size: 1rem; color: var(--grey-three); @@ -84,10 +97,9 @@ float: bottom; } - button { background-color: transparent; - border:none; + border: none; border: 1px solid var(--grey-six); color: var(--grey-four); padding: 0.5rem 1.25rem; diff --git a/testing-docs/README.md b/testing-docs/README.md deleted file mode 100644 index bee79c0..0000000 --- a/testing-docs/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Prerequisites -##### docs/prerequisites - -
- -#### Requirements - -- ADB -- x86/x86\_64 host architecture -- Zulu JDK 17 -- Latest Android SDK if you plan to build the integrations from the source -- The APK file you want to patch (e.g. YouTube v17.36.37 or YouTube Music v5.23.50). If you want to mount patched applications as root, make sure the same version is installed on your device. - -
- -You can continue by either [building everything from source](https://github.com/revanced/revanced-documentation/wiki/Building-from-source) or [downloading the prebuilt packages](https://github.com/revanced/revanced-documentation/wiki/Downloading-prebuilt-packages). diff --git a/testing-docs/adoc-format.adoc b/testing-docs/adoc-format.adoc deleted file mode 100644 index 0fdfcce..0000000 --- a/testing-docs/adoc-format.adoc +++ /dev/null @@ -1,10 +0,0 @@ -= AsciiDoc Example - -= Another title - -*Bold text* - -== Section 1 - -* Item 1 -* Item 2 diff --git a/testing-docs/deeply/README.md b/testing-docs/deeply/README.md deleted file mode 100644 index 1251a54..0000000 --- a/testing-docs/deeply/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Nesting sample - -# First one -Text diff --git a/testing-docs/deeply/another-page.md b/testing-docs/deeply/another-page.md deleted file mode 100644 index 5ec36a1..0000000 --- a/testing-docs/deeply/another-page.md +++ /dev/null @@ -1,4 +0,0 @@ -# Another Page - -# Hello -Content! diff --git a/testing-docs/deeply/nested/README.md b/testing-docs/deeply/nested/README.md deleted file mode 100644 index 547e6e4..0000000 --- a/testing-docs/deeply/nested/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Nesting sample - -# Second one -Text diff --git a/testing-docs/deeply/nested/content/README.md b/testing-docs/deeply/nested/content/README.md deleted file mode 100644 index e8511a1..0000000 --- a/testing-docs/deeply/nested/content/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Nesting sample - -# Third one -Text diff --git a/testing-docs/markdown-format.md b/testing-docs/markdown-format.md deleted file mode 100644 index 1244a86..0000000 --- a/testing-docs/markdown-format.md +++ /dev/null @@ -1,4 +0,0 @@ -# Markdown Example -Text - -**Bold text** diff --git a/testing-docs/writing-docs.md b/testing-docs/writing-docs.md deleted file mode 100644 index ae1446d..0000000 --- a/testing-docs/writing-docs.md +++ /dev/null @@ -1,9 +0,0 @@ -# Writing documentation - -You can write documentation with markdown or asciidoc. - -## Title -The first line must be the `h1` equivalent of the markup language. -For markdown, this would be `# ` and `= <title>` for asciidoc. - -**The title part may or may not go through the markup processor depending on the language.** It is instead added by the website itself.