Skip to content

Instantly share code, notes, and snippets.

View florinpop17's full-sized avatar
🏠
Working from home

Florin Pop florinpop17

🏠
Working from home
View GitHub Profile
@florinpop17
florinpop17 / script.js
Created May 15, 2019 08:19
Countdown React - extra functions
function polarToCartesian(centerX, centerY, radius, angleInDegrees) {
var angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0;
return {
x: centerX + radius * Math.cos(angleInRadians),
y: centerY + radius * Math.sin(angleInRadians)
};
}
function describeArc(x, y, radius, startAngle, endAngle) {
@florinpop17
florinpop17 / style.css
Created May 15, 2019 08:19
Countdown React
@import url('https://fonts.googleapis.com/css?family=Lato');
* {
box-sizing: border-box;
}
body {
font-family: 'Lato', sans-serif;
}
@florinpop17
florinpop17 / Countdown.jsx
Created May 15, 2019 08:18
Countdown React - Moment added
import React from 'react';
import moment from 'moment';
class Countdown extends React.Component {
state = {
days: undefined,
hours: undefined,
minutes: undefined,
seconds: undefined
};
@florinpop17
florinpop17 / Countdown.jsx
Created May 15, 2019 08:17
Countdown React
import React from 'react';
class Countdown extends React.Component {
state = {
days: undefined,
hours: undefined,
minutes: undefined,
seconds: undefined
};
@florinpop17
florinpop17 / index.js
Created May 15, 2019 08:17
Countdown React
import moment from 'moment';
const then = moment(timeTillDate, timeFormat);
const now = moment();
const countdown = moment(then - now);
const days = countdown.format('D');
const hours = countdown.format('HH');
const minutes = countdown.format('mm');
const seconds = countdown.format('ss');
@florinpop17
florinpop17 / index.js
Last active May 15, 2019 08:16
Countdown React
import moment from 'moment';
const then = moment(timeTillDate, timeFormat);
const now = moment();
const countdown = moment(then - now);
@florinpop17
florinpop17 / style.css
Created April 11, 2019 03:13
Buttons UI Kit - sizes
.btn-large {
font-size: 16px;
padding: 12px 36px;
}
.btn-small {
font-size: 12px;
padding: 4px 12px;
}
@florinpop17
florinpop17 / style.css
Created April 11, 2019 03:12
Buttons UI Kit - root
:root {
--primary-color: #3457dc;
--secondary-color: #ea4d67;
--tertiary-color: #ea674d;
}
@florinpop17
florinpop17 / style.css
Created April 11, 2019 03:12
Buttons UI Kit - types
.btn-primary {
border-color: var(--primary-color);
background-color: var(--primary-color);
}
.btn-primary:disabled {
color: var(--primary-color);
}
.btn-primary:focus {
@florinpop17
florinpop17 / style.css
Created April 11, 2019 03:11
Buttons UI Kit - states
.btn-hover,
.btn:hover {
opacity: 0.9;
}
.btn:disabled {
background-color: transparent;
cursor: not-allowed;
opacity: 0.7;
}