console message
This commit is contained in:
parent
0904949f13
commit
306b0042b3
3 changed files with 31 additions and 2 deletions
|
|
@ -12,8 +12,10 @@
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
import loadFonts from '@fuzzco/font-loader'
|
import loadFonts from '@fuzzco/font-loader'
|
||||||
import { useWindowSize } from '@vueuse/core'
|
import { useWindowSize } from '@vueuse/core'
|
||||||
|
import useConsoleCredit from '@/composables/useConsoleCredit'
|
||||||
|
|
||||||
const { height } = useWindowSize()
|
const { height } = useWindowSize()
|
||||||
|
useConsoleCredit()
|
||||||
|
|
||||||
const classes = computed(() => [
|
const classes = computed(() => [
|
||||||
'container',
|
'container',
|
||||||
|
|
|
||||||
27
src/composables/useConsoleCredit.js
Normal file
27
src/composables/useConsoleCredit.js
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
import { onMounted } from 'vue'
|
||||||
|
import _kebabCase from 'lodash/kebabCase'
|
||||||
|
import { themes } from '@/libs/theme'
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const style = {
|
||||||
|
backgroundColor: themes.red.bg,
|
||||||
|
color: themes.red.fg,
|
||||||
|
padding: '8px',
|
||||||
|
borderRadius: '5px',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
}
|
||||||
|
|
||||||
|
const styleToString = (style) => {
|
||||||
|
return Object.entries(style)
|
||||||
|
.map(([key, value]) => `${_kebabCase(key)}: ${value}`)
|
||||||
|
.join('; ')
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
console.log('%c🪄 nicwands 🪄', styleToString(style))
|
||||||
|
console.log(
|
||||||
|
'%cDesign by: Jeff Kardos https://jeffkardos.com',
|
||||||
|
styleToString(style),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -9,7 +9,7 @@ const { height: wHeight } = useWindowSize()
|
||||||
/**
|
/**
|
||||||
* Bidirectional infinite virtual scroll composable
|
* Bidirectional infinite virtual scroll composable
|
||||||
* Manages virtual viewports with on-demand content generation.
|
* Manages virtual viewports with on-demand content generation.
|
||||||
* The page stays at 100vh — scroll position is tracked via Lenis
|
* The page stays window height — scroll position is tracked via Lenis
|
||||||
* virtual-scroll events and viewports are positioned with CSS transforms.
|
* virtual-scroll events and viewports are positioned with CSS transforms.
|
||||||
*
|
*
|
||||||
* @param {Object} options Configuration options
|
* @param {Object} options Configuration options
|
||||||
|
|
@ -35,7 +35,7 @@ export const useInfiniteScroll = (options = {}) => {
|
||||||
|
|
||||||
// Core state
|
// Core state
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
// Accumulated virtual scroll position (not the real DOM scroll)
|
// Accumulated virtual scroll position
|
||||||
scrollY: initialIndex * (viewportHeight || 0),
|
scrollY: initialIndex * (viewportHeight || 0),
|
||||||
// Active state to stop/start scroll
|
// Active state to stop/start scroll
|
||||||
active: true,
|
active: true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue