diff --git a/edge/server/main.js b/edge/server/main.js index e90f9bf..0d62398 100644 --- a/edge/server/main.js +++ b/edge/server/main.js @@ -62,34 +62,34 @@ function setFixures() { var obj = initTilelevel(ctx, { _id: "clubprive", order: 8, description: "Club privé" }); // Case - var obj = initTile(ctx, { _id: "st", position: 0, tiletype: "start", name: "Week-end", img: "https://static.actu.fr/uploads/2017/05/rue-de-la-soif-Rennes-960x640.jpg" }); - var obj = initTile(ctx, { _id: "b1", position: 1, tiletype: "bar", name: "Les hirondelles", prixDeBase: "1", img: "https://media-cdn.tripadvisor.com/media/photo-s/08/99/ef/5a/les-hirondelles.jpg" }); - var obj = initTile(ctx, { _id: "b2", position: 2, tiletype: "bar", name: "Le cheval blanc", prixDeBase: "1", img: "https://media-cdn.tripadvisor.com/media/photo-s/14/f4/ed/0f/le-cheval-blanc.jpg" }); - var obj = initTile(ctx, { _id: "meetup1", position: 3, tiletype: "meetup", name: "Rencontre", img: "https://hoptodate.com/wp-content/uploads/2022/10/Depositphotos_331369428_XL-scaled.jpg" }); - var obj = initTile(ctx, { _id: "b3", position: 4, tiletype: "bar", name: "L'ABC", prixDeBase: "2", img: "https://www.pagesjaunes.fr/media/agc/52/85/77/00/00/d1/00/ab/e8/ca/62bc5285770000d100abe8ca/62bc5285770000d100abe8cc.jpg" }); - var obj = initTile(ctx, { _id: "b4", position: 5, tiletype: "bar", name: "La taverne", prixDeBase: "2", img: "https://www.clamecyhautnivernais-tourisme.fr/wp-content/uploads/wpetourisme/Bar-La-Taverne-Clamecy----D.Data-900x535.jpg" }); - var obj = initTile(ctx, { _id: "hh1", position: 6, tiletype: "happyHour", name: "Happy hour", img: "https://blog.laddition.com/sites/default/files/2022-03/sans-titre-17_0.png" }); - var obj = initTile(ctx, { _id: "b6", position: 7, tiletype: "bar", name: "La fine mousse", prixDeBase: "3", img: "https://cdn.eat-list.fr/establishment/photo/gallery_photo/75011-paris-11/la-fine-mousse_91615_c4c.jpg" }); - var obj = initTile(ctx, { _id: "b7", position: 8, tiletype: "bar", name: "Le barboteur", prixDeBase: "3", img: "https://storage.googleapis.com/statics-wp/sites/lebarboteurlille.com/Le-Barboteur-0-1-1.jpg" }); - var obj = initTile(ctx, { _id: "b8", position: 9, tiletype: "bar", name: "Le palais de la bière", prixDeBase: "3", img: "https://www.tourisme-pontaudemer-rislenormande.com/wp-content/uploads/2017/03/Palais-de-la-bi%C3%A8re.jpeg" }); - var obj = initTile(ctx, { _id: "meetup2", position: 10, tiletype: "meetup", name: "Rencontre", img: "https://www.monpetitdate.fr/wp-content/uploads/2022/01/rencontre-trans-paris.jpg" }); - var obj = initTile(ctx, { _id: "b9", position: 11, tiletype: "bar", name: "Le comptoir des bières", prixDeBase: "4", img: "https://lh3.googleusercontent.com/p/AF1QipPRj-YgeXsNxXjkpxill-QMSh20T9jeNl8OLcuj=s1600-w640" }); - var obj = initTile(ctx, { _id: "b10", position: 12, tiletype: "bar", name: "Les moulins bleus", prixDeBase: "4", img: "https://www.brunnenbraeu.org/Alben2/MoulinsBleusDijon/album/slides/Les%20Moulins%20Bleus%20%E2%80%93%20Craft%20Beer%20and%20Food%20%281%29.jpg" }); - var obj = initTile(ctx, { _id: "b11", position: 13, tiletype: "bar", name: "Le fourquet", prixDeBase: "4", img: "https://media-cdn.tripadvisor.com/media/photo-s/0c/ce/ca/87/le-fourquet.jpg" }); - var obj = initTile(ctx, { _id: "prs", position: 14, tiletype: "prison", name: "Cellule de dégrisement", img: "https://lvdneng.rosselcdn.net/sites/default/files/dpistyles_v2/ena_16_9_extra_big/2022/09/05/node_1224621/55601340/public/2022/09/05/B9732002324Z.1_20220905182824_000%2BGBHL6LBT5.1-0.jpg?itok=UqmdxUiM1662450019" }); - var obj = initTile(ctx, { _id: "b12", position: 15, tiletype: "bar", name: "Au beaux fûts", prixDeBase: "5", img: "https://because-gus.com/wp-content/uploads/2020/02/Bars-MaryRebeccaElliott.jpg" }); - var obj = initTile(ctx, { _id: "b13", position: 16, tiletype: "bar", name: "Le Bacchus", prixDeBase: "5", img: "https://media-cdn.tripadvisor.com/media/photo-s/10/f6/a8/75/facade.jpg" }); - var obj = initTile(ctx, { _id: "b14", position: 17, tiletype: "bar", name: "Matusalém", prixDeBase: "5", img: "https://foodforthought.com.my/wp-content/uploads/Franks-Bar-Matusalem-Rum-x-Franks-Food-For-Thought-1024x731.jpeg" }); - var obj = initTile(ctx, { _id: "meetup3", position: 18, tiletype: "meetup", name: "Rencontre", img: "https://test.psychologies.com/var/tests/storage/images/2/3/3/1/11332-2-fre-FR/Test-pret-rencontre_thumb_434_265.jpg" }); - var obj = initTile(ctx, { _id: "b15", position: 19, tiletype: "bar", name: "Bloody Marianne", prixDeBase: "6", img: "https://lh3.googleusercontent.com/p/AF1QipPAS0edvVXEiY7_ttg_wBIegJs1Nz2lxIXmqmr3=s1600-w640" }); - var obj = initTile(ctx, { _id: "b16", position: 20, tiletype: "bar", name: "Shake it up", prixDeBase: "6", img: "https://images.barrons.com/im-839994?width=700&height=466" }); - var obj = initTile(ctx, { _id: "b17", position: 21, tiletype: "bar", name: "Le mixologue", prixDeBase: "6", img: "https://www.ciga.fr/img/cms/le-mixologue/mise-en-situation-le-mixologue.jpg" }); - var obj = initTile(ctx, { _id: "hh2", position: 22, tiletype: "happyHour", name: "Happy hour", img: "https://img.freepik.com/vecteurs-libre/fond-dessin-anime-happy-hours_52683-81243.jpg" }); - var obj = initTile(ctx, { _id: "b18", position: 23, tiletype: "bar", name: "Le senateur", prixDeBase: "7", img: "https://media-cdn.tripadvisor.com/media/photo-s/0f/72/99/b4/montreal-marriott-chateau.jpg" }); - var obj = initTile(ctx, { _id: "b19", position: 24, tiletype: "bar", name: "La dame blanche", prixDeBase: "7", img: "https://decibelles-data.media.tourinsoft.eu/upload/dame-jour.jpeg" }); - var obj = initTile(ctx, { _id: "meetup4", position: 25, tiletype: "meetup", name: "Rencontre", img: "https://www.commeuncamion.com/content/uploads/2015/08/Rencontre-Couple-Bar.jpg" }); - var obj = initTile(ctx, { _id: "b20", position: 26, tiletype: "bar", name: "Le Kube", prixDeBase: "8", img: "https://www.lesbarres.com/media/image/slideshow/726a6f8ea266c7c0cbb72cbc261d3520bf8f90df.jpg" }); - var obj = initTile(ctx, { _id: "b21", position: 27, tiletype: "bar", name: "L'amirauté", prixDeBase: "8", img: "https://www.lamiraute-restaurant-saintes-maries-de-la-mer.com/media/cache/resolve/l800/websites/b510beeb640a5dc50a78118b3c8f7ce2/img/restaurant-amiraute-saintes-maries-de-la-mer-04_20210927172840.jpg" }); + var obj = initTile(ctx, { _id: "st", position: 0, tiletype: "start", size:"big", name: "Week-end", img: "https://static.actu.fr/uploads/2017/05/rue-de-la-soif-Rennes-960x640.jpg" }); + var obj = initTile(ctx, { _id: "b1", position: 1, tiletype: "bar", size:"small", name: "Les hirondelles", price: "1", img: "https://media-cdn.tripadvisor.com/media/photo-s/08/99/ef/5a/les-hirondelles.jpg" }); + var obj = initTile(ctx, { _id: "b2", position: 2, tiletype: "bar", size:"small", name: "Le cheval blanc", price: "1", img: "https://media-cdn.tripadvisor.com/media/photo-s/14/f4/ed/0f/le-cheval-blanc.jpg" }); + var obj = initTile(ctx, { _id: "meetup1", position: 3, tiletype: "meetup", size:"small", name: "Rencontre", img: "https://hoptodate.com/wp-content/uploads/2022/10/Depositphotos_331369428_XL-scaled.jpg" }); + var obj = initTile(ctx, { _id: "b3", position: 4, tiletype: "bar", size:"small", name: "L'ABC", price: "2", img: "https://www.pagesjaunes.fr/media/agc/52/85/77/00/00/d1/00/ab/e8/ca/62bc5285770000d100abe8ca/62bc5285770000d100abe8cc.jpg" }); + var obj = initTile(ctx, { _id: "b4", position: 5, tiletype: "bar", size:"small", name: "La taverne", price: "2", img: "https://www.clamecyhautnivernais-tourisme.fr/wp-content/uploads/wpetourisme/Bar-La-Taverne-Clamecy----D.Data-900x535.jpg" }); + var obj = initTile(ctx, { _id: "hh1", position: 6, tiletype: "happyHour", size:"small", name: "Happy hour", img: "https://blog.laddition.com/sites/default/files/2022-03/sans-titre-17_0.png" }); + var obj = initTile(ctx, { _id: "b6", position: 7, tiletype: "bar", size:"small", name: "La fine mousse", price: "3", img: "https://cdn.eat-list.fr/establishment/photo/gallery_photo/75011-paris-11/la-fine-mousse_91615_c4c.jpg" }); + var obj = initTile(ctx, { _id: "b7", position: 8, tiletype: "bar", size:"small", name: "Le barboteur", price: "3", img: "https://storage.googleapis.com/statics-wp/sites/lebarboteurlille.com/Le-Barboteur-0-1-1.jpg" }); + var obj = initTile(ctx, { _id: "b8", position: 9, tiletype: "bar", size:"small", name: "Le palais de la bière", price: "3", img: "https://www.tourisme-pontaudemer-rislenormande.com/wp-content/uploads/2017/03/Palais-de-la-bi%C3%A8re.jpeg" }); + var obj = initTile(ctx, { _id: "meetup2", position: 10, tiletype: "meetup", size:"small", name: "Rencontre", img: "https://www.monpetitdate.fr/wp-content/uploads/2022/01/rencontre-trans-paris.jpg" }); + var obj = initTile(ctx, { _id: "b9", position: 11, tiletype: "bar", size:"small", name: "Le comptoir des bières", price: "4", img: "https://lh3.googleusercontent.com/p/AF1QipPRj-YgeXsNxXjkpxill-QMSh20T9jeNl8OLcuj=s1600-w640" }); + var obj = initTile(ctx, { _id: "b10", position: 12, tiletype: "bar", size:"small", name: "Les moulins bleus", price: "4", img: "https://www.brunnenbraeu.org/Alben2/MoulinsBleusDijon/album/slides/Les%20Moulins%20Bleus%20%E2%80%93%20Craft%20Beer%20and%20Food%20%281%29.jpg" }); + var obj = initTile(ctx, { _id: "b11", position: 13, tiletype: "bar", size:"small", name: "Le fourquet", price: "4", img: "https://media-cdn.tripadvisor.com/media/photo-s/0c/ce/ca/87/le-fourquet.jpg" }); + var obj = initTile(ctx, { _id: "prs", position: 14, tiletype: "prison", size:"big", name: "Cellule de dégrisement", img: "https://lvdneng.rosselcdn.net/sites/default/files/dpistyles_v2/ena_16_9_extra_big/2022/09/05/node_1224621/55601340/public/2022/09/05/B9732002324Z.1_20220905182824_000%2BGBHL6LBT5.1-0.jpg?itok=UqmdxUiM1662450019" }); + var obj = initTile(ctx, { _id: "b12", position: 15, tiletype: "bar", size:"small", name: "Au beaux fûts", price: "5", img: "https://because-gus.com/wp-content/uploads/2020/02/Bars-MaryRebeccaElliott.jpg" }); + var obj = initTile(ctx, { _id: "b13", position: 16, tiletype: "bar", size:"small", name: "Le Bacchus", price: "5", img: "https://media-cdn.tripadvisor.com/media/photo-s/10/f6/a8/75/facade.jpg" }); + var obj = initTile(ctx, { _id: "b14", position: 17, tiletype: "bar", size:"small", name: "Matusalém", price: "5", img: "https://foodforthought.com.my/wp-content/uploads/Franks-Bar-Matusalem-Rum-x-Franks-Food-For-Thought-1024x731.jpeg" }); + var obj = initTile(ctx, { _id: "meetup3", position: 18, tiletype: "meetup", size:"small", name: "Rencontre", img: "https://test.psychologies.com/var/tests/storage/images/2/3/3/1/11332-2-fre-FR/Test-pret-rencontre_thumb_434_265.jpg" }); + var obj = initTile(ctx, { _id: "b15", position: 19, tiletype: "bar", size:"small", name: "Bloody Marianne", price: "6", img: "https://lh3.googleusercontent.com/p/AF1QipPAS0edvVXEiY7_ttg_wBIegJs1Nz2lxIXmqmr3=s1600-w640" }); + var obj = initTile(ctx, { _id: "b16", position: 20, tiletype: "bar", size:"small", name: "Shake it up", price: "6", img: "https://images.barrons.com/im-839994?width=700&height=466" }); + var obj = initTile(ctx, { _id: "b17", position: 21, tiletype: "bar", size:"small", name: "Le mixologue", price: "6", img: "https://www.ciga.fr/img/cms/le-mixologue/mise-en-situation-le-mixologue.jpg" }); + var obj = initTile(ctx, { _id: "hh2", position: 22, tiletype: "happyHour", size:"small", name: "Happy hour", img: "https://img.freepik.com/vecteurs-libre/fond-dessin-anime-happy-hours_52683-81243.jpg" }); + var obj = initTile(ctx, { _id: "b18", position: 23, tiletype: "bar", size:"small", name: "Le senateur", price: "7", img: "https://media-cdn.tripadvisor.com/media/photo-s/0f/72/99/b4/montreal-marriott-chateau.jpg" }); + var obj = initTile(ctx, { _id: "b19", position: 24, tiletype: "bar", size:"small", name: "La dame blanche", price: "7", img: "https://decibelles-data.media.tourinsoft.eu/upload/dame-jour.jpeg" }); + var obj = initTile(ctx, { _id: "meetup4", position: 25, tiletype: "meetup", size:"small", name: "Rencontre", img: "https://www.commeuncamion.com/content/uploads/2015/08/Rencontre-Couple-Bar.jpg" }); + var obj = initTile(ctx, { _id: "b20", position: 26, tiletype: "bar", size:"small", name: "Le Kube", price: "8", img: "https://www.lesbarres.com/media/image/slideshow/726a6f8ea266c7c0cbb72cbc261d3520bf8f90df.jpg" }); + var obj = initTile(ctx, { _id: "b21", position: 27, tiletype: "bar", size:"small", name: "L'amirauté", price: "8", img: "https://www.lamiraute-restaurant-saintes-maries-de-la-mer.com/media/cache/resolve/l800/websites/b510beeb640a5dc50a78118b3c8f7ce2/img/restaurant-amiraute-saintes-maries-de-la-mer-04_20210927172840.jpg" }); } // La fonction "onInit()" (si déclarée) est automatiquement @@ -110,6 +110,7 @@ function onInit() { rpc.register("upsertCard"); rpc.register("initCard"); + rpc.register("getTiles"); rpc.register("getTile"); rpc.register("getTilebyorder"); rpc.register("upsertTile"); @@ -201,6 +202,10 @@ function initCard(ctx,card) { } // Repository Tile +async function getTiles(ctx) { + var obj = await store.query(ctx, "Tile"); + return obj; +} async function getTile(ctx,id) { var obj = await store.get(ctx, "Tile",id); if(obj&&!obj.value) obj.value=obj.default; diff --git a/src/app.css b/src/app.css index 67115df..9585e62 100644 --- a/src/app.css +++ b/src/app.css @@ -318,7 +318,15 @@ +.bigtile, .tile, .tilenone { + height: 200px; + background-position: center; + background-size:cover; + border: 1px red solid; +} +.tile, .tilenone { width: 33.33333333333333333333333% } +.tilenone {border: none;} .sortable > span { -webkit-touch-callout:none; diff --git a/src/lib/Tile.svelte b/src/lib/Tile.svelte new file mode 100644 index 0000000..621c448 --- /dev/null +++ b/src/lib/Tile.svelte @@ -0,0 +1,15 @@ + + +