diff --git a/README.md b/README.md index b150d92..3ee4379 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# PyBrowser -My own little Python Browser. +# TurboWarp-Extension-Creator +Easily create extensions for TurboWarp. diff --git a/download.js b/download.js new file mode 100644 index 0000000..11f80c7 --- /dev/null +++ b/download.js @@ -0,0 +1,70 @@ +function if_then_else_return(condition, then_return, else_return){ + if (condition) {return then_return;} else {return else_return;} +} + +function getOS(){ + if (navigator.userAgent.includes("Mac OS")) return "macOS"; + if (navigator.userAgent.includes("Linux")) return "Linux"; + if (navigator.userAgent.includes("Windows")) return "Windows"; + return "Other"; +} + +function getArchitecture(){ + if (navigator.userAgent.includes("x64")){ + return "64"; + } else { + return "32"; + } +} + +async function loadDownloadButton(){ + var lastest_version = await fetch('https://samuellouf.github.io/api/PyBrowser/update.json').then(result => result.text()); + lastest_version = JSON.parse(lastest_version); + + var download_button = document.querySelector('#page #download a.downloadbutton button'); + var download_link = document.querySelector('#page #download a.downloadbutton'); + + download_button.innerHTML = 'Download version ' + lastest_version.lastest_version + ' for ' + getOS(); + + download_link.href = 'javascript: download();'; +} + +async function loadVersions(){ + var versions = await fetch('https://samuellouf.github.io/api/PyBrowser/versions.json').then(result => result.text()).then(r => JSON.parse(r)); + const addOptionInSelect = (name, value, select) => { + var opt = document.createElement('option'); + opt.innerText = name; + opt.value = value; + document.querySelector(select).appendChild(opt); + } + versions.forEach((version) => { + if (!(version.toString().includes('.'))) version = String(version) + '.0' + addOptionInSelect(version, version, '#selectanotherversion'); + }); +} + +// This download function can work all by itself +async function download(version='lastest', os=if_then_else_return(getOS() == 'Windows', 'win', if_then_else_return(getOS() == 'macOS', 'macOS', 'linux'))){ + if (version == 'lastest'){ + var lastest_version = await fetch('https://samuellouf.github.io/api/PyBrowser/update.json').then(result => result.text()); + lastest_version = JSON.parse(lastest_version); + version = lastest_version.lastest_version; + } + const link = document.createElement("a"); + link.href = 'https://github.com/samuellouf/PyBrowser/releases/download/v' + version + '/PyBrowser-v' + version + '.zip'; + link.download = 'PyBrowser-v' + version + '.zip'; + document.body.appendChild(link); + link.click(); + link.remove(); +} + +loadVersions(); +loadDownloadButton(); + +const queryString = window.location.search; +const urlParams = new URLSearchParams(queryString); +const download_urlparam = urlParams.get('download'); + +if (download_urlparam != null){ + download(); +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..c16ec82 Binary files /dev/null and b/favicon.ico differ diff --git a/header.css b/header.css new file mode 100644 index 0000000..9ba1bf3 --- /dev/null +++ b/header.css @@ -0,0 +1,33 @@ +.sticky { + position: fixed; + width: 100%; + top: 5px; +} + +.topnav{ + overflow: hidden; + background-color: #ff4d4d; + z-index: 100; +} + +.topnav a { + float: left; + color: #f2f2f2; + text-align: center; + padding: 14px 16px; + text-decoration: none; + font-size: 17px; + transition-duration: 0.5s; +} + +.topnav a:hover { + background-color: #d94242; + color: black; + transition-duration: 0.5s; +} + +.topnav a.active { + background-color: #ff4d4d#04AA6D; + color: white; + transition-duration: 0.5s; +} \ No newline at end of file diff --git a/header.js b/header.js new file mode 100644 index 0000000..1b66c9a --- /dev/null +++ b/header.js @@ -0,0 +1,18 @@ +// When the user scrolls the page, execute myFunction +window.onscroll = function() {myFunction()}; +window.onload = function() {myFunction()}; + +// Get the header +var header = document.querySelector("header"); + +// Get the offset position of the navbar +var sticky = header.offsetTop; + +// Add the sticky class to the header when you reach its scroll position. Remove "sticky" when you leave the scroll position +function myFunction() { + if (window.pageYOffset > sticky) { + header.classList.add("sticky"); + } else { + header.classList.remove("sticky"); + } +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..7fa1ccb --- /dev/null +++ b/index.html @@ -0,0 +1,164 @@ + + + + PyBrowser + + + + + + + + + + + ⬆️ +
+
+ +
+
+ +
+
1 / 4
+ +
PyBrowser
+
+ +
+
2 / 4
+ +
Private navigation
+
+ +
+
3 / 4
+ +
Color customization
+
+ +
+
4 / 4
+ +
Change name
+
+ + + + +
+
+ +
+ + + + +
+
+
+
+
+

A free, open-source, Python-made web browser.

+ +
+
+
+ +
+
+ Home + About + Download + Functionalities + Bugs and issues +
+
+
+
+

About

+
+

PyBrowser is a free, open-source, Python-made browser.

