Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

326 gallery fixes #327

Merged
merged 8 commits into from
Nov 15, 2024
34 changes: 23 additions & 11 deletions src/components/elements/GalleryComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
</div>
</div>
</div>

<div class="mt-12 flex flex-row justify-center items-center">
<BaseCCButton
:type="Color.RED"
@click="loadyes()"
:class="{ invisible: !loadButtonVisible }"
>
Reckless Card Loading
</BaseCCButton>
</div>
</template>

<script setup lang="ts">
Expand All @@ -23,6 +33,8 @@ import { computed, onBeforeUnmount, onMounted, reactive, watch } from "vue";
import { useCards } from "@/def-composables/useCards";
import { Card } from "@/model/Card";
import CardComponent from "@/components/elements/CardComponent.vue";
import { Color } from "@/components/utils/color";
import BaseCCButton from "@/components/elements/CCButton/BaseCCButton.vue";

const { getCard } = useCards();
const emit = defineEmits(["cardClicked"]);
Expand Down Expand Up @@ -59,32 +71,32 @@ const cardIdsOnPage = computed(() => {

const shadowClass = (card) => {
let classes = 0
console.log("CARD" ,card)
R.forEachObjIndexed(entry => {
if (entry) classes++;
}, card.Class)
console.log(classes)
if (classes > 1) return {
'drop-shadow-glowCCYellow': true,
}
else {
return {
else return {
'drop-shadow-glowCCRed': card.Class.Culture,
'drop-shadow-glowCCBlue': card.Class.Technology,
'drop-shadow-glowCCGreen': card.Class.Nature,
'drop-shadow-glowCCPurple': card.Class.Mysticism,
'text-danger': false
}
}
'drop-shadow-glowCCPurple': card.Class.Mysticism
}
};



onMounted(() => {
state.cardsOnPage = props.cardsPerPage;
window.addEventListener("scroll", onScroll);
});

let loadButtonVisible = true;

const loadyes = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please not loadyes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we rename to loadYouLike()?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please something propper

state.cardsOnPage += 10;
loadButtonVisible = false;
window.addEventListener("scroll", onScroll);
};

onBeforeUnmount(() => {
window.removeEventListener("scroll", onScroll);
});
Expand Down