Skip to content

Instantly share code, notes, and snippets.

View wvovaw's full-sized avatar
👀
I don't blink anymore...

Vladimir Ivakhno wvovaw

👀
I don't blink anymore...
View GitHub Profile
@wvovaw
wvovaw / nuxt_strapi.conf
Last active December 24, 2022 18:06
nuxt + strapi nginx proxy config
upstream strapi {
server 127.0.0.1:1337;
}
upstream nuxt {
server 127.0.0.1:3000;
}
server {
server_name www.domainname.com domainname.com;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
@wvovaw
wvovaw / Modal.vue
Created April 22, 2023 08:25
Nice responsive mobile-friendly modal window implementation with TailwindCSS and HeadlessUI (and some DaisyUI styles)
<script lang="ts" setup>
import {
Dialog as HDialog,
DialogPanel as HDialogPanel,
TransitionRoot as HTransitionRoot,
TransitionChild as HTransitionChild,
} from "@headlessui/vue";
const props = defineProps({
show: {
@wvovaw
wvovaw / README.md
Last active February 7, 2024 13:47
Nuxt SSR friendly color theme switcher

Nuxt 3 + vueuse + Pinia SSR friendly color theme switcher

  1. Declare theme cookie in the app.vue.
  2. Use HTML nuxt builtin to bind data-theme attribute (your may differ) to the cookie.theme.
  3. Create theme.store.ts Pinia store. cycle function cycles through the list of modes and sets current state in the theme cookie
  4. Create ThemeSwitcher.vue component.

This approach is universal, SSR friendly and easy adoptable.

Read more about useColorMode