reza added 4 layouts

master
Reza_ashrafi 3 years ago
parent 6bef83dd46
commit 3038fae33d
  1. 7
      src/components/Button/index.js
  2. 48
      src/components/Input/index.js
  3. 119
      src/components/Slider/Slider.scss
  4. 172
      src/components/Slider/index.js
  5. 21
      src/components/Textarea/index.js
  6. 4
      src/redux/actions/form.js
  7. 14
      src/redux/reducers/form.js
  8. 87
      src/utils/customHooks.js
  9. 11
      src/utils/location.js
  10. 292
      src/utils/onInput.js
  11. 21
      src/views/Home/index.js
  12. 8
      src/views/Home/layouts/CrossPlatform/assets/android.svg
  13. 8
      src/views/Home/layouts/CrossPlatform/assets/ios.svg
  14. 3
      src/views/Home/layouts/CrossPlatform/assets/pwa.svg
  15. 55
      src/views/Home/layouts/CrossPlatform/index.js
  16. 3
      src/views/Home/layouts/Features/index.js
  17. 81
      src/views/Home/layouts/Form/index.js
  18. 33
      src/views/Home/layouts/Gradient/index.js
  19. 2
      src/views/Home/layouts/Graphic/index.js
  20. 12
      src/views/Home/layouts/Panel/index.js
  21. 48
      src/views/Home/layouts/Samples/index.js
  22. 11
      tailwind.config.js

