Skip to content

Instantly share code, notes, and snippets.

View a-m-dev's full-sized avatar

Ahmad Mirzaei a-m-dev

View GitHub Profile
import { Spring, animated, config } from 'react-spring'
import { TimingAnimation, Easing } from 'react-spring/dist/addons'
const myComponent = () => {
return(
<Spring
// hi there
// this is a trick that blowed my mind
// => BY THIS =>
// you can use icon unicode (html unicode like &#xe802;) that comes from api inside JS
// that is gonna be parsed and placed the icon it self instead of printing some jebrish in browser
// #01 . here is the function
const decodeHtml = (html) => {
var txt = document.createElement("textarea");
txt.innerHTML = html;
// #01 creating action file (./src/js/actions/courseActions.js)
export function createCourse(course) {
return { type: 'CREATE_COURSE' , course }
}
/* .env file is the best place to store all your diffrent api endpoint
* this gist is explain hot tyo create one
* best of luck
*/
// #01 -----------------------------------------------------
// create .env file in your root directory and
// add your end points with different names to it like below
// in our case we have one endpoint ( this is base url )
const AddDayForm = ({ resort, date , powder, backcountry }) => {
let _resort , _date , _powder , _backcountry
const handleSubmit = (e) => {
e.preventDefault()
const formValues = {
resort: _resort.value,
date: _date.value,
powder: _powder.checked,
{
"name": "amdev",
"version": "1.0.0",
"description": "My Personal Website",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server -d --progress",
"build": "npm run clear && webpack -p",
"clear": "rimraf ./dist/*"
},
var SmoothScrolling = {
timer: null,
stop: function() {
clearTimeout(this.timer);
},
scrollTo: function(id, callback) {
var settings = {
duration: 1000,
window.onscroll = () => {
let wScroll = window.scrollY;
// Movement Parallax
document.querySelector('.logo').style.cssText = `transform: translate(0px, ${wScroll/2}%)`;
document.querySelector('.back-bird').style.cssText = `transform: translate(0px, ${wScroll/4}%)`;
document.querySelector('.fore-bird').style.cssText = `transform: translate(0px, -${wScroll/40}%)`;
@a-m-dev
a-m-dev / Scroll Top Offset React
Last active July 10, 2018 19:37
scroll top in react using ReactDOM
import React from 'react'
import ReactDOM from 'react-dom'
import AroundIcons from './AroundIcons'
class ResumeComponent extends React.Component {
constructor(props) {
super();
class MyComponent extends Component {
constructor(props) {
super();
this.state = {
_data: {
must_known: [],
libs: [],
tools: [],