diff --git a/package-lock.json b/package-lock.json index 2233e06..bdcf11a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2361,8 +2361,7 @@ "@types/hex2dec": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@types/hex2dec/-/hex2dec-1.1.2.tgz", - "integrity": "sha512-9mWQ0gKYWKybgC0UsW2ZwurhPYyCnO0ZmN7bnvxxk5m19PEydzums7ozq2p5f1pbV07IZ9qjR/IkGYpEIpXNoQ==", - "dev": true + "integrity": "sha512-9mWQ0gKYWKybgC0UsW2ZwurhPYyCnO0ZmN7bnvxxk5m19PEydzums7ozq2p5f1pbV07IZ9qjR/IkGYpEIpXNoQ==" }, "@types/history": { "version": "4.7.9", @@ -13372,6 +13371,11 @@ } } }, + "react-circular-progressbar": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/react-circular-progressbar/-/react-circular-progressbar-2.0.4.tgz", + "integrity": "sha512-OfX0ThSxRYEVGaQSt0DlXfyl5w4DbXHsXetyeivmoQrh9xA9bzVPHNf8aAhOIiwiaxX2WYWpLDB3gcpsDJ9oww==" + }, "react-dev-utils": { "version": "11.0.4", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-11.0.4.tgz", diff --git a/package.json b/package.json index 011d768..7285358 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,13 @@ "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.8.3", "@types/hex-rgba": "^1.0.1", + "@types/hex2dec": "^1.0.0", "@types/jest": "^26.0.24", "@types/node": "^12.20.28", "@types/react": "^17.0.27", "@types/react-dom": "^17.0.9", "@types/react-router-dom": "^5.3.0", "@types/webmidi": "^2.0.6", - "@types/hex2dec": "^1.0.0", "babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", "babel-register": "^6.26.0", @@ -25,6 +25,7 @@ "hex2dec": "^1.1.2", "midi-json-parser": "^8.0.48", "react": "^17.0.2", + "react-circular-progressbar": "^2.0.4", "react-dom": "^17.0.2", "react-paypal-express-checkout": "^1.0.5", "react-redux": "^7.2.6", diff --git a/public/Contribute.txt b/public/Contribute.txt index b8a3f70..79a544b 100644 --- a/public/Contribute.txt +++ b/public/Contribute.txt @@ -4,6 +4,24 @@ SoundFont Player :: https://www.npmjs.com/package/soundfont-player Midi-Json-Parser :: https://www.npmjs.com/package/midi-json-parser rgb-hex :: https://www.npmjs.com/package/rgb-hex hex2dec :: https://www.npmjs.com/package/hex2dec +circular_progress_bar :: https://www.npmjs.com/package/react-circular-progressbar Dancing_Cactus :: https://tenor.com/view/cactus-cool-shades-animated-dancing-gif-17528497 Sad_Cactus :: https://tenor.com/view/hug-yay-squeeze-bear-hug-hug-tight-gif-15085080 +default_background :: https://unsplash.com/photos/zXwG_60Yo0Q +Midi_Data_Image :: https://www.npmjs.com/package/midi-parser-js + +--------------------------- +Website Designed in Figma :: https://www.figma.com/ +Writen using Vs Code :: https://code.visualstudio.com/ +Hosted on Heroku :: https://www.heroku.com/ +DNS delivered by Cloudflare :: https://www.cloudflare.com/ + +Technologies used :: + +- React +- Typescript +- HTML +- SCSS (Sass) +- Redux +- Npm library diff --git a/public/sitemap.xml b/public/sitemap.xml index c2242c5..6a98fff 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -9,13 +9,13 @@ https://pianoblocksapp.com/ - 2021-12-27T21:47:20+00:00 + 2021-12-28T21:47:20+00:00 https://pianoblocksapp.com/tutorial - 2021-12-22T21:47:20+00:00 + 2021-12-28T21:47:20+00:00 https://pianoblocksapp.com/info - 2021-12-22T21:47:20+00:00 + 2021-12-28T21:47:20+00:00 https://pianoblocksapp.com/record - 2021-12-22T21:47:20+00:00 + 2021-12-28T21:47:20+00:00 diff --git a/src/App.tsx b/src/App.tsx index 8db9f3f..2017c6a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,7 +13,6 @@ import './App.css'; function App() { const [ac,setAc] = useState(null); - const [password,setPassword] = useState(''); const [allowed,setIsallowed] = useState(false); useEffect(()=>{ @@ -28,20 +27,12 @@ function App() { window.removeEventListener('drop',ac_add); } - const passwordChange = (e:any) =>{ - setPassword(e.target.value); - if(e.target.value === 'bayo_yayo_03'){ - setIsallowed(true) - } - } - return (
{!allowed &&
-

Piano Blocks App Closed Beta (testing)

-

To access insert Password

- - +

Piano Blocks App

+

Final adjustments ... Start 30 Dec 20:00

+ {setIsallowed(true)}} />
} {allowed &&
} {allowed && diff --git a/src/Components/CountDownTimer/CountDownTimer.tsx b/src/Components/CountDownTimer/CountDownTimer.tsx index afd5579..8959e4b 100644 --- a/src/Components/CountDownTimer/CountDownTimer.tsx +++ b/src/Components/CountDownTimer/CountDownTimer.tsx @@ -1,7 +1,11 @@ -import React,{useEffect,useState} from 'react'; +import React,{ReactElement, useEffect,useState} from 'react'; import './Timer.scss'; -export default function CountDownTimer() { +interface CountDown_Props{ + onEnd:Function +} + +export default function CountDownTimer({onEnd}:CountDown_Props):ReactElement { const [time,setTime] = useState(Date.now()); const [data,setData] = useState({ @@ -32,6 +36,9 @@ export default function CountDownTimer() { minutes:minutes, seconds:seconds }) + if(distance <= 0){ + onEnd(); + } }, [time]) return ( diff --git a/src/Components/InsideNavigator/InsideNavigator.style.scss b/src/Components/InsideNavigator/InsideNavigator.style.scss index ad30c60..3579a09 100644 --- a/src/Components/InsideNavigator/InsideNavigator.style.scss +++ b/src/Components/InsideNavigator/InsideNavigator.style.scss @@ -51,9 +51,6 @@ transition: 0.4s; } } - .SingleLink:hover{ - // background-color: rgba(128, 128, 128, 0.377); - } } .Component{ padding-top: 80px; @@ -62,5 +59,87 @@ z-index: 2; overflow-y:auto; } + .Component::-webkit-scrollbar { + width: 10px; + } + .Component::-webkit-scrollbar-track { + background: #f1f1f105; + border-radius: 9px; + } + .Component::-webkit-scrollbar-thumb { + background: rgba(136, 136, 136, 0.24); + border-radius: 9px; + } + .Component::-webkit-scrollbar-thumb:hover { + background: rgba(85, 85, 85, 0.712); + } +} + +@media only screen and (max-width:1000px) { + .InsideNavigator{ + .Links{ + padding-left: 20px; + .SingleLink{ + width:98%; + .SingleLinkText{ + font-size: 14px; + width:90%; + } + } + } + } +} + +@media only screen and (max-width:900px) { + .InsideNavigator{ + flex-direction: column; + overflow-y: auto; + overflow-x: hidden; + .Links{ + width:98%; + margin: 0 auto; + display: flex; + flex-direction: row; + justify-content: space-evenly; + align-items: center; + height:100px; + padding-left: 10px; + padding-right: 10px; + .SingleLink{ + width:fit-content; + } + } + .Component{ + box-shadow: 0px -2px 6px black; + width:100%; + z-index: 4; + } + } +} + +@media only screen and (max-width:550px) { + .InsideNavigator{ + .Links{ + width:98%; + margin: 0 auto; + display: flex; + flex-direction: column; + justify-content: space-evenly; + align-items: flex-start; + height:auto; + margin-bottom: 0px; + .SingleLink{ + height:fit-content; + min-height: 28px; + margin: 2px; + .SingleLinkText{ + height:fit-content; + } + } + } + .Component{ + width:100%; + } + } } diff --git a/src/Components/InsideNavigator/InsideNavigator.tsx b/src/Components/InsideNavigator/InsideNavigator.tsx index 5239bc5..5a80032 100644 --- a/src/Components/InsideNavigator/InsideNavigator.tsx +++ b/src/Components/InsideNavigator/InsideNavigator.tsx @@ -46,10 +46,10 @@ export default function InsideNavigator({elements,width,height,proportion,setId, return (
-
+
900 ? {width:width / nav_proportion.current} : {}}> {RenderLinks()}
-
+
900 ? {width:width / nav_proportion.current * (nav_proportion.current - 1)} : {}}> {elements[component_id].component}
diff --git a/src/Components/NewOptions/NewOptions.styles.scss b/src/Components/NewOptions/NewOptions.styles.scss index 0634e59..9e477e5 100644 --- a/src/Components/NewOptions/NewOptions.styles.scss +++ b/src/Components/NewOptions/NewOptions.styles.scss @@ -45,7 +45,7 @@ text-align: center; font-size: 24px; color:white; - display:block; + display:inline-block; font-weight: 400; margin: 0; } @@ -142,6 +142,16 @@ width:50%; } +.Restore{ + position: absolute; + top:20px; + border:none; + font-size: 10px; + border-radius: 5px; + cursor: pointer; + padding: 2px; +} + @keyframes Enter{ 0%{ margin-Top: -50%; @@ -247,4 +257,7 @@ left:0% !important; width:100%; } + .Restore{ + display: none; + } } diff --git a/src/Components/NewOptions/OptionCard/OptionCard.style.scss b/src/Components/NewOptions/OptionCard/OptionCard.style.scss index 3bbb41b..b05f790 100644 --- a/src/Components/NewOptions/OptionCard/OptionCard.style.scss +++ b/src/Components/NewOptions/OptionCard/OptionCard.style.scss @@ -42,21 +42,46 @@ } } -// @media only screen and (max-width: 920px) { -// .OptionCard{ -// height:150px; -// width:280px; -// .Card_Title{ -// margin:0; -// margin-top: 8px; -// margin-bottom: 4px; -// font-size: 18px; -// } -// .Card_Description{ -// font-size: 12px !important; -// } -// } -// } +.inputImageDiv{ + position: relative; + width:80%; + height:45px; + margin: 0px auto; + overflow:hidden; + border-radius: 5px; + border:2px dashed black; + display:flex; + align-items: center; + justify-content: center; +} + +.inputImage{ + display: block; + position: relative; + width:80%; + margin: 0px auto; + height:50px; + border-radius: 10px; +} + +.ImageInput{ + position: absolute; + height:200%; + width:100%; + top:-50px; + border-radius: 10px; + cursor: pointer; +} + +.inputImageDiv{ + h1{ + font-size: 12px; + font-family: 'IM Fell English SC'; + color:black; + font-weight: 100; + } +} + @media only screen and (max-width: 550px) { .OptionCard{ diff --git a/src/Components/NewOptions/OptionCard/OptionCardImage.tsx b/src/Components/NewOptions/OptionCard/OptionCardImage.tsx new file mode 100644 index 0000000..10b5f13 --- /dev/null +++ b/src/Components/NewOptions/OptionCard/OptionCardImage.tsx @@ -0,0 +1,70 @@ +import React, { ReactElement,useRef, useState } from 'react' + +import {checkExtension} from '../../../Utils/smallFunctions'; + +interface CardProps{ + onChange: Function; + name: string; + type: string; + title?:string; + children:JSX.Element | string; + value: string|boolean, + textColor:string +} + +export default function OptionCard({onChange,name,type,textColor,title,children,value}:CardProps):ReactElement { + + const Myvalue = useRef(); + const [image,setImage] = useState(); + + const handleChange = () =>{ + + function convertDataToArray64():Promise { + + if(Myvalue.current){ + const file = Myvalue.current.files![0]; + + return new Promise((resolve, reject) => { + const reader = new FileReader(); + + reader.onload = (event:any) => { + resolve(event.target.result); + }; + + reader.onerror = (err) => { + reject(err); + }; + // reader.readAsArrayBuffer(file); + reader.readAsDataURL(file) + }); + }else{ + return new Promise(resolve =>{resolve('Error')}) + } + } + if(checkExtension(Myvalue.current?.files[0],'.jpg') || checkExtension(Myvalue.current?.files[0],'.png') || checkExtension(Myvalue.current?.files[0],'.gif')){ + convertDataToArray64().then(reading =>{ + const data = { + target:{name:'Image', value:reading} + }; + onChange(data); + setImage(reading); + }) + } + else{ + alert('Error, Image Format Not supported'); + } + } + return ( +
+

