Skip to content

Commit

Permalink
2023.10.07.1
Browse files Browse the repository at this point in the history
  • Loading branch information
oiimrosabel committed Oct 6, 2023
1 parent 7188885 commit 0a80ffc
Show file tree
Hide file tree
Showing 19 changed files with 101 additions and 157 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ coverage
*.sln
*.sw?

.vite
production.sh
.vite
46 changes: 23 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prettyheroes",
"version": "0.0.1",
"version": "fang",
"private": true,
"scripts": {
"dev": "vite",
Expand Down
File renamed without changes
35 changes: 0 additions & 35 deletions public/flags/test.txt

This file was deleted.

25 changes: 1 addition & 24 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
<script setup>
import HomePage from "@/views/HomePage.vue";
import HeroCreator from "@/views/HeroCreator.vue";
import HeroPage from "@/views/HeroPage.vue";
import LoadingPage from "@/components/Transition/LoadingPage.vue";
function currentPage(route) {
switch (route.path) {
case '/':
return "HOME";
case '/creator':
return "CREATOR";
default:
return "HERO";
}
}
</script>

<template>
<HomePage v-if="currentPage($route) === 'HOME'"/>
<HeroCreator v-if="currentPage($route) === 'CREATOR'"/>
<Suspense v-if="currentPage($route) === 'HERO'">
<template #fallback>
<LoadingPage/>
</template>
<HeroPage/>
</Suspense>
<router-view></router-view>
</template>

<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion src/assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

@media screen and (orientation: portrait) {
:root{
:root {
--col: var(--wi);
--al: #353056;
}
Expand Down
35 changes: 19 additions & 16 deletions src/assets/js/fetchResult.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {load} from "js-yaml";
import {parse} from "smol-toml";
import {refactorToml, refactorYaml} from "@/assets/js/checkFile";
import homeInfo from "@/assets/json/homeInfo.json"

export async function fetchWebsite(url) {
let res = null;
Expand All @@ -15,7 +16,7 @@ export async function fetchWebsite(url) {
return res.text();
}

export function loadAsToml(fetchedContent) {
export function loadAsToml(fetchedContent, noColor) {
let loadedContent = null;
try {
loadedContent = parse(fetchedContent);
Expand All @@ -25,29 +26,31 @@ export function loadAsToml(fetchedContent) {

refactorToml(loadedContent);

document.querySelector('head title').textContent = `${loadedContent.title.title} - PrettyHeroes`;
document.querySelector('head title').textContent = `${loadedContent.title.title} - ${homeInfo.appName}`;
document.querySelector("link[rel~='icon']").href = loadedContent.title.img;
document.querySelector("meta[name='description']").content = loadedContent.title.catchphrase;
document.querySelector("meta[name='og:title']").content = loadedContent.title.title;
document.querySelector("meta[name='og:description']").content = loadedContent.title.catchphrase;

let params = {
'--cbg': loadedContent.colors.background,
'--cwi': loadedContent.colors.widget,
'--clk': loadedContent.colors.link,
'--cho': loadedContent.colors.hover,
'--ctt': loadedContent.colors.title,
'--ctxt': loadedContent.colors.text
}
for (let elem in params) {
if (params[elem] !== undefined) {
document.documentElement.style.setProperty(elem, params[elem]);
if (!noColor) {
let params = {
'--cbg': loadedContent.colors.background,
'--cwi': loadedContent.colors.widget,
'--clk': loadedContent.colors.link,
'--cho': loadedContent.colors.hover,
'--ctt': loadedContent.colors.title,
'--ctxt': loadedContent.colors.text
}
for (let elem in params) {
if (params[elem] !== undefined) {
document.documentElement.style.setProperty(elem, params[elem]);
}
}
}
return loadedContent;
}

export function loadAsYaml(fetchedContent) {
export function loadAsYaml(fetchedContent, noColor) {
let loadedContent = null;
try {
loadedContent = load(fetchedContent);
Expand Down Expand Up @@ -91,12 +94,12 @@ export function loadAsYaml(fetchedContent) {
url: loadedContent.urls[elem]
})
}
document.querySelector('head title').textContent = `${loadedContent.title} - PrettyHeroes`;
document.querySelector('head title').textContent = `${loadedContent.title} - ${homeInfo.appName}`;
document.querySelector("head link[rel~='icon']").href = loadedContent.icon;
document.querySelector("head meta[name='description']").content = "From Pronounce";
document.querySelector("head meta[name='og:title']").content = loadedContent.title;
document.querySelector("head meta[name='og:description']").content = "From Pronounce";
if (loadedContent.colors === undefined) {
if (loadedContent.colors === undefined || noColor) {
return result;
}
let params = {
Expand Down
8 changes: 4 additions & 4 deletions src/assets/json/flagsMatches.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
"img": "grey.png",
"name": "Greysexual"
},
"homo": {
"img": "homo.png",
"name": "Homosexual"
"pride": {
"img": "pride.png",
"name": "LGBTQIA+"
},
"inter": {
"img": "inter.png",
Expand Down Expand Up @@ -123,7 +123,7 @@
"img": "transfem.png",
"name": "Transfeminine"
},
"transmac": {
"transmasc": {
"img": "transmasc.png",
"name": "Transmasculine"
},
Expand Down
12 changes: 4 additions & 8 deletions src/components/Creator/Dummy/HelpPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ defineEmits([
border-radius: 32px;
padding: 32px;
float: right;
animation: slidein ease-out 0.25s;
animation: Blur ease-out 0.5s;
}
#helpmess > div > * {
Expand Down Expand Up @@ -148,7 +147,6 @@ defineEmits([
justify-content: center;
cursor: pointer;
transition: all 0.25s;
}
#helpmess > div > div:not(.flags) > a:hover {
Expand Down Expand Up @@ -178,8 +176,7 @@ defineEmits([
z-index: 15;
align-items: center;
justify-content: center;
animation: Blur ease-out 0.5s;
}
}
#helpmess > div {
width: 80vw;
Expand All @@ -190,9 +187,8 @@ defineEmits([
height: fit-content;
padding: 5vh 0;
float: right;
animation: slidein ease-out 0.25s;
}
animation: Blur ease-out 0.5s;
}
#helpmess > div > * {
margin: 0;
Expand Down
4 changes: 4 additions & 0 deletions src/components/Hero/HeroTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ const props = defineProps(
.herotitle > div > h1 {
color: var(--ctt);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 50vw;
}
.herotitle > img {
Expand Down
9 changes: 2 additions & 7 deletions src/components/Hero/PronounceCompat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ defineEmits([
z-index: 10;
align-items: center;
justify-content: center;
animation: Blur ease-out 0.5s;
}
.promess > div {
Expand All @@ -88,8 +87,7 @@ defineEmits([
height: fit-content;
padding: 32px;
float: right;
animation: slidein ease-out 0.25s;
animation: Blur ease-out 0.5s;
}
.promess > div > * {
Expand Down Expand Up @@ -130,7 +128,6 @@ defineEmits([
justify-content: center;
cursor: pointer;
transition: all 0.25s;
}
.promess > div > div > a:hover {
Expand Down Expand Up @@ -160,7 +157,6 @@ defineEmits([
z-index: 15;
align-items: center;
justify-content: center;
animation: Blur ease-out 0.5s;
background: var(--bg);
}
Expand All @@ -173,8 +169,7 @@ defineEmits([
height: fit-content;
padding: 5vh 0;
float: right;
animation: slidein ease-out 0.25s;
animation: Blur ease-out 0.5s;
}
.promess > div > * {
Expand Down
Loading

0 comments on commit 0a80ffc

Please sign in to comment.