Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format code with prettier #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,35 +2,34 @@

![](./svgwavecover.png)


----
---

SVG Wave is a **tiny, free and beautiful gradient SVG waves generator** for your UI or website desgin. It offers dead simple UI to customize, and style your waves based on your theme specifications.

SVG Wave is a tiny UI tool built with **Preact, tailwind and bundled with Webpack**. ⚛

---


### 💡 Update 1 - Added animation support, enable animation by simple click and export as SVG.

### 💡 Update 2 ! - New Gradient Wave Support 🌈

### Features

- Adjust number of layers of waves 🏢
- Modify the number of crest and trough ➰
- Change Colors of waves 🎨
- Export as SVG or PNG ⬇
- Randomize 🔁
- New cool Dark mode 🖤
- Gradient fill to waves 🌈
- Added Animations
- Coming soon...

- Adjust number of layers of waves 🏢
- Modify the number of crest and trough ➰
- Change Colors of waves 🎨
- Export as SVG or PNG ⬇
- Randomize 🔁
- New cool Dark mode 🖤
- Gradient fill to waves 🌈
- Added Animations
- Coming soon...

---

### App ⭐

![](updated_svg_wave.png)
![](bg.png)

6 changes: 3 additions & 3 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
plugins: [require('tailwindcss'), require('autoprefixer')],
}
module.exports = {
plugins: [require('tailwindcss'), require('autoprefixer')],
}
42 changes: 21 additions & 21 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { h } from 'preact'
import Home from './components/home'
import { useDarkMode } from './stores/useDarkMode'
import './styles/main.css'
function App() {
const { theme, setTheme } = useDarkMode(({ theme, setTheme }) => ({
theme,
setTheme,
}))
const currentTheme = theme === 'dark' ? true : false
return (
<div className={`main-container ${currentTheme && 'dark-mode'}`}>
<Home isDark={currentTheme} toggleDarkMode={setTheme} />
</div>
)
}
export default App
import { h } from 'preact'
import Home from './components/home'
import { useDarkMode } from './stores/useDarkMode'
import './styles/main.css'

function App() {
const { theme, setTheme } = useDarkMode(({ theme, setTheme }) => ({
theme,
setTheme,
}))

const currentTheme = theme === 'dark' ? true : false

return (
<div className={`main-container ${currentTheme && 'dark-mode'}`}>
<Home isDark={currentTheme} toggleDarkMode={setTheme} />
</div>
)
}

export default App
2 changes: 1 addition & 1 deletion src/components/alerts.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { h } from 'preact';
import { h } from 'preact'

function Alert({ content, color }) {
return (
63 changes: 31 additions & 32 deletions src/components/canvas.jsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
import { h } from 'preact';
import { useRef } from 'preact/hooks'
import SVGCode from './svgCode'

function Canvas({ svg, invert }) {

return (
<div className="relative z-10 w-4/5 overflow-hidden bg-white sm:shadow-lg sm:rounded-md sm:m-5 sm:w-7/10 md:w-3/5 h-1/5 sm:h-4/5 dark:bg-darkish-black dark:text-white">
{!invert ?
<div className=".fade-in">
<h1 className="absolute top-0 hidden w-full p-6 font-sans text-4xl font-extrabold text-center opacity-75 sm:block">
Generate SVG Waves 🌊
</h1>
<div className="absolute bottom-0 w-full transition-all duration-300 ease-in-out delay-150">
{svg}
</div>
</div>
:
<div className=".fade-in">
<div className="absolute top-0 w-full transition-all duration-300 ease-in-out delay-150">
{svg}
</div>
<h1 className="absolute bottom-0 hidden w-full p-6 font-sans text-4xl font-extrabold text-center opacity-75 sm:block">
Generate SVG Waves 🌊
</h1>
</div>
}
</div>
)
}

export default Canvas
import { h } from 'preact'
import { useRef } from 'preact/hooks'
import SVGCode from './svgCode'

function Canvas({ svg, invert }) {
return (
<div className="relative z-10 w-4/5 overflow-hidden bg-white sm:shadow-lg sm:rounded-md sm:m-5 sm:w-7/10 md:w-3/5 h-1/5 sm:h-4/5 dark:bg-darkish-black dark:text-white">
{!invert ? (
<div className=".fade-in">
<h1 className="absolute top-0 hidden w-full p-6 font-sans text-4xl font-extrabold text-center opacity-75 sm:block">
Generate SVG Waves 🌊
</h1>
<div className="absolute bottom-0 w-full transition-all duration-300 ease-in-out delay-150">
{svg}
</div>
</div>
) : (
<div className=".fade-in">
<div className="absolute top-0 w-full transition-all duration-300 ease-in-out delay-150">
{svg}
</div>
<h1 className="absolute bottom-0 hidden w-full p-6 font-sans text-4xl font-extrabold text-center opacity-75 sm:block">
Generate SVG Waves 🌊
</h1>
</div>
)}
</div>
)
}

export default Canvas
Loading