-
Notifications
You must be signed in to change notification settings - Fork 7
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
6bc7107
commit a6ad8bd
Showing
16 changed files
with
224 additions
and
80 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
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,26 @@ | ||
package datastore | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"path" | ||
) | ||
|
||
type ImageCache struct { | ||
base string | ||
} | ||
|
||
func NewImageCache() *ImageCache { | ||
path := path.Join(os.TempDir(), "gogallery") | ||
os.MkdirAll(path, 0755) | ||
return &ImageCache{ | ||
base: path, | ||
} | ||
} | ||
|
||
func (ic *ImageCache) Get(name string, size string) (*os.File, error) { | ||
return os.Open(path.Join(ic.base, fmt.Sprintf("%s-%s.webp", name, size))) | ||
} | ||
func (ic *ImageCache) Writer(name string, size string) (*os.File, error) { | ||
return os.Create(path.Join(ic.base, fmt.Sprintf("%s-%s.webp", name, size))) | ||
} |
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
This file was deleted.
Oops, something went wrong.
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,39 @@ | ||
.container { | ||
--uib-size: 35px; | ||
--uib-color: black; | ||
--uib-speed: 1.2s; | ||
--uib-bg-opacity: .1; | ||
height: var(--uib-size); | ||
width: var(--uib-size); | ||
transform-origin: center; | ||
will-change: transform; | ||
overflow: visible; | ||
} | ||
|
||
.car { | ||
fill: none; | ||
stroke: var(--uib-color); | ||
stroke-dasharray: 25, 75; | ||
stroke-dashoffset: 0; | ||
animation: travel var(--uib-speed) linear infinite; | ||
will-change: stroke-dasharray, stroke-dashoffset; | ||
transition: stroke 0.5s ease; | ||
} | ||
|
||
.track { | ||
fill: none; | ||
stroke: var(--uib-color); | ||
opacity: var(--uib-bg-opacity); | ||
transition: stroke 0.5s ease; | ||
} | ||
|
||
@keyframes travel { | ||
0% { | ||
stroke-dashoffset: 0; | ||
} | ||
|
||
100% { | ||
stroke-dashoffset: -100; | ||
} | ||
} | ||
|
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,30 @@ | ||
import "./loading.css" | ||
|
||
export const Loading = () => ( | ||
<svg | ||
className="container" | ||
viewBox="0 0 35 35" | ||
height="35" | ||
width="35" | ||
> | ||
<rect | ||
className="track" | ||
x="2.5" | ||
y="2.5" | ||
fill="none" | ||
stroke-width="5px" | ||
width="32.5" | ||
height="32.5" | ||
/> | ||
<rect | ||
className="car" | ||
x="2.5" | ||
y="2.5" | ||
fill="none" | ||
stroke-width="5px" | ||
width="32.5" | ||
height="32.5" | ||
pathlength="100" | ||
/> | ||
</svg> | ||
) |
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
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
Oops, something went wrong.