Skip to content

Commit

Permalink
moved to 2024300
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkIntaqt committed Oct 6, 2024
1 parent a38066b commit 61131ca
Show file tree
Hide file tree
Showing 9 changed files with 1,693 additions and 1,322 deletions.
2 changes: 1 addition & 1 deletion src/css/user.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ img.mclogo {

.profile.c:not(.cid0):not(.cid1):not(.cid2):not(.cid3):not(.cid4):not(.cid5):not(.cid2022000):not(.cid2023000):not(
.cid2024100
):not(.cid2024200)::before {
):not(.cid2024200):not(.cid2024300)::before {
height: 80px;
width: 80px;
margin: 30px;
Expand Down
102 changes: 54 additions & 48 deletions src/func/generateChallengeBlock.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,62 @@
import { Fragment } from "react"
import { LazyLoadImage } from "react-lazy-load-image-component"
import aboutChallenge from "../css/aboutChallenge.module.css"
import goTo from "./goTo"
import capstone from "../img/capstone.svg"
import { checkExists } from "./arrayManipulationFunctions.js"

import { Fragment } from "react";
import { LazyLoadImage } from "react-lazy-load-image-component";
import aboutChallenge from "../css/aboutChallenge.module.css";
import goTo from "./goTo";
import capstone from "../img/capstone.svg";
import { checkExists } from "./arrayManipulationFunctions.js";

/**
* Function to generate a react object which shows a challenge
* @param {object} content
* @param {boolean} genLine
* @returns {object} - React object containing the name and the image of a challenge
*/
export default function generateObject(content, genLine = true, challengeId = -1) {

// Additional stylesheet might be needed, as the challenge will be colored blue if it is the current one
let additionalStylesheet = ""

if (content.id === challengeId) {

additionalStylesheet = " " + aboutChallenge.this

}

let imageurl = "https://lolcdn.darkintaqt.com/cdn/np-token" + content.id
if (content.id < 10 || content.id === 2022000 || content.id === 2023000 || content.id === 2024100 || content.id === 2024200) {
if (content.id !== 0) {
imageurl = "https://cdn.darkintaqt.com/lol/static/challenges/" + content.translation.name.toLowerCase().replace(" ", "") + ".svg"
}
* Function to generate a react object which shows a challenge
* @param {object} content
* @param {boolean} genLine
* @returns {object} - React object containing the name and the image of a challenge
*/
export default function generateObject(
content,
genLine = true,
challengeId = -1
) {
// Additional stylesheet might be needed, as the challenge will be colored blue if it is the current one
let additionalStylesheet = "";

if (content.id === challengeId) {
additionalStylesheet = " " + aboutChallenge.this;
}

let imageurl = "https://lolcdn.darkintaqt.com/cdn/np-token" + content.id;
if (
content.id < 10 ||
content.id === 2022000 ||
content.id === 2023000 ||
content.id === 2024100 ||
content.id === 2024200 ||
content.id === 2024300
) {
if (content.id !== 0) {
imageurl =
"https://cdn.darkintaqt.com/lol/static/challenges/" +
content.translation.name.toLowerCase().replace(" ", "") +
".svg";
}
}

return <Fragment key={content.id}>

{genLine ?
<div className={aboutChallenge.line}></div>
: null}

<a href={"/challenge/" + content.id} className={aboutChallenge.category + additionalStylesheet} onClick={goTo}>

{checkExists(content.tags.isCapstone)
? <img src={capstone} alt="" className={aboutChallenge.capstone} /> :
null}

<LazyLoadImage height={28} width={28} src={imageurl} alt={""} />

<p>

{content.translation.name}
return (
<Fragment key={content.id}>
{genLine ? <div className={aboutChallenge.line}></div> : null}

</p>
<a
href={"/challenge/" + content.id}
className={aboutChallenge.category + additionalStylesheet}
onClick={goTo}
>
{checkExists(content.tags.isCapstone) ? (
<img src={capstone} alt="" className={aboutChallenge.capstone} />
) : null}

</a>
<LazyLoadImage height={28} width={28} src={imageurl} alt={""} />

<p>{content.translation.name}</p>
</a>
</Fragment>
}
);
}
Loading

0 comments on commit 61131ca

Please sign in to comment.