Skip to content

Instantly share code, notes, and snippets.

View Novout's full-sized avatar

Giovane Silva Novout

  • todo
  • Brazil
  • 15:36 (UTC -03:00)
View GitHub Profile
@Novout
Novout / .npmrc
Created April 15, 2023 23:45
default .npmrc for pnpm workspaces
ignore-workspace-root-check=true
shamefully-hoist=true
strict-peer-dependencies=false
auto-install-peers=true
@Novout
Novout / index.js
Last active May 29, 2022 22:52
Correct handle requestFullscreen() method
const fullscreen = () => {
window.document.exitFullscreen().catch(() => {
const target = window.document.querySelector('body')
target?.requestFullscreen()
})
}
// change the conventional global method
window.addEventListener('keypress', (e) => {
@Novout
Novout / nuxt.config.js
Last active July 23, 2021 02:24
Nuxt.js improved head seo
// ...
head: {
title: 'Title Here',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'googlebot', content: 'index,follow' },
{ name: 'google-site-verification', content: 'YOUR_KEY' },
@Novout
Novout / background.css
Created May 6, 2021 02:59
Fixed background image in all page
.background {
position: fixed;
top: 0;
left: 0;
z-index: -1;
background: #000 url('/path/to/foo.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
@Novout
Novout / loop.js
Last active February 13, 2021 01:30
Ticker example in typescript
//.ts not highlight :/
// ticker.ts
/**
* @category Context
* @param base Content object.
* @param cb_stop Callback for break loop condition.
* @param cb_loop Array with callback's for loop.
* @param cb_initial Array with callback's for initial loop creation.
* @param cb_finish Array with callback's for finish loop destruction.
@Novout
Novout / chunk.js
Last active February 13, 2021 01:28
Chunk Generator with 2D Player Coordinates JSVanilla
export const setNodeChunk = () => {
const player = getPlayerCoordinates(); // x and y
const __GLOBAL__ = getStore(); // entity system
const chunk = __GLOBAL__.map.chunk; // radius
const container = getMapNode(); // reference player node
__GLOBAL__.player.coordinates = player;
setStore(__GLOBAL__);
const min_x = player.x - chunk;
@Novout
Novout / mouse.js
Created February 13, 2021 00:41
Simple Combo Attack Pixi.js
import Mouse from 'pixi.js-mouse';
/*
* attack_time = 1 per tick
* attack_velocity = 30 tick per attack animate
* player_base = textures with resource loader context
*/
export const PlayerMouseListener = (delta, player, player_base, options) => {
if (Mouse.isButtonDown(Mouse.Button.LEFT)) {
@Novout
Novout / homebrewery.txt
Last active October 16, 2020 17:01
Homebrewery White Theme
<style>
/* Font Imports */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Questrial&display=swap');
/* Reset CSS */
* {
-webkit-font-smoothing: antialiased;