+
+
+
+
+

Download

+
+
+ +
+
+
+

or

+
+
+
+
+ +
+

     

+
+ +
+
+
+
+ +
+
+
+
+
+
+

Functionalities

+
+ +
+
+
+
+

Bugs and issues

+
+

If you have found any bug or issue in PyBrowser, please report it in issues.

+ + + +
+
+
+ + + + + + + diff --git a/linux.svg b/linux.svg new file mode 100644 index 0000000..91ffe3e --- /dev/null +++ b/linux.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/macos.svg b/macos.svg new file mode 100644 index 0000000..49f32b1 --- /dev/null +++ b/macos.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/screenshot1.png b/screenshot1.png new file mode 100644 index 0000000..338d2e1 Binary files /dev/null and b/screenshot1.png differ diff --git a/screenshot2.png b/screenshot2.png new file mode 100644 index 0000000..96664d8 Binary files /dev/null and b/screenshot2.png differ diff --git a/screenshot3.png b/screenshot3.png new file mode 100644 index 0000000..31d0002 Binary files /dev/null and b/screenshot3.png differ diff --git a/screenshot4.png b/screenshot4.png new file mode 100644 index 0000000..dab6536 Binary files /dev/null and b/screenshot4.png differ diff --git a/script.js b/script.js new file mode 100644 index 0000000..67cf56c --- /dev/null +++ b/script.js @@ -0,0 +1,55 @@ +function setActive(page){ + try { + if (document.querySelector('header').innerHTML.includes('active')){ + var activepage = document.querySelector('header.topnav a.active'); + activepage.classList.remove('active'); + } + } catch (error){} + + if (page == '' || page == '/'){ + document.querySelector('header.topnav a').classList.add('active'); + } else { + document.querySelector('header.topnav a[href="#' + page + '"]').classList.add('active'); + } +} + +if (window.location.href.includes('#')){ + setActive(window.location.hash.replace('#', '')); +} else { + setActive('home'); +} + +function sendIssue(title, body = '', assignees = 'samuellouf'){ + var link = `https://github.com/samuellouf/PyBrowser/issues/new?labels=bug&body=${body}&title=${title}&assignees=${assignees}`; + var a = document.createElement('a'); + a.href = link; + a.target = '_blank' + a.click(); +} + +let slideIndex = 1; +showSlides(slideIndex); + +function plusSlides(n) { + showSlides(slideIndex += n); +} + +function currentSlide(n) { + showSlides(slideIndex = n); +} + +function showSlides(n) { + let i; + let slides = document.getElementsByClassName("mySlides"); + let dots = document.getElementsByClassName("dot"); + if (n > slides.length) {slideIndex = 1} + if (n < 1) {slideIndex = slides.length} + for (i = 0; i < slides.length; i++) { + slides[i].style.display = "none"; + } + for (i = 0; i < dots.length; i++) { + dots[i].className = dots[i].className.replace(" active", ""); + } + slides[slideIndex-1].style.display = "flex"; + dots[slideIndex-1].className += " active"; +} \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..ed6e0d8 --- /dev/null +++ b/style.css @@ -0,0 +1,276 @@ +html{ + scroll-behavior: smooth; +} + +body{ + font-family: Arial, Helvetica, sans-serif; +} + +.title{ + font-size: 72px; + text-align: center; +} + +#home .presentation{ + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; +} + +.centeritems{ + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +} + +#home{ + background-color: #ff4d4d; +} + +#home div.presentation div.text p{ + font-size: 32px; + font-weight: bolder; + color: white; +} + +#home div.presentation div.snapshot{ + background-color: #d94242; + font-size: 32px; + font-weight: bolder; + color: white; + border-radius: 10px; + margin: 20px; + border: 10px solid #d94242; +} + +button.stylizedbutton{ + margin: 0.5rem; + outline-color: #d94242; + outline-width: 2.5px; + outline-style: solid; + background-color: #ff4d4d; + border-radius: 5px; + font-size: 1em; + font-weight: 600; + color: white; + border: none; + padding: 1em; +} + +button.stylizedbutton:hover{ + outline-width: 5px; +} + +button.stylizedbutton:active{ + outline-width: 2.5px; +} + +#about{ + display: block; + background-color: #00a6e7; + color: white; +} + +.aboutparagraph{ + font-size: 24px; +} + +#download{ + display: block; + background-color: #505050; + color: white; +} + +#lastestversionlog{ + display: block; + background-color: #bcbcbc; + color: white; +} + +.oslogo{ + fill: white; +} + +#download .bigdownloadbutton{ + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +} + +#bugs{ + background-color: #30a14e; + color: white; +} + +#functionalities{ + background-color: rgb(196, 196, 0); + color: white; +} + +.devstate.developping{ + font-weight: bold; + color: yellow; +} + +.devstate.finished{ + font-weight: bold; + color: green; +} + +.devstate.reported{ + font-weight: bold; + color: red; +} + +.devstate.off{ + font-weight: bold; + color: white; +} + +footer { + background-color: #888888; + text-align: center; + color: white; +} + +footer a{ + color: blue; +} + +footer a:hover{ + font-weight: bolder; +} + +.selectanother{ + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: center; +} + +.gototop{ + position: fixed; + right: 0px; + bottom: 0px; + border-radius: 50%; + /* background-color: #ffffff9e; */ +} + +.gototop span{ + font-size: xxx-large; +} + +.mySlides {display: none} +img {vertical-align: middle;} + +#home .presentation { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; +} + +#home .presentation .snapshot { + display: flex; + flex-direction: column; + align-items: center; +} + +/* Slideshow container */ +.slideshow-container { + max-width: 1000px; + position: relative; + margin: auto; +} + +.slideshow-container img{ + width: 300px; +} + +/* Next & previous buttons */ +.slideshow-container .prev, .slideshow-container .next { + cursor: pointer; + position: absolute; + top: 50%; + width: auto; + padding: 16px; + margin-top: -22px; + color: white; + font-weight: bold; + font-size: 18px; + transition: 0.6s ease; + border-radius: 0 3px 3px 0; + user-select: none; +} + +/* Position the "next button" to the right */ +.slideshow-container .next { + right: 0; + border-radius: 3px 0 0 3px; +} + +/* On hover, add a black background color with a little bit see-through */ +.slideshow-container .prev:hover, .slideshow-container .next:hover { + background-color: rgba(0,0,0,0.8); +} + +/* Caption text */ +.slideshow-container .text { + color: #f2f2f2; + font-size: 15px; + padding: 8px 12px; + position: absolute; + bottom: 8px; + width: 100%; + text-align: center; +} + +/* Number text (1/3 etc) */ +.slideshow-container .numbertext { + color: #f2f2f2; + font-size: 12px; + padding: 8px 12px; + position: absolute; + top: 0; +} + +/* The dots/bullets/indicators */ +.dot { + cursor: pointer; + height: 15px; + width: 15px; + margin: 0 2px; + background-color: #bbb; + border-radius: 50%; + display: inline-block; + transition: background-color 0.6s ease; +} + +.active, .dot:hover { + background-color: #717171; +} + +/* Fading animation */ +.slideshow-container .fade { + animation-name: fade; + animation-duration: 1.5s; +} + +@keyframes fade { + from {opacity: .4} + to {opacity: 1} +} + +/* On smaller screens, decrease text size */ +@media only screen and (max-width: 300px) { + .prev, .next,.text {font-size: 11px} +} + +.mySlides{ + display: flex; + justify-content: center; +} \ No newline at end of file diff --git a/stylizedinputs.css b/stylizedinputs.css new file mode 100644 index 0000000..000f594 --- /dev/null +++ b/stylizedinputs.css @@ -0,0 +1,120 @@ +*, +*::before, +*::after { + box-sizing: border-box; +} + +:root { + --select-border: #777; + --select-focus: blue; + --select-arrow: var(--select-border); +} + +select { + appearance: none; + background-color: transparent; + border: none; + padding: 0 1em 0 0; + margin: 0; + width: 100%; + font-family: inherit; + font-size: inherit; + cursor: inherit; + line-height: inherit; + + z-index: 1; + + outline: none; + + &::-ms-expand { + display: none; + } +} + +.select { + display: grid; + grid-template-areas: "select"; + align-items: center; + position: relative; + + min-width: 15ch; + max-width: 30ch; + + border: 1px solid var(--select-border); + border-radius: 0.25em; + padding: 0.25em 0.5em; + + font-size: 1.25rem; + cursor: pointer; + line-height: 1.1; + + background-color: #fff; + background-image: linear-gradient(to top, #f9f9f9, #fff 33%); + + + &:not(.select--multiple)::after { + content: ""; + justify-self: end; + width: 0.8em; + height: 0.5em; + background-color: var(--select-arrow); + clip-path: polygon(100% 0%, 0 0%, 50% 100%); + } + + + select, + &::after { + grid-area: select; + } +} + +select:focus + .focus { + position: absolute; + top: -1px; + left: -1px; + right: -1px; + bottom: -1px; + border: 2px solid var(--select-focus); + border-radius: inherit; +} + +select[multiple] { + padding-right: 0; + height: 6rem; + + option { + white-space: normal; + outline-color: var(--select-focus); + } +} + +.select--disabled { + cursor: not-allowed; + background-color: #eee; + background-image: linear-gradient(to top, #ddd, #eee 33%); +} + +label { + font-size: 1.125rem; + font-weight: 500; +} + +.select + label { + margin-top: 2rem; +} + + +.stylizedinput{ + display: grid; + grid-template-areas: "select"; + align-items: center; + position: relative; + border: 1px solid var(--select-border); + border-radius: 0.25em; + padding: 0.25em 0.5em; + font-size: 1.25rem; + cursor: pointer; + line-height: 1.1; + background-color: #fff; + background-image: linear-gradient(to top, #f9f9f9, #fff 33%); +} \ No newline at end of file diff --git a/windows.svg b/windows.svg new file mode 100644 index 0000000..f4fdbb1 --- /dev/null +++ b/windows.svg @@ -0,0 +1 @@ + \ No newline at end of file