Skip to content

Instantly share code, notes, and snippets.

View studentIvan's full-sized avatar
🎯
Focusing

Ivan Maslov | JavaScript & Web Performance Enthusiast studentIvan

🎯
Focusing
View GitHub Profile
@studentIvan
studentIvan / capacitor.js
Created May 25, 2016 10:18
Удобная мелкая вещь для сглаживания вызова операций, например var x = new OperatingCapacitor(); x.register('scroll', function () {alert(123)}); x.register('scroll', function () {alert(456)}); x.run('scroll'); // вызовет alert 456
/**
* Сглаживание вызова операций
*
* @returns {{broker: {}, register: function, run: function}}
* @constructor
*/
var OperatingCapacitor = function () {
var object;
object = {
/**
* @package PickMeUp
* @author Nazar Mokrynskyi <[email protected]>
* @author Stefan Petre <www.eyecon.ro>
* @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
* @copyright Copyright (c) 2008-2009, Stefan Petre
* @license MIT License, see license.txt
*/
$__border-radius = 0
$__border-color = #e0e0e0;
mixin chooseDate(options)
+b.choose-date
+e.datepicker
input(type='text' placeholder='Pick a date')
+fontIcon({ name: 'calendar' })
mixin chooseDate(options)
+b.choose-date
+e.datepicker
input(type='text' placeholder='Pick a date')
+fontIcon({ name: 'calendar' })
+e.datepickerbox
@studentIvan
studentIvan / datepicker.js
Created October 9, 2016 16:23
Datepicker ES6 PickMeUp component example with flat mode
import pickmeup from 'pickmeup'
import moment from 'moment'
const init = () => {
$(() => {
let today = new Date(), next3months = moment().add(3, 'months').toDate();
let element = document.querySelector('.choose-date__datepickerbox');
if (!element) {
return;
ipad($version = all, $orientation = all)
$orientation == all ? 'and' : 'and (orientation: ' + $orientation + ') and'
if $version == mini or $version == 1 or $version == 2 or $version == all
$query = 'only screen and (min-device-width: 768px) and (max-device-width: 1024px) %s (-webkit-min-device-pixel-ratio: 1)' % $media-orientation
@media $query
{block}
if $version == 3 $version == 4 or $version == all
$query = 'only screen and (min-device-width: 768px) and (max-device-width: 1024px) %s (-webkit-min-device-pixel-ratio: 2)' % $media-orientation
@media $query
{block}
/**
* iPhone mixin
* example:
* +iphone(all, landscape)
* body
* display none
*/
iphone($version = all, $orientation = all)
$orientation == all ? 'and' : 'and (orientation: ' + $orientation + ') and'
if $version == '4' or $version == '4S' or $version == 'all'
var isSupportsBasicES6, isSupportsDefaultParamsDestructing, appVersionCode,
getScriptLocation, includeScript, scriptBasePath, modulePaths, bundleDependencies;
/**
* url to scripts on the server
* @type {String}
*/
scriptBasePath = '/scripts/';
/**
@studentIvan
studentIvan / just an example
Created December 13, 2016 19:22
example.styl
.calendar-dropdown
min-width auto !important
border solid 1px lightgray !important
&__select2
position absolute
top 0
width 100%
background red
z-index 500