Skip to content

Commit

Permalink
Update icons, update codebase, add spring animation
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanrikulu committed Feb 22, 2020
1 parent 4935dff commit 7fb0d3f
Show file tree
Hide file tree
Showing 20 changed files with 13,539 additions and 7 deletions.
13,490 changes: 13,490 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"lodash-es": "^4.17.15",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.4.0"
"react-scripts": "3.4.0",
"react-spring": "^8.0.27",
"react-with-gesture": "^4.0.8"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"bundle": "react-scripts build && tauri build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand Down
Binary file modified src-tauri/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square107x107Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square142x142Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square150x150Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square284x284Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square30x30Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square310x310Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square44x44Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square71x71Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square89x89Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/icon.icns
Binary file not shown.
Binary file modified src-tauri/icons/icon.ico
Binary file not shown.
Binary file modified src-tauri/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 15 additions & 3 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ body {
width: 100vw;
position: relative;
overflow: hidden;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
font-family: Tahoma, Geneva, serif;
}
.overlay {
width: 100vw;
Expand All @@ -17,7 +24,7 @@ body {
rgba(98, 35, 210, 0.85) 100%
);
}
.author{
.sticker {
position: absolute;
height: 100vh;
width: 100vw;
Expand All @@ -29,16 +36,21 @@ body {
color: white;
z-index: 2;
}
.author > span {
background: rgba(120,120,120, 0.9);
.sticker > div {
background: rgba(120, 120, 120, 0.9);
padding: 0 20px;
border-radius: 7px;
cursor: pointer;
}
.sticker > div:active {
cursor: -webkit-grabbing;
}
.container {
display: grid;
grid-template-columns: repeat(10, 200px);
grid-template-rows: repeat(6, 230px);
transform: translate(-3%, -4%);
will-change: transform;
}
.shape {
width: 200px;
Expand Down
32 changes: 29 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
import React from 'react';
import React, { useState } from 'react';
import clamp from 'lodash-es/clamp';
import { useSpring, animated } from 'react-spring';
import { useGesture } from 'react-with-gesture';

import logo from './logo.svg';
import './App.css';

function App() {
const [clicked, setClick] = useState(false);
const [{ xy }, set] = useSpring(() => ({ xy: [0, 0] }));
const bind = useGesture(({ down, delta, velocity }) => {
velocity = clamp(velocity, 1, 8);
set({
xy: down ? delta : [0, 0],
config: { mass: velocity, tension: 500 * velocity, friction: 50 }
});
});

const _onClick = _ => setClick(!clicked);

return (
<div className="App">
<header className="App-header">
<div className="overlay" />
<div className="author">
<span>React-Tauri</span>
<div className="sticker">
<animated.div
{...bind()}
style={{
transform: xy.interpolate(
(x, y) => `translate3d(${x}px,${y}px,0)`
)
}}>
<span onClick={_onClick}>
{!clicked ? 'React-Tauri' : 'Hellö!'}
</span>
</animated.div>
</div>
<div className="container">
<svg
Expand Down

0 comments on commit 7fb0d3f

Please sign in to comment.