Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="initial-scale=1,maximum-scale=1,user-scalable=no"
    />
    <title>Filter features with TimeSlider - 4.13</title>

    <style>
      html,
      body
       {
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
      }
      
      #viewDiv {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;
      }

      #sliderExpand {
        position: absolute;
        left: 100px;
        right: 100px;
        bottom: 30px;
      }
      
      #timeSlider {
        position: absolute;
        left: 100px;
        right: 100px;
        bottom: 30px;
      }

      #infoDiv {
        height: 200px;
        padding: 10px;
        width: 280px;
      }

      #infoDiv span {
        color: #f9c653;
        font-size: 12pt;
        font-weight: bolder;
      }
 
    </style>

    <link
      rel="stylesheet"
      href="https://js.arcgis.com/4.13/esri/themes/light/main.css"
    />

    
    <script src="https://js.arcgis.com/4.13/"></script>

    <script>
      require([
        "esri/Map",
        "esri/views/MapView",
        "esri/layers/FeatureLayer",
        "esri/layers/MapImageLayer",
        "esri/widgets/TimeSlider",
        "esri/widgets/Expand",
        "esri/widgets/LayerList",
        "esri/widgets/Legend",
        "esri/widgets/Fullscreen",
        
        "esri/views/layers/support/FeatureFilter"
      ], function(Map, MapView, FeatureLayer, MapImageLayer, TimeSlider, Expand, LayerList, Legend, Fullscreen, FeatureFilter) {  
        
        // Rendering Settings
        // overwrites render for city limits "cLimits"
        var limitsRenderer = {
            type: "simple", // autocasts as new SimpleRenderer()
            symbol: {
              type: "simple-fill", // autocasts as new SimpleFillSymbol()
              color: [0, 0, 0, 0],
              outline: {
                color: [217, 139, 23, 0.8],
                width: 0.75
                }
              }
            };
        
        //Layers
        const Vacation  = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'Vacation'",
          copyright: "City of Appleton",
          title: "Street Vacation",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const tempUse  = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'Temp Use'",
          copyright: "City of Appleton",
          title: "Temporary Use Permit",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const SitePlan = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'SitePlan'",
          copyright: "City of Appleton",
          title: "Site Plan",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const Plat = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'Plat'",
          copyright: "City of Appleton",
          title: "Plat",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const LotLine = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'LotLine'",
          copyright: "City of Appleton",
          title: "LotLine Adjustment",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const historicPreservation = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'Historic Preservation'",
          copyright: "City of Appleton",
          title: "Historic Preservation",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const Dedication = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'Dedication'",
          copyright: "City of Appleton",
          title: "Street Dedication",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const CompPlanAmend = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'Comp Plan Amend'",
          copyright: "City of Appleton",
          title: "Comp Plan Amend",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const CSM = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'CSM'",
          copyright: "City of Appleton",
          title: "CSM",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const Art = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'Art'",
          copyright: "City of Appleton",
          title: "Public Art",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const SUP = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'SUP'",
          copyright: "City of Appleton",
          title: "Special Use Permits",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const Rezoning = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          legendEnabled: false,
          definitionExpression: "project_type = 'Rezoning'",
          copyright: "City of Appleton",
          title: "Rezoning",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        const Annexation = new FeatureLayer({
          url: "https://gis.appleton.org/pubserver/rest/services/Hosted/EnvisionAppleton/FeatureServer/0",
          definitionExpression: "project_type = 'Annexation'",
          copyright: "City of Appleton",
          title: "Annexation",
          // set the CSVLayer's timeInfo based on the date field
          timeInfo: {
            startField: "project_date", // name of the date field
            interval: {
              // set time interval to one day
              unit: "days",
              value: 1
            }
          },
          popupTemplate: {
            // autocasts as new PopupTemplate()
            title: "{name}",

            // Set content elements in the order to display.
            // The first element displayed here is the fieldInfos.
            content: [
              {
                // It is also possible to set the fieldInfos outside of the content
                // directly in the popupTemplate. If no fieldInfos is specifically set
                // in the content, it defaults to whatever may be set within the popupTemplate.
                type: "fields", // FieldsContentElement
                fieldInfos: [
                  {
                    fieldName: "project_number",
                    visible: true,
                    label: "Project Number"
                  },
                  {
                    fieldName: "description",
                    visible: true,
                    label: "Description"
                  },
                  {
                    fieldName: "project_type",
                    visible: true,
                    label: "Project Type"
                  },
                  {
                    fieldName: "link",
                    visible: true,
                    label: "More Information"
                  },
                  {
                    fieldName: "project_date",
                    visible: true,
                    label: "Approval Date",
                    format: {
                      dateFormat: "year"
                    }
                  }
                ]
              }
            ]
          },
          outFields: ["*"]
        });
        
        var cLimits = new MapImageLayer({
          url:
            "https://gis.appleton.org/pubserver/rest/services/CityLimits/MapServer",
          listMode: "hide",
          legendEnabled: false,
          sublayers: [
            {
              id: 0,
              renderer: limitsRenderer
            }
          ]         
        });

        var addr = new MapImageLayer({
          url:
            "https://gis.appleton.org/pubserver/rest/services/ExGISLotData2/MapServer",
          listMode: "hide",
          sublayers: [
            {
              id: 0,
              visible: false
            },
            {
              id: 2,
              visible: false
            },
            {
              id: 4,
              visible: false
            },
            {
              id: 6,
              visible: false
            },
            {
              id: 8,
              visible: true
            },
            {
              id: 10,
              visible: false
            },
            {
              id: 12,
              visible: false
            }
          ]
        });
        
        // Map and Layer Settings
        const map = new Map({
          basemap: "gray",
          layers: [cLimits, tempUse, Vacation, Dedication, SUP, SitePlan, Rezoning, Art, Plat, LotLine, historicPreservation, CSM, CompPlanAmend, Annexation, addr] //Set order of operational items here
        });

        var view = new MapView({
          map: map,
          container: "viewDiv",
          center: [-88.401, 44.273],
          zoom: 12,
          constraints: {
            rotationEnabled: false
          },
          ui: {
            components: []
          }
        });

        // Time Slider setting and UI visibility
        const timeSlider = new TimeSlider({
          //container: document.createElement("timeSlider"),
		      container: "timeSlider",
          playRate: 750,
          view: view,
          //mode: "cumulative-from-start",
          stops: {
            interval: {
              value: 1,
              unit: "months"
            }
          },
          fullTimeExtent: {
            start: new Date(2019, 0, 1),
            end: new Date(2020, 0, 1)
          },
          values: [new Date(2019, 0, 1), new Date(2020, 0, 1)]
        });
        
        view.ui.add(timeSlider, "manual");
        
        const timeExpand = new Expand({
          collapseIconClass: "esri-icon-close",
          expandIconClass: "esri-icon-time-clock",
          expandTooltip: "Time Slider",
          view: view,
          expanded: false,
          container: document.getElementById("flip")
        });    
        //view.ui.add(sliderExpand, "bottom-left");
        
        
        // Legend UI for Annexation layer is on regard less of layer visibility
        const legendExpand = new Expand({
          collapsedIconClass: "esri-icon-collapse",
          expandIconClass: "esri-icon-layer-list",
          expandTooltip: "Legend",
          view: view,
          content: new Legend({
            view: view,
            respectLayerVisibility: false,
            layerInfos: [{
              layer: Annexation,
              title: "Legend",
              style: {
                type: "card",
                layout: "auto"
              }
            }]
          }),
          expanded: false
        });
        //view.ui.add(legendExpand, "top-left");
        
        // Layer List UI
        const listExpand = new Expand({
          collapseIconClass: "esri-icon-collapse",
          expandIconClass: "esri-icon-layers",
          expandTooltip: "Layer List",
          view: view,
          content: new LayerList({
            view: view
          }),
          expanded: false
        });
        //view.ui.add([listExpand,legendExpand,sliderExpand], "top-left");
       
        // MOBILE
        
        const expandMobile = [];
        
        // Full Screen UI
        fullscreen = new Fullscreen({
          view: view
        });
        view.ui.add(fullscreen, "top-right");
        
        // clear the view's default UI components if
        // app is used on a small device
        
        // Instead of watching the size or resizing properties
        // Load

        isResponsiveSize = view.widthBreakpoint === "xsmall";
        updateView(isResponsiveSize);

        // Breakpoints

        view.watch("widthBreakpoint", function(breakpoint) {
          switch (breakpoint) {
            case "xsmall":
              updateView(true);
              break;
            case "small":
            case "medium":
            case "large":
            case "xlarge":
            default:
          }
        });
        
        function updateView(isMobile) {
          setMobile(isMobile);
        }
        
        function setMobile(isMobile) {
          var toAdd = isMobile ? expandMobile : [listExpand,legendExpand,timeExpand];
          var toRemove = isMobile ? [listExpand,legendExpand,timeExpand] : expandMobile;

          view.ui.remove(toRemove);
          view.ui.add(toAdd, "top-left");
        }
        
      });
    </script>
    
  </head>

  <body>
      <div id="viewDiv"></div>
      <div id="flip"></div>
      <div id="timeSlider"></div>
  </body>
</html>

              
            
!

CSS

              
                
              
            
!

JS

              
                $(document).ready(function () {
  $("#flip").click(function () {
    $("#timeSlider").slideToggle("200");
  }).click();
});
              
            
!
999px

Console