Skip to content

Commit

Permalink
GuestBanner for home page (#1058)
Browse files Browse the repository at this point in the history
* guest banner

* update icons

* fix style details

* typo

* upgrade casdoor-js-sdk
  • Loading branch information
nighca authored Oct 31, 2024
1 parent 20729da commit b8e95cd
Show file tree
Hide file tree
Showing 12 changed files with 291 additions and 152 deletions.
9 changes: 4 additions & 5 deletions spx-gui/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 spx-gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@vue/runtime-dom": "^3.4.10",
"@vue/test-utils": "^2.4.5",
"@vue/tsconfig": "^0.5.1",
"casdoor-js-sdk": "^0.15.0",
"casdoor-js-sdk": "^0.16.0",
"dayjs": "^1.11.10",
"eslint": "^8.56.0",
"eslint-plugin-vue": "^9.20.1",
Expand Down
60 changes: 60 additions & 0 deletions spx-gui/src/components/community/home/banner/GuestBanner.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<script setup lang="ts">
import { useUserStore } from '@/stores/user'
import { UIButton } from '@/components/ui'
import CommunityCard from '../../CommunityCard.vue'
const userStore = useUserStore()
function handleJoin() {
userStore.initiateSignIn()
}
</script>

<template>
<CommunityCard class="guest-banner">
<div class="main">
<h1 class="title">
{{ $t({ en: 'Join Go+ Builder', zh: '加入 Go+ Builder' }) }}
</h1>
<h4 class="sub-title">
{{ $t({ en: 'Build and share your projects', zh: '创作并分享你的作品' }) }}
</h4>
<UIButton class="join-btn" type="primary" size="large" @click="handleJoin">
{{ $t({ en: 'Join now', zh: '立即加入' }) }}
</UIButton>
</div>
</CommunityCard>
</template>

<style lang="scss" scoped>
.guest-banner {
padding: 12px;
}
.main {
position: relative;
padding: 48px 52px 50px;
border-radius: var(--ui-border-radius-2);
color: #073156;
background-color: #f0faff;
background-image: url('./bg.svg');
background-repeat: no-repeat;
background-position: center right 54px;
}
.title {
font-size: 24px;
line-height: 1.5;
}
.sub-title {
font-size: 13px;
line-height: 20px;
margin-top: 8px;
}
.join-btn {
margin-top: 28px;
}
</style>
109 changes: 109 additions & 0 deletions spx-gui/src/components/community/home/banner/bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 23 additions & 8 deletions spx-gui/src/components/community/user/sidebar/UserSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,44 @@ defineProps<{
<CommunityCard class="user-sidebar">
<!-- TODO: check text here -->
<UserSidebarItem :to="getUserPageRoute(username, 'overview')">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
<path
d="M15.5833 19.0207C13.6885 19.0207 12.1458 17.4788 12.1458 15.5832C12.1458 13.6875 13.6885 12.1457 15.5833 12.1457C17.478 12.1457 19.0208 13.6875 19.0208 15.5832C19.0208 17.4788 17.478 19.0207 15.5833 19.0207ZM15.5833 13.5207C14.4466 13.5207 13.5208 14.4456 13.5208 15.5832C13.5208 16.7208 14.4466 17.6457 15.5833 17.6457C16.72 17.6457 17.6458 16.7208 17.6458 15.5832C17.6458 14.4456 16.72 13.5207 15.5833 13.5207ZM16.9583 9.854H14.2083C12.9167 9.854 12.1458 9.08309 12.1458 7.7915V5.0415C12.1458 3.74992 12.9167 2.979 14.2083 2.979H16.9583C18.2499 2.979 19.0208 3.74992 19.0208 5.0415V7.7915C19.0208 9.08309 18.2499 9.854 16.9583 9.854ZM14.2083 4.354C13.6684 4.354 13.5208 4.50159 13.5208 5.0415V7.7915C13.5208 8.33142 13.6684 8.479 14.2083 8.479H16.9583C17.4982 8.479 17.6458 8.33142 17.6458 7.7915V5.0415C17.6458 4.50159 17.4982 4.354 16.9583 4.354H14.2083ZM7.79163 9.854H5.04163C3.75004 9.854 2.97913 9.08309 2.97913 7.7915V5.0415C2.97913 3.74992 3.75004 2.979 5.04163 2.979H7.79163C9.08321 2.979 9.85413 3.74992 9.85413 5.0415V7.7915C9.85413 9.08309 9.08321 9.854 7.79163 9.854ZM5.04163 4.354C4.50171 4.354 4.35413 4.50159 4.35413 5.0415V7.7915C4.35413 8.33142 4.50171 8.479 5.04163 8.479H7.79163C8.33154 8.479 8.47913 8.33142 8.47913 7.7915V5.0415C8.47913 4.50159 8.33154 4.354 7.79163 4.354H5.04163ZM7.79163 19.0207H5.04163C3.75004 19.0207 2.97913 18.2498 2.97913 16.9582V14.2082C2.97913 12.9166 3.75004 12.1457 5.04163 12.1457H7.79163C9.08321 12.1457 9.85413 12.9166 9.85413 14.2082V16.9582C9.85413 18.2498 9.08321 19.0207 7.79163 19.0207ZM5.04163 13.5207C4.50171 13.5207 4.35413 13.6683 4.35413 14.2082V16.9582C4.35413 17.4981 4.50171 17.6457 5.04163 17.6457H7.79163C8.33154 17.6457 8.47913 17.4981 8.47913 16.9582V14.2082C8.47913 13.6683 8.33154 13.5207 7.79163 13.5207H5.04163Z"
d="M1.5 3.79683C1.5 3.5855 1.58395 3.38283 1.73338 3.23339C1.88282 3.08396 2.08549 3.00001 2.29683 3.00001H6.81536C8.11896 3.00001 9.27701 3.62684 10.0027 4.59472C10.3734 4.09867 10.855 3.69614 11.4089 3.41926C11.9629 3.14238 12.5739 2.99881 13.1931 3.00001H17.7032C17.9145 3.00001 18.1172 3.08396 18.2666 3.23339C18.416 3.38283 18.5 3.5855 18.5 3.79683V14.9524C18.5 15.1637 18.416 15.3664 18.2666 15.5158C18.1172 15.6653 17.9145 15.7492 17.7032 15.7492H12.9148C12.6009 15.7492 12.29 15.811 12 15.9312C11.71 16.0513 11.4464 16.2274 11.2245 16.4494L10.5636 17.1091C10.4142 17.2583 10.2117 17.3422 10.0005 17.3422C9.78937 17.3422 9.58685 17.2583 9.43744 17.1091L8.77661 16.4494C8.55463 16.2274 8.2911 16.0513 8.00108 15.9312C7.71105 15.811 7.4002 15.7492 7.08628 15.7492H2.29683C2.08549 15.7492 1.88282 15.6653 1.73338 15.5158C1.58395 15.3664 1.5 15.1637 1.5 14.9524V3.79683ZM9.20371 14.7654L9.20796 9.37567L9.20583 6.98201C9.20527 6.34838 8.95317 5.7409 8.50493 5.29306C8.05669 4.84522 7.44898 4.59366 6.81536 4.59366H3.09365V14.1556H7.08521C7.83468 14.1555 8.56896 14.3669 9.20371 14.7654ZM10.8016 6.98413L10.7974 14.7633C11.4317 14.3659 12.1652 14.1553 12.9137 14.1556H16.9053V4.59366H13.1921C12.5581 4.59366 11.9501 4.84551 11.5018 5.29381C11.0535 5.74211 10.8016 6.35014 10.8016 6.98413Z"
fill="currentColor"
stroke="currentColor"
stroke-width="0.4"
/>
</svg>
{{ $t({ en: 'Overview', zh: '概览' }) }}
</UserSidebarItem>
<UserSidebarItem :to="getUserPageRoute(username, 'projects')">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
<path
d="M5.78125 11.6992C5.58594 12.2201 5.41667 12.7148 5.27344 13.1836C6.08073 12.5977 7.03125 12.2331 8.125 12.0898C9.15365 11.9596 10.1172 11.582 11.0156 10.957C11.875 10.3451 12.5456 9.59635 13.0273 8.71094L11.8164 7.5L13.8281 5.48828C14.1927 5.1237 14.5898 4.46615 15.0195 3.51562C12.7409 3.86719 10.8333 4.74609 9.29688 6.15234C7.83854 7.48047 6.66667 9.32943 5.78125 11.6992ZM14.1602 7.5L15 8.33984C14.7135 9.1862 14.2578 9.99349 13.6328 10.7617C12.9948 11.556 12.2396 12.207 11.3672 12.7148C10.4167 13.2747 9.40755 13.6198 8.33984 13.75C6.11328 14.0234 4.72005 15.5534 4.16016 18.3398H2.5L2.55859 18.0078C2.80599 16.4714 3.04036 15.2474 3.26172 14.3359C3.63932 12.7344 4.10156 11.3021 4.64844 10.0391C5.35156 8.4375 6.19792 7.07031 7.1875 5.9375C8.35938 4.59635 9.73958 3.57422 11.3281 2.87109C13.125 2.0638 15.1823 1.66016 17.5 1.66016C16.6667 4.16016 15.8333 5.82682 15 6.66016L14.1602 7.5Z"
fill="currentColor"
d="M7.11634 2.93311H4.01097C3.06592 2.93311 2.2998 3.69922 2.2998 4.64427V14.5685C2.2998 15.5135 3.06592 16.2796 4.01097 16.2796H15.9885C16.9335 16.2796 17.6996 15.5135 17.6996 14.5685V8.39797C17.6996 7.45292 16.9335 6.68681 15.9885 6.68681H12.0024C11.8144 6.68681 11.6328 6.61872 11.4911 6.49513L7.62765 3.12479C7.48598 3.0012 7.30434 2.93311 7.11634 2.93311Z"
stroke="currentColor"
stroke-width="1.44671"
/>
<path
d="M8.85693 4.18408L15.9886 4.18408C16.9337 4.18408 17.6998 4.9502 17.6998 5.89525V9.18902"
stroke="currentColor"
stroke-width="1.44671"
/>
</svg>
{{ $t({ en: 'Projects', zh: '项目' }) }}
</UserSidebarItem>
<UserSidebarItem :to="getUserPageRoute(username, 'likes')">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M16.0254 4.82951C14.5205 3.36976 12.1131 3.29924 10.5221 4.62428C10.3706 4.75053 10.1848 4.81182 10.0002 4.8095C9.81558 4.81182 9.62984 4.75053 9.47825 4.62428C7.88727 3.29924 5.47986 3.36976 3.97495 4.82951C2.4814 6.27824 2.41309 8.57429 3.76366 10.1001C3.78351 10.1225 3.80187 10.1457 3.81875 10.1696L10.0002 16.1656L16.1816 10.1696C16.1985 10.1457 16.2169 10.1225 16.2367 10.1001C17.5873 8.57429 17.519 6.27824 16.0254 4.82951ZM17.5387 11.0397C19.3456 8.87674 19.2105 5.68991 17.1395 3.68103C15.1942 1.79416 12.1908 1.57613 10.0002 3.02191C7.80956 1.57613 4.8062 1.79416 2.86094 3.68103C0.789911 5.68991 0.654812 8.87674 2.46167 11.0397C2.49837 11.1033 2.54397 11.1621 2.59765 11.2142L9.4432 17.8543C9.75353 18.1553 10.2469 18.1553 10.5572 17.8543L17.4027 11.2142C17.4564 11.1621 17.502 11.1033 17.5387 11.0397Z"
fill="currentColor"
stroke="currentColor"
stroke-width="0.1"
stroke-linejoin="round"
/>
<path
d="M16.0349 3.96484C16.6209 4.55078 17.0343 5.24089 17.2752 6.03516C17.516 6.82943 17.5584 7.63672 17.4021 8.45703C17.9099 8.58724 18.3461 8.83464 18.7107 9.19922C18.9841 9.48568 19.199 9.8112 19.3552 10.1758C19.5115 10.5404 19.5896 10.918 19.5896 11.3086C19.5896 11.6992 19.5115 12.0768 19.3552 12.4414C19.199 12.806 18.9841 13.1315 18.7107 13.418L14.1599 17.9102L11.6404 15.4102L9.15992 17.9102L2.10914 10.8203C1.5232 10.1693 1.13583 9.42708 0.947031 8.59375C0.758229 7.76042 0.781015 6.93359 1.01539 6.11328C1.24977 5.29297 1.6762 4.57357 2.29469 3.95508C2.91318 3.33659 3.63258 2.91341 4.45289 2.68555C5.2732 2.45768 6.10328 2.43815 6.94312 2.62695C7.78297 2.81575 8.5219 3.19661 9.15992 3.76953C9.81096 3.19661 10.5532 2.81575 11.3865 2.62695C12.2198 2.43815 13.0499 2.46094 13.8767 2.69531C14.7035 2.92969 15.4229 3.35286 16.0349 3.96484ZM10.8005 10.3906C10.5401 10.638 10.4099 10.944 10.4099 11.3086C10.4099 11.6732 10.5401 11.9792 10.8005 12.2266L14.1599 15.5664L17.5388 12.2266C17.7862 11.9792 17.9099 11.6732 17.9099 11.3086C17.9099 10.944 17.7797 10.6348 17.5193 10.3809C17.2589 10.127 16.9464 10 16.5818 10C16.2172 10 15.9047 10.1302 15.6443 10.3906L14.1599 11.8555L12.6951 10.3906C12.4347 10.1302 12.1189 10 11.7478 10C11.3767 10 11.061 10.1302 10.8005 10.3906ZM3.47633 5.13672C3.07268 5.55339 2.79273 6.0319 2.63648 6.57227C2.48023 7.11263 2.4607 7.6595 2.57789 8.21289C2.69508 8.76628 2.94247 9.25781 3.32008 9.6875L9.15992 15.5469L10.4685 14.2383L9.62867 13.418C9.34221 13.1315 9.12411 12.806 8.97437 12.4414C8.82464 12.0768 8.74977 11.6992 8.74977 11.3086C8.74977 10.918 8.82464 10.5404 8.97437 10.1758C9.12411 9.8112 9.34221 9.48568 9.62867 9.19922C10.0063 8.82161 10.4522 8.56771 10.9666 8.4375C11.4809 8.30729 11.9952 8.30729 12.5095 8.4375C13.0239 8.56771 13.4763 8.82161 13.867 9.19922L14.1599 9.51172L14.4724 9.19922C14.824 8.86068 15.2276 8.61979 15.6834 8.47656C15.9047 7.76042 15.8852 7.05078 15.6248 6.34766C15.3643 5.64453 14.9216 5.09115 14.2966 4.6875C13.6716 4.28385 12.9848 4.11458 12.2361 4.17969C11.4874 4.24479 10.8331 4.52474 10.2732 5.01953L9.15992 6.01562L8.04664 5.01953C7.61695 4.62891 7.12542 4.37175 6.57203 4.24805C6.01865 4.12435 5.46852 4.14062 4.92164 4.29688C4.37477 4.45312 3.89299 4.73307 3.47633 5.13672Z"
fill-rule="evenodd"
clip-rule="evenodd"
d="M15.1002 7.68023C14.9345 7.68023 14.8031 7.54467 14.7724 7.38185C14.6509 6.73746 14.143 6.22954 13.4986 6.108C13.3358 6.07729 13.2002 5.94591 13.2002 5.78023V4.78022C13.2002 4.61454 13.3349 4.47875 13.4999 4.49408C15.028 4.63602 16.2444 5.85241 16.3863 7.38051C16.4017 7.54548 16.2659 7.68023 16.1002 7.68023H15.1002Z"
fill="currentColor"
/>
</svg>
Expand Down
1 change: 1 addition & 0 deletions spx-gui/src/components/project/ProjectItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ const handleRemove = useMessageHandle(
height: 20px;
gap: 12px;
font-size: 13px;
line-height: 20px;
color: var(--ui-color-grey-700);
.part {
Expand Down
Loading

0 comments on commit b8e95cd

Please sign in to comment.