Skip to content

Commit 83bc3be

Browse files
committed
mobile improvements
1 parent eedbddd commit 83bc3be

File tree

9 files changed

+66
-91
lines changed

9 files changed

+66
-91
lines changed

dist/ReactIntense.css

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
no-drop;
1515
}
1616

17-
.ri-wrapper {
18-
display: inline-block;
19-
margin: 0 8px;
20-
}
21-
2217
.ri-wrapper a.clicked {
2318
box-shadow: inset 0 0 0 500px rgba(0, 0, 0, 0.2);
2419
}
@@ -69,12 +64,6 @@
6964
margin-top: 5px;
7065
}
7166

72-
.ri-loader {
73-
position: relative;
74-
left: 30%;
75-
top: 30%;
76-
}
77-
7867
.ri-loader > div {
7968
width: 12px;
8069
height: 12px;
@@ -87,9 +76,11 @@
8776
}
8877

8978
.ri-trigger {
90-
display: inline-block;
9179
width: 200px;
9280
height: 200px;
9381
background-size: cover;
9482
background-position: 50% 50%;
83+
display: flex;
84+
justify-content: center;
85+
align-items: center;
9586
}

dist/ReactIntense.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ReactIntense.css

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
no-drop;
1515
}
1616

17-
.ri-wrapper {
18-
display: inline-block;
19-
margin: 0 8px;
20-
}
21-
2217
.ri-wrapper a.clicked {
2318
box-shadow: inset 0 0 0 500px rgba(0, 0, 0, 0.2);
2419
}
@@ -69,12 +64,6 @@
6964
margin-top: 5px;
7065
}
7166

72-
.ri-loader {
73-
position: relative;
74-
left: 30%;
75-
top: 30%;
76-
}
77-
7867
.ri-loader > div {
7968
width: 12px;
8069
height: 12px;
@@ -87,9 +76,11 @@
8776
}
8877

8978
.ri-trigger {
90-
display: inline-block;
9179
width: 200px;
9280
height: 200px;
9381
background-size: cover;
9482
background-position: 50% 50%;
83+
display: flex;
84+
justify-content: center;
85+
align-items: center;
9586
}

lib/ReactIntense.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* React Intense v0.2.0
2+
* React Intense v0.2.1
33
* https://github.com/brycedorn/react-intense
44
*
55
* A React component of https://github.com/tholman/intense-images
@@ -235,11 +235,12 @@ function ReactIntense(props: Props) {
235235
return (
236236
<div className="ri-wrapper">
237237
<TriggerElement
238-
children={renderLoader(loader)}
239238
className={`${className} ri-trigger ${visible ? ' clicked' : ''}`}
240239
onClick={(e) => _onClick(e)}
241240
style={{ backgroundImage: `url(${thumbnailSrc || src})` }}
242-
/>
241+
>
242+
{renderLoader(loader)}
243+
</TriggerElement>
243244
{renderViewer()}
244245
</div>
245246
);

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-intense",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "A React port of the javascript full-size image viewer",
55
"scripts": {
66
"build": "parcel build src/index.html --dist-dir public",

src/img/rain.jpg

-437 KB
Loading

src/index.html

Lines changed: 22 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,28 @@ <h1>Click the images to see it in action!</h1>
3232
</div>
3333
</header>
3434
<section id="demos"></section>
35+
<a href="https://github.com/brycedorn/react-intense" class="github-corner" aria-label="View source on GitHub">
36+
<svg
37+
width="80"
38+
height="80"
39+
viewBox="0 0 250 250"
40+
style="fill: #222; color: #fff; position: absolute; top: 0; border: 0; right: 0"
41+
aria-hidden="true"
42+
>
43+
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
44+
<path
45+
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
46+
fill="currentColor"
47+
style="transform-origin: 130px 106px"
48+
class="octo-arm"
49+
></path>
50+
<path
51+
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
52+
fill="currentColor"
53+
class="octo-body"
54+
></path>
55+
</svg>
56+
</a>
3557
</body>
3658
<footer>
3759
<h1>
@@ -42,62 +64,6 @@ <h1>
4264
<a href="http://bryce.io/">bryce</a>
4365
<span class="bullet">&#9679;</span>
4466
<a href="https://github.com/brycedorn/react-intense">Source</a>
45-
<span class="bullet">&#9679;</span>
46-
<a
47-
href="https://twitter.com/share"
48-
class="twitter-share-button"
49-
data-text="ReactIntense.js - images for the full screen"
50-
data-show-count="false"
51-
>Tweet</a
52-
>
53-
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
5467
</h1>
5568
</footer>
56-
<a href="https://github.com/brycedorn/react-intense" class="github-corner" aria-label="View source on GitHub"
57-
><svg
58-
width="80"
59-
height="80"
60-
viewBox="0 0 250 250"
61-
style="fill: #222; color: #fff; position: absolute; top: 0; border: 0; right: 0"
62-
aria-hidden="true"
63-
>
64-
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
65-
<path
66-
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
67-
fill="currentColor"
68-
style="transform-origin: 130px 106px"
69-
class="octo-arm"
70-
></path>
71-
<path
72-
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
73-
fill="currentColor"
74-
class="octo-body"
75-
></path></svg></a
76-
><style>
77-
.github-corner:hover .octo-arm {
78-
animation: octocat-wave 560ms ease-in-out;
79-
}
80-
@keyframes octocat-wave {
81-
0%,
82-
100% {
83-
transform: rotate(0);
84-
}
85-
20%,
86-
60% {
87-
transform: rotate(-25deg);
88-
}
89-
40%,
90-
80% {
91-
transform: rotate(10deg);
92-
}
93-
}
94-
@media (max-width: 500px) {
95-
.github-corner:hover .octo-arm {
96-
animation: none;
97-
}
98-
.github-corner .octo-arm {
99-
animation: octocat-wave 560ms ease-in-out;
100-
}
101-
}
102-
</style>
10369
</html>

0 commit comments

Comments
 (0)