mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
rename
This commit is contained in:
BIN
website/public/berlin.webp
Normal file
BIN
website/public/berlin.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 205 KiB |
BIN
website/public/favicon.ico
Executable file
BIN
website/public/favicon.ico
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
1
website/public/github.svg
Normal file
1
website/public/github.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="98" height="96"><path fill="#333" fill-rule="evenodd" d="M48.85 0C21.84 0 0 22 0 49.22 0 70.97 14 89.39 33.4 95.9c2.43.49 3.32-1.06 3.32-2.37 0-1.14-.08-5.05-.08-9.12-13.59 2.93-16.42-5.87-16.42-5.87-2.18-5.7-5.42-7.17-5.42-7.17-4.45-3.01.33-3.01.33-3.01 4.93.32 7.52 5.05 7.52 5.05 4.37 7.5 11.4 5.38 14.23 4.07.4-3.18 1.7-5.38 3.08-6.6-10.84-1.14-22.25-5.38-22.25-24.28 0-5.38 1.94-9.78 5.02-13.2-.49-1.22-2.19-6.28.48-13.04 0 0 4.13-1.3 13.43 5.05a46.97 46.97 0 0 1 12.21-1.63c4.13 0 8.33.57 12.22 1.63 9.3-6.35 13.42-5.05 13.42-5.05 2.67 6.76.97 11.82.49 13.04a18.9 18.9 0 0 1 5.01 13.2c0 18.9-11.4 23.06-22.32 24.28 1.78 1.55 3.32 4.48 3.32 9.13 0 6.6-.08 11.9-.08 13.52 0 1.3.89 2.86 3.31 2.37a49.18 49.18 0 0 0 33.4-46.7C97.72 22 75.8 0 48.86 0z" clip-rule="evenodd"/></svg>
|
||||
|
After Width: | Height: | Size: 829 B |
BIN
website/public/logo.jpg
Normal file
BIN
website/public/logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
113
website/public/scripts/donate.js
Normal file
113
website/public/scripts/donate.js
Normal file
@@ -0,0 +1,113 @@
|
||||
const pricingList = [
|
||||
{
|
||||
price: 10,
|
||||
name: 'Steel',
|
||||
icon: '🗡️',
|
||||
lm_url: 'af5553c6-f5fe-4253-b5d5-eb5531f8dcdf',
|
||||
},
|
||||
{
|
||||
price: 20,
|
||||
name: 'Bronze',
|
||||
icon: '🗽',
|
||||
lm_url: '9d2b0961-d8d2-4b10-94fc-5d7497baef40',
|
||||
},
|
||||
{
|
||||
price: 40,
|
||||
name: 'Copper',
|
||||
icon: '🎷',
|
||||
lm_url: '76d47d46-9ffa-411c-b6c3-96dd491631bc',
|
||||
},
|
||||
{
|
||||
price: 75,
|
||||
name: 'Silver',
|
||||
icon: '🍴',
|
||||
lm_url: 'df45c1e6-49dc-4494-9bdf-071d85e254a5',
|
||||
},
|
||||
{
|
||||
price: 150,
|
||||
name: 'Gold',
|
||||
icon: '🏆',
|
||||
lm_url: '30bf66e8-c9ff-4642-bb39-17a1dfe278f2',
|
||||
},
|
||||
{
|
||||
price: 250,
|
||||
name: 'Platinum',
|
||||
icon: '🛰',
|
||||
lm_url: 'c837df35-eb23-4206-a0b5-024a236077cb',
|
||||
},
|
||||
{
|
||||
price: 500,
|
||||
name: 'Sapphire',
|
||||
icon: '💍',
|
||||
lm_url: '5e5f0b42-b885-4bb6-a981-642d1e40d9ac',
|
||||
},
|
||||
{
|
||||
price: 1000,
|
||||
name: 'Diamond',
|
||||
icon: '👑',
|
||||
lm_url: '5c24c85b-cd08-42ff-9515-743e46f3e825',
|
||||
},
|
||||
]
|
||||
|
||||
const priceNumbers = pricingList.map(i => i.price)
|
||||
|
||||
const sliderDiv = document.getElementById('support-plans-slider')
|
||||
|
||||
const tooltipFormat = {
|
||||
to: function (value) {
|
||||
const price = pricingList[value]
|
||||
const url = `https://support.openfreemap.org/checkout/buy/${price.lm_url}?media=1&desc=0&discount=0`
|
||||
return `
|
||||
<div class="plan-name">${price.name} Plan</div>
|
||||
<div>$${price.price}/month</div>
|
||||
<div>
|
||||
<a class="plan-link" href="${url}" target="_blank">Subscribe</a>
|
||||
</div>
|
||||
`
|
||||
},
|
||||
}
|
||||
|
||||
const pipFormat = {
|
||||
to: function (value) {
|
||||
return pricingList[value].icon
|
||||
},
|
||||
}
|
||||
|
||||
const pricingSlider = noUiSlider.create(sliderDiv, {
|
||||
start: 3,
|
||||
range: { min: 0, max: priceNumbers.length - 1 },
|
||||
step: 1,
|
||||
tooltips: tooltipFormat,
|
||||
pips: { mode: 'count', values: priceNumbers.length, format: pipFormat, density: -1 },
|
||||
})
|
||||
|
||||
pricingSlider.on('update', function (values, _) {
|
||||
for (const e of sliderDiv.querySelectorAll('.noUi-value')) {
|
||||
e.classList.remove('active')
|
||||
}
|
||||
|
||||
const value = parseInt(values[0])
|
||||
const el = sliderDiv.querySelector('.noUi-value[data-value="' + value + '"]')
|
||||
el.classList.add('active')
|
||||
|
||||
const tooltip = sliderDiv.querySelector('.noUi-tooltip')
|
||||
tooltip.classList.remove('first')
|
||||
tooltip.classList.remove('last')
|
||||
|
||||
if (document.documentElement.clientWidth < 500) {
|
||||
if (value === 0) {
|
||||
tooltip.classList.add('first')
|
||||
}
|
||||
if (value === priceNumbers.length - 1) {
|
||||
tooltip.classList.add('last')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const pips = sliderDiv.querySelectorAll('.noUi-value')
|
||||
for (const pip of pips) {
|
||||
pip.addEventListener('click', e => {
|
||||
const v = e.target.getAttribute('data-value')
|
||||
pricingSlider.set(v)
|
||||
})
|
||||
}
|
||||
86
website/public/scripts/map.js
Normal file
86
website/public/scripts/map.js
Normal file
@@ -0,0 +1,86 @@
|
||||
const london3d = {
|
||||
center: [-0.114, 51.506],
|
||||
zoom: 14.2,
|
||||
bearing: 55.2,
|
||||
pitch: 60,
|
||||
}
|
||||
|
||||
const berlin = {
|
||||
center: [13.388, 52.517],
|
||||
zoom: 9.5,
|
||||
bearing: 0,
|
||||
pitch: 0,
|
||||
}
|
||||
|
||||
function initMap() {
|
||||
if (window.map) return
|
||||
|
||||
document.getElementById('mapbg-image').style.opacity = '0.5'
|
||||
|
||||
const map = new maplibregl.Map({
|
||||
style: 'https://tiles.openfreemap.org/styles/liberty',
|
||||
center: berlin.center,
|
||||
zoom: berlin.zoom,
|
||||
bearing: berlin.bearing,
|
||||
pitch: berlin.pitch,
|
||||
container: mapDiv,
|
||||
boxZoom: false,
|
||||
// doubleClickZoom: false,
|
||||
scrollZoom: false,
|
||||
attributionControl: false,
|
||||
})
|
||||
window.map = map
|
||||
|
||||
map.once('idle', () => {
|
||||
document.getElementById('mapbg-image').remove()
|
||||
})
|
||||
|
||||
let nav = new maplibregl.NavigationControl({ showCompass: false })
|
||||
map.addControl(nav, 'top-right')
|
||||
|
||||
let scale = new maplibregl.ScaleControl()
|
||||
map.addControl(scale)
|
||||
|
||||
let attrib = new maplibregl.AttributionControl({
|
||||
compact: false,
|
||||
})
|
||||
map.addControl(attrib)
|
||||
|
||||
new maplibregl.Marker().setLngLat([-0.119, 51.507]).addTo(map)
|
||||
}
|
||||
|
||||
function selectStyle(style) {
|
||||
const styleUrl = 'https://tiles.openfreemap.org/styles/' + style.split('-')[0]
|
||||
map.setStyle(styleUrl)
|
||||
|
||||
if (style === 'liberty-3d') {
|
||||
map.setCenter(london3d.center)
|
||||
map.setPitch(london3d.pitch)
|
||||
map.setBearing(london3d.bearing)
|
||||
map.setZoom(london3d.zoom)
|
||||
} else if (map.getBearing() !== 0) {
|
||||
map.setCenter(berlin.center)
|
||||
map.setPitch(berlin.pitch)
|
||||
map.setBearing(berlin.bearing)
|
||||
map.setZoom(berlin.zoom)
|
||||
}
|
||||
|
||||
document.getElementById('style-url-code').innerText = styleUrl
|
||||
}
|
||||
|
||||
// --- start
|
||||
|
||||
const mapDiv = document.getElementById('map-container')
|
||||
initMap()
|
||||
|
||||
const buttons = document.querySelectorAll('.button-container .btn')
|
||||
|
||||
buttons.forEach(button => {
|
||||
button.addEventListener('click', function (event) {
|
||||
buttons.forEach(button => button.classList.remove('selected'))
|
||||
button.classList.add('selected')
|
||||
|
||||
const style = event.target.getAttribute('data-style')
|
||||
selectStyle(style)
|
||||
})
|
||||
})
|
||||
1
website/public/x.svg
Normal file
1
website/public/x.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1227" fill="none"><path fill="#333" d="M714.16 519.28 1160.9 0h-105.86l-387.9 450.89L357.34 0H0l468.5 681.82L0 1226.37h105.87l409.62-476.15 327.18 476.15H1200L714.14 519.28h.02Zm-145 168.55-47.46-67.9L144 79.7h162.6l304.8 436 47.47 67.89 396.2 566.72h-162.6L569.16 687.85v-.02Z"/></svg>
|
||||
|
After Width: | Height: | Size: 348 B |
Reference in New Issue
Block a user