Skip to content

Instantly share code, notes, and snippets.

View w33bvGL's full-sized avatar
🏠
Working from home

Vahe Sargsyan w33bvGL

🏠
Working from home
View GitHub Profile
@w33bvGL
w33bvGL / header.vue
Created March 17, 2025 17:04
Nuxt 3 Scrollspy Navigation with Active Section Highlighting
<script setup lang="ts">
const nuxtApp = useNuxtApp()
const localeRoute = useLocaleRoute()
const { t } = useI18n()
const config = useRuntimeConfig()
const { activeHeadings, updateHeadings } = useScrollspy()
const links = computed(() => {
const activeSection =
scrollPosition.value <= 10
@w33bvGL
w33bvGL / codeBlock.vue
Last active March 5, 2025 16:59
Code Block Component for Nuxt.js with Nuxt UI and Prism.js for embedding code snippets on a website
<script setup lang="ts">
import Prism from 'prismjs';
import Clipboard from 'clipboard';
import 'prismjs/themes/prism-tomorrow.css';
import 'prismjs/components/prism-graphql.js';
const { t } = useI18n();
const toast = useToast();
const props = defineProps<{
@w33bvGL
w33bvGL / preloader.js
Last active January 8, 2025 16:32
Tilda PreLoader with ZeroBlock
(function () {
const normalTime = 1500;
const spareTime = 3000;
const body = document.body;
body.style.overflow = "hidden";
const preloader = document.querySelector('.uc-preloader');
if (!preloader) {