{title}

+

{children}

+ {!image && +
+

Insert Image

+ +
+ } + {image && your} +
+ ) +} \ No newline at end of file diff --git a/src/Components/NewOptions/OptionCard/OptionCardList.tsx b/src/Components/NewOptions/OptionCard/OptionCardList.tsx deleted file mode 100644 index 82a0105..0000000 --- a/src/Components/NewOptions/OptionCard/OptionCardList.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React, { ReactElement,useState } from 'react' -import './OptionCard.style.scss'; -import './Input.styles.scss'; - -interface OptionCardProps{ - name:string, - onChange: Function; - Important?:boolean; - title?:string; - children:JSX.Element | string; - value: string|boolean, - values:Array -} - -export default function OptionCard({name,onChange,value,children,title,values}:OptionCardProps):ReactElement { - - const [Myvalue,setValue] = useState(value); - - const handleChange = (e:any) =>{ - onChange(e) - if(e.target.type === 'checkbox'){ - setValue(!Myvalue); - }else if(e.target.type === 'number'){ - setValue(parseInt(e.target.value) < 0 ? 0: parseInt(e.target.value)); - parseInt(e.target.value) >= 0 && onChange(e); - } - else{ - setValue(e.target.value) - } - } - - const RenderOptions = () =>{ - return values.map((element,index) => ) - } - - return ( -
-

{title}

-

{children}

- -
- ) -} diff --git a/src/Components/NewOptions/Options.tsx b/src/Components/NewOptions/Options.tsx index 0361abd..4b59c5b 100644 --- a/src/Components/NewOptions/Options.tsx +++ b/src/Components/NewOptions/Options.tsx @@ -4,6 +4,7 @@ import './NewOptions.styles.scss'; import ChooseButton from './ChooseButtons/ChooseButton'; import { Options as OptionsType } from '../../Utils/TypesForOptions'; +import { restoreDefaults } from '../../Utils/smallFunctions'; import { Options_Blocks as OptionsBlocks, @@ -33,6 +34,7 @@ export default function Options({isOpened,onGoBack,options,handleOptionsChange}:

Configure Visuals

+ {table === 'blocks' && } {table === 'effects' && } {table === 'Effects Adv' && } diff --git a/src/Components/NewOptions/OptionsType/OptionsType.tsx b/src/Components/NewOptions/OptionsType/OptionsType.tsx index 25b4463..c2b0384 100644 --- a/src/Components/NewOptions/OptionsType/OptionsType.tsx +++ b/src/Components/NewOptions/OptionsType/OptionsType.tsx @@ -1,6 +1,7 @@ import React,{useState} from 'react'; import OptionCard from '../OptionCard/OptionCard'; +import OptionCardImage from '../OptionCard/OptionCardImage'; import EffectChoose from '../OptionCard/EffectChoose/EffectChoose'; import Fountain from '../OptionCard/EffectChoose/Previews/fountain.mp4'; @@ -104,6 +105,10 @@ function Options_Other({isOpened,onGoBack,options,handleOptionsChange}:OptionsPr Choose How fast will the blocks fall. Remember, blocks are also higher/taller with more speed + + Choose Background. Carefoul ! You can't easily switch back to default image + +
diff --git a/src/Components/PlayingManagement/PlayingManagement.scss b/src/Components/PlayingManagement/PlayingManagement.scss index 016ca18..7fbc36e 100644 --- a/src/Components/PlayingManagement/PlayingManagement.scss +++ b/src/Components/PlayingManagement/PlayingManagement.scss @@ -1,4 +1,6 @@ -$background : #001524f3; +@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500&display=swap'); + +$background : hsla(205, 100%, 7%, 0.953); $buttons_color : #FF7D00; .Playing_main{ @@ -46,12 +48,14 @@ $buttons_color : #FF7D00; } } .Timer{ + font-family: 'Quicksand', sans-serif; display: block; - font-size: 16px; - color:rgba(212, 212, 212, 0.795); + width:50px; + height:50px; + font-weight: 700; } .Duration{ - width:60%; + width:75%; justify-self: flex-end; height:30%; border:2px solid rgb(0, 0, 0); @@ -66,4 +70,24 @@ $buttons_color : #FF7D00; transition: 0.1s linear; } } +} + +@media only screen and (max-width:900px) { + .Playing_main{ + .icons{ + padding-left: 2px; + margin-left: 0px; + i{ + font-size: 22px; + margin: 4px; + } + .IconGoBack{ + width:28px; + margin-right: 4px; + } + } + .Duration{ + width:60%; + } + } } \ No newline at end of file diff --git a/src/Components/PlayingManagement/PlayingManagement.tsx b/src/Components/PlayingManagement/PlayingManagement.tsx index d47a489..b211beb 100644 --- a/src/Components/PlayingManagement/PlayingManagement.tsx +++ b/src/Components/PlayingManagement/PlayingManagement.tsx @@ -1,5 +1,7 @@ import React, { MouseEvent, ReactElement, useEffect, useState } from 'react'; import { useHistory } from 'react-router-dom'; +import { buildStyles, CircularProgressbar } from 'react-circular-progressbar'; +import 'react-circular-progressbar/dist/styles.css'; import './PlayingManagement.scss'; import MidiPlayer from '../../Helpers/MidiPlayer'; @@ -59,7 +61,20 @@ export default function PlayingManagement({Player,onStart}:PlayingManagementProp
-

{Math.floor(Player.timer / 1000)}/{Math.floor(Player.MidiLength / 1000)} (seconds)

+ {/*

{Math.floor(Player.timer / 1000)}/{Math.floor(Player.MidiLength / 1000)} (seconds)

*/} + ;
diff --git a/src/Components/Tracks/Tracks.styles.css b/src/Components/Tracks/Tracks.styles.css index e18816a..042e5b2 100644 --- a/src/Components/Tracks/Tracks.styles.css +++ b/src/Components/Tracks/Tracks.styles.css @@ -27,7 +27,7 @@ .Summer{ z-index: 152; position: absolute; - background: linear-gradient(180deg,transparent,rgba(0, 0, 0, 0.171)); + background: linear-gradient(180deg,transparent,rgba(0, 0, 0, 0.397)); } .Mark{ diff --git a/src/Components/Tracks/Tracks.tsx b/src/Components/Tracks/Tracks.tsx index bb246bc..6465e2e 100644 --- a/src/Components/Tracks/Tracks.tsx +++ b/src/Components/Tracks/Tracks.tsx @@ -59,26 +59,33 @@ export default function Tracks({Data,Speed,Width,Height, BlackNumbers, KeysPosit pianoCtx?.clearRect(0,0,PianoRef.current!.width,PianoRef.current!.height); pianoWhiteCtx?.clearRect(0,0,PianoWhiteRef.current!.width,PianoWhiteRef.current!.height); } - else if(Player.isMoved){ - let sp = Speed - if(Speed < 5){ - if(Speed >= 4){ - sp *= 2 - }else if(Speed >= 3){ - sp *= 4 - }else{ - sp *= 16; - } - } - const toBlocks = Player.getBackwardsBlocks((sp * 1000)); - blocks?.forcibly_add_blocks(toBlocks); - pianoCtx?.clearRect(0,0,PianoRef.current!.width,PianoRef.current!.height); - pianoWhiteCtx?.clearRect(0,0,PianoWhiteRef.current!.width,PianoWhiteRef.current!.height); - Player.PausePlay(); - } else{ blocks?.Paused(); } + if(Player){ + if(blocks){ + if(Player.isMoved){ + let sp = Speed + if(Speed < 5){ + if(Speed >= 4){ + sp *= 2 + }else if(Speed >= 3){ + sp *= 4 + }else{ + sp *= 16; + } + } + const toBlocks = Player.getBackwardsBlocks((sp * 1000)); + blocks?.forcibly_add_blocks(toBlocks); + pianoCtx?.clearRect(0,0,PianoRef.current!.width,PianoRef.current!.height); + pianoWhiteCtx?.clearRect(0,0,PianoWhiteRef.current!.width,PianoWhiteRef.current!.height); + Player.PausePlay(); + blocks?.render(); + Player.isMoved = false; + } + } + } + requestRef.current = requestAnimationFrame(animate); } @@ -166,7 +173,7 @@ export default function Tracks({Data,Speed,Width,Height, BlackNumbers, KeysPosit

© Tymoteusz Apriasz

}
-
+
diff --git a/src/Pages/Main/Main.tsx b/src/Pages/Main/Main.tsx index 098415f..9b6f800 100644 --- a/src/Pages/Main/Main.tsx +++ b/src/Pages/Main/Main.tsx @@ -108,7 +108,11 @@ export default function Main() { default: break; } - localStorage.setItem('options',JSON.stringify(currentOptions)) + try{ + localStorage.setItem('options',JSON.stringify(currentOptions)) + }catch{ + alert('this File is probably to big man') + } setOptions(currentOptions); } diff --git a/src/Pages/Record/Record.styles.scss b/src/Pages/Record/Record.styles.scss index c1c1661..9d634a3 100644 --- a/src/Pages/Record/Record.styles.scss +++ b/src/Pages/Record/Record.styles.scss @@ -207,3 +207,80 @@ display: flex; flex-direction: row; } + +@media only screen and (max-width:1650px){ + .Record{ + .content{ + .flex-50{ + .Canvas_Rec{ + transform: scale(0.8); + } + } + } + } +} + +@media only screen and (max-width:1420px){ + .Record{ + .content{ + .flex-50{ + .Canvas_Rec{ + transform: scale(0.6); + } + } + } + } + #Record_Title{ + font-size: 24px; + } + #Record_Description{ + font-size: 16px; + } +} + +@media only screen and (max-width:980px){ + .Record{ + overflow-y: auto; + .content{ + height:auto; + flex-direction: column; + margin-bottom: 0; + .devices{ + .device{ + h1{ + font-size: 12px; + } + } + } + .flex-50{ + width:100%; + height:auto; + z-index: 1; + .Canvas_Rec{ + transform: scale(0.8); + } + } + } + } + #backgroundRot{ + display: none; + } + #Record_Title{ + width:100%; + } + #Record_Description{ + width:90%; + } +} + +@media only screen and (max-width:550px){ + .Record{ + .content{ + .flex-50{ + .Canvas_Rec{ + width:100%; + } + } + } + } +} diff --git a/src/Pages/Record/Record.tsx b/src/Pages/Record/Record.tsx index 841c81e..55152e9 100644 --- a/src/Pages/Record/Record.tsx +++ b/src/Pages/Record/Record.tsx @@ -22,7 +22,7 @@ export default function Record():ReactElement { const [devices,setDevices] = useState>([]); const [events,setEvents] = useState>([]); const [recording,setRecording] = useState(false); - const height = useRef(window.innerHeight); + const [height,setHeight] = useState(window.innerHeight) useEffect(()=>{ if('requestMIDIAccess' in window.navigator){ @@ -112,26 +112,37 @@ export default function Record():ReactElement { return

No device Connected

} + const handleResize = () =>{ + setHeight(window.innerHeight); + } + + useEffect(() => { + window.addEventListener('resize',handleResize); + return () => { + window.removeEventListener('resize',handleResize); + } + }, []) + return ( -
+
-
-

Record / Play

-

Welcome to the Record page! Here you can record your playing and then use PianoBlocksApp to visualize it. It's super simple. Click "Rec" button, then play, then click it again, and click "Play Recorded"

-
- - +
+

Record / Play

+

Welcome to the Record page! Here you can record your playing and then use PianoBlocksApp to visualize it. It's super simple. Click "Rec" button, then play, then click it again, and click "Play Recorded"

+
+ + +
+

Connected MIDI devices :

+
+ {renderDevices()} +
+
+
+
-

Connected MIDI devices :

-
- {renderDevices()}
-
-
- -
-
) } diff --git a/src/Pages/ToDo/ToDo.tsx b/src/Pages/ToDo/ToDo.tsx index 98a0671..5862247 100644 --- a/src/Pages/ToDo/ToDo.tsx +++ b/src/Pages/ToDo/ToDo.tsx @@ -32,6 +32,7 @@ export default function ToDo() {

<-- Click to accept

I understand what a Donation is and I accept a fact that I'm not receiving any goods from this payment

+ {checkbox === 'checked' && Buy Me a Coffe} {checkbox ==='checked' &&
diff --git a/src/Pages/Tutorial/Pages/Midi.tsx b/src/Pages/Tutorial/Pages/Midi.tsx index 3840793..663159c 100644 --- a/src/Pages/Tutorial/Pages/Midi.tsx +++ b/src/Pages/Tutorial/Pages/Midi.tsx @@ -39,12 +39,12 @@ export default function Midi({on_change_id}:BasicProps):ReactElement {

* For Nerds

-
-
+
+

This is how this website reads MIDI files. With typescript it creates an object with this interface before playing. Thanks to that preparation, it can aquire reasonable performance during playing. By doing that, it reduces the initial - array of midi events, and makes it even 4 times smaller (as it completely reduces events like onKeyPress,onKeyRelease,onPedalPress,onPedalRelease + array of midi events, and makes it even 4 times smaller (as it completely reduces events like onKeyPress, onKeyRelease, onPedalPress, onPedalRelease to one object). Thanks to that, during playing, app needs to analyze 4 times less data.

diff --git a/src/Pages/Tutorial/Pages/PagesStyle.scss b/src/Pages/Tutorial/Pages/PagesStyle.scss index edfbfef..9de147f 100644 --- a/src/Pages/Tutorial/Pages/PagesStyle.scss +++ b/src/Pages/Tutorial/Pages/PagesStyle.scss @@ -247,8 +247,8 @@ justify-content: center; } -.Pg-Container-Flex{ - height:250px; +.Pg-Container-Flex_b{ + height:fit-content; width:100%; display: flex; flex-direction: row; @@ -261,7 +261,7 @@ } .Pg-Container-Flex-img{ - height:150%; + height:300px; margin-top: -40px; transform: rotate(90deg); } @@ -460,3 +460,166 @@ font-size: 18px; color:rgb(253, 228, 87); } + +.w-70{ + width:70% !important; +} + +@media only screen and (max-width:1500px) { + .Pg-For-Devs{ + width:80%; + } +} + +@media only screen and (max-width:1300px) { + .Pg-Video-Demo{ + left:-30vw; + } +} + +@media only screen and (max-width:1150px) { + .flex-2{ + .data-video-cnt{ + height:100%; + width:98%; + } + } + .Pg-For-Devs{ + width:90%; + } +} + +@media only screen and (max-width:1150px) { + .flex-5{ + width:20%; + } + .image_for-nerds{ + width:160px; + } + .Pg-Config-40{ + .Pg-Paragraph{ + font-size: 14px; + } + } + .Pg-Flex-Dip{ + .Pg-Flex-70{ + width:80%; + } + } +} + +@media only screen and (max-width:1000px) { + .Pg-Config-4-Description{ + flex-direction: column; + height: fit-content; + } + .Pg-Config-20{ + width: 50%; + margin-bottom: 20px; + } + .Pg-Config-40{ + width:80%; + .Pg-Paragraph{ + font-size: 18px; + } + } +} + +@media only screen and (max-width:900px) { + .flex-2{ + flex-direction: column; + align-items: center; + height:fit-content; + .data-r{ + width:90%; + } + .data-l{ + width:90%; + height:fit-content; + } + } + .Pg-Flex-Img-Container{ + width:70%; + margin: 20px; + height: fit-content; + img{ + box-shadow: none; + } + } + .Pg-Flex-Text-Container{ + width:90%; + } + .flex-res{ + flex-direction: row; + } + .Pg-For-Devs{ + width:95%; + } + .w-70{ + width:75% !important; + } + .flex-5{ + width:20%; + } + .image_for-nerds{ + width:100%; + } + .Pg-Flex-Dip{ + height: 400px; + .Pg-Flex-30{ + height: 380px; + overflow-y: auto; + } + } +} + +@media only screen and (max-width:800px) { + .Pg-Video-Demo{ + left:-380px; + top: -450px; + transform: scale(0.6); + } + .Pg-Video-Container{ + border-radius: 3px; + } + .Pg-Container-Flex_b{ + flex-direction: column; + } + .Pg-Container-Flex-40{ + width:100%; + } + .Pg-Container-Flex-50{ + width:100%; + } + .Pg-Container-Flex-60{ + width:100%; + } + .Pg-Container-Video-Demo{ + width:50%; + } +} + +@media only screen and (max-width:610px) { + .w-70{ + width:100% !important; + overflow-y: auto; + } + .flex-5{ + width:0%; + } + .Pg-For-Devs-Header{ + display: none; + } + .Pg-Config-20{ + width: 80%; + margin-bottom: 20px; + } +} + +@media only screen and (max-width:550px) { + .Pg-Video-Demo{ + left:-480px; + top: -410px; + transform: scale(0.5); + } +} diff --git a/src/Pages/Tutorial/Pages/Record.tsx b/src/Pages/Tutorial/Pages/Record.tsx index 5a1447a..07df300 100644 --- a/src/Pages/Tutorial/Pages/Record.tsx +++ b/src/Pages/Tutorial/Pages/Record.tsx @@ -8,7 +8,7 @@ export default function Record() {

Recording

How to record in Piano Blocks App

-
+

When you enter a Record page, you'r gona see buttos Rec, play Recorded, and a rectangle with a list of connected devices. @@ -25,7 +25,7 @@ export default function Record() {

Sheet music of your recording

-
+

*BETA*. If you record your playing through this website, you can instantly get prototype of sheet music. diff --git a/src/Utils/Default.ts b/src/Utils/Default.ts index 89219c1..94ca2e3 100644 --- a/src/Utils/Default.ts +++ b/src/Utils/Default.ts @@ -132,4 +132,5 @@ if(!('Color' in DefaultOptions)){ window.location.reload(); } -export {DefaultOptions}; \ No newline at end of file +export {DefaultOptions}; +export {data}; \ No newline at end of file diff --git a/src/Utils/smallFunctions.ts b/src/Utils/smallFunctions.ts index cf6ba1c..d019bbd 100644 --- a/src/Utils/smallFunctions.ts +++ b/src/Utils/smallFunctions.ts @@ -1,6 +1,8 @@ import { noteEvent } from "./TypesForMidi"; import rgbHex from 'rgb-hex'; +import {data} from './Default'; + const getEmptyNoteEvent = (noteNumber:number): noteEvent => { return{ @@ -84,8 +86,14 @@ const SaveAsBase64 = (element:any,storageName:string,json?:boolean):Promise{ + localStorage.setItem('options',JSON.stringify(data)); + window.location.reload(); +} + export {CreateEmptyArray as CreateMidiNoteEventsArray}; export {getEmptyNoteEvent}; export {RandomColor, RandomColorToAlhpa, RandomColorHex, RandomColorRGBwithMin, RandomColorToAlphawithMin}; export {checkExtension}; +export {restoreDefaults}; export {ReadFromLocalStorageBase64, SaveAsBase64} \ No newline at end of file