Skip to content

Instantly share code, notes, and snippets.

@artlili
artlili / button.sass
Last active May 1, 2019 15:12
Button Sass Style
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600
@artlili
artlili / jquery.plugin.js
Last active May 1, 2019 15:17
jQuery plugin start
(($, window, undefined) => {
let pluginName = 'plugin_name',
document = window.document,
settings = {
}
class Plugin {
constructor(element, options) {
<div id="root" class="container">
<tabs>
<tab name="Services" :selected="true">
<h1>What we do</h1>
</tab>
<tab name="Pricing">
<h1>How much we do it for</h1>
</tab>
<tab name="About Us">
@artlili
artlili / modal.css
Created May 15, 2019 20:03
Modal window
.modal-mask {
position: fixed;
z-index: 9998;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .5);
display: table;
transition: opacity .3s ease;
@artlili
artlili / delete.vue
Created May 15, 2019 20:16
delete item in list
v-for="(event, index) in events"
...
<button ... @click="deleteEvent(index)"
deleteEvent: function(index) {
this.events.splice(index, 1);
}
@artlili
artlili / click-outside.vue
Created May 15, 2019 20:20
click outside
Vue.directive('click-outside', {
bind () {
this.event = event => this.vm.$emit(this.expression, event)
this.el.addEventListener('click', this.stopProp)
document.body.addEventListener('click', this.event)
},
unbind() {
this.el.removeEventListener('click', this.stopProp)
document.body.removeEventListener('click', this.event)
},
@artlili
artlili / fonts.scss
Created May 15, 2019 20:22
Fonts function
$font: ("Bold": bold, "Regular": normal, "Medium": 500, "Thin": 100);
@each $style, $width in $font {
$url: $base-font-family + '-' + #{$style};
$rel_url: '/fonts/' + $url + '/' + $url;
@font-face {
font-family: $base-font-family;
src: url($rel_url + '.eot');
src: url($rel_url + '.eot?#iefix') format('embedded-opentype'),
url($rel_url + '.woff') format('woff'),
@artlili
artlili / mixins.scss
Last active May 31, 2019 11:16
px to rem
@function rem($pixels, $context: $base-font-size) {
@if (unitless($pixels)) {
$pixels: $pixels * 1px;
}
@if (unitless($context)) {
$context: $context * 1px;
}
@return $pixels / $context * 1rem;
@artlili
artlili / webpack.mix.js
Created May 16, 2019 12:01
laravel webpack mix
let mix = require('laravel-mix');
const path = require('path')
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
JS Placeholder
$.widget( 'app.selectmenu', $.ui.selectmenu, {
_drawButton: function() {
this._super();
var selected = this.element
.find( '[selected]' )
.length,
placeholder = this.options.placeholder;
if (!selected && placeholder) {