Skip to content

Instantly share code, notes, and snippets.

<template>
<div class="tabs">
<nav class="nav" :tabs="tabs">
<span v-for="tab in tabs"
class="nav-link"
:key="tab"
:class="{'active': activeTab === tab}"
@click="onClick(tab)"
>{{tab}}</span>
</nav>
@mixin image-2x($image, $width, $height) {
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
/* on retina, use image that's scaled by 2 */
background-image: url($image);
background-size: $width $height;
}
module.exports = {
/*
Headers of the page
- Nuxt.js uses vue-meta to update the headers and html attributes of your application.
- Nuxt.js configures vue-meta with these options:
{
keyName: 'head', // the component option name that vue-meta looks for meta info on.
attribute: 'data-n-head', // the attribute name vue-meta adds to the tags it observes
ssrAttribute: 'data-n-head-ssr', // the attribute name that lets vue-meta know that meta info has already been server-rendered
tagIDKeyName: 'hid' // the property name that vue-meta uses to determine whether to overwrite or append a tag
@artlili
artlili / package.json
Created April 28, 2020 14:46
npm update all packages
"scripts": {
"update:packages": "node wipe-dependencies.js && rm -rf node_modules && npm update --save-dev && npm update --save"
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
.slider {
position:relative;
@artlili
artlili / gradient.scss
Created January 2, 2020 15:34
Dynamic Gradient Background
$bg-color: #ff8888; //start color
$stops: 100; //smoothness
$time: 20s; //duration of animation
$hue-range: 20; //of 360deg
body{
background-color: $bg-color;
-webkit-animation: colorChange $time linear 0s infinite;
animation: colorChange $time linear 0s infinite ;
}
<?php
header('Access-Control-Allow-Origin: *');
echo $_SERVER('REMOTE_ADDR');
?>
console run php -S 127.0.0.1:8080
@artlili
artlili / all_mixins.sass
Last active February 20, 2020 11:11
All mixins
/*** Usage
+clear
=clear
&::after
content: ''
display: table
clear: both
/*** Usage
+antialias
<div class="relation">
<div class="relation__offset relation__offset-16-9"></div>
<div class="relation__content">
<iframe class="video__content" src="https://www.youtube.com/embed/KFVoIzaGPYg" ></iframe>
</div>
</div>
.relation{
max-width: 560px;
position: relative;
@artlili
artlili / app.js
Created May 28, 2019 23:55
vue back to top
Vue.component('backtotop', {
template: '#backtotop',
data: function() {
return {
isVisible: false
};
},
methods: {
initToTopButton: function() {
$(document).bind('scroll', function() {