Skip to content

Commit

Permalink
chore(UI): applied the glowing effect to the buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanM3x committed Sep 7, 2021
1 parent 8fd06be commit 37247b9
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 46 deletions.
4 changes: 3 additions & 1 deletion components/interactables/Button/Button.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<button
:class="`button is-button is-${size} is-${type} ${outlined ? 'is-outlined' : ''} is-${fullWidth ? 'full-width' : 'normal-width'} ${inactive ? 'is-inactive' : ''}`"
v-on:click="action" :disabled="loading">
<UiGlowingCursorArea :class="`${!glow ? 'hide' : ''}`">
<!-- If the button is in the loading state -->
<div v-if="loading">
<!-- Loading Spinner -->
Expand All @@ -15,4 +16,5 @@
<font-awesome-icon v-if="icon" :icon="[icon.style, icon.name]" :class="`button-icon ${text.length ? 'button-icon-padded' : ''}`" />
<span v-if="text.length">{{ text }}</span>
</div>
</button>
</UiGlowingCursorArea>
</button>
3 changes: 1 addition & 2 deletions components/interactables/Button/Button.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.button {
min-width: 35px;
overflow: hidden;
.button-icon-padded {
margin-right: 0.25rem;
}
}
.is-full-width {
width: 100%;
}


6 changes: 6 additions & 0 deletions components/interactables/Button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ export default Vue.extend({
*/
fullWidth: Boolean,
inactive: Boolean,
//glowing effetc
glow: {
type: Boolean,
default: false,
},
},
})
</script>
Expand Down
4 changes: 4 additions & 0 deletions components/tailored/core/sidebar/Sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
:icon="{ style: 'far', name: 'user-friends' }"
:action="() => $router.push('/friends/list')"
:text="$t('global.friends')"
:glow="true"
/>
<span :class="$route.path.includes('/friends/list') ? 'label tag-inverted' : 'label'">
14
Expand All @@ -44,6 +45,7 @@
:action="() => $router.push('/files/browse')"
:icon="{ style: 'far', name: 'folder' }"
:text="$t('global.files')"
:glow="true"
/>
</div>

Expand All @@ -55,6 +57,7 @@
:icon="{ style: 'far', name: 'comment-alt-lines' }"
:text="$t('global.messages')"
:action="() => $store.commit('showSidebarUsers', true)"
:glow="true"
/>
<InteractablesButton
full-width
Expand All @@ -63,6 +66,7 @@
:icon="{ style: 'far', name: 'users' }"
:text="$t('global.groups')"
:action="() => $store.commit('showSidebarUsers', false)"
:glow="true"
/>
</div>
<div
Expand Down
4 changes: 0 additions & 4 deletions components/ui/CustomCursorArea/CustomCursorArea.html

This file was deleted.

31 changes: 0 additions & 31 deletions components/ui/CustomCursorArea/CustomCursorArea.vue

This file was deleted.

4 changes: 4 additions & 0 deletions components/ui/GlowingCursorArea/GlowingCursorArea.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div id="custom-cursor-area" @mousemove="moveCursor" @mouseover="hideCursor = false" @mouseleave="hideCursor = true">
<div v-if="!hideCursor" id="custom-cursor" ref="point" :style="cursorPoint"></div>
<slot />
</div>
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
#custom-cursor-area {
width: 100%;
height: 100%;
> * {
pointer-events: none;
}
&.hide {
#custom-cursor {
display: none;
}
}
}

#custom-cursor {
top: 0;
left: 0;
position: fixed;
width: 30px;
height: 30px;
position: absolute;
width: 80px;
height: 80px;
pointer-events: none;
user-select: none;
border-radius: 100%;
z-index: 55555555;
backface-visibility: hidden;
will-change: transform;
box-shadow: 0 0 8px #fff, inset 0 0 8px #fff;
-webkit-animation: pulse 2s linear 1s infinite;
// box-shadow: 0 0 8px #fff, inset 0 0 8px #fff;
// -webkit-animation: pulse 2s linear 1s infinite;
background: -webkit-radial-gradient(
rgba(255, 255, 255, 1),
rgba(255, 255, 255, 0.2),
rgba(255, 255, 255, 0.4),
rgba(255, 255, 255, 0.7)
rgba(134, 86, 86, 0.1)
);
opacity: 0.4;
box-shadow: 120px 80px 40px 20px #000;
opacity: 0.1;
}

@-webkit-keyframes pulse {
Expand Down
29 changes: 29 additions & 0 deletions components/ui/GlowingCursorArea/GlowingCursorArea.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<template src="./GlowingCursorArea.html"></template>
<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
data() {
return { xChild: 0, yChild: 0, hideCursor: true }
},
computed: {
cursorPoint(): string {
return `transform: translateX(${this.xChild - 25}px) translateY(${
this.yChild - 25
}px) translateZ(0) translate3d(0, 0, 0);`
},
},
methods: {
moveCursor(e: Event | any) {
let bounds = e.target.getBoundingClientRect()
this.xChild = e.clientX - bounds.left
this.yChild = e.clientY - bounds.top
},
},
mounted() {
// document.addEventListener('mousemove', this.moveCursor)
},
})
</script>
<style scoped lang="less" src="./GlowingCursorArea.less"></style>

0 comments on commit 37247b9

Please sign in to comment.