-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f900d9a
commit 1cd0139
Showing
25 changed files
with
428 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
let modules = process.env.MODULES || false; | ||
if (modules === 'esm' || modules === 'false') modules = false; | ||
|
||
module.exports = { | ||
presets: [['@babel/preset-env', { modules, loose: true }]], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
let modules = process.env.MODULES || false; | ||
if (modules === 'esm' || modules === 'false') modules = false; | ||
|
||
module.exports = { | ||
presets: ['@babel/preset-react', ['@babel/preset-env', { modules, loose: true }]], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "mariko/react", | ||
"private": true, | ||
"type": "module", | ||
"exports": "./mariko-react.esm.js", | ||
"typings": "./mariko-react.d.ts", | ||
"sideEffects": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "mariko/react", | ||
"private": true, | ||
"type": "module", | ||
"exports": "./mariko-react.esm.js", | ||
"typings": "./mariko-react.d.ts", | ||
"sideEffects": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { useState } from 'react'; | ||
import Mariko from '../../build/react'; | ||
|
||
const App = () => { | ||
const [count, setCount] = useState(0); | ||
return ( | ||
<div className="container"> | ||
<p | ||
style={{ position: 'absolute', left: 0, top: 0, zIndex: 1000 }} | ||
onClick={() => setCount(count + 1)} | ||
> | ||
{count} | ||
</p> | ||
<Mariko className="mariko-banner" onEnter={() => console.log('enter', count)}> | ||
<img className="mariko-banner-spacer" src="./i/mariko-bg.svg" alt="" /> | ||
<img data-mariko-offset="-4.5" src="./i/mariko-bg.svg" alt="" /> | ||
<img data-mariko-offset="-2.5" src="./i/mariko-mountains.svg" alt="" /> | ||
<img data-mariko-offset="0" src="./i/mariko-forest-back.svg" alt="" /> | ||
<img data-mariko-offset="2" src="./i/mariko-forest-mid.svg" alt="" /> | ||
<img data-mariko-offset="4" src="./i/mariko-forest-front.svg" alt="" /> | ||
<img data-mariko-offset="4.5" src="./i/mariko-logo-en.svg" alt="" /> | ||
<img data-mariko-offset="5" src="./i/mariko-logo-jp.svg" alt="" /> | ||
</Mariko> | ||
</div> | ||
); | ||
}; | ||
|
||
export default App; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Mariko React</title> | ||
<link rel="stylesheet" href="./main.css"> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="./main.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
html, | ||
body { | ||
position: relative; | ||
margin: 0; | ||
padding: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, | ||
'Open Sans', 'Helvetica Neue', sans-serif; | ||
min-height: 100vh; | ||
} | ||
body { | ||
background-image: linear-gradient(to bottom, #ad3ef5, #5814a2); | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.container { | ||
padding: 0px 40px; | ||
max-width: 960px; | ||
margin: 32px auto; | ||
display: flex; | ||
justify-content: space-between; | ||
width: 100%; | ||
box-sizing: border-box; | ||
} | ||
.mariko-banner { | ||
width: 100%; | ||
} | ||
.mariko-banner .mariko-inner { | ||
border-radius: 10px; | ||
} | ||
.mariko-banner img { | ||
position: absolute; | ||
left: -5%; | ||
top: -5%; | ||
width: 110%; | ||
height: 110%; | ||
object-fit: contain; | ||
display: block; | ||
z-index: 1; | ||
transform-style: preserve-3d; | ||
pointer-events: none; | ||
} | ||
.mariko-banner img.mariko-banner-spacer { | ||
position: relative; | ||
width: 100%; | ||
height: auto; | ||
left: 0; | ||
top: 0; | ||
visibility: hidden; | ||
} | ||
.mariko-banner .mariko-shadow { | ||
filter: blur(50px); | ||
opacity: 0.5; | ||
} | ||
.mariko-banner .mariko-highlight { | ||
z-index: 100; | ||
} | ||
|
||
.mariko-banner-text { | ||
position: absolute; | ||
color: #fff; | ||
font-weight: bold; | ||
left: 0%; | ||
top: 0%; | ||
} | ||
.mariko-active .mariko-banner-text { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
// eslint-disable-next-line | ||
import '../../build/mariko.css'; | ||
|
||
import App from './App.jsx'; | ||
|
||
// eslint-disable-next-line | ||
ReactDOM.render(React.createElement(App), document.getElementById('app')); |
Oops, something went wrong.