| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Lee Morgan</title>
- <link rel="stylesheet" href="/style">
- <link href='https://api.mapbox.com/mapbox-gl-js/v2.3.1/mapbox-gl.css' rel='stylesheet' />
- </head>
- <body>
- <div id="menu">
- <button id="projectsButton" class="active">
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <polyline points="16 18 22 12 16 6"></polyline>
- <polyline points="8 6 2 12 8 18"></polyline>
- </svg>
- <p>Projects</p>
- <p>Проекты</p>
- </button>
- <button id="aboutButton">
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
- <circle cx="12" cy="7" r="4"></circle>
- </svg>
- <p>About Me</p>
- <p>Обо Мне</p>
- </button>
- <button id="blogButton">
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M12 19l7-7 3 3-7 7-3-3z"></path>
- <path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"></path>
- <path d="M2 2l7.586 7.586"></path>
- <circle cx="11" cy="11" r="2"></circle>
- </svg>
- <p>Blog</p>
- <p>Блог</p>
- </button>
- <button id="linksButton">
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
- <line x1="3" y1="9" x2="21" y2="9"></line>
- <line x1="9" y1="21" x2="9" y2="9"></line>
- </svg>
- <p>Fun Links</p>
- <p>Интересные Ссылкы</p>
- </button>
- <button id="galleryButton">
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
- <circle cx="8.5" cy="8.5" r="1.5"></circle>
- <polyline points="21 15 16 10 5 21"></polyline>
- </svg>
-
- <p>Gallery</p>
- <p>Галерея</p>
- </button>
- <button id="learnButton">
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path>
- <path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path>
- </svg>
- <p>Learn</p>
- <p>Учить</p>
- </button>
- </div>
- <div id="main">
- <div id="projects" class="cardContainer">
- <a class="card" href="https://thesubline.com">
- <h2>The Subline</h2>
- <img src="/images/subline" alt="The Subline">
- <p>A web application to assist restaurant owners in managing their inventories. Providing insights into usage, waste and other details through the use of data.</p>
- </a>
- <a class="card" href="https://budgeteer.money">
- <h2>Budgeteer</h2>
- <img src="/images/budgeteer" alt="Budgeteer">
- <p>A simple web application to help people to budget their money in a simple and approachable manner.</p>
- </a>
- <a class="card" href="markket.xyz">
- <h2>Local Markets</h2>
- <img src="/images/market" alt="Market">
- <p>A website for people to find farmers markets and vendors of local products in their area.</p>
- </a>
- <a class="card" href="/sudoku">
- <h2>Sudoku Solver</h2>
- <img src="/images/sudoku" alt="Sudoku">
- <p>Stuck on a particularly difficult game of sudoku? Enter any sudoku puzzle and have it solved immediately.</p>
- </a>
- <a class="card" href="/birthdayparadox">
- <h2>The Birthday Paradox</h2>
- <img src="/images/birthday" alt="Birthday Hat">
- <p>A demonstration of the counterintuitive birthday paradox.</p>
- </a>
- <a class="card" href="https://blacklist.aero">
- <h2>Blacklist.aero</h2>
- <img src="/images/blacklist" alt="Blacklist.aero logo">
- <p>A site to enable airports to blacklist and check on the status of those who use their services.</p>
- </a>
- </div>
- <div id="about" style="display:none;">
- <h1>Ya, Ya, I'm working on it...</h1>
- </div>
- <div id="blog" style="display:none;">
- <div id="blogTags" class="tagContainer"></div>
- <div id="blogs" class="cardContainer"></div>
- <template id="blogCard">
- <a class="card">
- <h1></h1>
- <img>
- </a>
- </template>
- </div>
- <div id="links" class="cardContainer" style="display:none;">
- <a class="card" href="https://cs-online.club/en/servers">
- <h2>CS:GO in the browser</h2>
- <p>A website to play CS:GO in the browser with other people online.</p>
- </a>
- <a class="card" href="https://driveandlisten.herokuapp.com/">
- <h2>Drive and Listen</h2>
- <p>Pretend to be driving your car and listening to the radio. Watch cars driving down the road all over the world while listening to local radio stations.</p>
- </a>
- <a class="card" href="https://www.ekzhang.com/game-of-life">
- <h2>Conway's Game of Life</h2>
- <p>Play around and experiment with different situations in Conway's Game of Life</p>
- </a>
- <a class="card" href="https://librivox.org/">
- <h2>LibriVox</h2>
- <p>Free public domain audiobooks. Listen to books for free, or volunteer your time to read them for others to listen to</p>
- </a>
- <a class="card" href="https://rocketcrab.com/">
- <h2>rocketcrab.com</h2>
- <p>Party games right on your phone</p>
- </a>
- <a class="card" href="https://thetruesize.com/">
- <h2>The True Size of</h2>
- <p>The common Mercator projection map that we are used to distorts the real size of countries. This site will let you move and directly compare the real size of different countries to see how big they really are</p>
- </a>
- <a class="card" href="https://win95.ajf.me/">
- <h2>Windows 95</h2>
- <p>Use a virtual Windows 95 computer right in your browser</p>
- </a>
- <a class="card" href="https://pointerpointer.com/">
- <h2>Pointer Pointer</h2>
- <p>Point to your pointer</p>
- </a>
- <a class="card" href="https://pudding.cool/2020/12/judge-my-spotify">
- <h2>Judge My Spotify</h2>
- <p>Let an AI criticize your taste in music</p>
- </a>
- </div>
- <div id="gallery" style="display:none">
- <div id="galleryTags" class="tagContainer"></div>
- <div id='map' style='width: 400px; height: 300px;'></div>
- </div>
- <div id="learn" class="cardContainer" style="display:none"></div>
- </div>
- <script>
- //GALLERY MAP
- let mapped = false;
- let mapPromise = new Promise((resolve, reject)=>{
- let script = document.createElement("script");
- script.src = "https://api.mapbox.com/mapbox-gl-js/v2.3.1/mapbox-gl.js";
- script.onload = resolve;
- document.getElementById("gallery").appendChild(script);
- });
-
- let buttons = document.getElementById("menu").children;
- let content = document.getElementById("main").children;
- for(let i = 0; i < buttons.length; i++){
- buttons[i].onclick = ()=>{
- for(let j = 0; j < buttons.length; j++){
- buttons[j].classList.remove("active");
- }
- buttons[i].classList.add("active");
- for(let j = 0; j < content.length; j++){
- content[j].style.display = "none";
- }
- if(buttons[i].id === "galleryButton" && mapped === false){
- Promise.all([
- mapPromise,
- fetch("/gallery/retrieve").then(response => response.json())
- ])
- .then(loadGallery)
- .catch((err)=>{});
- mapped = true;
- }
- let string = buttons[i].id.replace("Button", "");
- document.getElementById(string).style.display = "flex";
- };
- }
- let searchTags = (content, tag)=>{
- let galleryList = [];
- for(let i = 0; i < content.length; i++){
- for(let j = 0; j < content[i].tags.length; j++){
- if(content[i].tags[j].toLowerCase() === tag){
- galleryList.push(content[i]);
- break;
- }
- }
- }
- return galleryList;
- }
- //Get blog content
- let populateBlogs = (blogs)=>{
- let container = document.getElementById("blogs");
- let template = document.getElementById("blogCard").content.children[0];
- while(container.children.length > 0){
- container.removeChild(container.firstChild);
- }
-
- for(let i = 0; i < blogs.length; i++){
- let card = template.cloneNode(true);
- card.href = `/blog/${blogs[i]._id}`;
- card.children[0].innerText = blogs[i].title;
- card.children[1].src = blogs[i].thumbnail;
- card.children[1].alt = `${blogs[i].title} thumbnail`;
- container.appendChild(card);
- }
- }
- fetch("/blog/retrieve")
- .then(response => response.json())
- .then((response)=>{
- let tagContainer = document.getElementById("blogTags");
- let tags = [];
- let tag = document.createElement("button");
- tag.innerText = "All";
- tag.classList.add("tag");
- tag.onclick = ()=>{populateBlogs(response)};
- tagContainer.appendChild(tag);
- for(let i = 0; i < response.length; i++){
- for(let j = 0; j < response[i].tags.length; j++){
- if(tags.includes(response[i].tags[j].toLowerCase()) === true) continue;
- tags.push(response[i].tags[j].toLowerCase());
- let tag = document.createElement("button");
- tag.innerText = response[i].tags[j];
- tag.classList.add("tag");
- tag.onclick = ()=>{populateBlogs(searchTags(response, response[i].tags[j].toLowerCase()))};
- tagContainer.appendChild(tag);
- }
- }
- populateBlogs(response);
- })
- .catch((err)=>{});
- let loadGallery = (response)=>{
- let galleries = response[1].galleries;
- //MAP
- mapboxgl.accessToken = response[1].mapboxKey;
- let map = new mapboxgl.Map({
- container: 'map',
- style: 'mapbox://styles/mapbox/streets-v11',
- center: [46.313332, 56.183037],
- zoom: 7
- });
- let mapDiv = document.getElementById("map");
- mapDiv.style.height = "90%";
- mapDiv.style.width = "90%";
- map.resize();
- //GALLERY DATA
- let tagContainer = document.getElementById("galleryTags");
- let tags = [];
- let tag = document.createElement("button");
- tag.innerText = "All";
- tag.classList.add("tag");
- tagContainer.appendChild(tag);
- for(let i = 0; i < galleries.length; i++){
- let tags = galleries[i].tags.toString();
- tags = tags.replaceAll(",", ", ");
- let popup = new mapboxgl.Popup()
- .setHTML(`
- <a class="galleryPopup" href="/gallery/${galleries[i]._id}">
- <h1>${galleries[i].title}</h1>
- <p>${tags}</p>
- <img class="popupImage" src="${galleries[i].images[0]}" alt="${galleries[i].title} image">
- </a>
- `);
- let marker = new mapboxgl.Marker()
- .setLngLat([galleries[i].location.coordinates[1], galleries[i].location.coordinates[0]])
- .addTo(map)
- .setPopup(popup);
- for(let j = 0; j < galleries[i].tags.length; j++){
- if(tags.includes(galleries[i].tags[j]) === true) continue;
- tags.push(galleries[i].tags[j]);
- let tag = document.createElement("button");
- tag.innerText = galleries[i].tags[j];
- tag.classList.add("tag");
- tagContainer.appendChild(tag);
- }
- }
- }
- //Get "learn" content
- fetch("/learn/courses/json")
- .then(response => response.json())
- .then((response)=>{
- let container = document.getElementById("learn");
- for(let i = 0; i < response.length; i++){
- let card = document.createElement("a");
- card.classList.add("card");
- card.href = `/learn/courses/${response[i]._id}`;
- container.appendChild(card);
- let h2 = document.createElement("h2");
- h2.innerText = response[i].title;
- card.appendChild(h2);
- let img = document.createElement("img");
- img.src = response[i].thumbNail;
- img.alt = `${response[i].title} thumbnail`;
- card.appendChild(img);
- }
- })
- .catch((err)=>{});
- </script>
- </body>
- </html>
|