feat: store selected logos, nicer ui

This commit is contained in:
afn
2022-11-25 02:00:23 -05:00
parent 4e096a3a5c
commit 6c4e30256b
7 changed files with 153 additions and 343 deletions

View File

@@ -1,69 +0,0 @@
<script lang="ts">
export let name: string;
export let pfp: string;
export let url: string;
let alt = `h`;
let clicked = false;
</script>
<a href={url} rel="noreferrer" target="_blank" on:click={() => (clicked = !clicked)} class:clicked>
<img src={pfp} {alt} />
<h2>{name}</h2>
</a>
<style>
a {
color: var(--white);
text-decoration: none;
padding: 1rem;
width: 100%;
transition: all 0.3s var(--bezier-one);
border-radius: 8px;
display: flex;
gap: 1rem;
align-items: center;
background-color: var(--grey-six);
border: 1px solid var(--grey-three);
cursor: pointer;
}
a:hover {
background-color: var(--grey-one);
}
h2 {
font-size: 0.95rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.clicked {
background-color: var(--accent-color);
}
.clicked h2 {
color: var(--grey-four);
}
.clicked:hover {
background-color: var(--accent-color);
}
img {
border-radius: 8px;
height: 150px;
width: 150px;
background-color: var(--grey-two);
transition: transform 0.4s var(--bezier-one);
user-select: none;
}
@media screen and (max-width: 768px) {
a {
flex-direction: column;
}
}
</style>

View File

@@ -0,0 +1,94 @@
<script lang="ts">
export let name: string;
export let logo: string;
export let file: string;
export let id: string;
export let selected: Array<string>;
const handleClick = () => {
clicked = !clicked;
if (selected.includes(id)) {
selected = selected.filter((e) => e !== id);
} else {
selected.push(id);
// the Updater
selected = selected;
}
};
let clicked = false;
</script>
<div on:click={handleClick} class:clicked>
<img src={logo} alt={file} />
<span class="text">
<h2>{name}</h2>
<h6>{file}</h6>
</span>
</div>
<style>
div {
color: var(--white);
text-decoration: none;
padding: 1rem;
width: 100%;
transition: all 0.3s var(--bezier-one);
border-radius: 8px;
display: flex;
gap: 1.5rem;
align-items: center;
background-color: var(--grey-six);
border: 1px solid var(--grey-three);
cursor: pointer;
}
h2 {
font-size: 1rem;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
h6 {
font-size: 0.9rem;
}
.text {
flex-direction: column;
}
.clicked {
background-color: var(--grey-three);
}
.clicked h2,
.clicked h6 {
color: var(--accent-color);
}
div:hover:not(.clicked) {
background-color: var(--grey-two);
}
img {
border-radius: 8px;
height: 150px;
width: 150px;
background-color: var(--grey-two);
transition: transform 0.4s var(--bezier-one);
user-select: none;
}
@media screen and (max-width: 768px) {
div {
flex-direction: column;
}
.text {
text-align: center;
}
}
</style>

View File

@@ -1,78 +0,0 @@
<script lang="ts">
import type { Contributor } from 'src/data/types';
import ContributorButton from '../atoms/ContributorPerson.svelte';
export let contribs: Contributor[];
export let repo: string;
let repo_name = repo
.replace(/-/g, ' ')
.replace(/revanced\/revanced/g, 'ReVanced')
.replace(/cli/g, 'CLI')
.replace(/api/g, 'API')
.replace(/(?:^|\s)\S/g, (x) => x.toUpperCase());
let usersIwantToExplodeSoBadly = ['semantic-release-bot'];
</script>
<div class="title">
<a href="https://github.com/{repo}" rel="noreferrer" target="_blank">
<h2>{repo_name}</h2>
</a>
</div>
<hr />
<div class="contrib-host">
{#each contribs as { login, avatar_url, html_url }}
{#if !usersIwantToExplodeSoBadly.includes(login)}
<ContributorButton name={login} pfp={avatar_url} url={html_url} />
{/if}
{/each}
</div>
<style>
.title {
display: flex;
align-items: center;
border-radius: 4px;
transform: translateX(-6px);
}
h2 {
text-align: center;
font-size: 1.25rem;
}
hr {
margin-top: 0.5rem;
margin-bottom: 1rem;
border-top: 1px solid var(--grey-two);
}
a {
transition: all 0.3s var(--bezier-one);
display: flex;
text-decoration: none;
width: max-content;
border-radius: 8px;
}
a > h2 {
transition: all 0.3s var(--bezier-one);
width: max-content;
padding: 0rem 0.4rem;
border-radius: 4px;
}
a:hover > h2 {
width: max-content;
background-color: var(--grey-three);
color: var(--accent-color);
}
.contrib-host {
gap: 0.5rem;
display: grid;
justify-items: center;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
</style>

View File

@@ -1,39 +0,0 @@
<script lang="ts">
import { is_tree } from '$lib/documentation.shared';
import type { DocsTree } from '$lib/documentation.shared';
import DocsNavNode from '$lib/components/atoms/DocsNavNode.svelte';
export let tree: DocsTree;
// How deeply nested this is.
export let nested = 0;
</script>
{#if nested}
<!-- The index should be part of the `ul` above us. -->
<DocsNavNode info={tree.index} />
{/if}
<ul>
{#if !nested}
<!-- There is no `ul` above us, so index should go here instead. -->
<DocsNavNode info={tree.index} />
{/if}
{#each tree.nodes as node}
{#if is_tree(node)}
<!-- Recursion here is fine. We are not dealing with a tree the size of a linux root file system. -->
<svelte:self tree={node} nested={nested + 1} />
{:else}
<DocsNavNode info={node} />
{/if}
{/each}
</ul>
<style>
ul {
padding-left: 2rem;
list-style-type: "• ";
color: var(--white);
}
</style>

View File

@@ -1,119 +0,0 @@
<script>
import Button from '$lib/components/atoms/Button.svelte';
</script>
<section class="hero">
<div class="hero-text">
<h1>
Nothing <br />apps, <span class="flicker">ad</span><span class="blue">vanced.</span>
</h1>
<h2>
ReVanced is an extensible framework for building <br /> Android application mods.
</h2>
<div class="hero-buttons">
<Button icon="download" href="download" kind="primary">Download Manager</Button>
<Button icon="docs" href="patches">View Patches</Button>
</div>
</div>
</section>
<style>
h2 {
margin-top: 1.75\rem;
margin-bottom: 2rem;
}
.hero {
padding-bottom: 9rem;
}
.hero-text {
align-items: center;
}
.hero-buttons {
display: flex;
user-select: none;
gap: 1rem;
}
.blue {
color: var(--accent-color);
}
@keyframes flicker {
0% {
color: var(--grey-two);
}
10% {
color: var(--accent-color);
}
15% {
color: var(--grey-two);
}
35% {
color: var(--accent-color);
}
45% {
color: var(--accent-color);
}
50% {
color: var(--grey-two);
}
52.5% {
color: var(--accent-color);
}
85% {
color: var(--accent-color);
}
100% {
color: var(--grey-two);
}
}
.flicker {
color: var(--accent-color);
/* animation: flicker 2s forwards;
animation-timing-function: var(--bezier-one);
animation-delay: 1.5s;
animation-iteration-count: 1; */
}
h1 {
line-height: 1em;
font-size: 4rem;
}
@media (max-width: 768px) {
.hero {
padding-bottom: 0;
text-align: center;
}
h1 {
font-size: clamp(2.9rem, 10vw, 4rem);
}
h2 {
font-size: 1.2rem;
}
br {
content: ' ';
}
.hero-buttons {
justify-content: center;
}
}
@media screen and (max-width: 600px) {
.hero-buttons {
flex-direction: column;
align-items: center;
}
}
</style>