-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from Cogapp/feature/custom-tours
Custom Tours Sprint 1
- Loading branch information
Showing
13 changed files
with
220 additions
and
3,033 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use App\Models\CustomTour; | ||
use Illuminate\Database\Seeder; | ||
|
||
class CustomTourSeeder extends Seeder | ||
{ | ||
public function run(): void | ||
{ | ||
// Custom Tour - Complete Content | ||
$tourJson = [ | ||
"title" => "Custom Tour - Complete Content", | ||
"description" => "My custom tour description", | ||
"artworks" => [ | ||
[ | ||
"id" => 656, | ||
"title" => "Lion (One of a Pair, South Pedestal)", | ||
"objectNote" => "Note about Lion (One of a Pair, South Pedestal)", | ||
], | ||
[ | ||
"id" => 28560, | ||
"title" => "The Bedroom", | ||
"objectNote" => "Note about The Bedroom", | ||
], | ||
[ | ||
"id" => 117266, | ||
"title" => "Nightlife", | ||
"objectNote" => "Note about Nightlife", | ||
], | ||
[ | ||
"id" => 24306, | ||
"title" => "Blue and Green Music", | ||
"objectNote" => "Note about Blue and Green Music", | ||
], | ||
[ | ||
"id" => 64818, | ||
"title" => "Stacks of Wheat (End of Summer)", | ||
"objectNote" => "Note about Stacks of Wheat (End of Summer)", | ||
], | ||
], | ||
]; | ||
|
||
$customTour = new CustomTour(); | ||
$customTour->tour_json = json_encode($tourJson); | ||
$customTour->save(); | ||
|
||
// Custom Tour - No Description | ||
$tourJson = [ | ||
"title" => "Custom Tour - No Description", | ||
"description" => "", | ||
"artworks" => [ | ||
[ | ||
"id" => 117266, | ||
"title" => "Nightlife", | ||
"objectNote" => "Note about Nightlife", | ||
], | ||
[ | ||
"id" => 24306, | ||
"title" => "Blue and Green Music", | ||
"objectNote" => "Note about Blue and Green Music", | ||
], | ||
[ | ||
"id" => 64818, | ||
"title" => "Stacks of Wheat (End of Summer)", | ||
"objectNote" => "Note about Stacks of Wheat (End of Summer)", | ||
], | ||
], | ||
]; | ||
|
||
$customTour = new CustomTour(); | ||
$customTour->tour_json = json_encode($tourJson); | ||
$customTour->save(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
frontend/js/behaviors/customTourBuilder/customTourBuilder.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import ReactDOM from 'react-dom'; | ||
import React from 'react'; | ||
import CustomTourBuilder from 'custom-tour-builder'; | ||
|
||
export default function customTourBuilder(container) { | ||
this.init = function () { | ||
ReactDOM.render( | ||
<CustomTourBuilder | ||
initMessage="Custom Tour Builder will render here!" | ||
/>, | ||
container, | ||
() => { | ||
// This is informed by where I think the header scroll hiding is happening | ||
// See: frontend/js/functions/core/setScrollDirection.js | ||
// Catch if the scroll is below the threshold and remove the class | ||
if (window.scrollY < 100) { | ||
document.documentElement.classList.remove('s-header-hide'); | ||
} | ||
} | ||
); | ||
} | ||
this.destroy = function () { | ||
ReactDOM.unmountComponentAtNode(container); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as customTourBuilder } from './customTourBuilder'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { manageBehaviors } from '@area17/a17-helpers'; | ||
import * as Behaviors from './behaviors/customTourBuilder'; | ||
|
||
document.addEventListener('DOMContentLoaded', function() { | ||
manageBehaviors(Behaviors); | ||
}); |
Oops, something went wrong.