mirror of
https://github.com/revanced/revanced-website.git
synced 2025-04-29 22:24:31 +02:00
test
This commit is contained in:
parent
58c68944ab
commit
f8f09f6814
@ -7,7 +7,7 @@
|
||||
import previous from '$lib/assets/icons/previous.svg';
|
||||
import type { Logo } from '$lib/types';
|
||||
|
||||
export let selected: string[];
|
||||
export let selected: string[] = [];
|
||||
export let variants: Logo[];
|
||||
export let clicked = false;
|
||||
export let hideDetails = false;
|
||||
@ -189,6 +189,4 @@
|
||||
gap: 1.5rem;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
60
src/lib/components/atoms/LogoResultOption.svelte
Normal file
60
src/lib/components/atoms/LogoResultOption.svelte
Normal file
@ -0,0 +1,60 @@
|
||||
<script lang="ts">
|
||||
export let logoUrl: string;
|
||||
export let votes: number;
|
||||
</script>
|
||||
|
||||
<!-- SHUT UP -->
|
||||
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
||||
<div class="option" tabindex="0">
|
||||
<div class="row">
|
||||
<!-- Screenreader compatibility does not make sense in this context. -->
|
||||
<img src={logoUrl} alt="" />
|
||||
</div>
|
||||
<div class="actions">
|
||||
<h3>Votes: {votes}</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.option {
|
||||
border: 1.5px solid var(--grey-three);
|
||||
width: 100%;
|
||||
color: var(--white);
|
||||
transition: all 0.3s var(--bezier-one);
|
||||
border-radius: 16px;
|
||||
background-color: var(--grey-six);
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 1.25rem;
|
||||
gap: 1.5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.actions {
|
||||
border-top: 1px solid var(--grey-three);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 1rem 1.25rem;
|
||||
align-items: center;
|
||||
border-radius: 0 0 16px 16px;
|
||||
justify-content: space-between;
|
||||
pointer-events: none;
|
||||
}
|
||||
.option:hover {
|
||||
filter: brightness(0.85);
|
||||
}
|
||||
|
||||
img {
|
||||
border-radius: 8px;
|
||||
height: 125px;
|
||||
max-width: 125px;
|
||||
transition: transform 0.4s var(--bezier-one);
|
||||
user-select: none;
|
||||
}
|
||||
</style>
|
@ -4,4 +4,11 @@ export interface Logo {
|
||||
logo_direct_url: string;
|
||||
}
|
||||
|
||||
export interface LogoResult {
|
||||
votes: number;
|
||||
optimized_direct_url: string | null;
|
||||
logo_direct_url: string;
|
||||
}
|
||||
|
||||
export type LogosResponse = Logo[][];
|
||||
export type LogoResultResponse = LogoResult[][];
|
||||
|
@ -81,7 +81,7 @@
|
||||
logos[i] = logos[j];
|
||||
logos[j] = k;
|
||||
}
|
||||
|
||||
|
||||
// min is the lowest index of the logos on a page, max is the highest index
|
||||
// max will be determined based on min and the amount of logos we want on each page (4)
|
||||
min = currentPage * logoAmount;
|
||||
|
99
src/routes/poll/results/+page.svelte
Normal file
99
src/routes/poll/results/+page.svelte
Normal file
@ -0,0 +1,99 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { fly } from 'svelte/transition';
|
||||
import { expoOut } from 'svelte/easing';
|
||||
import type { LogoResult } from '$lib/types';
|
||||
import LogoResultOption from '$lib/components/atoms/LogoResultOption.svelte';
|
||||
|
||||
// afn please don't do this lol this is shitty code
|
||||
let logos: LogoResult[] = [];
|
||||
let transitionDirection = 5;
|
||||
|
||||
// you will never see shittier code tm
|
||||
// will refactor later maybe idk
|
||||
// Reply: don't think we need to refactor because nobody cares if this code is shit lol
|
||||
onMount(async () => {
|
||||
const response = await fetch('http://localhost:5174/results');
|
||||
logos = await response.json();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>ReVanced · Logo Poll</title>
|
||||
<meta content="ReVanced · Logo Poll" name="og:title" />
|
||||
<meta content="ReVanced · Logo Poll" name="twitter:title" />
|
||||
</svelte:head>
|
||||
|
||||
<main>
|
||||
<div class="wrapper">
|
||||
<div class="top-container">
|
||||
<div class="top-container-text">
|
||||
<h3>ReVanced</h3>
|
||||
<h1>{'Poll results'}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="options-grid">
|
||||
{#each logos as logo}
|
||||
<span in:fly={{ x: transitionDirection, easing: expoOut, duration: 1000 }}>
|
||||
<LogoResultOption
|
||||
logoUrl={logo.optimized_direct_url ?? logo.logo_direct_url}
|
||||
votes={logo.votes}
|
||||
/>
|
||||
</span>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
.options-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
color: var(--white);
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: var(--white);
|
||||
margin-bottom: -0.5rem;
|
||||
}
|
||||
|
||||
@media screen and (orientation: landscape) and (min-width: 1500px) and (min-height: 950px) {
|
||||
:global(.wrapper) {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.top-container {
|
||||
margin-bottom: 2rem;
|
||||
background-color: var(--accent-color);
|
||||
padding: 2rem;
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.top-container-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
h1 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
.options-grid {
|
||||
/* The magic number, teef */
|
||||
grid-template-columns: repeat(auto-fill, minmax(16.628645896rem, 1fr));
|
||||
}
|
||||
}
|
||||
</style>
|
98
src/routes/poll/results/results.json
Normal file
98
src/routes/poll/results/results.json
Normal file
@ -0,0 +1,98 @@
|
||||
{
|
||||
"bd42079a6bc04f999442f6adae6140c8": {
|
||||
"results": 1466,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeiglxo4xrksqyijm4zshhoz4n2mnhtzsgqud5fuwles4b4ve57on3i/31.svg",
|
||||
"optimized_direct_url": null
|
||||
},
|
||||
"7cd4043fb8c04ccba09950a32cf81860": {
|
||||
"votes": 1408,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeic5rdxblpoc2jh3zxvip7j3qvviqzfpvuy7vxe34bl4d5ihfd6dqa/56.png",
|
||||
"optimized_direct_url": "https://bafybeidbmjfxvlreys3c4z2h7odrspqh6kz2ty7ydveuxypmoeujmie2ja.ipfs.w3s.link/56.webp"
|
||||
},
|
||||
"d19821ece36e4455ba3a93b66054df1e": {
|
||||
"votes": 1348,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeigselb7vkd4wfzbc2ak5gjzp2ir4m2uo6hp2o4w2nwhgno7byddrq/17.png",
|
||||
"optimized_direct_url": "https://bafybeida3uwdqhoipv4uagmzmw6qgpvzd7ew4gsfcqi46yy5xcbvongtsu.ipfs.w3s.link/17.webp"
|
||||
},
|
||||
"55c98b322a3b4157bde409a5f014a538": {
|
||||
"votes": 1299,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeidektpfgujxiaiv2dwmp6mfx7yxgyk3guozvhgykgvi5gmm3aia5e/35.png",
|
||||
"optimized_direct_url": "https://bafybeig26cco3akprsvguiuba5pfduce5cv23hhmysnta25vvzosj3neye.ipfs.w3s.link/35.webp"
|
||||
},
|
||||
"0bc827427ad34e28bcc28ce9316924c4": {
|
||||
"votes": 1262,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeifi65sb7govxibdkzziqtbc2qnnjjmkbxmhh37oojyeujzk3bul4a/29.svg",
|
||||
"optimized_direct_url": null
|
||||
},
|
||||
"263c32250b0d4f92a97288c07a259697": {
|
||||
"votes": 1207,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeiezgoqwhgqdsgadfjl6zc22khsyyjja4xfeygvpge5plao3oe77cq/36.png",
|
||||
"optimized_direct_url": "https://bafybeigjfwo6ldx56odohngasdik64zbtlsfnpg4bvzky34uuh4xp4nzyq.ipfs.w3s.link/36.webp"
|
||||
},
|
||||
"c6715efd1c334a6ba3270fede675cd65": {
|
||||
"votes": 1120,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeiaukg4uh6ts63ulde37vc7kizmq723l3mmtro4ug3h2yfmghiohly/23.svg",
|
||||
"optimized_direct_url": null
|
||||
},
|
||||
"de59ca7e5b7146a1ba818a7f930c8073": {
|
||||
"votes": 1093,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeif3fsv2bqxljff2gbgsowlj27mc55nqshka4f5fymaretvas6vwuu/52.png",
|
||||
"optimized_direct_url": "https://bafybeie7kx3cq2rwqqtsd6neppp6grf4kr67tohl27bl2go4xv367exmpe.ipfs.w3s.link/52.webp"
|
||||
},
|
||||
"c975148c648648458f899e92825fb47e": {
|
||||
"votes": 973,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeibcxydeifxfy2cbzdpikscc2bw5l5ci47jzjqcs2k6eeknukxd7ky/25.png",
|
||||
"optimized_direct_url": "https://bafybeib7dt7dm4ew6hcu6jbdkjbk3xknjsbcpmlknxyn2e2atazjf46ftm.ipfs.w3s.link/25.webp"
|
||||
},
|
||||
"e3b859b28ffa4846b4fb8d4d9f2df704": {
|
||||
"votes": 968,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeigkrrby4uxwdeyaisqsenovdpldr74epbgxahmshhl244z5agi77e/30.svg",
|
||||
"optimized_direct_url": null
|
||||
},
|
||||
"3fcb7dbbd94c4ea2bfe8e4d55da108f6": {
|
||||
"votes": 964,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeibxtonx5is22flypetvnf35zrtzm7syr2ksvlaoq45kaje3nhtape/63.png",
|
||||
"optimized_direct_url": "https://bafybeiem6gsapvtyqoixx4g3odvfvl46rf3im73qxt5c6dv45ifly2tn6a.ipfs.w3s.link/63.webp"
|
||||
},
|
||||
"baaf9cf622d8461593990c45c9f31885": {
|
||||
"votes": 942,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeietxgh4oqgr4ermyake2abchqgd24qoe67kyggsyzj2lowddiddae/40.png",
|
||||
"optimized_direct_url": "https://bafybeihst7txjs4sjwoakyjyyzeoheb3jjjtvdxchmz2p3oj27mg2agrdu.ipfs.w3s.link/40.webp"
|
||||
},
|
||||
"5767ce0d00c740e1a27c8cada4f0bed3": {
|
||||
"votes": 825,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeidwndmcixaxejjcoln57s6gcyqfk5pl5ahru5xe3s26gjbz52iara/22.svg",
|
||||
"optimized_direct_url": null
|
||||
},
|
||||
"02c73fb20d6b4f15b2acaeba5ca95d50": {
|
||||
"votes": 807,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeiaxksvajicisglq6hcozoyqioi33rwinckljneoh2h4ejeinopmru/81.png",
|
||||
"optimized_direct_url": "https://bafybeiasaz3ylcprsk5nrth4yyqje6h3e4cndhn4xziy44qqc6m7v7lzb4.ipfs.w3s.link/81.webp"
|
||||
},
|
||||
"e023e69b2ff5444dbbc8c8aae9e7659a": {
|
||||
"votes": 791,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeietro32s6figxyem7cxq73bgxhrn7bht4nfirmlgik33qqaxrqti4/27.svg",
|
||||
"optimized_direct_url": null
|
||||
},
|
||||
"5feb39731edb4e6d8d390a46adaae8bc": {
|
||||
"votes": 786,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeigrilvvhavk6pswvx66cu3ax7t5ypxsuspmdxo5mw4lunognhuaba/24.svg",
|
||||
"optimized_direct_url": null
|
||||
},
|
||||
"e4726e1300f24806b9da6d2df93c5070": {
|
||||
"votes": 761,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeic2kkdb5vhzdzs4qteqt5ff4d2dylyr32c65cbhd6hxbnsc7v7r7e/89.svg",
|
||||
"optimized_direct_url": null
|
||||
},
|
||||
"8bd5ba267bd34a8799efc1e3e6d61f84": {
|
||||
"votes": 754,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeicgjkp7kupxect7pofhwtmifw3aibetbxraofns7gjjwozhby3kvy/revanced-logo.svg",
|
||||
"optimized_direct_url": null
|
||||
},
|
||||
"3ea2e9525fbc49f895efd5a7e12d283b": {
|
||||
"votes": 668,
|
||||
"logo_direct_url": "https://w3s.link/ipfs/bafybeid4rvrsr5l5rwm4qoxaibtmzspz66qrh6yrmyyahpkwfvigg36h5u/20.png",
|
||||
"optimized_direct_url": "https://bafybeic67d3tvroalo7nvo63twvys5wus7chwd7mq7qqzz3ewcjkugjpy4.ipfs.w3s.link/20.webp"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user