Skip to content

Commit 64d897a

Browse files
ayumitkbobo-k2
andauthored
Kaizen dApp Staking (#1001)
* add basic card slide ui * add new listing list * Add swiper navigation style * Add background image to dapps staking top page * update panel section style * update style * update my staking and on chain data section style * update slide card style * fix styles * update cards style * fix ads area style * fix dynamic ads section name style * Add youtube thumbnails * update staking video * upate ads thumbnails * remove hover effect * fix box shadow mask * fix top metric style * update on chain data section style * update background repeat * update background style * update scoped style * update my dapps and unbonding list background style * add info for dapps owners * Revert "Merge branch 'main' into feat/kaizen-dapp-staking" This reverts commit 2957349, reversing changes made to 8f49105. * fix styles * Add registration modal * Campaign logic (#1016) * Campaigns logic * Add campaigns * Add short description * Node version for checkout * Remove UA account icon * Check if images array is empty * Algem campaign image * Introduction logic * Fix registration page style * clean up * clean up * Add image info * Revert hide AuIcon --------- Co-authored-by: Bobo <bobo.kovacevic@gmail.com>
1 parent f6d9192 commit 64d897a

42 files changed

Lines changed: 861 additions & 487 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"serverless-http": "^2.7.0",
7979
"store": "^2.0.12",
8080
"stream": "^0.0.2",
81+
"swiper": "^11.0.3",
8182
"v-odometer": "^2.0.1",
8283
"validator": "^13.7.0",
8384
"vue-i18n": "^9.2.2",
195 KB
Loading
194 KB
Loading
79.5 KB
Loading
43.1 KB
Loading
33.5 KB
Loading

src/components/dapp-staking/StakingTop.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
<dapp-list category="Utility" />
2525
<dapp-list category="Others" />
2626
</div>
27+
28+
<Teleport to="#staking-top-bg">
29+
<div
30+
class="dapps-staking-bg"
31+
:style="{ backgroundImage: `url(${isDarkTheme ? bg_img.dark : bg_img.light})` }"
32+
/>
33+
</Teleport>
2734
</div>
2835
<div v-else />
2936
</template>
@@ -94,7 +101,13 @@ export default defineComponent({
94101
store.dispatch('dapps/getTvl');
95102
});
96103
97-
return { isReady, isZkEvm };
104+
const isDarkTheme = computed<boolean>(() => store.getters['general/theme'] === 'DARK');
105+
const bg_img = {
106+
light: require('/src/assets/img/dapps_staking_bg_light.webp'),
107+
dark: require('/src/assets/img/dapps_staking_bg_dark.webp'),
108+
};
109+
110+
return { isReady, isZkEvm, isDarkTheme, bg_img };
98111
},
99112
});
100113
</script>
Lines changed: 46 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
<template>
2-
<div class="wrapper--cards">
3-
<div v-for="(t, index) in items" :key="index" class="card" @click="goToLink(t.link)">
4-
<div
5-
class="wrapper--img"
6-
:style="`background-image: url('${isShiden ? bg_img.shiden_hero : bg_img.astar_hero}')`"
7-
></div>
8-
<div class="txt--subtitle">{{ t.subtitle }}</div>
9-
<div class="txt--title">{{ t.title }}</div>
10-
</div>
2+
<div class="wrapper--ads-area">
3+
<swiper
4+
class="swiper--ads-area"
5+
:slides-per-view="1.25"
6+
:slides-per-group="1"
7+
:space-between="24"
8+
:navigation="true"
9+
:parallax="true"
10+
:modules="modules"
11+
:breakpoints="{
12+
'768': {
13+
slidesPerView: 3,
14+
slidesPerGroup: 3,
15+
},
16+
}"
17+
>
18+
<swiper-slide v-for="(t, index) in items" :key="index">
19+
<div class="card--swiper" @click="goToLink(t.link)">
20+
<img :src="t.img" class="card__img" />
21+
<div class="card__bottom">
22+
<div>
23+
<div class="text--subtitle">{{ t.subtitle }}</div>
24+
<div class="text--title">{{ t.title }}</div>
25+
</div>
26+
</div>
27+
</div>
28+
</swiper-slide>
29+
</swiper>
1130
</div>
1231
</template>
1332
<script lang="ts">
@@ -16,7 +35,17 @@ import { useNetworkInfo } from 'src/hooks';
1635
import { endpointKey } from 'src/config/chainEndpoints';
1736
import adsData from 'src/data/ads.json';
1837
38+
// Import Swiper
39+
import { Swiper, SwiperSlide } from 'swiper/vue';
40+
import 'swiper/css';
41+
import 'swiper/css/navigation';
42+
import { Navigation } from 'swiper/modules';
43+
1944
export default defineComponent({
45+
components: {
46+
Swiper,
47+
SwiperSlide,
48+
},
2049
setup() {
2150
const bg_img = {
2251
astar_hero: require('/src/assets/img/banner/banner-02-astar.png'),
@@ -25,87 +54,25 @@ export default defineComponent({
2554
const { currentNetworkIdx } = useNetworkInfo();
2655
const isShiden = computed(() => currentNetworkIdx.value === endpointKey.SHIDEN);
2756
28-
const items = adsData;
57+
const items = adsData.map((item) => {
58+
return {
59+
...item,
60+
img: item.img === '' ? bg_img.astar_hero : item.img,
61+
};
62+
});
2963
3064
const goToLink = (link: string) => {
3165
window.open(link, '_blank');
3266
};
3367
3468
return {
69+
modules: [Navigation],
3570
items,
36-
bg_img,
37-
isShiden,
3871
goToLink,
3972
};
4073
},
4174
});
4275
</script>
4376
<style lang="scss" scoped>
44-
@import 'src/css/quasar.variables.scss';
45-
.wrapper--cards {
46-
display: grid;
47-
grid-template-columns: auto auto auto;
48-
gap: 16px;
49-
justify-content: center;
50-
padding: 0 16px;
51-
margin-top: 48px;
52-
margin-bottom: 48px;
53-
@media (min-width: $md) {
54-
justify-content: center;
55-
gap: 24px;
56-
}
57-
width: 100%;
58-
overflow-x: auto;
59-
overflow-y: hidden;
60-
justify-content: left;
61-
&::-webkit-scrollbar {
62-
display: none;
63-
}
64-
}
65-
.card {
66-
flex-basis: 30%;
67-
cursor: pointer;
68-
69-
margin-bottom: 48px;
70-
@media (min-width: $md) {
71-
flex-basis: 0;
72-
}
73-
.wrapper--img {
74-
background: rgb(110, 110, 110);
75-
background-size: cover;
76-
height: 200px;
77-
border-radius: 6px;
78-
width: 300px;
79-
@media (min-width: $md) {
80-
width: 100%;
81-
}
82-
@media (min-width: $xl) {
83-
width: 310px;
84-
}
85-
}
86-
.txt--subtitle {
87-
font-weight: 600;
88-
font-size: 14px;
89-
line-height: 17px;
90-
color: #b1b7c1;
91-
margin-top: 16px;
92-
}
93-
.txt--title {
94-
font-weight: 600;
95-
font-size: 20px;
96-
line-height: 18px;
97-
color: $navy-1;
98-
margin-top: 10px;
99-
}
100-
@media (max-width: $sm) {
101-
margin-bottom: 40px;
102-
}
103-
}
104-
.body--dark {
105-
.card {
106-
.txt--title {
107-
color: $gray-1;
108-
}
109-
}
110-
}
77+
@import './styles/ads-area.scss';
11178
</style>

0 commit comments

Comments
 (0)