@ -12,7 +12,7 @@ const Button = ({
}) => { }) => {
return ( return (
<button <button
className={`text-base font-4 relative ${ className={`md:text-2x font-4 relative ${
backgroundColor + backgroundColor +
" " + " " +
round + round +
@ -21,9 +21,12 @@ const Button = ({
" " + " " +
padding + padding +
" " + " " +
(borderColor ? `border text-1x border-solid ${borderColor}` : "") (borderColor ? `border border-solid ${borderColor}` : "")
}`} }`}
onClick={() => action()} onClick={() => action()}
style={{
width: "fit-content",
}}
> >
{title} {title}
<img <img

@ -3,7 +3,6 @@ import React from "react";
function Input({ function Input({
type = "text", type = "text",
inputMode = "text", inputMode = "text",
label,
value, value,
maxLength, maxLength,
regex, regex,
@ -11,38 +10,25 @@ function Input({
name, name,
align, align,
direction, direction,
placeholder,
}) { }) {
const [focused, setFocused] = React.useState(false);
return ( return (
<div className="relative w-full"> <input
<label name={name}
className={`absolute right-4 px-1 bg-white dark:bg-grayDarkJungle transition-all -translate-y-1/2 transform ${ type={type}
focused || value inputMode={inputMode}
? "top-0 text-blueMarine text-sm dark:text-blueCurious" value={value}
: "top-1/2 text-grayBattleShip text-tiny" placeholder={placeholder}
}`} maxLength={maxLength}
onClick={() => setFocused(true)} onChange={(e) =>
> onChange(e.target.name, (e.target.value = regex(e.target.value)))
{label} }
</label> className={`w-full outline-none border border-solid border-gray-200 focus:border-primary-7 focus:bg-secondary-9 bg-gray-50 rounded-lg placeholder:text-gray-400 focus:text-secondary-8 text-2x p-6 font-2`}
<input style={{
name={name} direction,
type={type} textAlign: align,
inputMode={inputMode} }}
value={value} />
maxLength={maxLength}
onChange={(e) =>
onChange(e.target.name, (e.target.value = regex(e.target.value)))
}
onFocus={() => setFocused(true)}
onBlur={() => setFocused(false)}
className={`w-full outline-none border border-solid focus:border-blueMarine dark:focus:border-blueCurious border-grayBattleShip dark:bg-grayDarkJungle rounded-md text-blueMarine dark:text-grayBattleShip text-lg py-4 px-4`}
style={{
direction,
textAlign: align,
}}
/>
</div>
); );
} }

@ -0,0 +1,119 @@
.Slider{
width: 100%;
height: 80vh;
overflow: hidden;
position: relative;
z-index: 4;
max-width: 1550px;
@media screen and (min-width: 1551px) {
margin: 0 auto;
}
&-main-box {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
&-title {
width: 80%;
margin: 0 auto;
font-size: 38px;
color: #fff;
font-family: Medium;
}
&-item-container {
width: 80%;
margin: 0 auto;
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
// direction: rtl;
&-item {
width: 32%;
flex-shrink: 0;
aspect-ratio: 1/0.85;
border-radius: 21px;
background-color: rgba($color: #fff, $alpha: 0.1);
backdrop-filter: blur(10px);
box-sizing: border-box;
padding: 20px;
margin-right: 2%;
transition: all 1s;
&-img-container {
width: 100%;
height: 70%;
// background-color: rgb(253, 57, 178);
}
&-title {
font-size: 24px;
width: 100%;
margin-top: 10px;
font-family: Medium;
color: #0080ff;
}
&-subtitle {
width: 100%;
font-size: 18px;
margin-top: 10px;
color: #fff;
font-family: Thin;
}
}
}
&-slider-btns {
width: 80%;
margin: 0 auto;
margin-top: 30px;
display: flex;
align-items: center;
justify-content: space-between;
&-previous {
display: flex;
align-items: center;
cursor: pointer;
color: #555;
&-icon {
// color: #fff;
font-size: 25px;
margin-right: 10px;
}
&-text {
font-size: 30px;
font-family: Thin;
// color: #fff;
}
}
&-next {
display: flex;
align-items: center;
cursor: pointer;
&-icon {
color: #fff;
font-size: 25px;
margin-left: 10px;
}
&-text {
font-size: 30px;
font-family: Thin;
color: #fff;
}
}
}
}
}

@ -0,0 +1,172 @@
import { useState } from "react";
import './Slider.scss';
let p4SliderCounter = 0;
const Slider = () => {
const [hp4Data, setHp4Data] = useState([
{
id: 101,
title: "Create Multi Platform",
subtitle: "Colored pencils were busy except",
title_fa: " ساخت نرمافزارهای چند پلتفرمه",
subtitle_fa: "متنی برای تست",
},
{
id: 102,
title: "Gamify",
subtitle: "Colored pencils were busy except",
title_fa: "گیمیفای",
subtitle_fa: "متنی برای تست",
},
{
id: 201,
title: "Web Design",
subtitle: "Colored pencils were busy except",
title_fa: "طراحی سایت",
subtitle_fa: "متنی برای تست",
},
{
id: 202,
title: "PR & HR Software",
subtitle: "Colored pencils were busy except",
title_fa: "نرمافزارهای PR و HR",
subtitle_fa: "متنی برای تست",
},
{
id: 301,
title: "Android & IOS",
subtitle: "Colored pencils were busy except",
title_fa: "نرمافزارهای android و ios",
subtitle_fa: "متنی برای تست",
},
{
id: 302,
title: "AR Platform",
subtitle: "Colored pencils were busy except",
title_fa: " پلتفرم AR",
subtitle_fa: "متنی برای تست",
},
]);
const p4SliderNextHandler = () => {
let slider = document.querySelectorAll(
".Slider-main-box-item-container-item"
);
document.querySelector(
".Slider-main-box-slider-btns-previous"
).style.color = "#fff";
if (p4SliderCounter < 3) {
if (p4SliderCounter === 0) {
slider[0].style.transform = "translateX(-200%)";
slider[1].style.transform = "translateX(-106.25%)";
slider[2].style.transform = "translateX(-106.25%)";
slider[3].style.transform = "translateX(-106.25%)";
} else if (p4SliderCounter === 1) {
slider[1].style.transform = "translateX(-306.25%)";
slider[2].style.transform = "translateX(-212.5%)";
slider[3].style.transform = "translateX(-212.5%)";
slider[4].style.transform = "translateX(-212.5%)";
} else if (p4SliderCounter === 2) {
slider[2].style.transform = "translateX(-412.5%)";
slider[3].style.transform = "translateX(-318.75%)";
slider[4].style.transform = "translateX(-318.75%)";
slider[5].style.transform = "translateX(-318.75%)";
document.querySelector(
".Slider-main-box-slider-btns-next-text"
).style.color = "#555";
document.querySelector(
".Slider-main-box-slider-btns-next-icon"
).style.color = "#555";
}
p4SliderCounter++;
}
};
const p4SliderPreviousHandler = () => {
let slider = document.querySelectorAll(
".Slider-main-box-item-container-item"
);
document.querySelector(
".Slider-main-box-slider-btns-next-text"
).style.color = "#fff";
document.querySelector(
".Slider-main-box-slider-btns-next-icon"
).style.color = "#fff";
if (p4SliderCounter > 0) {
if (p4SliderCounter === 3) {
slider[5].style.transform = "translateX(100%)";
slider[4].style.transform = "translateX(-212.5%)";
slider[3].style.transform = "translateX(-212.5%)";
slider[2].style.transform = "translateX(-212.5%)";
} else if (p4SliderCounter === 2) {
slider[4].style.transform = "translateX(100%)";
slider[3].style.transform = "translateX(-106.25%)";
slider[2].style.transform = "translateX(-106.25%)";
slider[1].style.transform = "translateX(-106.25%)";
} else if (p4SliderCounter === 1) {
slider[3].style.transform = "translateX(100%)";
slider[2].style.transform = "translateX(0%)";
slider[1].style.transform = "translateX(0%)";
slider[0].style.transform = "translateX(0%)";
document.querySelector(
".Slider-main-box-slider-btns-previous"
).style.color = "#555";
}
p4SliderCounter--;
}
};
return (
<div className="Slider bg-black ltr">
<div className="Slider-main-box ltr">
<div className="Slider-main-box-item-container ltr">
{hp4Data.map((item, index) => (
<div
key={item.id}
className="Slider-main-box-item-container-item"
style={index > 2 ? { transform: "translateX(100%)" } : null}
>
<div className="Slider-main-box-item-container-item-img-container ltr"></div>
<div
className="Slider-main-box-item-container-item-title"
style={{ direction: "rtl" }}
>
{item.title_fa}
</div>
<div
className="Slider-main-box-item-container-item-subtitle"
style={{ direction: "rtl" }}
>
{item.subtitle_fa}
</div>
</div>
))}
</div>
<div className="Slider-main-box-slider-btns">
<div
className="Slider-main-box-slider-btns-previous bg-red-400"
onClick={p4SliderPreviousHandler}
// style={p4SliderCounter === 0 ? { color:"#555" } : null}
>
{/* <BsArrowLeft className="Slider-main-box-slider-btns-previous-icon" /> */}
<div className="Slider-main-box-slider-btns-previous-text">
قبلی
</div>
</div>
<div
className="Slider-main-box-slider-btns-next"
onClick={p4SliderNextHandler}
// style={p4SliderCounter === 3 ? { filter: "grayscale(100%)" } : null}
>
<div className="Slider-main-box-slider-btns-next-text">
بعدی
</div>
{/* <BsArrowRight className="Slider-main-box-slider-btns-next-icon" /> */}
</div>
</div>
</div>
</div>
);
};
export default Slider;

@ -0,0 +1,21 @@
import React from "react";
import { connect } from "react-redux";
export const Textarea = ({ rows, value, onChange, name, placeholder }) => {
return (
<textarea
rows={rows}
value={value}
placeholder={placeholder}
name={name}
onChange={e => onChange(e.target.name, e.target.value)}
className={`w-full outline-none border border-solid border-gray-200 focus:border-primary-7 focus:bg-secondary-9 bg-gray-50 rounded-lg placeholder:text-gray-400 focus:text-secondary-8 text-2x p-6 font-2`}
/>
);
};
const mapStateToProps = (state) => ({});
const mapDispatchToProps = {};
export default connect(mapStateToProps, mapDispatchToProps)(Textarea);

@ -15,6 +15,10 @@ const form = {
(data = {}) => (data = {}) =>
async (dispatch) => async (dispatch) =>
await dispatch({ type: "form/setSearch", data }), await dispatch({ type: "form/setSearch", data }),
setContact:
(data = {}) =>
async (dispatch) =>
await dispatch({ type: "form/setContact", data }),
}; };
export default form; export default form;

@ -21,6 +21,12 @@ const initialState = {
nationalId: "", nationalId: "",
cellphone: "", cellphone: "",
}, },
contact: {
name: "",
email: "",
job: "",
message: "",
},
search: "", search: "",
}; };
export default function form(state = initialState, action) { export default function form(state = initialState, action) {
@ -54,6 +60,14 @@ export default function form(state = initialState, action) {
search: { ...state.profile, search: data }, search: { ...state.profile, search: data },
error: null, error: null,
}; };
case "form/setContact":
console.log(data);
return {
...state,
loading: false,
contact: { ...state.ticket, [data.name]: data.value },
error: null,
};
case "form/loading": case "form/loading":
return { ...state, loading: true }; return { ...state, loading: true };
case "form/error": case "form/error":

@ -0,0 +1,87 @@
import { useCallback, useRef, useState } from "react";
export const useLongPress = (
onLongPress,
onClick,
{ shouldPreventDefault = true, delay = 300 } = {}
) => {
const [longPressTriggered, setLongPressTriggered] = useState(false);
const timeout = useRef();
const target = useRef();
const start = useCallback(
(event) => {
if (shouldPreventDefault && event.target) {
event.target.addEventListener("touchend", preventDefault, {
passive: false,
});
target.current = event.target;
}
timeout.current = setTimeout(() => {
onLongPress(event);
setLongPressTriggered(true);
}, delay);
},
[onLongPress, delay, shouldPreventDefault]
);
const clear = useCallback(
(event, shouldTriggerClick = true) => {
timeout.current && clearTimeout(timeout.current);
shouldTriggerClick && !longPressTriggered && onClick();
setLongPressTriggered(false);
if (shouldPreventDefault && target.current) {
target.current.removeEventListener("touchend", preventDefault);
}
},
[shouldPreventDefault, onClick, longPressTriggered]
);
return {
onMouseDown: (e) => start(e),
onTouchStart: (e) => start(e),
onMouseUp: (e) => clear(e),
onMouseLeave: (e) => clear(e, false),
onTouchEnd: (e) => clear(e),
};
};
const isTouchEvent = (event) => {
return "touches" in event;
};
const preventDefault = (event) => {
if (!isTouchEvent(event)) return;
if (event.touches.length < 2 && event.preventDefault) {
event.preventDefault();
}
};
export default null;
//sample of useLongPress
// import useLongPress from "./useLongPress";
// export default function App() {
// const onLongPress = () => {
// console.log('longpress is triggered');
// };
// const onClick = () => {
// console.log('click is triggered')
// }
// const defaultOptions = {
// shouldPreventDefault: true,
// delay: 500,
// };
// const longPressEvent = useLongPress(onLongPress, onClick, defaultOptions);
// return (
// <div className="App">
// <button {...longPressEvent}>use Loooong Press</button>
// </div>
// );
// }

@ -0,0 +1,11 @@
class location {
getId = () => {
const pathname = window.location.pathname;
return pathname.slice(pathname.lastIndexOf('/') + 1, pathname.length);
}
}
const _location = new location();
export default _location;

@ -0,0 +1,292 @@
import { toast } from "react-toastify";
class onInput {
persianOnly = (txt) => {
let newText = txt;
newText = newText.replace(/`/g, "");
newText = newText.replace(/0/g, "");
newText = newText.replace(/1/g, "");
newText = newText.replace(/2/g, "");
newText = newText.replace(/3/g, "");
newText = newText.replace(/4/g, "");
newText = newText.replace(/5/g, "");
newText = newText.replace(/6/g, "");
newText = newText.replace(/7/g, "");
newText = newText.replace(/8/g, "");
newText = newText.replace(/9/g, "");
newText = newText.replace(/0/g, "");
newText = newText.replace(/q/g, "");
newText = newText.replace(/w/g, "");
newText = newText.replace(/e/g, "");
newText = newText.replace(/r/g, "");
newText = newText.replace(/t/g, "");
newText = newText.replace(/y/g, "");
newText = newText.replace(/u/g, "");
newText = newText.replace(/i/g, "");
newText = newText.replace(/o/g, "");
newText = newText.replace(/p/g, "");
newText = newText.replace(/\[/g, "");
newText = newText.replace(/\]/g, "");
newText = newText.replace(/a/g, "");
newText = newText.replace(/s/g, "");
newText = newText.replace(/d/g, "");
newText = newText.replace(/f/g, "");
newText = newText.replace(/g/g, "");
newText = newText.replace(/h/g, "");
newText = newText.replace(/j/g, "");
newText = newText.replace(/k/g, "");
newText = newText.replace(/l/g, "");
newText = newText.replace(/;/g, "");
newText = newText.replace(/'/g, "");
newText = newText.replace(/z/g, "");
newText = newText.replace(/x/g, "");
newText = newText.replace(/c/g, "");
newText = newText.replace(/v/g, "");
newText = newText.replace(/b/g, "");
newText = newText.replace(/n/g, "");
newText = newText.replace(/m/g, "");
newText = newText.replace(/,/g, "");
newText = newText.replace(/./g, "");
newText = newText.replace(/\//g, "");
newText = newText.replace(/~/g, " ");
newText = newText.replace(/Q/g, "");
newText = newText.replace(/W/g, "");
newText = newText.replace(/E/g, "");
newText = newText.replace(/R/g, "");
newText = newText.replace(/T/g, "");
newText = newText.replace(/Y/g, "");
newText = newText.replace(/U/g, "");
newText = newText.replace(/I/g, "");
newText = newText.replace(/O/g, "");
newText = newText.replace(/P/g, "");
newText = newText.replace(/A/g, "");
newText = newText.replace(/S/g, "");
newText = newText.replace(/G/g, "");
newText = newText.replace(/H/g, "");
newText = newText.replace(/J/g, "");
newText = newText.replace(/K/g, "");
newText = newText.replace(/L/g, "");
newText = newText.replace(/Z/g, "");
newText = newText.replace(/X/g, "");
newText = newText.replace(/B/g, "");
newText = newText.replace(/N/g, "");
newText = newText.replace(/M/g, "");
newText = newText.replace(/\?/g, "");
if (!newText && newText.length !== 0) {
toast.info("از کاراکتر فارسی استفاده کنید");
}
return newText;
};
englishAndNumberWithoutSpace = (txt) => {
let newText = txt;
newText = newText.replace(/`/g, "");
newText = newText.replace(/۰/g, "0");
newText = newText.replace(/۱/g, "1");
newText = newText.replace(/۲/g, "2");
newText = newText.replace(/۳/g, "3");
newText = newText.replace(/۴/g, "4");
newText = newText.replace(/۵/g, "5");
newText = newText.replace(/۶/g, "6");
newText = newText.replace(/۷/g, "7");
newText = newText.replace(/۸/g, "8");
newText = newText.replace(/۹/g, "9");
newText = newText.replace(/ا/g, "");
newText = newText.replace(/ب/g, "");
newText = newText.replace(/پ/g, "");
newText = newText.replace(/ت/g, "");
newText = newText.replace(/ث/g, "");
newText = newText.replace(/ج/g, "");
newText = newText.replace(/چ/g, "");
newText = newText.replace(/ح/g, "");
newText = newText.replace(/خ/g, "");
newText = newText.replace(/د/g, "");
newText = newText.replace(/\[/g, "");
newText = newText.replace(/\]/g, "");
newText = newText.replace(/ذ/g, "");
newText = newText.replace(/ر/g, "");
newText = newText.replace(/ز/g, "");
newText = newText.replace(/ژ/g, "");
newText = newText.replace(/ط/g, "");
newText = newText.replace(/ظ/g, "");
newText = newText.replace(/ع/g, "");
newText = newText.replace(/غ/g, "");
newText = newText.replace(/ف/g, "");
newText = newText.replace(/;/g, "");
newText = newText.replace(/'/g, "");
newText = newText.replace(/ق/g, "");
newText = newText.replace(/س/g, "");
newText = newText.replace(/ش/g, "");
newText = newText.replace(/ص/g, "");
newText = newText.replace(/ض/g, "");
newText = newText.replace(/ک/g, "");
newText = newText.replace(/گ/g, "");
newText = newText.replace(/,/g, "");
newText = newText.replace(/\./g, "");
newText = newText.replace(/\//g, "");
newText = newText.replace(/~/g, " ");
newText = newText.replace(/ل/g, "");
newText = newText.replace(/م/g, "");
newText = newText.replace(/ن/g, "");
newText = newText.replace(/و/g, "");
newText = newText.replace(/ه/g, "");
newText = newText.replace(/ی/g, "");
newText = newText.replace(/\?/g, "");
if (!newText && newText.length !== 0) {
toast.info("از کاراکتر انگلیسی واعداداستفاده کنید");
}
return newText;
};
numberOnly = (txt) => {
let newText = txt;
newText = newText.replace(/`/g, "");
newText = newText.replace(/0/g, "0");
newText = newText.replace(/1/g, "1");
newText = newText.replace(/2/g, "2");
newText = newText.replace(/3/g, "3");
newText = newText.replace(/4/g, "4");
newText = newText.replace(/5/g, "5");
newText = newText.replace(/6/g, "6");
newText = newText.replace(/7/g, "7");
newText = newText.replace(/8/g, "8");
newText = newText.replace(/9/g, "9");
newText = newText.replace(/۰/g, "0");
newText = newText.replace(/۱/g, "1");
newText = newText.replace(/۲/g, "2");
newText = newText.replace(/۳/g, "3");
newText = newText.replace(/۴/g, "4");
newText = newText.replace(/۵/g, "5");
newText = newText.replace(/۶/g, "6");
newText = newText.replace(/۷/g, "7");
newText = newText.replace(/۸/g, "8");
newText = newText.replace(/۹/g, "9");
newText = newText.replace(/ا/g, "");
newText = newText.replace(/ب/g, "");
newText = newText.replace(/پ/g, "");
newText = newText.replace(/ت/g, "");
newText = newText.replace(/ث/g, "");
newText = newText.replace(/ج/g, "");
newText = newText.replace(/چ/g, "");
newText = newText.replace(/ح/g, "");
newText = newText.replace(/خ/g, "");
newText = newText.replace(/د/g, "");
newText = newText.replace(/\[/g, "");
newText = newText.replace(/\]/g, "");
newText = newText.replace(/ذ/g, "");
newText = newText.replace(/ر/g, "");
newText = newText.replace(/ز/g, "");
newText = newText.replace(/ژ/g, "");
newText = newText.replace(/ط/g, "");
newText = newText.replace(/ظ/g, "");
newText = newText.replace(/ع/g, "");
newText = newText.replace(/غ/g, "");
newText = newText.replace(/ف/g, "");
newText = newText.replace(/;/g, "");
newText = newText.replace(/'/g, "");
newText = newText.replace(/ق/g, "");
newText = newText.replace(/س/g, "");
newText = newText.replace(/ش/g, "");
newText = newText.replace(/ص/g, "");
newText = newText.replace(/ض/g, "");
newText = newText.replace(/ک/g, "");
newText = newText.replace(/گ/g, "");
newText = newText.replace(/\,/g, "");
newText = newText.replace(/\./g, "");
newText = newText.replace(/\//g, "");
newText = newText.replace(/~/g, " ");
newText = newText.replace(/ل/g, "");
newText = newText.replace(/م/g, "");
newText = newText.replace(/ن/g, "");
newText = newText.replace(/و/g, "");
newText = newText.replace(/ه/g, "");
newText = newText.replace(/ی/g, "");
newText = newText.replace(/\?/g, "");
newText = newText.replace(/q/g, "");
newText = newText.replace(/w/g, "");
newText = newText.replace(/e/g, "");
newText = newText.replace(/r/g, "");
newText = newText.replace(/t/g, "");
newText = newText.replace(/y/g, "");
newText = newText.replace(/u/g, "");
newText = newText.replace(/i/g, "");
newText = newText.replace(/o/g, "");
newText = newText.replace(/p/g, "");
newText = newText.replace(/a/g, "");
newText = newText.replace(/s/g, "");
newText = newText.replace(/d/g, "");
newText = newText.replace(/f/g, "");
newText = newText.replace(/g/g, "");
newText = newText.replace(/h/g, "");
newText = newText.replace(/j/g, "");
newText = newText.replace(/k/g, "");
newText = newText.replace(/l/g, "");
newText = newText.replace(/z/g, "");
newText = newText.replace(/x/g, "");
newText = newText.replace(/c/g, "");
newText = newText.replace(/v/g, "");
newText = newText.replace(/b/g, "");
newText = newText.replace(/n/g, "");
newText = newText.replace(/m/g, "");
newText = newText.replace(/Q/g, "");
newText = newText.replace(/W/g, "");
newText = newText.replace(/E/g, "");
newText = newText.replace(/R/g, "");
newText = newText.replace(/T/g, "");
newText = newText.replace(/Y/g, "");
newText = newText.replace(/U/g, "");
newText = newText.replace(/I/g, "");
newText = newText.replace(/O/g, "");
newText = newText.replace(/P/g, "");
newText = newText.replace(/A/g, "");
newText = newText.replace(/S/g, "");
newText = newText.replace(/G/g, "");
newText = newText.replace(/H/g, "");
newText = newText.replace(/J/g, "");
newText = newText.replace(/K/g, "");
newText = newText.replace(/L/g, "");
newText = newText.replace(/Z/g, "");
newText = newText.replace(/X/g, "");
newText = newText.replace(/B/g, "");
newText = newText.replace(/N/g, "");
newText = newText.replace(/M/g, "");
if (!newText && newText.length !== 0) {
toast.info("از اعداداستفاده کنید");
}
return newText;
};
dayHandler = (num) => {
let newNum = this.numberOnly(num);
if (newNum > 31) {
toast.error("روز نباید بزرگتر از 31 باشد.");
return Math.floor(newNum / 10);
}
return newNum;
};
monthHandler = (num) => {
let newNum = this.numberOnly(num);
if (newNum > 12 || newNum < 0) {
toast.error("ماه باید بین 1 تا 12 باشد.");
return Math.floor(newNum / 10);
}
return newNum;
};
yearHandler = (num) => {
let newNum = this.numberOnly(num);
if (newNum > 1395) {
toast.error("سال باید کوچکتر از 1395 باشد.");
return Math.floor(newNum / 10);
}
return newNum;
};
phonenumber = (value) => {
let formattedValue = value
.replace(/[\u0660-\u0669\u06f0-\u06f9]/g, function (c) {
return c.charCodeAt(0) & 0xf;
})
.replace(/[^\d]/, "");
return formattedValue;
};
}
const _onInput = new onInput();
export default _onInput;

@ -11,7 +11,6 @@ import Samples from "./layouts/Samples";
import CrossPlatform from "./layouts/CrossPlatform"; import CrossPlatform from "./layouts/CrossPlatform";
import Form from "./layouts/Form"; import Form from "./layouts/Form";
export const Home = ({ device, setHeaderOptions, isDesktop }) => { export const Home = ({ device, setHeaderOptions, isDesktop }) => {
React.useEffect(() => { React.useEffect(() => {
if (isDesktop) { if (isDesktop) {
@ -19,17 +18,15 @@ export const Home = ({ device, setHeaderOptions, isDesktop }) => {
} }
}, []); }, []);
return ( return (
<div className="flex-1 flex justify-center"> <main className="flex-1 flex flex-col items-center">
<main className="w-10/12"> <Graphic />
<Graphic /> <Features />
<Features /> <Panel />
<Panel /> <Gradient />
<Gradient /> <Samples />
<Samples /> <CrossPlatform />
<CrossPlatform /> <Form />
<Form /> </main>
</main>
</div>
); );
}; };

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.6 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

@ -1,13 +1,64 @@
import React from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
//assets
import iosImage from "./assets/ios.svg";
import androidImage from "./assets/android.svg";
import pwaImage from "./assets/pwa.svg";
export const CrossPlatform = ({}) => { export const CrossPlatform = ({}) => {
const links = React.useMemo(() => {
return [
{
link: "/android",
image: androidImage,
width: "calc(14.43vw)",
height: "calc(14.43vw * 0.4379)",
},
{
link: "/ios",
image: iosImage,
width: "calc(14.43vw * 0.8148)",
height: "calc(14.43vw * 0.2554)",
},
{
link: "/pwa",
image: pwaImage,
width: "calc(14.43vw * 0.8759)",
height: "calc(14.43vw * 0.2919)",
},
];
});
return ( return (
<div <div
className="w-full flex items-center justify-center bg-yellow-400" className="w-10/12 flex items-center justify-between"
style={{ height: "calc(100vh / 10)" }} style={{ height: "calc(100vh / 10)" }}
> >
CrossPlatform <div className="flex flex-col">
<strong className="text-primary-3 font-6 text-5x">
قابل استفاده برای{" "}
</strong>
<strong className="text-primary-6 font-6 text-2x my-2">
گوشیهای اندرویدی و آی او اس و PWA
</strong>
</div>
<div className="flex gap-4 items-center">
{links.map((link, index) => (
<a href={link.link} download>
<img
src={link.image}
alt={link}
key={index}
style={{
width: link.width,
height: link.height,
}}
/>
</a>
))}
</div>
</div> </div>
); );
}; };

@ -41,7 +41,7 @@ export const Features = ({ isDesktop }) => {
}, [isDesktop]); }, [isDesktop]);
return ( return (
<div className="w-full h-screen flex flex-col justify-around items-center py-5"> <div className="w-10/12 h-screen flex flex-col justify-around items-center py-5">
<div className="flex flex-col"> <div className="flex flex-col">
<strong className="text-primary-3 font-6 text-5x"> <strong className="text-primary-3 font-6 text-5x">
بیشتر از یک پلتفرم محتوایی اعجاب انگیز بیشتر از یک پلتفرم محتوایی اعجاب انگیز
@ -62,7 +62,6 @@ export const Features = ({ isDesktop }) => {
</div> </div>
))} ))}
</div> </div>
<Button <Button
title="امکانات بیشتری کشف کنید" title="امکانات بیشتری کشف کنید"
round="rounded-full" round="rounded-full"

@ -1,19 +1,90 @@
import React from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { form } from "../../../../redux/actions";
import onInput from "../../../../utils/onInput";
export const Form = ({}) => { //components
import Input from "../../../../components/Input";
import Button from "../../../../components/Button";
import Textarea from "../../../../components/Textarea";
export const Form = ({ contact, setContact }) => {
return ( return (
<div <div
className="w-full flex items-center justify-center bg-purple-100" className="w-10/12 flex flex-col items-center justify-around"
style={{ height: "calc(100vh - 100vh / 10)" }} style={{ height: "calc(100vh - 100vh / 10)" }}
> >
Form <div className="flex flex-col items-center">
<strong className="text-primary-3 font-6 text-5x">
فرم درخواست سرویس{" "}
</strong>
<p className="text-2x font-4 text-gray-400 mt-3">
در این قسمت یک متن بسیار عجیب و جالب باید قرار بگیرید{" "}
</p>
</div>
<div className="flex w-full justify-between">
<div className="flex flex-col justify-center w-5/12">
<strong className="text-primary-7 font-4 text-4x">تماس با ما </strong>
<strong className="text-black font-7 text-5x mt-2">
سلام
<br /> بیاید با هم صحبت کنیم
</strong>
<strong className="text-black font-2 text-4x mt-4">
Info@Barnamenegar.com
</strong>
</div>
<div className="h-full w-px bg-gray-200"></div>
<form
className="flex flex-col gap-6 items-end justify-center w-5/12"
onSubmit={(e) => e.prevDefault()}
>
<Input
placeholder="نام"
name="name"
value={contact.name}
onChange={(name, value) => setContact({ name, value })}
regex={(val) => val}
/>
<Input
placeholder="ایمیل"
name="email"
value={contact.email}
onChange={(name, value) => setContact({ name, value })}
regex={(val) => val}
/>
<Input
placeholder="زمینه فعالیت"
name="job"
value={contact.job}
onChange={(name, value) => setContact({ name, value })}
regex={(val) => val}
/>
<Textarea
rows={4}
name="message"
value={contact.message}
placeholder="پیام"
onChange={(name, value) => setContact({ name, value })}
/>
<Button
title="ارسال"
backgroundColor="bg-primary-7"
color="text-white"
padding="py-4 px-20"
round="rounded-lg"
/>
</form>
</div>
</div> </div>
); );
}; };
const mapStateToProps = (state) => ({}); const mapStateToProps = (state) => ({
contact: state.form.contact,
});
const mapDispatchToProps = {}; const mapDispatchToProps = {
setContact: form.setContact,
};
export default connect(mapStateToProps, mapDispatchToProps)(Form); export default connect(mapStateToProps, mapDispatchToProps)(Form);

@ -4,10 +4,37 @@ import { connect } from "react-redux";
export const Gradient = ({}) => { export const Gradient = ({}) => {
return ( return (
<div <div
className="w-full flex items-center justify-center" className="w-full flex relative justify-center pt-10"
style={{ height: "calc(100vh / 2)" }} style={{
background:
"linear-gradient(315deg, rgba(255,238,225,1) 0%, rgba(248,250,255,1) 50%, rgba(211,245,255,1) 100%)",
}}
> >
Gradient <div className="w-10/12 flex">
<div className="flex-1 flex items-end">
<div
className="bg-white rounded-t-3xl"
style={{
width: "calc((100vw - 16vw) / 2 * 3 / 5)",
height: "calc((100vw - 16vw) / 2 * 3 / 5 * 5 / 4)",
}}
></div>
</div>
<div className="flex-1 flex flex-col justify-center">
<strong className="text-primary-3 font-6 text-5x">
امکانات بسیار متفاوت
<br /> قابلیت ارسال تصویر، صورت، ویدئو
</strong>
<strong className="text-primary-6 font-6 text-2x my-2">
قابلیتهای که هرجا نمیتوانید آن را پیدا کنید{" "}
</strong>
<p className="text-primary-1 text-6xl font-4 text-2x">
یکی از امکانات مهم و ضروری داستان بازی امکان
<br /> ارسال پاسخ کاربران به شما به صورت نوشته، ویدئو
<br /> صوت و یا فرمت دلخواه شما میباشد.
</p>
</div>
</div>
</div> </div>
); );
}; };

@ -4,7 +4,7 @@ import { connect } from "react-redux";
export const Graphic = ({}) => { export const Graphic = ({}) => {
return ( return (
<header <header
className="w-full flex items-center justify-center bg-green-100" className="w-10/12 flex items-center justify-center bg-green-100"
style={{ style={{
height: "calc( 100vh - 100vh / 15)", height: "calc( 100vh - 100vh / 15)",
}} }}

@ -25,7 +25,7 @@ export const Panel = ({ isDesktop }) => {
return ( return (
<div <div
className="w-full flex items-center justify-between" className="w-10/12 flex items-center justify-between"
style={{ height: "calc(100vh / 2)" }} style={{ height: "calc(100vh / 2)" }}
> >
<div className="flex flex-col"> <div className="flex flex-col">
@ -43,14 +43,20 @@ export const Panel = ({ isDesktop }) => {
<br /> همه چیز در کنترل شماست <br /> همه چیز در کنترل شماست
</p> </p>
</div> </div>
<div className="flex flex-col justify-center h-4/5 bg-dark-2 w-1/2 rounded-md"> <div
className="flex flex-col justify-center bg-dark-2 w-1/2 rounded-md"
style={{
height: "calc((100vw - 16vw) / 2 * 9 /16)",
width: "calc((100vw - 16vw) / 2)",
}}
>
<ul className="flex flex-col w-full h-4/5 justify-around"> <ul className="flex flex-col w-full h-4/5 justify-around">
{items.map((item, index) => ( {items.map((item, index) => (
<li <li
className={`bg-secondary-8 p-2 rounded-md flex items-center text-1x text-white transform ${ className={`bg-secondary-8 p-2 rounded-md flex items-center text-1x text-white transform ${
index === 1 ? "translate-x-1/2" : "translate-x-1/3" index === 1 ? "translate-x-1/2" : "translate-x-1/3"
}`} }`}
style={{ maxWidth: "270px" }} style={{ maxWidth: "calc((100vw - 16vw) / 2 / 2.8)" }}
> >
<span className={`${item.color} ml-2`}>#</span> <span className={`${item.color} ml-2`}>#</span>
{item.title} {item.title}

@ -1,12 +1,52 @@
import React from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
//components
import Button from "../../../../components/Button";
import Slider from "../../../../components/Slider";
export const Samples = ({}) => { export const Samples = ({}) => {
const [activeProject, setActiveProject] = React.useState(null);
const Info = () => {
return (
<div className="flex justify-between border-2 border-solid border-primary-5 rounded-lg px-7 py-16 w-11/12">
<div className="flex flex-col flex-1">
<strong className="text-primary-4 font-4 text-2x">
آقا بزرگ
<br /> یک متن توضیح کوتاه در این قسمت قرار میگیرد
</strong>
<p className="text-2x font-3 text-primary-2 mt-3">
فرق نمیکند کاربران شما با تلفنهای همراه یا کامپیوترهای شخصی خود
وارد حسابشان شوند، دسترسی از هر مکان و زمانی امکان پذیر است
</p>
</div>
<div className="flex flex-col flex-1 justify-center items-end">
<Button
title="مشاهده و کار با پروژه"
round="rounded-full"
borderColor="text-primary-5"
color="text-primary-4"
padding="px-10 py-5"
backgroundColor="bg-green-50 bg-opacity-50"
/>
</div>
</div>
);
};
return ( return (
<div <div className="w-10/12 h-screen flex flex-col justify-around items-center py-5 relative">
className="w-full h-screen flex items-center justify-center bg-blue-100" <div className="flex flex-col">
> <strong className="text-primary-3 font-6 text-5x">
Samples با افتخار قدرت گرفته از داستان بازی{" "}
</strong>
<p className="text-2x font-4 text-gray-400 mt-3">
در این قسمت یک متن بسیار عجیب و جالب باید قرار بگیرید
</p>
</div>
<Slider />
<Info />
</div> </div>
); );
}; };

@ -3,16 +3,16 @@ module.exports = {
darkMode: "class", // or 'media' or 'class' darkMode: "class", // or 'media' or 'class'
theme: { theme: {
fontSize: { fontSize: {
"1x": "clamp(11px, 1.42vw, 20px)", "1x": "clamp(11px, 1.05vw, 20px)",
"2x": "clamp(15px, 1.85vw , 26px)", "2x": "clamp(15px, 1.40vw , 26px)",
"3x": "", "3x": "",
"4x": "", "4x": "clamp(18px, 2.127vw, 40px)",
"5x": "clamp(18px, 3.33vw, 46px)", "5x": "clamp(18px, 2.42vw, 46px)",
"6x": "", "6x": "",
"7x": "", "7x": "",
"8x": "", "8x": "",
"9x": "", "9x": "",
"10x": "clamp(46px, 14vw, 100px)", "10x": "clamp(46px, 5.26vw, 100px)",
}, },
backgroundColor: (theme) => ({ backgroundColor: (theme) => ({
...theme("colors"), ...theme("colors"),
@ -32,7 +32,6 @@ module.exports = {
"secondary-7": "#426AEE", "secondary-7": "#426AEE",
"secondary-8": "#292841", "secondary-8": "#292841",
"secondary-9": "#F5F6FF", "secondary-9": "#F5F6FF",
gradient: "null",
"dark-1": "#2F8BD2", "dark-1": "#2F8BD2",
"dark-2": "#CFCFCF", "dark-2": "#CFCFCF",
"dark-3": "#000517", "dark-3": "#000517",

Loading…
Cancel
Save