Skip to content

Commit

Permalink
Fix merge conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrown0000 committed Feb 16, 2021
2 parents dd81fc7 + d46de4d commit bcf2029
Show file tree
Hide file tree
Showing 26 changed files with 661 additions and 182 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# 🌊 [SVG Wave](www.svgwave.in) - A tiny SVG wave generator -
# 🌊 [SVG Wave](https://www.svgwave.in) - A tiny, customizable gradient SVG wave generator

![](./svgwavecover.png)


----

SVG Wave is a **tiny, free and beautiful 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, 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**. ⚛

---

### Updated ! - New Gradient Wave Support 🌈

### Features

- Adjust number of layers of waves 🏢
Expand All @@ -19,13 +21,14 @@ SVG Wave is a tiny UI tool built with **Preact, tailwind and bundled with Webpac
- Export as SVG or PNG ⬇
- Randomize 🔁
- New cool Dark mode 🖤
- Gradient fill to waves 🌈
- Coming soon...


---

### App ⭐

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

---
Expand All @@ -42,4 +45,9 @@ Give a star if you like It.👍

### Contributors

- your name is soon to be here. 😀
- [anup-a](https://github.com/anup-a)
- [kychok98](https://github.com/kychok98)
- [yencolon](https://github.com/yencolon)
- [Remakh](https://github.com/Remakh)
- [ansh-les](https://github.com/ansh-les)
- [ansh-saini](https://github.com/ansh-saini)
Binary file modified bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { h } from 'preact';
import { useState} from 'preact/hooks'
import Home from './components/home'
import { useDarkModeState } from './hooks/useDarkMode'
import './styles/main.css'

function App() {
const [isDark, setIsDark] = useState(false)
const [isDark, setIsDark] = useDarkModeState()

const onChangeTheme = (arg) => {
setIsDark(arg)
setIsDark(arg)
}

return (
Expand Down
4 changes: 1 addition & 3 deletions src/assets/001-copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/001-cross-sign.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 1 addition & 48 deletions src/assets/001-github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 1 addition & 15 deletions src/assets/3-01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 1 addition & 15 deletions src/assets/4-01.svg
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/assets/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/cross_white.svg
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/assets/underwave.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
160 changes: 160 additions & 0 deletions src/components/colorTool.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import { h } from 'preact'
import { useState } from 'preact/hooks'
import { TwitterPicker } from 'react-color'

import {
colorToolMode,
gradientPickerStyle,
colorPickerLightStyle,
} from '../constants'
import GradientPicker from './gradientPicker'

import CloseSVG from './../assets/001-cross-sign.svg'
import CloseWhiteSVG from './../assets/cross_white.svg'

import { colorPickerDarkStyle } from './../constants'

function ColorTool({
onBGChange,
isDark,
onGradColorsChange,
onGradientToggle,
gradient,
gradColors,
}) {
const [colorTool, setColorTool] = useState(
gradient ? colorToolMode.GRADIENT : colorToolMode.COLOR,
)
const [showTool, setShowTool] = useState(false)
const [fillColor, setFillColor] = useState('#ff0080')

const handleColorChange = (hex) => {
setFillColor(hex)
onBGChange(hex)
setColorTool(colorToolMode.NONE)
setShowTool(false)
}

const handleColorTool = (colorStatus) => {
setColorTool(colorStatus)
if (colorStatus === colorToolMode.GRADIENT) {
onGradientToggle(true)
} else {
onGradientToggle(false)
}
}

const handleToggleTool = (e, colorStatus) => {
e.stopPropagation()
handleColorTool(colorStatus)
setShowTool(true)
}

const isGradient = colorTool === colorToolMode.GRADIENT
const isColor = colorTool === colorToolMode.COLOR

return (
<div className="relative flex items-center w-full justify-evenly">
<div
className="flex flex-col items-center justify-center w-1/2 p-3 rounded-lg cursor-pointer section"
onClick={() => handleColorTool(colorToolMode.COLOR)}
style={
!isGradient
? isDark
? { background: '#182635' }
: { background: '#edf2f7' }
: {}
}
>
<div className="flex items-center justify-center w-12 h-12 bg-white border-2 border-indigo-900 rounded-full shadow-lg color-btn">
<div
className="w-10 h-10 rounded-full shadow-md "
onClick={(e) => handleToggleTool(e, colorToolMode.COLOR)}
style={{ backgroundColor: fillColor }}
></div>
</div>
<div
className="mt-3 font-semibold"
style={isGradient && { color: '#718096' }}
>
Color
</div>
</div>

<div
className="flex flex-col items-center justify-center w-1/2 p-3 rounded-lg cursor-pointer section"
onClick={() => handleColorTool(colorToolMode.GRADIENT)}
style={
isGradient
? isDark
? { background: '#182635' }
: { background: '#edf2f7' }
: {}
}
>
<div className="flex items-center justify-center w-12 h-12 bg-white border-2 border-indigo-900 rounded-full shadow-lg color-btn">
<div
className="w-10 h-10 rounded-full shadow-md "
onClick={(e) => handleToggleTool(e, colorToolMode.GRADIENT)}
style={
isGradient
? {
background: '#718096',
background: `linear-gradient(90deg, ${gradColors.colorOne} 0%, ${gradColors.colorTwo} 100%)`,
}
: {
background: `linear-gradient(90deg, ${gradColors.colorOne} 0%, ${gradColors.colorTwo} 100%)`,
}
}
></div>
</div>
<div
className="mt-3 font-semibold"
style={!isGradient && { color: '#718096' }}
>
Gradient
</div>
</div>
{showTool && (
<div className="absolute w-full color-tool">
<button
onClick={() => setShowTool(false)}
className="absolute top-0 right-0 z-20 m-3 scale-in-center"
>
{isDark ? (
<img src={CloseWhiteSVG} alt="close svg" width="10" />
) : (
<img src={CloseSVG} alt="close svg" width="10" />
)}
</button>
{isColor && (
<TwitterPicker
color={fillColor}
onChangeComplete={({ hex }) => handleColorChange(hex)}
width="100%"
z-index="20"
triangle="hide"
styles={
isDark
? colorPickerDarkStyle
: isColor
? colorPickerLightStyle
: gradientPickerStyle
}
className="py-6 scale-in-center"
/>
)}
{isGradient && (
<GradientPicker
onGradColorsChange={onGradColorsChange}
gradColors={gradColors}
isDark={isDark}
/>
)}
</div>
)}
</div>
)
}

export default ColorTool
Loading

0 comments on commit bcf2029

Please sign in to comment.