Explore all Augmented Reality open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Augmented Reality

aframe

v1.2.0

engine

v1.53.2

Relativty

Relativty 2 early Release

MixedRealityToolkit-Unity

Microsoft Mixed Reality Toolkit v2.7.3

openvr

v1.16.8

Popular Libraries in Augmented Reality

AR.js

by jeromeetienne doticonhtmldoticon

star image 15308 doticonMIT

Efficient Augmented Reality for the Web - 60fps on mobile!

ar-cutpaste

by cyrildiagne doticontypescriptdoticon

star image 14263 doticonMIT

Cut and paste your surroundings using AR

aframe

by aframevr doticonjavascriptdoticon

star image 13681 doticonMIT

:a: web framework for building virtual reality experiences.

engine

by playcanvas doticonjavascriptdoticon

star image 7301 doticonMIT

Fast and lightweight JavaScript game engine built on WebGL and glTF

Awesome-ARKit

by olucurious doticonswiftdoticon

star image 6962 doticon

A curated list of awesome ARKit projects and resources. Feel free to contribute!

Relativty

by relativty doticonc++doticon

star image 5416 doticonGPL-3.0

An open source VR headset with SteamVR supports for $200

MixedRealityToolkit-Unity

by microsoft doticoncsharpdoticon

star image 5032 doticonMIT

Mixed Reality Toolkit (MRTK) provides a set of components and features to accelerate cross-platform MR app development in Unity.

ARKit-CoreLocation

by ProjectDent doticonswiftdoticon

star image 4993 doticonMIT

Combines the high accuracy of AR with the scale of GPS data.

openvr

by ValveSoftware doticonc++doticon

star image 4789 doticonBSD-3-Clause

OpenVR SDK

Trending New libraries in Augmented Reality

ar-cutpaste

by cyrildiagne doticontypescriptdoticon

star image 14263 doticonMIT

Cut and paste your surroundings using AR

AR.js

by AR-js-org doticonjavascriptdoticon

star image 3449 doticonMIT

Image tracking, Location Based AR, Marker tracking. All on the Web.

react-xr

by pmndrs doticonjavascriptdoticon

star image 1002 doticonMIT

🤳 VR/AR with react-three-fiber

three-mesh-ui

by felixmariotto doticonjavascriptdoticon

star image 686 doticonMIT

⏹ Make VR user interfaces for Three.js

RealityMixer

by fabio914 doticoncdoticon

star image 641 doticonGPL-2.0

Mixed Reality app for iOS

mind-ar-js

by hiukim doticonjavascriptdoticon

star image 621 doticonMIT

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js

PaintingLight

by lllyasviel doticonpythondoticon

star image 550 doticonApache-2.0

Generating Digital Painting Lighting Effects via RGB-space Geometry (SIGGRAPH2020/TOG2020)

April-Tag-VR-FullBody-Tracker

by ju1ce doticonc++doticon

star image 510 doticonMIT

Full-body tracking in VR using AprilTag markers.

arcore-depth-lab

by googlesamples doticoncsharpdoticon

star image 445 doticonApache-2.0

ARCore Depth Lab is a set of Depth API samples that provides assets using depth for advanced geometry-aware features in AR interaction and rendering. (UIST 2020)

Top Authors in Augmented Reality

1

microsoft

29 Libraries

star icon9752

2

MozillaReality

20 Libraries

star icon2418

3

jeromeetienne

15 Libraries

star icon15863

4

udacity

14 Libraries

star icon98

5

maxxfrazer

13 Libraries

star icon1147

6

PacktPublishing

13 Libraries

star icon144

7

immersive-web

13 Libraries

star icon4977

8

Unity-Technologies

12 Libraries

star icon5925

9

Utopiah

11 Libraries

star icon71

10

exokitxr

10 Libraries

star icon1105

1

29 Libraries

star icon9752

2

20 Libraries

star icon2418

3

15 Libraries

star icon15863

4

14 Libraries

star icon98

5

13 Libraries

star icon1147

6

13 Libraries

star icon144

7

13 Libraries

star icon4977

8

12 Libraries

star icon5925

9

11 Libraries

star icon71

10

10 Libraries

star icon1105

Trending Kits in Augmented Reality


Projection Based AR is an Image/video projection technique that can be extended and reinforce visual data by throwing images on the surface of 3D objects.  Graphical and Imaginary representation is straightforward to implement with Projection Based AR techniques that standard lighting techniques cannot express. This kit helps users to experience the shopping experience like wearing Glasses, cap, earring in AR mode. Aframe is a framework for building virtual reality websites. This project will show you how to build an e-commerce site using aframe, AR.js, mind-AR.js, and Sketch-three.js.


Aframe has many components that can be used together or separately in your project. You may already be familiar with React or Three.js - these are two of the most common technologies used in web development today. They're used here as well! Aframe brings together these technologies and provides a simple interface for building virtual reality experiences on the web while maintaining the power of React and Three.js behind the scenes.

Troubleshooting

  1. While running batch file, if you encounter Windows protection alert, select More info --> Run anyway
  2. During kit installer, if you encounter a Windows security alert, click Allow

For a detailed tutorial on installing & executing the solution as well as learning resources including training & certification opportunities, please visit the OpenWeaver Community

Development Environment

Visual studio code IDE is used for this development. It becomes easy and simple to develop an interactive UI with Visual studio code.

AR Libraries

A-Frame is an open-source web framework used for building Augmented reality (AR) experiences. Web-based augmented reality (WebAR) is the most advanced technology that allows users to access AR experiences directly from their smartphones. Three.js is the open-source web framework used to develop augmented reality (AR) projects.

Support

If you need help using this kit, you may reach us at the OpenWeaver Community.

kandi 1-Click Install

AR Core app allows users to experience augmented reality on their Android devices. This kit helps developers and users to experience their own 3d models.


The users have the liberty to choose their own 3d models with all the fun elements also. Please see below a sample solution kit to jumpstart your solution on AR App using Android Kit. To use this kit to build your own solution, scroll down to the Kit Deployment Instructions sections.

Development Environment

The Android Studio IDE is open source and used for this development. It has a rich UI development environment with templates to give new developers launching their innovations into Android development.

Android Libraries

ARCore is the advanced platform that enables Android app developers and users to quickly and easily build AR experiences into their mobile apps and games.

Google Sceneform is an open-source 3D framework that makes it easy for you to build ARCore apps.

Android-Gradle is the open-source Android framework used to develop AR projects.

AR Fragments are used to build these ARCore apps.

Instruction to Replace 3d Models

  1. To place your own 3d model, initially, you need to set up your Android studio with "Google Sceneform Tool (Beta)"
  2. To install Google Sceneform Tool just follow the below steps : a. Go to file > settings b. In settings, click on 'plugins' c. In plugins search for "Google Sceneform Tool" in Marketplace d. Once you find, Install and restart the Android Studio
  3. Place your 3d model obj and mtl file in sampledata folder in the application Note:- Name of the obj file should be in lowercase
  4. Make a raw folder under app > src > main > res > raw
  5. Right-click on the obj file and generate the Sceneform for your 3d model under the raw folder.

Support

If you need help to use this kit, you can email us at kandi.support@openweaver.com or direct message us on Twitter Message @OpenWeaverInc.

kandi 1-Click Install

Most JavaScript libraries support marker-based AR, where users scan a physical marker with their device’s camera to trigger an AR experience.


Some libraries support markerless AR, which uses object recognition to trigger AR experiences without requiring a physical marker. Here are the top JavaScript Augmented Reality libraries used to create web AR experiences. AR libraries support the display of 3D models in AR, which will allow developers to create immersive experiences which blend digital content with the real world. It supports the display of image and video overlays in AR which can be used for displaying information or creating interactive experiences.


It uses advanced tracking algorithms for tracking the orientation and position of the device in real-time, which will allow the AR content to be accurately placed and aligned with the real world. These libraries are optimized for best performance with the help of techniques like feature and image recognition for reducing the amount of processing required for tracking the device’s orientation and position. 


Here is the list of top 19 JavaScript Augmented Reality libraries that are handpicked to help developers: 

three.js

  • Is a JavaScript library that makes creating and displaying 3D graphics in a web browser easier.  
  • Is one of the most popular 3D graphics libraries for the web and is widely used by web designers and developers for creating immersive and interactive experiences.  
  • Uses WebGL, a web standard to render 3D graphics, for creating high-performance graphics which can be displayed in a web browser. 

AR.js

  • Is a JavaScript library to create AR experiences on the web which uses computer vision to enable marker-based AR experiences without additional plugins or software.  
  • Is a lightweight library for Augmented Reality on the web with features like Location-based AR, Marker Tracking, and Image Tracking.  
  • Supports marker-based AR that will allow users to scan physical markers with their device’s camera to trigger AR experiences. 

three.ar.js

  • Is a JavaScript library that extends Three.js and AR.js to provide a framework for creating AR experiences in a web browser.  
  • Is designed to simplify the process of creating an AR experience by offering utilities and tools which integrate seamlessly with AR.js and Three.js. 
  • Is optimized for use on mobile devices and supports both Android and iOS. 

webxr

  • The WebXR device API to access VR and AR devices, like head-mounted displays and sensors on the Web.  
  • Is designed for creating immersive augmented reality and virtual experiences in web browsers. 
  • Is designed to be easy to set up and use with a simple API, allowing developers to get started quickly. 

jeelizFaceFilter

  • Is lightweight and does not include a 3D engine or third-party library.  
  • Is a JavaScript library that detects and tracks the face in real time from the camera video feed captured with WebRTC.  
  • Offers various demonstrations using the main WebGL 3D engines, which can overlay 3D content for AR applications. 

viro

  • Is a platform for developers to build Augmented and Virtual Reality experiences rapidly.  
  • Is a cross-platform AR/VR development platform that allows developers to create immersive experiences for web, virtual reality, and mobile device headsets. 
  • Provides a suite of features and tools for making creating high-quality AR and VR experiences easier. 

exokit

  • Is an open source JavaScript engine to create and run immersive experiences in virtual reality headsets, web browsers, and other platforms. 
  • Offers various features and tools, allowing developers to create and deploy immersive experiences and applications. 
  • Supports virtual experiences by allowing developers to create immersive experiences which can run on virtual reality headsets. 

js-aruco

  • Is a JavaScript library for marker-based augmented reality.  
  • Is an implementation of the ARToolKit library, allowing developers to create marker-based AR experiences in web browsers. 
  • Includes algorithms for detecting markers in real-time video streams, allowing developers to create experiences that respond to the physical world. 

React-Web-AR

  • Is based on the WebXR API and Three.js library, making creating high-quality AR experiences in the browser easier.  
  • Includes various components and tools for creating animations, 3D models, and other assets, making it easier to create high-quality AR content. 
  • Supports image tracking, allowing developers to create experiences triggered by specific patterns or images. 

ar-facedoodle

  • Is a JavaScript library that can enable developers to create AR experiences that track and draw on the user’s face in real-time.  
  • Is based on the WebRTC and TensorFlow.js libraries, making it possible to create a high-quality AR experience in web browsers without additional software or plugins. 
  • Is easy to set up and use with a simple API, allowing developers to get started quickly. 

jeelizAR

  • Is a JavaScript Object Detection lightweight library for AR that uses convolutional neural networks running on the GPU with WebGL.  
  • Is designed to work on various platforms, like mobile devices and desktops, and is compatible with various browsers.  
  • Includes algorithms to detect markers in real-time video streams, allowing developers to create experiences that respond to the physical world. 

threex.webar

  • Is a threex extension for three.js, which offers an easy-to-use extension for experimenting with augmented reality and three.js.  
  • Is built on top of the Three.js library, making it possible to create high-quality AR experiences with 3D graphics and animation.  
  • Has an active community of contributors and developers, making it easy to get support and help when required. 

WebXR-emulator-extension

  • Is a browser extension that helps your WebXR content creation and enables you to run WebXR applications on your browser without any XR devices. 
  • Includes multiple XR devices emulation, graphical device emulator control with Three.js, and cross browsers support with WebExtensions API. 
  • Allows developers to customize the environment they are testing their WebEX projects in, like adjusting the room lighting, scale, and other parameters. 

webxr-polyfill

  • Is a JavaScript implementation of the WebXR Device API and the WebXR Gamepad Module.  
  • Allows developers to write against the latest specifications, offering support if run on browsers that implement the WebVR 1.1 spec or on mobile devices.  
  • Offers a fallback mechanism for legacy browsers and provides additional functionality unavailable in native WebXR API. 

3dio-js

  • Is a JavaScript library that enables developers to create interactive 3D audio experiences in web browsers.  
  • Is built on top of the Web Audio API and Three.js, making it easy to create high-quality audio experiences with 3D spatialization.  
  • Various customization options allow developers to adjust the audio spatialization, sound effects, and other parameters to suit their requirements. 

wasm-sudoku-solver

  • Is a JavaScript library that uses WebAssembly to offer an efficient Sudoku-solving algorithm in web browsers.  
  • Is designed for solving sudoku puzzles quickly and accurately, making it a valuable tool for developers creating Sudoku puzzle applications or games.  
  • Various customization options allow developers to adjust the solving algorithm and other parameters to suit their requirements. 

webxr-polyfill

  • Is a JavaScript library that offers support for the WebXR API on browsers that do not natively support it. 
  • Is designed to enable responsive and immersive AR and VR experiences on the web, like support for hand tracking, head-mounted displays, and other features. 
  • Includes optimizations for performance, including asynchronous loading of resources, reducing latency, and minimizing the impact on CPU and memory usage. 

aframe-ar

  • Is a JavaScript library that offers an effortless way to create AR experiences on the web. 
  • Includes a range of customization options, allowing developers to adjust the appearance and behavior of their AR experiences 
  • Offers an accessible and user-friendly way for developers to create compelling AR experiences on the web. 

WebAR-Article

  • Is a JavaScript library created by Google AR which offers a straightforward way to embed AR content into web pages.  
  • Includes various customization options, allowing developers to adjust the behavior and appearance of their AR experiences.  
  • Can be easily integrated with other JavaScript libraries, making it possible to create more complex AR experiences. 

FAQ

1. What advantages does the AR-Display AR library offer for making Augmented Reality? 

Here are the advantages of using AR – Display AR library for developing AR experiences: 

  • Simplified Development: Developers can create AR experiences more easily without starting from scratch. It can significantly reduce development time and effort.  
  • Hardware Abstraction: It simplifies using various AR devices and sensors by removing complications. No matter what hardware they use, developers can always interact with it consistently.    
  • Optimized Performance: Optimized Performance helps improve how AR experiences work. It makes rendering more efficient, handles camera inputs, and manages 3D objects.   
  • Feature Set: It often comes with various built-in features and tools. It can be marker detection, gesture recognition, 3D rendering capabilities, and object tracking.  
  • Scalability: It helps your AR experiences work well in different situations and places. 
  • Rapid Prototyping: It helps with quick prototyping and testing of AR concepts. It is essential for iterating on ideas and refining the user experience. 

 

2. How can webcam filters be used to build JavaScript Augmented Reality experiences? 

Creating JavaScript-based Augmented Reality experiences using webcam filters involves using computer vision methods. It processes the live video feed from a user’s webcam and overlays virtual elements. We can achieve it by combining JavaScript, HTML, and CSS.  

Here is a basic outline of how you can build such experiences: 

  • Access Webcam Feed: You can use the ‘getUserMedia’ API to access the user’s webcam feed in the browser. It allows you to request permission to access the webcam and receive a live video stream. 
  • Canvas Rendering: You can make a canvas on your webpage to show the webcam and AR elements. You can use JavaScript to capture frames from the webcam and render them onto the canvas. 
  • Computer Vision Libraries: It can help track objects, detect features, and process images. It assists in finding markers, applying filters to video frames, and tracking movements. 
  • Marker Detection: The camera can display virtual markers by recognizing patterns or images. 
  • Applying Filters: You can improve videos by adding CSS and HTML filters and effects. You can use this for image overlays, animations, and color adjustments. 
  • Interaction and Animation: JavaScript can make interactive elements respond to user actions. It can also respond to movements detected by the webcam. Implement animations and transformations based on user interactions. 
  • Testing and Debugging: To ensure your AR experience works on all devices, test and debug it. Debug any issues related to webcam access, rendering, or the application of filters. 
  • Deployment: To share your AR experience online, deploy it on a web server or hosting platform. 

 

3. Can you create immersive and interactive experiences using a JavaScript AR library? 

Creating immersive and interactive AR experiences using a JavaScript AR library. The difficulty of the task depends on the library you select. It can be easy or hard. Here is a breakdown of the factors to consider: 

Advantages: 

  • Familiar technology 
  • Web-based  
  • Quick Prototyping 
  • Community Support 
  • Web Standards 

Disadvantages: 

  • Complexity 
  • Performance 
  • Learning Curve 
  • Compatibility 
  • Hardware Limitations 
  • Advanced Interactions 

 

4. What AR experiences can you have with a JavaScript AR library? 

JavaScript AR libraries can make interactive and engaging experiences using marker-based AR. The camera finds special markers, like pictures or patterns, to trigger these experiences. Here are many types of marker-based AR experiences: 

  • Image Overlay 
  • 3D Model Augmentation 
  • Informational Displays 
  • Virtual Try-on 
  • Interactive Games 
  • Educational Tools 
  • Navigation and Wayfinding 
  • Art and Creativity 
  • Social Sharing 
  • Animation Stories 
  • Training and Simulations 
  • AR Marketing Campaigns 

 

5. Are there any limitations with JavaScript augmented reality library? 

Yes, JavaScript AR libraries come with limitations. The limitations can affect the complexity of experiences you can create. They can also impact how well your applications work and how users experience them. Here are some common limitations associated with JavaScript AR libraries: 

  • Performance 
  • Device Compatibility 
  • Tracking Accuracy 
  • Limited Features 
  • Latency 
  • Battery Drain 
  • Network Dependency 
  • Marker Design Constraints 
  • Web Browser Limitations 
  • Learning Curve 
  • Limited Offline Functionality 
  • Privacy Concerns 
  • Lack of Native Integration 

 

6. Which libraries are popular for tracking AR types like markers, locations, and images? 

Here are some popular libraries for various types of AR experiences: 

  • Marker-based AR 
  • AR.js 
  • Vuforia 
  • Wikitude 
  • Location-based AR 
  • GeoAR 
  • Google ARCore and Apple ARKit 
  • Image Recognition-Based AR 
  • EasyAR 
  • Vuforia 
  • Wikitude 

 

7. How can an existing JavaScipt AR library be integrated into a project or website?   

Follow these steps to add a JavaScript AR library to your project or website. Here is how you can integrate: 

  • Choose the library 
  • Include the library files 
  • Set Up HTML structure 
  • Access Camera Feed 
  • Initialize the Library 
  • Configure and Customize 
  • Implement AR interactions 
  • Style and UI 
  • Testing and Debugging 
  • Deployment 
  • Ongoing Maintenance 

 

8. Can developers find tutorials or guides for creating augmented reality with these libraries?  

You can use JavaScript AR libraries to create AR experiences. Find online tutorials and guides. Here are some places to find tutorials and guides: 

  • Official documentation 
  • YouTube 
  • Online Learning Platforms 
  • Blogs and Websites 
  • Forums and Communities 
  • GitHub Repositories 
  • AR library Websites 
  • Social Media 
  • Webinars and Conferences 
  • Community Workshops

Virtual, Augmented, and Mixed realities bring in additional dimensions of collaboration in this distributed world. This collection represents a starter collection to experiment with different mixed reality use cases. It showcases toolkits, remote work use cases, and other exciting use cases for you to try across C#, JavaScript, and Java. If you have specific technologies or use cases in mind, use our search to find libraries specific to you.

With Facebook rebranding itself as Meta and multiple corporations betting on the Metaverse, the interest for development on Metaverse and Extended Reality (XR) have peaked. And it’s no surprise: XR technologies are changing the way we interact with our environment while offering immersive experiences. But what is Extended Reality (XR)? Extended Reality (XR) is an environment or experience that combines virtual and physical realities through the use of augmented reality (AR), mixed reality, virtual reality (VR) or any similar immersive technologies. Think Pokemon Go or The Walking Dead: Our World — games that combine your phone’s camera with a layer of 3D animated objects superimposed on top of it. Or imagine being able to virtually open up a virtual world inside of real-world buildings, like in Ready Player One. Whether you’re new to XR and just starting out, or you’re looking for specific tools to help you in your development process, you can use the following open source resources for your Extended Reality (XR) applications.

Trending Discussions on Augmented Reality

Using Microsoft Authentication Library (MSAL) in Unity for SSO in iOS app

AttributeError: 'numpy.ndarray' object has no attribute 'set'

Move the centre of the force within Reality Composer scene

How do I include rows from dataframe that contain certain keywords

Jquery .resizable function - resize icon not displaying properly

In which case the SLAM technique is used?

Why does my video only play sound and no video with ARJS?

How to fix AR connected issue in my device?

How to place a 3D model on top of a reference image with RealityKit?

ARKit does not recognize reference images

QUESTION

Using Microsoft Authentication Library (MSAL) in Unity for SSO in iOS app

Asked 2022-Mar-16 at 09:31

We develop a bunch of augmented reality applications for our company. The applications are based on the game engine Unity (currently in the version 2020.3.7f1). Now, we're facing the point that we'd like to implement a SSO method in our apps, so every member of our company authenticates himself with his company user credentials. To authenticate the user we want to / have to use the Microsoft identity platform and thus the Microsoft Authentication Library (MSAL).

We already created an client on Azure with a client id, redirect uri, authority uri, endpoint, tenant, etc and it was tested successfully with an official sample project by Microsoft (https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-ios).

But now we stuck at the point to establish this process in Unity. We created the MSAL library dll (https://github.com/AzureAD/microsoft-authentication-library-for-dotnet), imported it into Unity and called it by using the namespace Microsoft.Identity.Client. Due to security reasons we're only allowed to use PublicClientApplicationBuilder (which makes totally sense) so we need the web based login screen. The problem is that we can't implement a web view in Unity where the user can sign in to Microsoft and we can parse the received token out of the web view into our app for further communications.

We did a lot of internet research to find a solution but there are only some posts about MSAL in Unity in combination with Android and other posts which reference to the git repos I mentioned before.

How can we use MSAL in Unity for iOS devices?

Example code:

1 IPublicClientApplication PublicClientApp = PublicClientApplicationBuilder
2        .Create(kClientID)
3        .WithRedirectUri(kRedirectUri)
4        .WithAuthority(new Uri(kAuthority))
5        .Build();
6 IEnumerable<string> scopes = new List<string> { "https://graph.microsoft.com/.default" };
7 AuthenticationResult result;
8 result = await PublicClientApp.AcquireTokenInteractive(scopes)
9                   .ExecuteAsync();
10
11 result = await PublicClientApp
12        .AcquireTokenInteractive(scopes)
13        .WithParentActivityOrWindow(new object)
14        .ExecuteAsync();
15
16 Debug.Log(result.AccessToken);
17

ANSWER

Answered 2021-Nov-16 at 13:45

The standard solution for mobile is the AppAuth pattern, which involves use of an integrated system browser to sign the user in. See this code example article for how that looks, so that you understand the required behaviour.

So it looks like they key thing to do with iOS is to avoid logins via webviews and tell MSAL to use an ASWebAuthenticationSession window - this Microsoft article explains how.

Source https://stackoverflow.com/questions/69973596

QUESTION

AttributeError: 'numpy.ndarray' object has no attribute 'set'

Asked 2022-Feb-16 at 18:33

when I write this code: (my entire code, school project on Augmented Reality) Everything worked perfectly until I tried to run the video. ...........................................................................................................................................................................................................

1import cv2
2import numpy as np
3
4cap=cv2.VideoCapture(2)                                         
5imgTarget=cv2.imread('F1racecars.jpeg')                         
6vidTarget= cv2.VideoCapture('F1racecars.mp4')
7               
8success, vidTarget = vidTarget.read()                           
9imgTarget=cv2.resize(imgTarget,(640,360))                       
10hT, wT, cT = imgTarget.shape   
11vidTarget=cv2.resize(vidTarget,(wT,hT))                        
12
13
14orb = cv2.ORB_create(nfeatures=1000)
15kp1, des1 = orb.detectAndCompute(imgTarget,None)
16
17detect = False
18fcount = 0
19
20
21while True:                                                     
22   success, imgWebcam= cap.read()                              
23   imgAug = imgWebcam.copy()
24
25   imgWarp = np.zeros((imgWebcam.shape[1], imgWebcam.shape[0],imgWebcam.shape[2]))
26   masknew = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1],imgWebcam.shape[2]), np.uint8)
27   maskInv = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
28   Mergecamfeed =  np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
29   ARfinal = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
30
31   if detect is False:
32      vidTarget.set(cv2.CAP_PROP_POS_FRAMES,0)
33      fcount =0
34   else:
35      if fcount == vidTarget.get(cv2.CAP_PROP_FRAME_COUNT, 0):
36         vidTarget.set(cv2.CAP_PROP_POS_FRAMES, 0)
37         fcount = 0
38   success, vidTarget= vidTarget.read()
39   vidTarget= cv2.resize(vidTarget, (wT, hT))
40
41   kp2, des2 = orb.detectAndCompute(imgWebcam,None)
42
43   if des2 is None: print(False)
44   else:
45      bf = cv2.BFMatcher()
46      featmatch = bf.knnMatch(des1,des2,k=2)
47      good=[]
48      for m,n in featmatch:
49          if m.distance < 0.75 * n.distance: good.append(m)
50      print(len(good))
51
52      if len(good)>20:                                                                
53         detect = True
54         srcpts = np.float32([kp1[m.queryIdx].pt for m in good]).reshape(-1, 1, 2)
55         dstpts = np.float32([kp2[m.trainIdx].pt for m in good]).reshape(-1, 1, 2)
56
57         matrix, mask = cv2.findHomography(srcpts,dstpts, cv2.RANSAC, 5)
58         print(matrix)
59
60         pts = np.float32([[0,0],[0,360],[640,360],[640,0]]).reshape(-1, 1, 2)
61
62         dst = cv2.perspectiveTransform(pts,matrix)
63         cv2.polylines(imgWebcam,[np.int32(dst)],True,(255,0,255),3)
64
65         imgWarp = cv2.warpPerspective(vidTarget,matrix, (imgWebcam.shape[1],imgWebcam.shape[0]))
66
67         cv2.fillPoly(masknew, [np.int32(dst)], (255,255,255))
68
69         maskInv = cv2.bitwise_not(masknew)
70
71         Mergecamfeed = cv2.bitwise_and(imgAug,imgAug,None, mask = maskInv[:,:,0])
72                                                                            
73         ARfinal = cv2.bitwise_or(imgWarp, Mergecamfeed)                     
74
75
76   cv2.imshow('imgTarget', imgTarget)
77   cv2.imshow('imgTargetVdo', vidTarget)
78   cv2.imshow('webcam', imgWebcam)
79   cv2.imshow('warp', imgWarp)
80   cv2.imshow('mask', masknew)
81   cv2.imshow('Modified mask', maskInv)
82   cv2.imshow('Aug Image', Mergecamfeed)
83   cv2.imshow('Augmented Reality Final O/P', ARfinal)
84   cv2.waitKey(1)
85   fcount += 1
86

It shows like this:

1import cv2
2import numpy as np
3
4cap=cv2.VideoCapture(2)                                         
5imgTarget=cv2.imread('F1racecars.jpeg')                         
6vidTarget= cv2.VideoCapture('F1racecars.mp4')
7               
8success, vidTarget = vidTarget.read()                           
9imgTarget=cv2.resize(imgTarget,(640,360))                       
10hT, wT, cT = imgTarget.shape   
11vidTarget=cv2.resize(vidTarget,(wT,hT))                        
12
13
14orb = cv2.ORB_create(nfeatures=1000)
15kp1, des1 = orb.detectAndCompute(imgTarget,None)
16
17detect = False
18fcount = 0
19
20
21while True:                                                     
22   success, imgWebcam= cap.read()                              
23   imgAug = imgWebcam.copy()
24
25   imgWarp = np.zeros((imgWebcam.shape[1], imgWebcam.shape[0],imgWebcam.shape[2]))
26   masknew = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1],imgWebcam.shape[2]), np.uint8)
27   maskInv = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
28   Mergecamfeed =  np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
29   ARfinal = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
30
31   if detect is False:
32      vidTarget.set(cv2.CAP_PROP_POS_FRAMES,0)
33      fcount =0
34   else:
35      if fcount == vidTarget.get(cv2.CAP_PROP_FRAME_COUNT, 0):
36         vidTarget.set(cv2.CAP_PROP_POS_FRAMES, 0)
37         fcount = 0
38   success, vidTarget= vidTarget.read()
39   vidTarget= cv2.resize(vidTarget, (wT, hT))
40
41   kp2, des2 = orb.detectAndCompute(imgWebcam,None)
42
43   if des2 is None: print(False)
44   else:
45      bf = cv2.BFMatcher()
46      featmatch = bf.knnMatch(des1,des2,k=2)
47      good=[]
48      for m,n in featmatch:
49          if m.distance < 0.75 * n.distance: good.append(m)
50      print(len(good))
51
52      if len(good)>20:                                                                
53         detect = True
54         srcpts = np.float32([kp1[m.queryIdx].pt for m in good]).reshape(-1, 1, 2)
55         dstpts = np.float32([kp2[m.trainIdx].pt for m in good]).reshape(-1, 1, 2)
56
57         matrix, mask = cv2.findHomography(srcpts,dstpts, cv2.RANSAC, 5)
58         print(matrix)
59
60         pts = np.float32([[0,0],[0,360],[640,360],[640,0]]).reshape(-1, 1, 2)
61
62         dst = cv2.perspectiveTransform(pts,matrix)
63         cv2.polylines(imgWebcam,[np.int32(dst)],True,(255,0,255),3)
64
65         imgWarp = cv2.warpPerspective(vidTarget,matrix, (imgWebcam.shape[1],imgWebcam.shape[0]))
66
67         cv2.fillPoly(masknew, [np.int32(dst)], (255,255,255))
68
69         maskInv = cv2.bitwise_not(masknew)
70
71         Mergecamfeed = cv2.bitwise_and(imgAug,imgAug,None, mask = maskInv[:,:,0])
72                                                                            
73         ARfinal = cv2.bitwise_or(imgWarp, Mergecamfeed)                     
74
75
76   cv2.imshow('imgTarget', imgTarget)
77   cv2.imshow('imgTargetVdo', vidTarget)
78   cv2.imshow('webcam', imgWebcam)
79   cv2.imshow('warp', imgWarp)
80   cv2.imshow('mask', masknew)
81   cv2.imshow('Modified mask', maskInv)
82   cv2.imshow('Aug Image', Mergecamfeed)
83   cv2.imshow('Augmented Reality Final O/P', ARfinal)
84   cv2.waitKey(1)
85   fcount += 1
86AttributeError: 'numpy.ndarray' object has no attribute 'set'
87

ANSWER

Answered 2022-Feb-16 at 18:33

Normally we ask for the full error message, with traceback. That makes it easier to identify where the error occurs. In this case though, set is only used a couple of times.

1import cv2
2import numpy as np
3
4cap=cv2.VideoCapture(2)                                         
5imgTarget=cv2.imread('F1racecars.jpeg')                         
6vidTarget= cv2.VideoCapture('F1racecars.mp4')
7               
8success, vidTarget = vidTarget.read()                           
9imgTarget=cv2.resize(imgTarget,(640,360))                       
10hT, wT, cT = imgTarget.shape   
11vidTarget=cv2.resize(vidTarget,(wT,hT))                        
12
13
14orb = cv2.ORB_create(nfeatures=1000)
15kp1, des1 = orb.detectAndCompute(imgTarget,None)
16
17detect = False
18fcount = 0
19
20
21while True:                                                     
22   success, imgWebcam= cap.read()                              
23   imgAug = imgWebcam.copy()
24
25   imgWarp = np.zeros((imgWebcam.shape[1], imgWebcam.shape[0],imgWebcam.shape[2]))
26   masknew = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1],imgWebcam.shape[2]), np.uint8)
27   maskInv = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
28   Mergecamfeed =  np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
29   ARfinal = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
30
31   if detect is False:
32      vidTarget.set(cv2.CAP_PROP_POS_FRAMES,0)
33      fcount =0
34   else:
35      if fcount == vidTarget.get(cv2.CAP_PROP_FRAME_COUNT, 0):
36         vidTarget.set(cv2.CAP_PROP_POS_FRAMES, 0)
37         fcount = 0
38   success, vidTarget= vidTarget.read()
39   vidTarget= cv2.resize(vidTarget, (wT, hT))
40
41   kp2, des2 = orb.detectAndCompute(imgWebcam,None)
42
43   if des2 is None: print(False)
44   else:
45      bf = cv2.BFMatcher()
46      featmatch = bf.knnMatch(des1,des2,k=2)
47      good=[]
48      for m,n in featmatch:
49          if m.distance < 0.75 * n.distance: good.append(m)
50      print(len(good))
51
52      if len(good)>20:                                                                
53         detect = True
54         srcpts = np.float32([kp1[m.queryIdx].pt for m in good]).reshape(-1, 1, 2)
55         dstpts = np.float32([kp2[m.trainIdx].pt for m in good]).reshape(-1, 1, 2)
56
57         matrix, mask = cv2.findHomography(srcpts,dstpts, cv2.RANSAC, 5)
58         print(matrix)
59
60         pts = np.float32([[0,0],[0,360],[640,360],[640,0]]).reshape(-1, 1, 2)
61
62         dst = cv2.perspectiveTransform(pts,matrix)
63         cv2.polylines(imgWebcam,[np.int32(dst)],True,(255,0,255),3)
64
65         imgWarp = cv2.warpPerspective(vidTarget,matrix, (imgWebcam.shape[1],imgWebcam.shape[0]))
66
67         cv2.fillPoly(masknew, [np.int32(dst)], (255,255,255))
68
69         maskInv = cv2.bitwise_not(masknew)
70
71         Mergecamfeed = cv2.bitwise_and(imgAug,imgAug,None, mask = maskInv[:,:,0])
72                                                                            
73         ARfinal = cv2.bitwise_or(imgWarp, Mergecamfeed)                     
74
75
76   cv2.imshow('imgTarget', imgTarget)
77   cv2.imshow('imgTargetVdo', vidTarget)
78   cv2.imshow('webcam', imgWebcam)
79   cv2.imshow('warp', imgWarp)
80   cv2.imshow('mask', masknew)
81   cv2.imshow('Modified mask', maskInv)
82   cv2.imshow('Aug Image', Mergecamfeed)
83   cv2.imshow('Augmented Reality Final O/P', ARfinal)
84   cv2.waitKey(1)
85   fcount += 1
86AttributeError: 'numpy.ndarray' object has no attribute 'set'
87vidTarget.set(cv2.CAP_PROP_POS_FRAMES,0)
88

What's this thing vidTarget? The error says it's a numpy array, and is clear that such an object does not have a set method. Experienced numpy users also know that. So what kind of object did you expect it to be?

We see attribute errors for one of two reasons. Either the code writer did not read the documentation, and tried to use a non-existent method. Or the variable in question is not what he expected. You should know, at every, step what the variable is - not just guess or hope, know. Test if necessary.

edit

Initially

1import cv2
2import numpy as np
3
4cap=cv2.VideoCapture(2)                                         
5imgTarget=cv2.imread('F1racecars.jpeg')                         
6vidTarget= cv2.VideoCapture('F1racecars.mp4')
7               
8success, vidTarget = vidTarget.read()                           
9imgTarget=cv2.resize(imgTarget,(640,360))                       
10hT, wT, cT = imgTarget.shape   
11vidTarget=cv2.resize(vidTarget,(wT,hT))                        
12
13
14orb = cv2.ORB_create(nfeatures=1000)
15kp1, des1 = orb.detectAndCompute(imgTarget,None)
16
17detect = False
18fcount = 0
19
20
21while True:                                                     
22   success, imgWebcam= cap.read()                              
23   imgAug = imgWebcam.copy()
24
25   imgWarp = np.zeros((imgWebcam.shape[1], imgWebcam.shape[0],imgWebcam.shape[2]))
26   masknew = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1],imgWebcam.shape[2]), np.uint8)
27   maskInv = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
28   Mergecamfeed =  np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
29   ARfinal = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
30
31   if detect is False:
32      vidTarget.set(cv2.CAP_PROP_POS_FRAMES,0)
33      fcount =0
34   else:
35      if fcount == vidTarget.get(cv2.CAP_PROP_FRAME_COUNT, 0):
36         vidTarget.set(cv2.CAP_PROP_POS_FRAMES, 0)
37         fcount = 0
38   success, vidTarget= vidTarget.read()
39   vidTarget= cv2.resize(vidTarget, (wT, hT))
40
41   kp2, des2 = orb.detectAndCompute(imgWebcam,None)
42
43   if des2 is None: print(False)
44   else:
45      bf = cv2.BFMatcher()
46      featmatch = bf.knnMatch(des1,des2,k=2)
47      good=[]
48      for m,n in featmatch:
49          if m.distance < 0.75 * n.distance: good.append(m)
50      print(len(good))
51
52      if len(good)>20:                                                                
53         detect = True
54         srcpts = np.float32([kp1[m.queryIdx].pt for m in good]).reshape(-1, 1, 2)
55         dstpts = np.float32([kp2[m.trainIdx].pt for m in good]).reshape(-1, 1, 2)
56
57         matrix, mask = cv2.findHomography(srcpts,dstpts, cv2.RANSAC, 5)
58         print(matrix)
59
60         pts = np.float32([[0,0],[0,360],[640,360],[640,0]]).reshape(-1, 1, 2)
61
62         dst = cv2.perspectiveTransform(pts,matrix)
63         cv2.polylines(imgWebcam,[np.int32(dst)],True,(255,0,255),3)
64
65         imgWarp = cv2.warpPerspective(vidTarget,matrix, (imgWebcam.shape[1],imgWebcam.shape[0]))
66
67         cv2.fillPoly(masknew, [np.int32(dst)], (255,255,255))
68
69         maskInv = cv2.bitwise_not(masknew)
70
71         Mergecamfeed = cv2.bitwise_and(imgAug,imgAug,None, mask = maskInv[:,:,0])
72                                                                            
73         ARfinal = cv2.bitwise_or(imgWarp, Mergecamfeed)                     
74
75
76   cv2.imshow('imgTarget', imgTarget)
77   cv2.imshow('imgTargetVdo', vidTarget)
78   cv2.imshow('webcam', imgWebcam)
79   cv2.imshow('warp', imgWarp)
80   cv2.imshow('mask', masknew)
81   cv2.imshow('Modified mask', maskInv)
82   cv2.imshow('Aug Image', Mergecamfeed)
83   cv2.imshow('Augmented Reality Final O/P', ARfinal)
84   cv2.waitKey(1)
85   fcount += 1
86AttributeError: 'numpy.ndarray' object has no attribute 'set'
87vidTarget.set(cv2.CAP_PROP_POS_FRAMES,0)
88vidTarget= cv2.VideoCapture('F1racecars.mp4')
89

From a quick read of cv2 docs, this has get/set methods

but then you do

1import cv2
2import numpy as np
3
4cap=cv2.VideoCapture(2)                                         
5imgTarget=cv2.imread('F1racecars.jpeg')                         
6vidTarget= cv2.VideoCapture('F1racecars.mp4')
7               
8success, vidTarget = vidTarget.read()                           
9imgTarget=cv2.resize(imgTarget,(640,360))                       
10hT, wT, cT = imgTarget.shape   
11vidTarget=cv2.resize(vidTarget,(wT,hT))                        
12
13
14orb = cv2.ORB_create(nfeatures=1000)
15kp1, des1 = orb.detectAndCompute(imgTarget,None)
16
17detect = False
18fcount = 0
19
20
21while True:                                                     
22   success, imgWebcam= cap.read()                              
23   imgAug = imgWebcam.copy()
24
25   imgWarp = np.zeros((imgWebcam.shape[1], imgWebcam.shape[0],imgWebcam.shape[2]))
26   masknew = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1],imgWebcam.shape[2]), np.uint8)
27   maskInv = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
28   Mergecamfeed =  np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
29   ARfinal = np.zeros((imgWebcam.shape[0], imgWebcam.shape[1], imgWebcam.shape[2]), np.uint8)
30
31   if detect is False:
32      vidTarget.set(cv2.CAP_PROP_POS_FRAMES,0)
33      fcount =0
34   else:
35      if fcount == vidTarget.get(cv2.CAP_PROP_FRAME_COUNT, 0):
36         vidTarget.set(cv2.CAP_PROP_POS_FRAMES, 0)
37         fcount = 0
38   success, vidTarget= vidTarget.read()
39   vidTarget= cv2.resize(vidTarget, (wT, hT))
40
41   kp2, des2 = orb.detectAndCompute(imgWebcam,None)
42
43   if des2 is None: print(False)
44   else:
45      bf = cv2.BFMatcher()
46      featmatch = bf.knnMatch(des1,des2,k=2)
47      good=[]
48      for m,n in featmatch:
49          if m.distance < 0.75 * n.distance: good.append(m)
50      print(len(good))
51
52      if len(good)>20:                                                                
53         detect = True
54         srcpts = np.float32([kp1[m.queryIdx].pt for m in good]).reshape(-1, 1, 2)
55         dstpts = np.float32([kp2[m.trainIdx].pt for m in good]).reshape(-1, 1, 2)
56
57         matrix, mask = cv2.findHomography(srcpts,dstpts, cv2.RANSAC, 5)
58         print(matrix)
59
60         pts = np.float32([[0,0],[0,360],[640,360],[640,0]]).reshape(-1, 1, 2)
61
62         dst = cv2.perspectiveTransform(pts,matrix)
63         cv2.polylines(imgWebcam,[np.int32(dst)],True,(255,0,255),3)
64
65         imgWarp = cv2.warpPerspective(vidTarget,matrix, (imgWebcam.shape[1],imgWebcam.shape[0]))
66
67         cv2.fillPoly(masknew, [np.int32(dst)], (255,255,255))
68
69         maskInv = cv2.bitwise_not(masknew)
70
71         Mergecamfeed = cv2.bitwise_and(imgAug,imgAug,None, mask = maskInv[:,:,0])
72                                                                            
73         ARfinal = cv2.bitwise_or(imgWarp, Mergecamfeed)                     
74
75
76   cv2.imshow('imgTarget', imgTarget)
77   cv2.imshow('imgTargetVdo', vidTarget)
78   cv2.imshow('webcam', imgWebcam)
79   cv2.imshow('warp', imgWarp)
80   cv2.imshow('mask', masknew)
81   cv2.imshow('Modified mask', maskInv)
82   cv2.imshow('Aug Image', Mergecamfeed)
83   cv2.imshow('Augmented Reality Final O/P', ARfinal)
84   cv2.waitKey(1)
85   fcount += 1
86AttributeError: 'numpy.ndarray' object has no attribute 'set'
87vidTarget.set(cv2.CAP_PROP_POS_FRAMES,0)
88vidTarget= cv2.VideoCapture('F1racecars.mp4')
89succses, vidTarget = vidTarget.read()
90# and resize
91

That redefines vidTarget.

Source https://stackoverflow.com/questions/71143135

QUESTION

Move the centre of the force within Reality Composer scene

Asked 2022-Feb-05 at 10:59

Based on the Apples custom behaviour documentation I am able to trigger addForce for my Entity and modify the velocity of the force and also the angle where it is applied. The only problem I am facing that I would like to apply the force on the certain area of my object not always on the center.

known functionality

I can get the point where the user tapped my object, but with notifying the addForce it always triggers the force application for the centre of my object. Like this the object behaves weird and I lost the immersion of the augmented reality, is there a way to modify the point where the force is applied?

ANSWER

Answered 2022-Feb-05 at 10:59

Physics forces are applied to the model's pivot position. At the moment, neither RealityKit nor Reality Composer has the ability to change the location of an object's pivot point.

In addition to the above, you've applied Add Force behavior that pushes an object along a specific vector with the definite velocity, however, user's taps occur along the local -Z axis of the screen. Do these vectors match?

And one more note: within the Reality-family, only rigid body dynamics is possible, not soft body.

Source https://stackoverflow.com/questions/70957189

QUESTION

How do I include rows from dataframe that contain certain keywords

Asked 2022-Feb-04 at 15:47

I'm analysing reddit threads for an assignment and I only want to include threads that contain certain keywords.

I have a list of keywords: keywords <- c(addict', 'addicted', 'addiction','addictive', 'afraid' ,'anxiety','anxious','cry','crying','delusion','delusional')

The dataframe has 3 columns. I want to only include rows that contain one of the keywords in the column called title.

e.g.

title created_utc
1 Anyone have a RH wallet yet? Asking for a friend 164128421
2 Ravi Menon, managing director of the Monetary Auth... 164131283
3 Different Augmented Reality(AR) NFT apps and marke... 164134123

keywordstest2<-paste0(keywords, collapse = "|") dfsub%>% filter(grepl(keywordstest2,title))

Tried this, obvs didn't work.

Does anyone know how to do this. Thanks :D

ANSWER

Answered 2022-Feb-04 at 04:13

This should work.

1dfsub %&gt;% filter(grepl('addict|addicted|addiction|addictive|afraid|anxiety|anxious|cry|crying|delusion|delusional', title))
2

Source https://stackoverflow.com/questions/70981250

QUESTION

Jquery .resizable function - resize icon not displaying properly

Asked 2022-Jan-26 at 01:30

New to coding and doing an interview challenge.

They've asked for a dashboard made from JQuery (which I've never used before). Lots of help from W3schools and here in stack has me accomplished 100% of the functionality I need (even if the design could be improved: functionality first polish later!)

One of the bonus is to have some UI /UX functionality, so I've made the divs dragable, and I added the snip below from https://jqueryui.com/resizable/ to make the divs resizable.

1$(function()){
2$( &quot;resizable&quot; ).resizable();
3});
4

But when it runs, the little resize icon seems to do something different from the example on the page above.

Are there any ideas how I can fix it back into the resize icon, the way it is supposed to look?

1$(function()){
2$( &quot;resizable&quot; ).resizable();
3});
4var $linkID, $linkURL
5
6function changeTime(){
7    let d= new Date(); //built in JS function
8    let mm = ('0' + d.getMinutes()).slice(-2);
9    let ss = ('0' + d.getSeconds()).slice(-2);
10    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
11}
12
13setInterval(changeTime, 1000); //updates the time dynamically.
14
15//Group1
16//Click to Show functionality: group 1 
17//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
18//I am no marketer, so the text is some basic info I read on the websites.
19$(document).ready(function(){
20    $(".clickToShow").click(function(){
21        $(".clickToShowBlock").hide();
22        let idTag = '#' + this.getAttribute("title");        
23      $(idTag).toggle();
24    });
25  });
26
27//Group 2
28//Same as above, except using hover instead of click to show the images.
29
30$(document).ready(function(){    
31    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
32        $(idTag).show();
33      }, function(){let idTag = '#' + this.getAttribute("title");
34        $(idTag).hide();      
35      $(".hoverToShowBlock").hide();
36    });
37  });
38
39  //Group3
40  //follows group 1 method, but loads all links at the same time by toggling a button.
41  
42$(document).ready(function(){
43    $("#showLinksButton").click(function(){        
44      $(".showLinks").toggle();
45    });
46  });
47
48  $(function(){
49    $("#showLinksButton").click(function () {
50       $(this).text(function(i, text){
51           return text === "Show Links" ? "Hide Links" : "Show Links";
52       })
53    });
54 })
55 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
56
57 //Group4
58 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
59// http://jsfiddle.net/mblase75/wE4S8/
60//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
61$(document).ready(function (){
62    var elements =$("#aviationLinks li");
63    var index=0;
64    var showTwo = function (index) {
65        if (index &gt;=elements.length){
66            index = 0
67        }
68        elements.hide().slice(index, index+2).show();
69        setTimeout(function(){
70            showTwo(index +2)
71        }, 5000);
72        }
73        showTwo(0);
74    });
75
76//Make key-value pairs on id and hyperlinks
77const linkIDref = {
78    delphiInfo:"https://delphitechcorp.com/",
79    vrCityInfo:"https://vrcity.ca/",
80    auroraInfo:"https://auroraaerial.aero",
81    virbelaURL:"https://virbela.com",
82    amazonURL:"https://amazon.com",
83    moodleURL:"https://moodle.org",
84    xPlaneURL:"https://x-plane.com",
85    wordpressURL:"https://wordpress.org",
86    gitHub:"https://github.com",
87    googleMeet:"https://meet.google.com",
88    slack:"https://slack.com",
89    wrike:"https://wrike.com",
90    airbus:"https://airbus.com",
91    boeing:"https://boeing.com",
92    lockheedMartin:"https://lockheedmartin.com",
93    rtx:"https://rtx.com",
94    geAviation:"https://geaviation.com",
95    safran:"https://safran-group.com",
96    leonardo:"https://leonardocompany.com",
97    baseSystems:"https://baesystems.com"
98}
99//use key-values to populate the dynamic hyperlink functionality.
100jQuery(".link").click(function(){
101    $linkID = $(this).attr("id");
102    window.location.href=linkIDref[$linkID];
103})
104
105$( function() {
106    $( ".groups" ).draggable();
107  } );
108  
109  $( function() {
110    $( ".groups" ).resizable();
111  } );
1$(function()){
2$( &quot;resizable&quot; ).resizable();
3});
4var $linkID, $linkURL
5
6function changeTime(){
7    let d= new Date(); //built in JS function
8    let mm = ('0' + d.getMinutes()).slice(-2);
9    let ss = ('0' + d.getSeconds()).slice(-2);
10    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
11}
12
13setInterval(changeTime, 1000); //updates the time dynamically.
14
15//Group1
16//Click to Show functionality: group 1 
17//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
18//I am no marketer, so the text is some basic info I read on the websites.
19$(document).ready(function(){
20    $(".clickToShow").click(function(){
21        $(".clickToShowBlock").hide();
22        let idTag = '#' + this.getAttribute("title");        
23      $(idTag).toggle();
24    });
25  });
26
27//Group 2
28//Same as above, except using hover instead of click to show the images.
29
30$(document).ready(function(){    
31    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
32        $(idTag).show();
33      }, function(){let idTag = '#' + this.getAttribute("title");
34        $(idTag).hide();      
35      $(".hoverToShowBlock").hide();
36    });
37  });
38
39  //Group3
40  //follows group 1 method, but loads all links at the same time by toggling a button.
41  
42$(document).ready(function(){
43    $("#showLinksButton").click(function(){        
44      $(".showLinks").toggle();
45    });
46  });
47
48  $(function(){
49    $("#showLinksButton").click(function () {
50       $(this).text(function(i, text){
51           return text === "Show Links" ? "Hide Links" : "Show Links";
52       })
53    });
54 })
55 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
56
57 //Group4
58 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
59// http://jsfiddle.net/mblase75/wE4S8/
60//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
61$(document).ready(function (){
62    var elements =$("#aviationLinks li");
63    var index=0;
64    var showTwo = function (index) {
65        if (index &gt;=elements.length){
66            index = 0
67        }
68        elements.hide().slice(index, index+2).show();
69        setTimeout(function(){
70            showTwo(index +2)
71        }, 5000);
72        }
73        showTwo(0);
74    });
75
76//Make key-value pairs on id and hyperlinks
77const linkIDref = {
78    delphiInfo:"https://delphitechcorp.com/",
79    vrCityInfo:"https://vrcity.ca/",
80    auroraInfo:"https://auroraaerial.aero",
81    virbelaURL:"https://virbela.com",
82    amazonURL:"https://amazon.com",
83    moodleURL:"https://moodle.org",
84    xPlaneURL:"https://x-plane.com",
85    wordpressURL:"https://wordpress.org",
86    gitHub:"https://github.com",
87    googleMeet:"https://meet.google.com",
88    slack:"https://slack.com",
89    wrike:"https://wrike.com",
90    airbus:"https://airbus.com",
91    boeing:"https://boeing.com",
92    lockheedMartin:"https://lockheedmartin.com",
93    rtx:"https://rtx.com",
94    geAviation:"https://geaviation.com",
95    safran:"https://safran-group.com",
96    leonardo:"https://leonardocompany.com",
97    baseSystems:"https://baesystems.com"
98}
99//use key-values to populate the dynamic hyperlink functionality.
100jQuery(".link").click(function(){
101    $linkID = $(this).attr("id");
102    window.location.href=linkIDref[$linkID];
103})
104
105$( function() {
106    $( ".groups" ).draggable();
107  } );
108  
109  $( function() {
110    $( ".groups" ).resizable();
111  } );body{
112    font-family: Arial, Helvetica, sans-serif;
113    font-size:1em;
114    background-color: skyblue;
115}
116h1{
117    text-align:center;
118}
119div{
120    border: black solid 2px;
121    border-radius:10px;
122}
123#main{
124    width:100%;
125    height: fit-content;
126    border:none;
127}
128#dashboard{
129    margin:auto auto auto auto;
130    display:grid;
131    border:none;
132    grid-template-columns: auto auto;
133    column-gap: 1em;
134    row-gap: 1em;
135    width:100%;
136    height:fit-content;    
137}
138#dateTime{
139    margin:1em auto 1em auto;
140    border: black solid 2px;
141    width:fit-content;
142    height:fit-content;
143    padding:1em;
144    font-size: larger;
145    font-weight: bolder;
146    background-color: snow;
147}
148.groups{
149    position: relative;
150    margin:auto auto auto auto;
151    width:35em;
152    min-width: 32.5em;
153    background-color: snow;
154    padding:0px;
155    overflow: hidden;
156}
157.groups h2{
158    position:relative;
159    top:-0.9em;
160    text-align:center;
161    background-color: blue;
162    color:white;
163    cursor:move;
164}
165ul{
166    list-style-type: none;
167    position:relative;
168    top:-0.5em;
169}
170#group1{
171    height:10em;
172}
173#group2{
174    height:10em;
175}
176.clickToShowBlock{
177    cursor:pointer;
178    display:none;
179    position:absolute;
180    top: 3.5em;
181    left:12em;
182    height:fit-content;
183    width:20em;
184    border:none;
185}
186.hoverToShowBlock{
187    display:none;
188    position:absolute;
189    top: 4em;
190    left:12em;
191    height:fit-content;
192    width:20em;
193    border:none;
194}
195.hoverToShowBlock img{
196    max-height:6em;
197    max-width:19em;
198}
199dd{
200    padding: 0.5em 0em 0.5em 0em;
201}
202.showLinks{
203    display:none;
204}
205#showLinksButton{
206    position:absolute;
207    right:0.5em;
208    top:2em;
209    font-size:2em;
210}
211li:hover{
212    cursor:pointer;
213}
214
215dd:hover{
216    cursor:pointer;
217}
218@media screen and (max-width: 1200px)
219{    
220    #dashboard{
221
222        grid-template-columns: auto;
223    }
224}
1$(function()){
2$( &quot;resizable&quot; ).resizable();
3});
4var $linkID, $linkURL
5
6function changeTime(){
7    let d= new Date(); //built in JS function
8    let mm = ('0' + d.getMinutes()).slice(-2);
9    let ss = ('0' + d.getSeconds()).slice(-2);
10    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
11}
12
13setInterval(changeTime, 1000); //updates the time dynamically.
14
15//Group1
16//Click to Show functionality: group 1 
17//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
18//I am no marketer, so the text is some basic info I read on the websites.
19$(document).ready(function(){
20    $(".clickToShow").click(function(){
21        $(".clickToShowBlock").hide();
22        let idTag = '#' + this.getAttribute("title");        
23      $(idTag).toggle();
24    });
25  });
26
27//Group 2
28//Same as above, except using hover instead of click to show the images.
29
30$(document).ready(function(){    
31    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
32        $(idTag).show();
33      }, function(){let idTag = '#' + this.getAttribute("title");
34        $(idTag).hide();      
35      $(".hoverToShowBlock").hide();
36    });
37  });
38
39  //Group3
40  //follows group 1 method, but loads all links at the same time by toggling a button.
41  
42$(document).ready(function(){
43    $("#showLinksButton").click(function(){        
44      $(".showLinks").toggle();
45    });
46  });
47
48  $(function(){
49    $("#showLinksButton").click(function () {
50       $(this).text(function(i, text){
51           return text === "Show Links" ? "Hide Links" : "Show Links";
52       })
53    });
54 })
55 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
56
57 //Group4
58 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
59// http://jsfiddle.net/mblase75/wE4S8/
60//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
61$(document).ready(function (){
62    var elements =$("#aviationLinks li");
63    var index=0;
64    var showTwo = function (index) {
65        if (index &gt;=elements.length){
66            index = 0
67        }
68        elements.hide().slice(index, index+2).show();
69        setTimeout(function(){
70            showTwo(index +2)
71        }, 5000);
72        }
73        showTwo(0);
74    });
75
76//Make key-value pairs on id and hyperlinks
77const linkIDref = {
78    delphiInfo:"https://delphitechcorp.com/",
79    vrCityInfo:"https://vrcity.ca/",
80    auroraInfo:"https://auroraaerial.aero",
81    virbelaURL:"https://virbela.com",
82    amazonURL:"https://amazon.com",
83    moodleURL:"https://moodle.org",
84    xPlaneURL:"https://x-plane.com",
85    wordpressURL:"https://wordpress.org",
86    gitHub:"https://github.com",
87    googleMeet:"https://meet.google.com",
88    slack:"https://slack.com",
89    wrike:"https://wrike.com",
90    airbus:"https://airbus.com",
91    boeing:"https://boeing.com",
92    lockheedMartin:"https://lockheedmartin.com",
93    rtx:"https://rtx.com",
94    geAviation:"https://geaviation.com",
95    safran:"https://safran-group.com",
96    leonardo:"https://leonardocompany.com",
97    baseSystems:"https://baesystems.com"
98}
99//use key-values to populate the dynamic hyperlink functionality.
100jQuery(".link").click(function(){
101    $linkID = $(this).attr("id");
102    window.location.href=linkIDref[$linkID];
103})
104
105$( function() {
106    $( ".groups" ).draggable();
107  } );
108  
109  $( function() {
110    $( ".groups" ).resizable();
111  } );body{
112    font-family: Arial, Helvetica, sans-serif;
113    font-size:1em;
114    background-color: skyblue;
115}
116h1{
117    text-align:center;
118}
119div{
120    border: black solid 2px;
121    border-radius:10px;
122}
123#main{
124    width:100%;
125    height: fit-content;
126    border:none;
127}
128#dashboard{
129    margin:auto auto auto auto;
130    display:grid;
131    border:none;
132    grid-template-columns: auto auto;
133    column-gap: 1em;
134    row-gap: 1em;
135    width:100%;
136    height:fit-content;    
137}
138#dateTime{
139    margin:1em auto 1em auto;
140    border: black solid 2px;
141    width:fit-content;
142    height:fit-content;
143    padding:1em;
144    font-size: larger;
145    font-weight: bolder;
146    background-color: snow;
147}
148.groups{
149    position: relative;
150    margin:auto auto auto auto;
151    width:35em;
152    min-width: 32.5em;
153    background-color: snow;
154    padding:0px;
155    overflow: hidden;
156}
157.groups h2{
158    position:relative;
159    top:-0.9em;
160    text-align:center;
161    background-color: blue;
162    color:white;
163    cursor:move;
164}
165ul{
166    list-style-type: none;
167    position:relative;
168    top:-0.5em;
169}
170#group1{
171    height:10em;
172}
173#group2{
174    height:10em;
175}
176.clickToShowBlock{
177    cursor:pointer;
178    display:none;
179    position:absolute;
180    top: 3.5em;
181    left:12em;
182    height:fit-content;
183    width:20em;
184    border:none;
185}
186.hoverToShowBlock{
187    display:none;
188    position:absolute;
189    top: 4em;
190    left:12em;
191    height:fit-content;
192    width:20em;
193    border:none;
194}
195.hoverToShowBlock img{
196    max-height:6em;
197    max-width:19em;
198}
199dd{
200    padding: 0.5em 0em 0.5em 0em;
201}
202.showLinks{
203    display:none;
204}
205#showLinksButton{
206    position:absolute;
207    right:0.5em;
208    top:2em;
209    font-size:2em;
210}
211li:hover{
212    cursor:pointer;
213}
214
215dd:hover{
216    cursor:pointer;
217}
218@media screen and (max-width: 1200px)
219{    
220    #dashboard{
221
222        grid-template-columns: auto;
223    }
224}&lt;!DOCTYPE html&gt;
225&lt;html lang="en"&gt;
226  &lt;head&gt;
227    &lt;script src="https://code.jquery.com/jquery-3.6.0.min.js"&gt;&lt;/script&gt;
228    &lt;script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"&gt;&lt;/script&gt;
229    &lt;link rel="stylesheet" href="stylesheet2.css"&gt;
230    &lt;meta charset="UTF-8" /&gt;
231    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
232    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
233    &lt;title&gt;Delphi Tech Corp Front-End Development Team Coding Test&lt;/title&gt;
234    &lt;script src="script2.js" defer&gt;&lt;/script&gt;
235  &lt;/head&gt;
236  &lt;body&gt;
237    &lt;h1&gt;TASK 2 Dashboard&lt;/h1&gt;
238    &lt;div id="main"&gt;
239      &lt;div id = "dateTime"&gt;&lt;/div&gt;
240      &lt;div id = "dashboard"&gt;
241        &lt;div id="group1" class = "groups"&gt;
242          &lt;h2 id="group1h2"&gt;Group 1 - Alan Zheng's Companys + Products&lt;/h2&gt; 
243          &lt;ul&gt;
244            &lt;li class="clickToShow" title = "vrCityInfo"&gt;VR City&lt;/li&gt;
245            &lt;li class="clickToShow"  title = "delphiInfo"&gt;Delphi Tech Corp&lt;/li&gt;
246            &lt;li class="clickToShow"  title = "auroraInfo"&gt;Aurora Aerial&lt;/li&gt;
247          &lt;/ul&gt;
248          &lt;div id="vrCityInfo" class="clickToShowBlock link"&gt; 
249            VR City is a virtual aviation training company. Our virtual community provides people with the learning tools to learn how to fly. 
250            &lt;br&gt;
251            https://vrcity.ca/
252          &lt;/div&gt;
253          &lt;div id="delphiInfo" class="clickToShowBlock link"&gt; 
254            Delphi Technology Corp is integrating new technologies such as augmented reality and virtuality into the aerospace and aviation industries!
255            &lt;br&gt;
256            https://delphitechcorp.com/
257          &lt;/div&gt;  
258          &lt;div id="auroraInfo" class="clickToShowBlock link"&gt;
259            Aurora Aerial offers custom drone manufacturing. We develop both drone hardware and software.
260            &lt;br&gt;
261            https://auroraaerial.aero
262          &lt;/div&gt;
263          
264        &lt;/div&gt;
265        &lt;div id="group2" class = "groups"&gt;
266          &lt;h2 id="group2h2"&gt;Group 2 - Technology products used at Delphi&lt;/h2&gt;
267          &lt;ul&gt;
268            &lt;li class="hoverToShow link" title= "virbela" id= "virbelaURL"&gt;Virbela&lt;/li&gt;
269            &lt;li class="hoverToShow link" title= "amazon" id= "amazonURL"&gt;Amazon&lt;/li&gt;
270            &lt;li class="hoverToShow link" title= "moodle" id= "moodleURL"&gt;Moodle&lt;/li&gt;
271            &lt;li class="hoverToShow link" title= "xPlane" id= "xPlaneURL"&gt;X-Plane&lt;/li&gt;
272            &lt;li class="hoverToShow link" title= "wordpress" id= "wordpressURL"&gt;Wordpress&lt;/li&gt;
273          &lt;/ul&gt;
274          
275          &lt;div id="virbela" class="hoverToShowBlock"&gt;
276            &lt;img alt="Virbela" src="Logos/5fab9393da4ffe1e20d14cc6_virbela-logo-black-website.png"&gt; 
277          &lt;/div&gt;
278          &lt;div id="amazon" class="hoverToShowBlock"&gt;
279            &lt;img alt="Amazon" src="Logos/NicePng_amazon-png_197561.png"&gt;  
280          &lt;/div&gt;  
281          &lt;div id="moodle" class="hoverToShowBlock"&gt;
282            &lt;img alt="Moodle" src="Logos/moodle_logo_small.svg"&gt;  
283          &lt;/div&gt;
284          &lt;div id="xPlane" class="hoverToShowBlock"&gt; 
285            &lt;img alt="X-Plane" src="Logos/x-plane-logo.svg"&gt; 
286          &lt;/div&gt;  
287          &lt;div id="wordpress" class="hoverToShowBlock"&gt; 
288            &lt;img alt="Virbela" src="Logos/NicePng_wordpress-logo-png_395752.png"&gt; 
289          &lt;/div&gt;
290
291        &lt;/div&gt;
292        &lt;div id="group3" class = "groups"&gt;
293          &lt;h2 id="group3h2"&gt;Group 3 - Websites used at Delphi&lt;/h2&gt;
294          &lt;ul&gt;
295            &lt;dt&gt;GitHub&lt;/dt&gt;
296              &lt;dd class="showLinks link" id="gitHub"&gt;https://github.com&lt;/dd&gt;  
297            &lt;dt&gt;Google Meet&lt;/dt&gt;
298              &lt;dd class="showLinks link" id="googleMeet"&gt;https://meet.google.com&lt;/dd&gt;
299            &lt;dt&gt;Slack&lt;/dt&gt;
300              &lt;dd class="showLinks link" id="slack"&gt;https://slack.com&lt;/dd&gt;
301            &lt;dt&gt;Wrike&lt;/dt&gt;
302              &lt;dd class="showLinks link" id="wrike"&gt;https://wrike.com&lt;/dd&gt;    
303          &lt;/ul&gt;
304          &lt;button id="showLinksButton"&gt;Show Links&lt;/button&gt;
305        &lt;/div&gt;
306        &lt;div id="group4" class = "groups"&gt;
307          &lt;h2 id="group4h2"&gt;Group 4 - Aerospace Companies&lt;/h2&gt;
308
309          &lt;ul id="aviationLinks"&gt;
310            &lt;li class = "cycle link" id="airbus"&gt;airbus.com&lt;/li&gt; 
311            &lt;li class = "cycle link" id="boeing"&gt;boeing.com&lt;/li&gt;
312            &lt;li class = "cycle link" id="lockheedMartin"&gt;lockheedmartin.com&lt;/li&gt;
313            &lt;li class = "cycle link" id="rtx"&gt;rtx.com&lt;/li&gt;
314            &lt;li class = "cycle link" id="geAviation"&gt;geaviation.com&lt;/li&gt;
315            &lt;li class = "cycle link" id="safran"&gt;safran-group.com&lt;/li&gt;
316            &lt;li class = "cycle link" id="leonardo"&gt;leonardocompany.com&lt;/li&gt;
317            &lt;li class = "cycle link" id="baseSystems"&gt;baesystems.com&lt;/li&gt;
318          &lt;/ul&gt;
319        &lt;/div&gt;
320      &lt;/div&gt;
321    &lt;/div&gt;
322  &lt;/body&gt;
323&lt;/html&gt;

enter image description here

ANSWER

Answered 2021-Dec-18 at 21:46

You simply did not use the jQuery-ui CSS file...

1$(function()){
2$( &quot;resizable&quot; ).resizable();
3});
4var $linkID, $linkURL
5
6function changeTime(){
7    let d= new Date(); //built in JS function
8    let mm = ('0' + d.getMinutes()).slice(-2);
9    let ss = ('0' + d.getSeconds()).slice(-2);
10    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
11}
12
13setInterval(changeTime, 1000); //updates the time dynamically.
14
15//Group1
16//Click to Show functionality: group 1 
17//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
18//I am no marketer, so the text is some basic info I read on the websites.
19$(document).ready(function(){
20    $(".clickToShow").click(function(){
21        $(".clickToShowBlock").hide();
22        let idTag = '#' + this.getAttribute("title");        
23      $(idTag).toggle();
24    });
25  });
26
27//Group 2
28//Same as above, except using hover instead of click to show the images.
29
30$(document).ready(function(){    
31    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
32        $(idTag).show();
33      }, function(){let idTag = '#' + this.getAttribute("title");
34        $(idTag).hide();      
35      $(".hoverToShowBlock").hide();
36    });
37  });
38
39  //Group3
40  //follows group 1 method, but loads all links at the same time by toggling a button.
41  
42$(document).ready(function(){
43    $("#showLinksButton").click(function(){        
44      $(".showLinks").toggle();
45    });
46  });
47
48  $(function(){
49    $("#showLinksButton").click(function () {
50       $(this).text(function(i, text){
51           return text === "Show Links" ? "Hide Links" : "Show Links";
52       })
53    });
54 })
55 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
56
57 //Group4
58 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
59// http://jsfiddle.net/mblase75/wE4S8/
60//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
61$(document).ready(function (){
62    var elements =$("#aviationLinks li");
63    var index=0;
64    var showTwo = function (index) {
65        if (index &gt;=elements.length){
66            index = 0
67        }
68        elements.hide().slice(index, index+2).show();
69        setTimeout(function(){
70            showTwo(index +2)
71        }, 5000);
72        }
73        showTwo(0);
74    });
75
76//Make key-value pairs on id and hyperlinks
77const linkIDref = {
78    delphiInfo:"https://delphitechcorp.com/",
79    vrCityInfo:"https://vrcity.ca/",
80    auroraInfo:"https://auroraaerial.aero",
81    virbelaURL:"https://virbela.com",
82    amazonURL:"https://amazon.com",
83    moodleURL:"https://moodle.org",
84    xPlaneURL:"https://x-plane.com",
85    wordpressURL:"https://wordpress.org",
86    gitHub:"https://github.com",
87    googleMeet:"https://meet.google.com",
88    slack:"https://slack.com",
89    wrike:"https://wrike.com",
90    airbus:"https://airbus.com",
91    boeing:"https://boeing.com",
92    lockheedMartin:"https://lockheedmartin.com",
93    rtx:"https://rtx.com",
94    geAviation:"https://geaviation.com",
95    safran:"https://safran-group.com",
96    leonardo:"https://leonardocompany.com",
97    baseSystems:"https://baesystems.com"
98}
99//use key-values to populate the dynamic hyperlink functionality.
100jQuery(".link").click(function(){
101    $linkID = $(this).attr("id");
102    window.location.href=linkIDref[$linkID];
103})
104
105$( function() {
106    $( ".groups" ).draggable();
107  } );
108  
109  $( function() {
110    $( ".groups" ).resizable();
111  } );body{
112    font-family: Arial, Helvetica, sans-serif;
113    font-size:1em;
114    background-color: skyblue;
115}
116h1{
117    text-align:center;
118}
119div{
120    border: black solid 2px;
121    border-radius:10px;
122}
123#main{
124    width:100%;
125    height: fit-content;
126    border:none;
127}
128#dashboard{
129    margin:auto auto auto auto;
130    display:grid;
131    border:none;
132    grid-template-columns: auto auto;
133    column-gap: 1em;
134    row-gap: 1em;
135    width:100%;
136    height:fit-content;    
137}
138#dateTime{
139    margin:1em auto 1em auto;
140    border: black solid 2px;
141    width:fit-content;
142    height:fit-content;
143    padding:1em;
144    font-size: larger;
145    font-weight: bolder;
146    background-color: snow;
147}
148.groups{
149    position: relative;
150    margin:auto auto auto auto;
151    width:35em;
152    min-width: 32.5em;
153    background-color: snow;
154    padding:0px;
155    overflow: hidden;
156}
157.groups h2{
158    position:relative;
159    top:-0.9em;
160    text-align:center;
161    background-color: blue;
162    color:white;
163    cursor:move;
164}
165ul{
166    list-style-type: none;
167    position:relative;
168    top:-0.5em;
169}
170#group1{
171    height:10em;
172}
173#group2{
174    height:10em;
175}
176.clickToShowBlock{
177    cursor:pointer;
178    display:none;
179    position:absolute;
180    top: 3.5em;
181    left:12em;
182    height:fit-content;
183    width:20em;
184    border:none;
185}
186.hoverToShowBlock{
187    display:none;
188    position:absolute;
189    top: 4em;
190    left:12em;
191    height:fit-content;
192    width:20em;
193    border:none;
194}
195.hoverToShowBlock img{
196    max-height:6em;
197    max-width:19em;
198}
199dd{
200    padding: 0.5em 0em 0.5em 0em;
201}
202.showLinks{
203    display:none;
204}
205#showLinksButton{
206    position:absolute;
207    right:0.5em;
208    top:2em;
209    font-size:2em;
210}
211li:hover{
212    cursor:pointer;
213}
214
215dd:hover{
216    cursor:pointer;
217}
218@media screen and (max-width: 1200px)
219{    
220    #dashboard{
221
222        grid-template-columns: auto;
223    }
224}&lt;!DOCTYPE html&gt;
225&lt;html lang="en"&gt;
226  &lt;head&gt;
227    &lt;script src="https://code.jquery.com/jquery-3.6.0.min.js"&gt;&lt;/script&gt;
228    &lt;script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"&gt;&lt;/script&gt;
229    &lt;link rel="stylesheet" href="stylesheet2.css"&gt;
230    &lt;meta charset="UTF-8" /&gt;
231    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
232    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
233    &lt;title&gt;Delphi Tech Corp Front-End Development Team Coding Test&lt;/title&gt;
234    &lt;script src="script2.js" defer&gt;&lt;/script&gt;
235  &lt;/head&gt;
236  &lt;body&gt;
237    &lt;h1&gt;TASK 2 Dashboard&lt;/h1&gt;
238    &lt;div id="main"&gt;
239      &lt;div id = "dateTime"&gt;&lt;/div&gt;
240      &lt;div id = "dashboard"&gt;
241        &lt;div id="group1" class = "groups"&gt;
242          &lt;h2 id="group1h2"&gt;Group 1 - Alan Zheng's Companys + Products&lt;/h2&gt; 
243          &lt;ul&gt;
244            &lt;li class="clickToShow" title = "vrCityInfo"&gt;VR City&lt;/li&gt;
245            &lt;li class="clickToShow"  title = "delphiInfo"&gt;Delphi Tech Corp&lt;/li&gt;
246            &lt;li class="clickToShow"  title = "auroraInfo"&gt;Aurora Aerial&lt;/li&gt;
247          &lt;/ul&gt;
248          &lt;div id="vrCityInfo" class="clickToShowBlock link"&gt; 
249            VR City is a virtual aviation training company. Our virtual community provides people with the learning tools to learn how to fly. 
250            &lt;br&gt;
251            https://vrcity.ca/
252          &lt;/div&gt;
253          &lt;div id="delphiInfo" class="clickToShowBlock link"&gt; 
254            Delphi Technology Corp is integrating new technologies such as augmented reality and virtuality into the aerospace and aviation industries!
255            &lt;br&gt;
256            https://delphitechcorp.com/
257          &lt;/div&gt;  
258          &lt;div id="auroraInfo" class="clickToShowBlock link"&gt;
259            Aurora Aerial offers custom drone manufacturing. We develop both drone hardware and software.
260            &lt;br&gt;
261            https://auroraaerial.aero
262          &lt;/div&gt;
263          
264        &lt;/div&gt;
265        &lt;div id="group2" class = "groups"&gt;
266          &lt;h2 id="group2h2"&gt;Group 2 - Technology products used at Delphi&lt;/h2&gt;
267          &lt;ul&gt;
268            &lt;li class="hoverToShow link" title= "virbela" id= "virbelaURL"&gt;Virbela&lt;/li&gt;
269            &lt;li class="hoverToShow link" title= "amazon" id= "amazonURL"&gt;Amazon&lt;/li&gt;
270            &lt;li class="hoverToShow link" title= "moodle" id= "moodleURL"&gt;Moodle&lt;/li&gt;
271            &lt;li class="hoverToShow link" title= "xPlane" id= "xPlaneURL"&gt;X-Plane&lt;/li&gt;
272            &lt;li class="hoverToShow link" title= "wordpress" id= "wordpressURL"&gt;Wordpress&lt;/li&gt;
273          &lt;/ul&gt;
274          
275          &lt;div id="virbela" class="hoverToShowBlock"&gt;
276            &lt;img alt="Virbela" src="Logos/5fab9393da4ffe1e20d14cc6_virbela-logo-black-website.png"&gt; 
277          &lt;/div&gt;
278          &lt;div id="amazon" class="hoverToShowBlock"&gt;
279            &lt;img alt="Amazon" src="Logos/NicePng_amazon-png_197561.png"&gt;  
280          &lt;/div&gt;  
281          &lt;div id="moodle" class="hoverToShowBlock"&gt;
282            &lt;img alt="Moodle" src="Logos/moodle_logo_small.svg"&gt;  
283          &lt;/div&gt;
284          &lt;div id="xPlane" class="hoverToShowBlock"&gt; 
285            &lt;img alt="X-Plane" src="Logos/x-plane-logo.svg"&gt; 
286          &lt;/div&gt;  
287          &lt;div id="wordpress" class="hoverToShowBlock"&gt; 
288            &lt;img alt="Virbela" src="Logos/NicePng_wordpress-logo-png_395752.png"&gt; 
289          &lt;/div&gt;
290
291        &lt;/div&gt;
292        &lt;div id="group3" class = "groups"&gt;
293          &lt;h2 id="group3h2"&gt;Group 3 - Websites used at Delphi&lt;/h2&gt;
294          &lt;ul&gt;
295            &lt;dt&gt;GitHub&lt;/dt&gt;
296              &lt;dd class="showLinks link" id="gitHub"&gt;https://github.com&lt;/dd&gt;  
297            &lt;dt&gt;Google Meet&lt;/dt&gt;
298              &lt;dd class="showLinks link" id="googleMeet"&gt;https://meet.google.com&lt;/dd&gt;
299            &lt;dt&gt;Slack&lt;/dt&gt;
300              &lt;dd class="showLinks link" id="slack"&gt;https://slack.com&lt;/dd&gt;
301            &lt;dt&gt;Wrike&lt;/dt&gt;
302              &lt;dd class="showLinks link" id="wrike"&gt;https://wrike.com&lt;/dd&gt;    
303          &lt;/ul&gt;
304          &lt;button id="showLinksButton"&gt;Show Links&lt;/button&gt;
305        &lt;/div&gt;
306        &lt;div id="group4" class = "groups"&gt;
307          &lt;h2 id="group4h2"&gt;Group 4 - Aerospace Companies&lt;/h2&gt;
308
309          &lt;ul id="aviationLinks"&gt;
310            &lt;li class = "cycle link" id="airbus"&gt;airbus.com&lt;/li&gt; 
311            &lt;li class = "cycle link" id="boeing"&gt;boeing.com&lt;/li&gt;
312            &lt;li class = "cycle link" id="lockheedMartin"&gt;lockheedmartin.com&lt;/li&gt;
313            &lt;li class = "cycle link" id="rtx"&gt;rtx.com&lt;/li&gt;
314            &lt;li class = "cycle link" id="geAviation"&gt;geaviation.com&lt;/li&gt;
315            &lt;li class = "cycle link" id="safran"&gt;safran-group.com&lt;/li&gt;
316            &lt;li class = "cycle link" id="leonardo"&gt;leonardocompany.com&lt;/li&gt;
317            &lt;li class = "cycle link" id="baseSystems"&gt;baesystems.com&lt;/li&gt;
318          &lt;/ul&gt;
319        &lt;/div&gt;
320      &lt;/div&gt;
321    &lt;/div&gt;
322  &lt;/body&gt;
323&lt;/html&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;//code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css&quot;&gt;
324

And you have a way too "wide" rule on div. So specific to the rezise handles, it needed an exception using the :not() selector.

1$(function()){
2$( &quot;resizable&quot; ).resizable();
3});
4var $linkID, $linkURL
5
6function changeTime(){
7    let d= new Date(); //built in JS function
8    let mm = ('0' + d.getMinutes()).slice(-2);
9    let ss = ('0' + d.getSeconds()).slice(-2);
10    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
11}
12
13setInterval(changeTime, 1000); //updates the time dynamically.
14
15//Group1
16//Click to Show functionality: group 1 
17//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
18//I am no marketer, so the text is some basic info I read on the websites.
19$(document).ready(function(){
20    $(".clickToShow").click(function(){
21        $(".clickToShowBlock").hide();
22        let idTag = '#' + this.getAttribute("title");        
23      $(idTag).toggle();
24    });
25  });
26
27//Group 2
28//Same as above, except using hover instead of click to show the images.
29
30$(document).ready(function(){    
31    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
32        $(idTag).show();
33      }, function(){let idTag = '#' + this.getAttribute("title");
34        $(idTag).hide();      
35      $(".hoverToShowBlock").hide();
36    });
37  });
38
39  //Group3
40  //follows group 1 method, but loads all links at the same time by toggling a button.
41  
42$(document).ready(function(){
43    $("#showLinksButton").click(function(){        
44      $(".showLinks").toggle();
45    });
46  });
47
48  $(function(){
49    $("#showLinksButton").click(function () {
50       $(this).text(function(i, text){
51           return text === "Show Links" ? "Hide Links" : "Show Links";
52       })
53    });
54 })
55 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
56
57 //Group4
58 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
59// http://jsfiddle.net/mblase75/wE4S8/
60//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
61$(document).ready(function (){
62    var elements =$("#aviationLinks li");
63    var index=0;
64    var showTwo = function (index) {
65        if (index &gt;=elements.length){
66            index = 0
67        }
68        elements.hide().slice(index, index+2).show();
69        setTimeout(function(){
70            showTwo(index +2)
71        }, 5000);
72        }
73        showTwo(0);
74    });
75
76//Make key-value pairs on id and hyperlinks
77const linkIDref = {
78    delphiInfo:"https://delphitechcorp.com/",
79    vrCityInfo:"https://vrcity.ca/",
80    auroraInfo:"https://auroraaerial.aero",
81    virbelaURL:"https://virbela.com",
82    amazonURL:"https://amazon.com",
83    moodleURL:"https://moodle.org",
84    xPlaneURL:"https://x-plane.com",
85    wordpressURL:"https://wordpress.org",
86    gitHub:"https://github.com",
87    googleMeet:"https://meet.google.com",
88    slack:"https://slack.com",
89    wrike:"https://wrike.com",
90    airbus:"https://airbus.com",
91    boeing:"https://boeing.com",
92    lockheedMartin:"https://lockheedmartin.com",
93    rtx:"https://rtx.com",
94    geAviation:"https://geaviation.com",
95    safran:"https://safran-group.com",
96    leonardo:"https://leonardocompany.com",
97    baseSystems:"https://baesystems.com"
98}
99//use key-values to populate the dynamic hyperlink functionality.
100jQuery(".link").click(function(){
101    $linkID = $(this).attr("id");
102    window.location.href=linkIDref[$linkID];
103})
104
105$( function() {
106    $( ".groups" ).draggable();
107  } );
108  
109  $( function() {
110    $( ".groups" ).resizable();
111  } );body{
112    font-family: Arial, Helvetica, sans-serif;
113    font-size:1em;
114    background-color: skyblue;
115}
116h1{
117    text-align:center;
118}
119div{
120    border: black solid 2px;
121    border-radius:10px;
122}
123#main{
124    width:100%;
125    height: fit-content;
126    border:none;
127}
128#dashboard{
129    margin:auto auto auto auto;
130    display:grid;
131    border:none;
132    grid-template-columns: auto auto;
133    column-gap: 1em;
134    row-gap: 1em;
135    width:100%;
136    height:fit-content;    
137}
138#dateTime{
139    margin:1em auto 1em auto;
140    border: black solid 2px;
141    width:fit-content;
142    height:fit-content;
143    padding:1em;
144    font-size: larger;
145    font-weight: bolder;
146    background-color: snow;
147}
148.groups{
149    position: relative;
150    margin:auto auto auto auto;
151    width:35em;
152    min-width: 32.5em;
153    background-color: snow;
154    padding:0px;
155    overflow: hidden;
156}
157.groups h2{
158    position:relative;
159    top:-0.9em;
160    text-align:center;
161    background-color: blue;
162    color:white;
163    cursor:move;
164}
165ul{
166    list-style-type: none;
167    position:relative;
168    top:-0.5em;
169}
170#group1{
171    height:10em;
172}
173#group2{
174    height:10em;
175}
176.clickToShowBlock{
177    cursor:pointer;
178    display:none;
179    position:absolute;
180    top: 3.5em;
181    left:12em;
182    height:fit-content;
183    width:20em;
184    border:none;
185}
186.hoverToShowBlock{
187    display:none;
188    position:absolute;
189    top: 4em;
190    left:12em;
191    height:fit-content;
192    width:20em;
193    border:none;
194}
195.hoverToShowBlock img{
196    max-height:6em;
197    max-width:19em;
198}
199dd{
200    padding: 0.5em 0em 0.5em 0em;
201}
202.showLinks{
203    display:none;
204}
205#showLinksButton{
206    position:absolute;
207    right:0.5em;
208    top:2em;
209    font-size:2em;
210}
211li:hover{
212    cursor:pointer;
213}
214
215dd:hover{
216    cursor:pointer;
217}
218@media screen and (max-width: 1200px)
219{    
220    #dashboard{
221
222        grid-template-columns: auto;
223    }
224}&lt;!DOCTYPE html&gt;
225&lt;html lang="en"&gt;
226  &lt;head&gt;
227    &lt;script src="https://code.jquery.com/jquery-3.6.0.min.js"&gt;&lt;/script&gt;
228    &lt;script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"&gt;&lt;/script&gt;
229    &lt;link rel="stylesheet" href="stylesheet2.css"&gt;
230    &lt;meta charset="UTF-8" /&gt;
231    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
232    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
233    &lt;title&gt;Delphi Tech Corp Front-End Development Team Coding Test&lt;/title&gt;
234    &lt;script src="script2.js" defer&gt;&lt;/script&gt;
235  &lt;/head&gt;
236  &lt;body&gt;
237    &lt;h1&gt;TASK 2 Dashboard&lt;/h1&gt;
238    &lt;div id="main"&gt;
239      &lt;div id = "dateTime"&gt;&lt;/div&gt;
240      &lt;div id = "dashboard"&gt;
241        &lt;div id="group1" class = "groups"&gt;
242          &lt;h2 id="group1h2"&gt;Group 1 - Alan Zheng's Companys + Products&lt;/h2&gt; 
243          &lt;ul&gt;
244            &lt;li class="clickToShow" title = "vrCityInfo"&gt;VR City&lt;/li&gt;
245            &lt;li class="clickToShow"  title = "delphiInfo"&gt;Delphi Tech Corp&lt;/li&gt;
246            &lt;li class="clickToShow"  title = "auroraInfo"&gt;Aurora Aerial&lt;/li&gt;
247          &lt;/ul&gt;
248          &lt;div id="vrCityInfo" class="clickToShowBlock link"&gt; 
249            VR City is a virtual aviation training company. Our virtual community provides people with the learning tools to learn how to fly. 
250            &lt;br&gt;
251            https://vrcity.ca/
252          &lt;/div&gt;
253          &lt;div id="delphiInfo" class="clickToShowBlock link"&gt; 
254            Delphi Technology Corp is integrating new technologies such as augmented reality and virtuality into the aerospace and aviation industries!
255            &lt;br&gt;
256            https://delphitechcorp.com/
257          &lt;/div&gt;  
258          &lt;div id="auroraInfo" class="clickToShowBlock link"&gt;
259            Aurora Aerial offers custom drone manufacturing. We develop both drone hardware and software.
260            &lt;br&gt;
261            https://auroraaerial.aero
262          &lt;/div&gt;
263          
264        &lt;/div&gt;
265        &lt;div id="group2" class = "groups"&gt;
266          &lt;h2 id="group2h2"&gt;Group 2 - Technology products used at Delphi&lt;/h2&gt;
267          &lt;ul&gt;
268            &lt;li class="hoverToShow link" title= "virbela" id= "virbelaURL"&gt;Virbela&lt;/li&gt;
269            &lt;li class="hoverToShow link" title= "amazon" id= "amazonURL"&gt;Amazon&lt;/li&gt;
270            &lt;li class="hoverToShow link" title= "moodle" id= "moodleURL"&gt;Moodle&lt;/li&gt;
271            &lt;li class="hoverToShow link" title= "xPlane" id= "xPlaneURL"&gt;X-Plane&lt;/li&gt;
272            &lt;li class="hoverToShow link" title= "wordpress" id= "wordpressURL"&gt;Wordpress&lt;/li&gt;
273          &lt;/ul&gt;
274          
275          &lt;div id="virbela" class="hoverToShowBlock"&gt;
276            &lt;img alt="Virbela" src="Logos/5fab9393da4ffe1e20d14cc6_virbela-logo-black-website.png"&gt; 
277          &lt;/div&gt;
278          &lt;div id="amazon" class="hoverToShowBlock"&gt;
279            &lt;img alt="Amazon" src="Logos/NicePng_amazon-png_197561.png"&gt;  
280          &lt;/div&gt;  
281          &lt;div id="moodle" class="hoverToShowBlock"&gt;
282            &lt;img alt="Moodle" src="Logos/moodle_logo_small.svg"&gt;  
283          &lt;/div&gt;
284          &lt;div id="xPlane" class="hoverToShowBlock"&gt; 
285            &lt;img alt="X-Plane" src="Logos/x-plane-logo.svg"&gt; 
286          &lt;/div&gt;  
287          &lt;div id="wordpress" class="hoverToShowBlock"&gt; 
288            &lt;img alt="Virbela" src="Logos/NicePng_wordpress-logo-png_395752.png"&gt; 
289          &lt;/div&gt;
290
291        &lt;/div&gt;
292        &lt;div id="group3" class = "groups"&gt;
293          &lt;h2 id="group3h2"&gt;Group 3 - Websites used at Delphi&lt;/h2&gt;
294          &lt;ul&gt;
295            &lt;dt&gt;GitHub&lt;/dt&gt;
296              &lt;dd class="showLinks link" id="gitHub"&gt;https://github.com&lt;/dd&gt;  
297            &lt;dt&gt;Google Meet&lt;/dt&gt;
298              &lt;dd class="showLinks link" id="googleMeet"&gt;https://meet.google.com&lt;/dd&gt;
299            &lt;dt&gt;Slack&lt;/dt&gt;
300              &lt;dd class="showLinks link" id="slack"&gt;https://slack.com&lt;/dd&gt;
301            &lt;dt&gt;Wrike&lt;/dt&gt;
302              &lt;dd class="showLinks link" id="wrike"&gt;https://wrike.com&lt;/dd&gt;    
303          &lt;/ul&gt;
304          &lt;button id="showLinksButton"&gt;Show Links&lt;/button&gt;
305        &lt;/div&gt;
306        &lt;div id="group4" class = "groups"&gt;
307          &lt;h2 id="group4h2"&gt;Group 4 - Aerospace Companies&lt;/h2&gt;
308
309          &lt;ul id="aviationLinks"&gt;
310            &lt;li class = "cycle link" id="airbus"&gt;airbus.com&lt;/li&gt; 
311            &lt;li class = "cycle link" id="boeing"&gt;boeing.com&lt;/li&gt;
312            &lt;li class = "cycle link" id="lockheedMartin"&gt;lockheedmartin.com&lt;/li&gt;
313            &lt;li class = "cycle link" id="rtx"&gt;rtx.com&lt;/li&gt;
314            &lt;li class = "cycle link" id="geAviation"&gt;geaviation.com&lt;/li&gt;
315            &lt;li class = "cycle link" id="safran"&gt;safran-group.com&lt;/li&gt;
316            &lt;li class = "cycle link" id="leonardo"&gt;leonardocompany.com&lt;/li&gt;
317            &lt;li class = "cycle link" id="baseSystems"&gt;baesystems.com&lt;/li&gt;
318          &lt;/ul&gt;
319        &lt;/div&gt;
320      &lt;/div&gt;
321    &lt;/div&gt;
322  &lt;/body&gt;
323&lt;/html&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;//code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css&quot;&gt;
324div:not(.ui-resizable-handle){
325

1$(function()){
2$( &quot;resizable&quot; ).resizable();
3});
4var $linkID, $linkURL
5
6function changeTime(){
7    let d= new Date(); //built in JS function
8    let mm = ('0' + d.getMinutes()).slice(-2);
9    let ss = ('0' + d.getSeconds()).slice(-2);
10    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
11}
12
13setInterval(changeTime, 1000); //updates the time dynamically.
14
15//Group1
16//Click to Show functionality: group 1 
17//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
18//I am no marketer, so the text is some basic info I read on the websites.
19$(document).ready(function(){
20    $(".clickToShow").click(function(){
21        $(".clickToShowBlock").hide();
22        let idTag = '#' + this.getAttribute("title");        
23      $(idTag).toggle();
24    });
25  });
26
27//Group 2
28//Same as above, except using hover instead of click to show the images.
29
30$(document).ready(function(){    
31    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
32        $(idTag).show();
33      }, function(){let idTag = '#' + this.getAttribute("title");
34        $(idTag).hide();      
35      $(".hoverToShowBlock").hide();
36    });
37  });
38
39  //Group3
40  //follows group 1 method, but loads all links at the same time by toggling a button.
41  
42$(document).ready(function(){
43    $("#showLinksButton").click(function(){        
44      $(".showLinks").toggle();
45    });
46  });
47
48  $(function(){
49    $("#showLinksButton").click(function () {
50       $(this).text(function(i, text){
51           return text === "Show Links" ? "Hide Links" : "Show Links";
52       })
53    });
54 })
55 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
56
57 //Group4
58 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
59// http://jsfiddle.net/mblase75/wE4S8/
60//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
61$(document).ready(function (){
62    var elements =$("#aviationLinks li");
63    var index=0;
64    var showTwo = function (index) {
65        if (index &gt;=elements.length){
66            index = 0
67        }
68        elements.hide().slice(index, index+2).show();
69        setTimeout(function(){
70            showTwo(index +2)
71        }, 5000);
72        }
73        showTwo(0);
74    });
75
76//Make key-value pairs on id and hyperlinks
77const linkIDref = {
78    delphiInfo:"https://delphitechcorp.com/",
79    vrCityInfo:"https://vrcity.ca/",
80    auroraInfo:"https://auroraaerial.aero",
81    virbelaURL:"https://virbela.com",
82    amazonURL:"https://amazon.com",
83    moodleURL:"https://moodle.org",
84    xPlaneURL:"https://x-plane.com",
85    wordpressURL:"https://wordpress.org",
86    gitHub:"https://github.com",
87    googleMeet:"https://meet.google.com",
88    slack:"https://slack.com",
89    wrike:"https://wrike.com",
90    airbus:"https://airbus.com",
91    boeing:"https://boeing.com",
92    lockheedMartin:"https://lockheedmartin.com",
93    rtx:"https://rtx.com",
94    geAviation:"https://geaviation.com",
95    safran:"https://safran-group.com",
96    leonardo:"https://leonardocompany.com",
97    baseSystems:"https://baesystems.com"
98}
99//use key-values to populate the dynamic hyperlink functionality.
100jQuery(".link").click(function(){
101    $linkID = $(this).attr("id");
102    window.location.href=linkIDref[$linkID];
103})
104
105$( function() {
106    $( ".groups" ).draggable();
107  } );
108  
109  $( function() {
110    $( ".groups" ).resizable();
111  } );body{
112    font-family: Arial, Helvetica, sans-serif;
113    font-size:1em;
114    background-color: skyblue;
115}
116h1{
117    text-align:center;
118}
119div{
120    border: black solid 2px;
121    border-radius:10px;
122}
123#main{
124    width:100%;
125    height: fit-content;
126    border:none;
127}
128#dashboard{
129    margin:auto auto auto auto;
130    display:grid;
131    border:none;
132    grid-template-columns: auto auto;
133    column-gap: 1em;
134    row-gap: 1em;
135    width:100%;
136    height:fit-content;    
137}
138#dateTime{
139    margin:1em auto 1em auto;
140    border: black solid 2px;
141    width:fit-content;
142    height:fit-content;
143    padding:1em;
144    font-size: larger;
145    font-weight: bolder;
146    background-color: snow;
147}
148.groups{
149    position: relative;
150    margin:auto auto auto auto;
151    width:35em;
152    min-width: 32.5em;
153    background-color: snow;
154    padding:0px;
155    overflow: hidden;
156}
157.groups h2{
158    position:relative;
159    top:-0.9em;
160    text-align:center;
161    background-color: blue;
162    color:white;
163    cursor:move;
164}
165ul{
166    list-style-type: none;
167    position:relative;
168    top:-0.5em;
169}
170#group1{
171    height:10em;
172}
173#group2{
174    height:10em;
175}
176.clickToShowBlock{
177    cursor:pointer;
178    display:none;
179    position:absolute;
180    top: 3.5em;
181    left:12em;
182    height:fit-content;
183    width:20em;
184    border:none;
185}
186.hoverToShowBlock{
187    display:none;
188    position:absolute;
189    top: 4em;
190    left:12em;
191    height:fit-content;
192    width:20em;
193    border:none;
194}
195.hoverToShowBlock img{
196    max-height:6em;
197    max-width:19em;
198}
199dd{
200    padding: 0.5em 0em 0.5em 0em;
201}
202.showLinks{
203    display:none;
204}
205#showLinksButton{
206    position:absolute;
207    right:0.5em;
208    top:2em;
209    font-size:2em;
210}
211li:hover{
212    cursor:pointer;
213}
214
215dd:hover{
216    cursor:pointer;
217}
218@media screen and (max-width: 1200px)
219{    
220    #dashboard{
221
222        grid-template-columns: auto;
223    }
224}&lt;!DOCTYPE html&gt;
225&lt;html lang="en"&gt;
226  &lt;head&gt;
227    &lt;script src="https://code.jquery.com/jquery-3.6.0.min.js"&gt;&lt;/script&gt;
228    &lt;script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"&gt;&lt;/script&gt;
229    &lt;link rel="stylesheet" href="stylesheet2.css"&gt;
230    &lt;meta charset="UTF-8" /&gt;
231    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
232    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
233    &lt;title&gt;Delphi Tech Corp Front-End Development Team Coding Test&lt;/title&gt;
234    &lt;script src="script2.js" defer&gt;&lt;/script&gt;
235  &lt;/head&gt;
236  &lt;body&gt;
237    &lt;h1&gt;TASK 2 Dashboard&lt;/h1&gt;
238    &lt;div id="main"&gt;
239      &lt;div id = "dateTime"&gt;&lt;/div&gt;
240      &lt;div id = "dashboard"&gt;
241        &lt;div id="group1" class = "groups"&gt;
242          &lt;h2 id="group1h2"&gt;Group 1 - Alan Zheng's Companys + Products&lt;/h2&gt; 
243          &lt;ul&gt;
244            &lt;li class="clickToShow" title = "vrCityInfo"&gt;VR City&lt;/li&gt;
245            &lt;li class="clickToShow"  title = "delphiInfo"&gt;Delphi Tech Corp&lt;/li&gt;
246            &lt;li class="clickToShow"  title = "auroraInfo"&gt;Aurora Aerial&lt;/li&gt;
247          &lt;/ul&gt;
248          &lt;div id="vrCityInfo" class="clickToShowBlock link"&gt; 
249            VR City is a virtual aviation training company. Our virtual community provides people with the learning tools to learn how to fly. 
250            &lt;br&gt;
251            https://vrcity.ca/
252          &lt;/div&gt;
253          &lt;div id="delphiInfo" class="clickToShowBlock link"&gt; 
254            Delphi Technology Corp is integrating new technologies such as augmented reality and virtuality into the aerospace and aviation industries!
255            &lt;br&gt;
256            https://delphitechcorp.com/
257          &lt;/div&gt;  
258          &lt;div id="auroraInfo" class="clickToShowBlock link"&gt;
259            Aurora Aerial offers custom drone manufacturing. We develop both drone hardware and software.
260            &lt;br&gt;
261            https://auroraaerial.aero
262          &lt;/div&gt;
263          
264        &lt;/div&gt;
265        &lt;div id="group2" class = "groups"&gt;
266          &lt;h2 id="group2h2"&gt;Group 2 - Technology products used at Delphi&lt;/h2&gt;
267          &lt;ul&gt;
268            &lt;li class="hoverToShow link" title= "virbela" id= "virbelaURL"&gt;Virbela&lt;/li&gt;
269            &lt;li class="hoverToShow link" title= "amazon" id= "amazonURL"&gt;Amazon&lt;/li&gt;
270            &lt;li class="hoverToShow link" title= "moodle" id= "moodleURL"&gt;Moodle&lt;/li&gt;
271            &lt;li class="hoverToShow link" title= "xPlane" id= "xPlaneURL"&gt;X-Plane&lt;/li&gt;
272            &lt;li class="hoverToShow link" title= "wordpress" id= "wordpressURL"&gt;Wordpress&lt;/li&gt;
273          &lt;/ul&gt;
274          
275          &lt;div id="virbela" class="hoverToShowBlock"&gt;
276            &lt;img alt="Virbela" src="Logos/5fab9393da4ffe1e20d14cc6_virbela-logo-black-website.png"&gt; 
277          &lt;/div&gt;
278          &lt;div id="amazon" class="hoverToShowBlock"&gt;
279            &lt;img alt="Amazon" src="Logos/NicePng_amazon-png_197561.png"&gt;  
280          &lt;/div&gt;  
281          &lt;div id="moodle" class="hoverToShowBlock"&gt;
282            &lt;img alt="Moodle" src="Logos/moodle_logo_small.svg"&gt;  
283          &lt;/div&gt;
284          &lt;div id="xPlane" class="hoverToShowBlock"&gt; 
285            &lt;img alt="X-Plane" src="Logos/x-plane-logo.svg"&gt; 
286          &lt;/div&gt;  
287          &lt;div id="wordpress" class="hoverToShowBlock"&gt; 
288            &lt;img alt="Virbela" src="Logos/NicePng_wordpress-logo-png_395752.png"&gt; 
289          &lt;/div&gt;
290
291        &lt;/div&gt;
292        &lt;div id="group3" class = "groups"&gt;
293          &lt;h2 id="group3h2"&gt;Group 3 - Websites used at Delphi&lt;/h2&gt;
294          &lt;ul&gt;
295            &lt;dt&gt;GitHub&lt;/dt&gt;
296              &lt;dd class="showLinks link" id="gitHub"&gt;https://github.com&lt;/dd&gt;  
297            &lt;dt&gt;Google Meet&lt;/dt&gt;
298              &lt;dd class="showLinks link" id="googleMeet"&gt;https://meet.google.com&lt;/dd&gt;
299            &lt;dt&gt;Slack&lt;/dt&gt;
300              &lt;dd class="showLinks link" id="slack"&gt;https://slack.com&lt;/dd&gt;
301            &lt;dt&gt;Wrike&lt;/dt&gt;
302              &lt;dd class="showLinks link" id="wrike"&gt;https://wrike.com&lt;/dd&gt;    
303          &lt;/ul&gt;
304          &lt;button id="showLinksButton"&gt;Show Links&lt;/button&gt;
305        &lt;/div&gt;
306        &lt;div id="group4" class = "groups"&gt;
307          &lt;h2 id="group4h2"&gt;Group 4 - Aerospace Companies&lt;/h2&gt;
308
309          &lt;ul id="aviationLinks"&gt;
310            &lt;li class = "cycle link" id="airbus"&gt;airbus.com&lt;/li&gt; 
311            &lt;li class = "cycle link" id="boeing"&gt;boeing.com&lt;/li&gt;
312            &lt;li class = "cycle link" id="lockheedMartin"&gt;lockheedmartin.com&lt;/li&gt;
313            &lt;li class = "cycle link" id="rtx"&gt;rtx.com&lt;/li&gt;
314            &lt;li class = "cycle link" id="geAviation"&gt;geaviation.com&lt;/li&gt;
315            &lt;li class = "cycle link" id="safran"&gt;safran-group.com&lt;/li&gt;
316            &lt;li class = "cycle link" id="leonardo"&gt;leonardocompany.com&lt;/li&gt;
317            &lt;li class = "cycle link" id="baseSystems"&gt;baesystems.com&lt;/li&gt;
318          &lt;/ul&gt;
319        &lt;/div&gt;
320      &lt;/div&gt;
321    &lt;/div&gt;
322  &lt;/body&gt;
323&lt;/html&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;//code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css&quot;&gt;
324div:not(.ui-resizable-handle){
325var $linkID, $linkURL
326
327function changeTime(){
328    let d= new Date(); //built in JS function
329    let mm = ('0' + d.getMinutes()).slice(-2);
330    let ss = ('0' + d.getSeconds()).slice(-2);
331    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
332}
333
334setInterval(changeTime, 1000); //updates the time dynamically.
335
336//Group1
337//Click to Show functionality: group 1 
338//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
339//I am no marketer, so the text is some basic info I read on the websites.
340$(document).ready(function(){
341    $(".clickToShow").click(function(){
342        $(".clickToShowBlock").hide();
343        let idTag = '#' + this.getAttribute("title");        
344      $(idTag).toggle();
345    });
346  });
347
348//Group 2
349//Same as above, except using hover instead of click to show the images.
350
351$(document).ready(function(){    
352    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
353        $(idTag).show();
354      }, function(){let idTag = '#' + this.getAttribute("title");
355        $(idTag).hide();      
356      $(".hoverToShowBlock").hide();
357    });
358  });
359
360  //Group3
361  //follows group 1 method, but loads all links at the same time by toggling a button.
362  
363$(document).ready(function(){
364    $("#showLinksButton").click(function(){        
365      $(".showLinks").toggle();
366    });
367  });
368
369  $(function(){
370    $("#showLinksButton").click(function () {
371       $(this).text(function(i, text){
372           return text === "Show Links" ? "Hide Links" : "Show Links";
373       })
374    });
375 })
376 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
377
378 //Group4
379 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
380// http://jsfiddle.net/mblase75/wE4S8/
381//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
382$(document).ready(function (){
383    var elements =$("#aviationLinks li");
384    var index=0;
385    var showTwo = function (index) {
386        if (index &gt;=elements.length){
387            index = 0
388        }
389        elements.hide().slice(index, index+2).show();
390        setTimeout(function(){
391            showTwo(index +2)
392        }, 5000);
393        }
394        showTwo(0);
395    });
396
397//Make key-value pairs on id and hyperlinks
398const linkIDref = {
399    delphiInfo:"https://delphitechcorp.com/",
400    vrCityInfo:"https://vrcity.ca/",
401    auroraInfo:"https://auroraaerial.aero",
402    virbelaURL:"https://virbela.com",
403    amazonURL:"https://amazon.com",
404    moodleURL:"https://moodle.org",
405    xPlaneURL:"https://x-plane.com",
406    wordpressURL:"https://wordpress.org",
407    gitHub:"https://github.com",
408    googleMeet:"https://meet.google.com",
409    slack:"https://slack.com",
410    wrike:"https://wrike.com",
411    airbus:"https://airbus.com",
412    boeing:"https://boeing.com",
413    lockheedMartin:"https://lockheedmartin.com",
414    rtx:"https://rtx.com",
415    geAviation:"https://geaviation.com",
416    safran:"https://safran-group.com",
417    leonardo:"https://leonardocompany.com",
418    baseSystems:"https://baesystems.com"
419}
420//use key-values to populate the dynamic hyperlink functionality.
421jQuery(".link").click(function(){
422    $linkID = $(this).attr("id");
423    window.location.href=linkIDref[$linkID];
424})
425
426$( function() {
427    $( ".groups" ).draggable();
428  } );
429  
430  $( function() {
431    $( ".groups" ).resizable();
432  } );
1$(function()){
2$( &quot;resizable&quot; ).resizable();
3});
4var $linkID, $linkURL
5
6function changeTime(){
7    let d= new Date(); //built in JS function
8    let mm = ('0' + d.getMinutes()).slice(-2);
9    let ss = ('0' + d.getSeconds()).slice(-2);
10    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
11}
12
13setInterval(changeTime, 1000); //updates the time dynamically.
14
15//Group1
16//Click to Show functionality: group 1 
17//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
18//I am no marketer, so the text is some basic info I read on the websites.
19$(document).ready(function(){
20    $(".clickToShow").click(function(){
21        $(".clickToShowBlock").hide();
22        let idTag = '#' + this.getAttribute("title");        
23      $(idTag).toggle();
24    });
25  });
26
27//Group 2
28//Same as above, except using hover instead of click to show the images.
29
30$(document).ready(function(){    
31    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
32        $(idTag).show();
33      }, function(){let idTag = '#' + this.getAttribute("title");
34        $(idTag).hide();      
35      $(".hoverToShowBlock").hide();
36    });
37  });
38
39  //Group3
40  //follows group 1 method, but loads all links at the same time by toggling a button.
41  
42$(document).ready(function(){
43    $("#showLinksButton").click(function(){        
44      $(".showLinks").toggle();
45    });
46  });
47
48  $(function(){
49    $("#showLinksButton").click(function () {
50       $(this).text(function(i, text){
51           return text === "Show Links" ? "Hide Links" : "Show Links";
52       })
53    });
54 })
55 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
56
57 //Group4
58 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
59// http://jsfiddle.net/mblase75/wE4S8/
60//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
61$(document).ready(function (){
62    var elements =$("#aviationLinks li");
63    var index=0;
64    var showTwo = function (index) {
65        if (index &gt;=elements.length){
66            index = 0
67        }
68        elements.hide().slice(index, index+2).show();
69        setTimeout(function(){
70            showTwo(index +2)
71        }, 5000);
72        }
73        showTwo(0);
74    });
75
76//Make key-value pairs on id and hyperlinks
77const linkIDref = {
78    delphiInfo:"https://delphitechcorp.com/",
79    vrCityInfo:"https://vrcity.ca/",
80    auroraInfo:"https://auroraaerial.aero",
81    virbelaURL:"https://virbela.com",
82    amazonURL:"https://amazon.com",
83    moodleURL:"https://moodle.org",
84    xPlaneURL:"https://x-plane.com",
85    wordpressURL:"https://wordpress.org",
86    gitHub:"https://github.com",
87    googleMeet:"https://meet.google.com",
88    slack:"https://slack.com",
89    wrike:"https://wrike.com",
90    airbus:"https://airbus.com",
91    boeing:"https://boeing.com",
92    lockheedMartin:"https://lockheedmartin.com",
93    rtx:"https://rtx.com",
94    geAviation:"https://geaviation.com",
95    safran:"https://safran-group.com",
96    leonardo:"https://leonardocompany.com",
97    baseSystems:"https://baesystems.com"
98}
99//use key-values to populate the dynamic hyperlink functionality.
100jQuery(".link").click(function(){
101    $linkID = $(this).attr("id");
102    window.location.href=linkIDref[$linkID];
103})
104
105$( function() {
106    $( ".groups" ).draggable();
107  } );
108  
109  $( function() {
110    $( ".groups" ).resizable();
111  } );body{
112    font-family: Arial, Helvetica, sans-serif;
113    font-size:1em;
114    background-color: skyblue;
115}
116h1{
117    text-align:center;
118}
119div{
120    border: black solid 2px;
121    border-radius:10px;
122}
123#main{
124    width:100%;
125    height: fit-content;
126    border:none;
127}
128#dashboard{
129    margin:auto auto auto auto;
130    display:grid;
131    border:none;
132    grid-template-columns: auto auto;
133    column-gap: 1em;
134    row-gap: 1em;
135    width:100%;
136    height:fit-content;    
137}
138#dateTime{
139    margin:1em auto 1em auto;
140    border: black solid 2px;
141    width:fit-content;
142    height:fit-content;
143    padding:1em;
144    font-size: larger;
145    font-weight: bolder;
146    background-color: snow;
147}
148.groups{
149    position: relative;
150    margin:auto auto auto auto;
151    width:35em;
152    min-width: 32.5em;
153    background-color: snow;
154    padding:0px;
155    overflow: hidden;
156}
157.groups h2{
158    position:relative;
159    top:-0.9em;
160    text-align:center;
161    background-color: blue;
162    color:white;
163    cursor:move;
164}
165ul{
166    list-style-type: none;
167    position:relative;
168    top:-0.5em;
169}
170#group1{
171    height:10em;
172}
173#group2{
174    height:10em;
175}
176.clickToShowBlock{
177    cursor:pointer;
178    display:none;
179    position:absolute;
180    top: 3.5em;
181    left:12em;
182    height:fit-content;
183    width:20em;
184    border:none;
185}
186.hoverToShowBlock{
187    display:none;
188    position:absolute;
189    top: 4em;
190    left:12em;
191    height:fit-content;
192    width:20em;
193    border:none;
194}
195.hoverToShowBlock img{
196    max-height:6em;
197    max-width:19em;
198}
199dd{
200    padding: 0.5em 0em 0.5em 0em;
201}
202.showLinks{
203    display:none;
204}
205#showLinksButton{
206    position:absolute;
207    right:0.5em;
208    top:2em;
209    font-size:2em;
210}
211li:hover{
212    cursor:pointer;
213}
214
215dd:hover{
216    cursor:pointer;
217}
218@media screen and (max-width: 1200px)
219{    
220    #dashboard{
221
222        grid-template-columns: auto;
223    }
224}&lt;!DOCTYPE html&gt;
225&lt;html lang="en"&gt;
226  &lt;head&gt;
227    &lt;script src="https://code.jquery.com/jquery-3.6.0.min.js"&gt;&lt;/script&gt;
228    &lt;script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"&gt;&lt;/script&gt;
229    &lt;link rel="stylesheet" href="stylesheet2.css"&gt;
230    &lt;meta charset="UTF-8" /&gt;
231    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
232    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
233    &lt;title&gt;Delphi Tech Corp Front-End Development Team Coding Test&lt;/title&gt;
234    &lt;script src="script2.js" defer&gt;&lt;/script&gt;
235  &lt;/head&gt;
236  &lt;body&gt;
237    &lt;h1&gt;TASK 2 Dashboard&lt;/h1&gt;
238    &lt;div id="main"&gt;
239      &lt;div id = "dateTime"&gt;&lt;/div&gt;
240      &lt;div id = "dashboard"&gt;
241        &lt;div id="group1" class = "groups"&gt;
242          &lt;h2 id="group1h2"&gt;Group 1 - Alan Zheng's Companys + Products&lt;/h2&gt; 
243          &lt;ul&gt;
244            &lt;li class="clickToShow" title = "vrCityInfo"&gt;VR City&lt;/li&gt;
245            &lt;li class="clickToShow"  title = "delphiInfo"&gt;Delphi Tech Corp&lt;/li&gt;
246            &lt;li class="clickToShow"  title = "auroraInfo"&gt;Aurora Aerial&lt;/li&gt;
247          &lt;/ul&gt;
248          &lt;div id="vrCityInfo" class="clickToShowBlock link"&gt; 
249            VR City is a virtual aviation training company. Our virtual community provides people with the learning tools to learn how to fly. 
250            &lt;br&gt;
251            https://vrcity.ca/
252          &lt;/div&gt;
253          &lt;div id="delphiInfo" class="clickToShowBlock link"&gt; 
254            Delphi Technology Corp is integrating new technologies such as augmented reality and virtuality into the aerospace and aviation industries!
255            &lt;br&gt;
256            https://delphitechcorp.com/
257          &lt;/div&gt;  
258          &lt;div id="auroraInfo" class="clickToShowBlock link"&gt;
259            Aurora Aerial offers custom drone manufacturing. We develop both drone hardware and software.
260            &lt;br&gt;
261            https://auroraaerial.aero
262          &lt;/div&gt;
263          
264        &lt;/div&gt;
265        &lt;div id="group2" class = "groups"&gt;
266          &lt;h2 id="group2h2"&gt;Group 2 - Technology products used at Delphi&lt;/h2&gt;
267          &lt;ul&gt;
268            &lt;li class="hoverToShow link" title= "virbela" id= "virbelaURL"&gt;Virbela&lt;/li&gt;
269            &lt;li class="hoverToShow link" title= "amazon" id= "amazonURL"&gt;Amazon&lt;/li&gt;
270            &lt;li class="hoverToShow link" title= "moodle" id= "moodleURL"&gt;Moodle&lt;/li&gt;
271            &lt;li class="hoverToShow link" title= "xPlane" id= "xPlaneURL"&gt;X-Plane&lt;/li&gt;
272            &lt;li class="hoverToShow link" title= "wordpress" id= "wordpressURL"&gt;Wordpress&lt;/li&gt;
273          &lt;/ul&gt;
274          
275          &lt;div id="virbela" class="hoverToShowBlock"&gt;
276            &lt;img alt="Virbela" src="Logos/5fab9393da4ffe1e20d14cc6_virbela-logo-black-website.png"&gt; 
277          &lt;/div&gt;
278          &lt;div id="amazon" class="hoverToShowBlock"&gt;
279            &lt;img alt="Amazon" src="Logos/NicePng_amazon-png_197561.png"&gt;  
280          &lt;/div&gt;  
281          &lt;div id="moodle" class="hoverToShowBlock"&gt;
282            &lt;img alt="Moodle" src="Logos/moodle_logo_small.svg"&gt;  
283          &lt;/div&gt;
284          &lt;div id="xPlane" class="hoverToShowBlock"&gt; 
285            &lt;img alt="X-Plane" src="Logos/x-plane-logo.svg"&gt; 
286          &lt;/div&gt;  
287          &lt;div id="wordpress" class="hoverToShowBlock"&gt; 
288            &lt;img alt="Virbela" src="Logos/NicePng_wordpress-logo-png_395752.png"&gt; 
289          &lt;/div&gt;
290
291        &lt;/div&gt;
292        &lt;div id="group3" class = "groups"&gt;
293          &lt;h2 id="group3h2"&gt;Group 3 - Websites used at Delphi&lt;/h2&gt;
294          &lt;ul&gt;
295            &lt;dt&gt;GitHub&lt;/dt&gt;
296              &lt;dd class="showLinks link" id="gitHub"&gt;https://github.com&lt;/dd&gt;  
297            &lt;dt&gt;Google Meet&lt;/dt&gt;
298              &lt;dd class="showLinks link" id="googleMeet"&gt;https://meet.google.com&lt;/dd&gt;
299            &lt;dt&gt;Slack&lt;/dt&gt;
300              &lt;dd class="showLinks link" id="slack"&gt;https://slack.com&lt;/dd&gt;
301            &lt;dt&gt;Wrike&lt;/dt&gt;
302              &lt;dd class="showLinks link" id="wrike"&gt;https://wrike.com&lt;/dd&gt;    
303          &lt;/ul&gt;
304          &lt;button id="showLinksButton"&gt;Show Links&lt;/button&gt;
305        &lt;/div&gt;
306        &lt;div id="group4" class = "groups"&gt;
307          &lt;h2 id="group4h2"&gt;Group 4 - Aerospace Companies&lt;/h2&gt;
308
309          &lt;ul id="aviationLinks"&gt;
310            &lt;li class = "cycle link" id="airbus"&gt;airbus.com&lt;/li&gt; 
311            &lt;li class = "cycle link" id="boeing"&gt;boeing.com&lt;/li&gt;
312            &lt;li class = "cycle link" id="lockheedMartin"&gt;lockheedmartin.com&lt;/li&gt;
313            &lt;li class = "cycle link" id="rtx"&gt;rtx.com&lt;/li&gt;
314            &lt;li class = "cycle link" id="geAviation"&gt;geaviation.com&lt;/li&gt;
315            &lt;li class = "cycle link" id="safran"&gt;safran-group.com&lt;/li&gt;
316            &lt;li class = "cycle link" id="leonardo"&gt;leonardocompany.com&lt;/li&gt;
317            &lt;li class = "cycle link" id="baseSystems"&gt;baesystems.com&lt;/li&gt;
318          &lt;/ul&gt;
319        &lt;/div&gt;
320      &lt;/div&gt;
321    &lt;/div&gt;
322  &lt;/body&gt;
323&lt;/html&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;//code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css&quot;&gt;
324div:not(.ui-resizable-handle){
325var $linkID, $linkURL
326
327function changeTime(){
328    let d= new Date(); //built in JS function
329    let mm = ('0' + d.getMinutes()).slice(-2);
330    let ss = ('0' + d.getSeconds()).slice(-2);
331    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
332}
333
334setInterval(changeTime, 1000); //updates the time dynamically.
335
336//Group1
337//Click to Show functionality: group 1 
338//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
339//I am no marketer, so the text is some basic info I read on the websites.
340$(document).ready(function(){
341    $(".clickToShow").click(function(){
342        $(".clickToShowBlock").hide();
343        let idTag = '#' + this.getAttribute("title");        
344      $(idTag).toggle();
345    });
346  });
347
348//Group 2
349//Same as above, except using hover instead of click to show the images.
350
351$(document).ready(function(){    
352    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
353        $(idTag).show();
354      }, function(){let idTag = '#' + this.getAttribute("title");
355        $(idTag).hide();      
356      $(".hoverToShowBlock").hide();
357    });
358  });
359
360  //Group3
361  //follows group 1 method, but loads all links at the same time by toggling a button.
362  
363$(document).ready(function(){
364    $("#showLinksButton").click(function(){        
365      $(".showLinks").toggle();
366    });
367  });
368
369  $(function(){
370    $("#showLinksButton").click(function () {
371       $(this).text(function(i, text){
372           return text === "Show Links" ? "Hide Links" : "Show Links";
373       })
374    });
375 })
376 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
377
378 //Group4
379 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
380// http://jsfiddle.net/mblase75/wE4S8/
381//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
382$(document).ready(function (){
383    var elements =$("#aviationLinks li");
384    var index=0;
385    var showTwo = function (index) {
386        if (index &gt;=elements.length){
387            index = 0
388        }
389        elements.hide().slice(index, index+2).show();
390        setTimeout(function(){
391            showTwo(index +2)
392        }, 5000);
393        }
394        showTwo(0);
395    });
396
397//Make key-value pairs on id and hyperlinks
398const linkIDref = {
399    delphiInfo:"https://delphitechcorp.com/",
400    vrCityInfo:"https://vrcity.ca/",
401    auroraInfo:"https://auroraaerial.aero",
402    virbelaURL:"https://virbela.com",
403    amazonURL:"https://amazon.com",
404    moodleURL:"https://moodle.org",
405    xPlaneURL:"https://x-plane.com",
406    wordpressURL:"https://wordpress.org",
407    gitHub:"https://github.com",
408    googleMeet:"https://meet.google.com",
409    slack:"https://slack.com",
410    wrike:"https://wrike.com",
411    airbus:"https://airbus.com",
412    boeing:"https://boeing.com",
413    lockheedMartin:"https://lockheedmartin.com",
414    rtx:"https://rtx.com",
415    geAviation:"https://geaviation.com",
416    safran:"https://safran-group.com",
417    leonardo:"https://leonardocompany.com",
418    baseSystems:"https://baesystems.com"
419}
420//use key-values to populate the dynamic hyperlink functionality.
421jQuery(".link").click(function(){
422    $linkID = $(this).attr("id");
423    window.location.href=linkIDref[$linkID];
424})
425
426$( function() {
427    $( ".groups" ).draggable();
428  } );
429  
430  $( function() {
431    $( ".groups" ).resizable();
432  } );body{
433    font-family: Arial, Helvetica, sans-serif;
434    font-size:1em;
435    background-color: skyblue;
436}
437h1{
438    text-align:center;
439}
440div:not(.ui-resizable-handle){  /* Added an exception to your generic rule */
441    border: black solid 2px;
442    border-radius:10px;
443}
444#main{
445    width:100%;
446    height: fit-content;
447    border:none;
448}
449#dashboard{
450    margin:auto auto auto auto;
451    display:grid;
452    border:none;
453    grid-template-columns: auto auto;
454    column-gap: 1em;
455    row-gap: 1em;
456    width:100%;
457    height:fit-content;    
458}
459#dateTime{
460    margin:1em auto 1em auto;
461    border: black solid 2px;
462    width:fit-content;
463    height:fit-content;
464    padding:1em;
465    font-size: larger;
466    font-weight: bolder;
467    background-color: snow;
468}
469.groups{
470    position: relative;
471    margin:auto auto auto auto;
472    width:35em;
473    min-width: 32.5em;
474    background-color: snow;
475    padding:0px;
476    overflow: hidden;
477}
478.groups h2{
479    position:relative;
480    top:-0.9em;
481    text-align:center;
482    background-color: blue;
483    color:white;
484    cursor:move;
485}
486ul{
487    list-style-type: none;
488    position:relative;
489    top:-0.5em;
490}
491#group1{
492    height:10em;
493}
494#group2{
495    height:10em;
496}
497.clickToShowBlock{
498    cursor:pointer;
499    display:none;
500    position:absolute;
501    top: 3.5em;
502    left:12em;
503    height:fit-content;
504    width:20em;
505    border:none;
506}
507.hoverToShowBlock{
508    display:none;
509    position:absolute;
510    top: 4em;
511    left:12em;
512    height:fit-content;
513    width:20em;
514    border:none;
515}
516.hoverToShowBlock img{
517    max-height:6em;
518    max-width:19em;
519}
520dd{
521    padding: 0.5em 0em 0.5em 0em;
522}
523.showLinks{
524    display:none;
525}
526#showLinksButton{
527    position:absolute;
528    right:0.5em;
529    top:2em;
530    font-size:2em;
531}
532li:hover{
533    cursor:pointer;
534}
535
536dd:hover{
537    cursor:pointer;
538}
539@media screen and (max-width: 1200px)
540{    
541    #dashboard{
542
543        grid-template-columns: auto;
544    }
545}
1$(function()){
2$( &quot;resizable&quot; ).resizable();
3});
4var $linkID, $linkURL
5
6function changeTime(){
7    let d= new Date(); //built in JS function
8    let mm = ('0' + d.getMinutes()).slice(-2);
9    let ss = ('0' + d.getSeconds()).slice(-2);
10    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
11}
12
13setInterval(changeTime, 1000); //updates the time dynamically.
14
15//Group1
16//Click to Show functionality: group 1 
17//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
18//I am no marketer, so the text is some basic info I read on the websites.
19$(document).ready(function(){
20    $(".clickToShow").click(function(){
21        $(".clickToShowBlock").hide();
22        let idTag = '#' + this.getAttribute("title");        
23      $(idTag).toggle();
24    });
25  });
26
27//Group 2
28//Same as above, except using hover instead of click to show the images.
29
30$(document).ready(function(){    
31    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
32        $(idTag).show();
33      }, function(){let idTag = '#' + this.getAttribute("title");
34        $(idTag).hide();      
35      $(".hoverToShowBlock").hide();
36    });
37  });
38
39  //Group3
40  //follows group 1 method, but loads all links at the same time by toggling a button.
41  
42$(document).ready(function(){
43    $("#showLinksButton").click(function(){        
44      $(".showLinks").toggle();
45    });
46  });
47
48  $(function(){
49    $("#showLinksButton").click(function () {
50       $(this).text(function(i, text){
51           return text === "Show Links" ? "Hide Links" : "Show Links";
52       })
53    });
54 })
55 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
56
57 //Group4
58 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
59// http://jsfiddle.net/mblase75/wE4S8/
60//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
61$(document).ready(function (){
62    var elements =$("#aviationLinks li");
63    var index=0;
64    var showTwo = function (index) {
65        if (index &gt;=elements.length){
66            index = 0
67        }
68        elements.hide().slice(index, index+2).show();
69        setTimeout(function(){
70            showTwo(index +2)
71        }, 5000);
72        }
73        showTwo(0);
74    });
75
76//Make key-value pairs on id and hyperlinks
77const linkIDref = {
78    delphiInfo:"https://delphitechcorp.com/",
79    vrCityInfo:"https://vrcity.ca/",
80    auroraInfo:"https://auroraaerial.aero",
81    virbelaURL:"https://virbela.com",
82    amazonURL:"https://amazon.com",
83    moodleURL:"https://moodle.org",
84    xPlaneURL:"https://x-plane.com",
85    wordpressURL:"https://wordpress.org",
86    gitHub:"https://github.com",
87    googleMeet:"https://meet.google.com",
88    slack:"https://slack.com",
89    wrike:"https://wrike.com",
90    airbus:"https://airbus.com",
91    boeing:"https://boeing.com",
92    lockheedMartin:"https://lockheedmartin.com",
93    rtx:"https://rtx.com",
94    geAviation:"https://geaviation.com",
95    safran:"https://safran-group.com",
96    leonardo:"https://leonardocompany.com",
97    baseSystems:"https://baesystems.com"
98}
99//use key-values to populate the dynamic hyperlink functionality.
100jQuery(".link").click(function(){
101    $linkID = $(this).attr("id");
102    window.location.href=linkIDref[$linkID];
103})
104
105$( function() {
106    $( ".groups" ).draggable();
107  } );
108  
109  $( function() {
110    $( ".groups" ).resizable();
111  } );body{
112    font-family: Arial, Helvetica, sans-serif;
113    font-size:1em;
114    background-color: skyblue;
115}
116h1{
117    text-align:center;
118}
119div{
120    border: black solid 2px;
121    border-radius:10px;
122}
123#main{
124    width:100%;
125    height: fit-content;
126    border:none;
127}
128#dashboard{
129    margin:auto auto auto auto;
130    display:grid;
131    border:none;
132    grid-template-columns: auto auto;
133    column-gap: 1em;
134    row-gap: 1em;
135    width:100%;
136    height:fit-content;    
137}
138#dateTime{
139    margin:1em auto 1em auto;
140    border: black solid 2px;
141    width:fit-content;
142    height:fit-content;
143    padding:1em;
144    font-size: larger;
145    font-weight: bolder;
146    background-color: snow;
147}
148.groups{
149    position: relative;
150    margin:auto auto auto auto;
151    width:35em;
152    min-width: 32.5em;
153    background-color: snow;
154    padding:0px;
155    overflow: hidden;
156}
157.groups h2{
158    position:relative;
159    top:-0.9em;
160    text-align:center;
161    background-color: blue;
162    color:white;
163    cursor:move;
164}
165ul{
166    list-style-type: none;
167    position:relative;
168    top:-0.5em;
169}
170#group1{
171    height:10em;
172}
173#group2{
174    height:10em;
175}
176.clickToShowBlock{
177    cursor:pointer;
178    display:none;
179    position:absolute;
180    top: 3.5em;
181    left:12em;
182    height:fit-content;
183    width:20em;
184    border:none;
185}
186.hoverToShowBlock{
187    display:none;
188    position:absolute;
189    top: 4em;
190    left:12em;
191    height:fit-content;
192    width:20em;
193    border:none;
194}
195.hoverToShowBlock img{
196    max-height:6em;
197    max-width:19em;
198}
199dd{
200    padding: 0.5em 0em 0.5em 0em;
201}
202.showLinks{
203    display:none;
204}
205#showLinksButton{
206    position:absolute;
207    right:0.5em;
208    top:2em;
209    font-size:2em;
210}
211li:hover{
212    cursor:pointer;
213}
214
215dd:hover{
216    cursor:pointer;
217}
218@media screen and (max-width: 1200px)
219{    
220    #dashboard{
221
222        grid-template-columns: auto;
223    }
224}&lt;!DOCTYPE html&gt;
225&lt;html lang="en"&gt;
226  &lt;head&gt;
227    &lt;script src="https://code.jquery.com/jquery-3.6.0.min.js"&gt;&lt;/script&gt;
228    &lt;script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"&gt;&lt;/script&gt;
229    &lt;link rel="stylesheet" href="stylesheet2.css"&gt;
230    &lt;meta charset="UTF-8" /&gt;
231    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
232    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
233    &lt;title&gt;Delphi Tech Corp Front-End Development Team Coding Test&lt;/title&gt;
234    &lt;script src="script2.js" defer&gt;&lt;/script&gt;
235  &lt;/head&gt;
236  &lt;body&gt;
237    &lt;h1&gt;TASK 2 Dashboard&lt;/h1&gt;
238    &lt;div id="main"&gt;
239      &lt;div id = "dateTime"&gt;&lt;/div&gt;
240      &lt;div id = "dashboard"&gt;
241        &lt;div id="group1" class = "groups"&gt;
242          &lt;h2 id="group1h2"&gt;Group 1 - Alan Zheng's Companys + Products&lt;/h2&gt; 
243          &lt;ul&gt;
244            &lt;li class="clickToShow" title = "vrCityInfo"&gt;VR City&lt;/li&gt;
245            &lt;li class="clickToShow"  title = "delphiInfo"&gt;Delphi Tech Corp&lt;/li&gt;
246            &lt;li class="clickToShow"  title = "auroraInfo"&gt;Aurora Aerial&lt;/li&gt;
247          &lt;/ul&gt;
248          &lt;div id="vrCityInfo" class="clickToShowBlock link"&gt; 
249            VR City is a virtual aviation training company. Our virtual community provides people with the learning tools to learn how to fly. 
250            &lt;br&gt;
251            https://vrcity.ca/
252          &lt;/div&gt;
253          &lt;div id="delphiInfo" class="clickToShowBlock link"&gt; 
254            Delphi Technology Corp is integrating new technologies such as augmented reality and virtuality into the aerospace and aviation industries!
255            &lt;br&gt;
256            https://delphitechcorp.com/
257          &lt;/div&gt;  
258          &lt;div id="auroraInfo" class="clickToShowBlock link"&gt;
259            Aurora Aerial offers custom drone manufacturing. We develop both drone hardware and software.
260            &lt;br&gt;
261            https://auroraaerial.aero
262          &lt;/div&gt;
263          
264        &lt;/div&gt;
265        &lt;div id="group2" class = "groups"&gt;
266          &lt;h2 id="group2h2"&gt;Group 2 - Technology products used at Delphi&lt;/h2&gt;
267          &lt;ul&gt;
268            &lt;li class="hoverToShow link" title= "virbela" id= "virbelaURL"&gt;Virbela&lt;/li&gt;
269            &lt;li class="hoverToShow link" title= "amazon" id= "amazonURL"&gt;Amazon&lt;/li&gt;
270            &lt;li class="hoverToShow link" title= "moodle" id= "moodleURL"&gt;Moodle&lt;/li&gt;
271            &lt;li class="hoverToShow link" title= "xPlane" id= "xPlaneURL"&gt;X-Plane&lt;/li&gt;
272            &lt;li class="hoverToShow link" title= "wordpress" id= "wordpressURL"&gt;Wordpress&lt;/li&gt;
273          &lt;/ul&gt;
274          
275          &lt;div id="virbela" class="hoverToShowBlock"&gt;
276            &lt;img alt="Virbela" src="Logos/5fab9393da4ffe1e20d14cc6_virbela-logo-black-website.png"&gt; 
277          &lt;/div&gt;
278          &lt;div id="amazon" class="hoverToShowBlock"&gt;
279            &lt;img alt="Amazon" src="Logos/NicePng_amazon-png_197561.png"&gt;  
280          &lt;/div&gt;  
281          &lt;div id="moodle" class="hoverToShowBlock"&gt;
282            &lt;img alt="Moodle" src="Logos/moodle_logo_small.svg"&gt;  
283          &lt;/div&gt;
284          &lt;div id="xPlane" class="hoverToShowBlock"&gt; 
285            &lt;img alt="X-Plane" src="Logos/x-plane-logo.svg"&gt; 
286          &lt;/div&gt;  
287          &lt;div id="wordpress" class="hoverToShowBlock"&gt; 
288            &lt;img alt="Virbela" src="Logos/NicePng_wordpress-logo-png_395752.png"&gt; 
289          &lt;/div&gt;
290
291        &lt;/div&gt;
292        &lt;div id="group3" class = "groups"&gt;
293          &lt;h2 id="group3h2"&gt;Group 3 - Websites used at Delphi&lt;/h2&gt;
294          &lt;ul&gt;
295            &lt;dt&gt;GitHub&lt;/dt&gt;
296              &lt;dd class="showLinks link" id="gitHub"&gt;https://github.com&lt;/dd&gt;  
297            &lt;dt&gt;Google Meet&lt;/dt&gt;
298              &lt;dd class="showLinks link" id="googleMeet"&gt;https://meet.google.com&lt;/dd&gt;
299            &lt;dt&gt;Slack&lt;/dt&gt;
300              &lt;dd class="showLinks link" id="slack"&gt;https://slack.com&lt;/dd&gt;
301            &lt;dt&gt;Wrike&lt;/dt&gt;
302              &lt;dd class="showLinks link" id="wrike"&gt;https://wrike.com&lt;/dd&gt;    
303          &lt;/ul&gt;
304          &lt;button id="showLinksButton"&gt;Show Links&lt;/button&gt;
305        &lt;/div&gt;
306        &lt;div id="group4" class = "groups"&gt;
307          &lt;h2 id="group4h2"&gt;Group 4 - Aerospace Companies&lt;/h2&gt;
308
309          &lt;ul id="aviationLinks"&gt;
310            &lt;li class = "cycle link" id="airbus"&gt;airbus.com&lt;/li&gt; 
311            &lt;li class = "cycle link" id="boeing"&gt;boeing.com&lt;/li&gt;
312            &lt;li class = "cycle link" id="lockheedMartin"&gt;lockheedmartin.com&lt;/li&gt;
313            &lt;li class = "cycle link" id="rtx"&gt;rtx.com&lt;/li&gt;
314            &lt;li class = "cycle link" id="geAviation"&gt;geaviation.com&lt;/li&gt;
315            &lt;li class = "cycle link" id="safran"&gt;safran-group.com&lt;/li&gt;
316            &lt;li class = "cycle link" id="leonardo"&gt;leonardocompany.com&lt;/li&gt;
317            &lt;li class = "cycle link" id="baseSystems"&gt;baesystems.com&lt;/li&gt;
318          &lt;/ul&gt;
319        &lt;/div&gt;
320      &lt;/div&gt;
321    &lt;/div&gt;
322  &lt;/body&gt;
323&lt;/html&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;//code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css&quot;&gt;
324div:not(.ui-resizable-handle){
325var $linkID, $linkURL
326
327function changeTime(){
328    let d= new Date(); //built in JS function
329    let mm = ('0' + d.getMinutes()).slice(-2);
330    let ss = ('0' + d.getSeconds()).slice(-2);
331    document.getElementById("dateTime").innerHTML = `${d.getMonth()}/${d.getDay()}/${d.getYear()} ${d.getHours()}:${mm}:${ss}`;
332}
333
334setInterval(changeTime, 1000); //updates the time dynamically.
335
336//Group1
337//Click to Show functionality: group 1 
338//clicks hide all divs, then uses a "title" attribute as a variable to toggle the associated box showing that title's information. 
339//I am no marketer, so the text is some basic info I read on the websites.
340$(document).ready(function(){
341    $(".clickToShow").click(function(){
342        $(".clickToShowBlock").hide();
343        let idTag = '#' + this.getAttribute("title");        
344      $(idTag).toggle();
345    });
346  });
347
348//Group 2
349//Same as above, except using hover instead of click to show the images.
350
351$(document).ready(function(){    
352    $(".hoverToShow").hover(function(){let idTag = '#' + this.getAttribute("title");
353        $(idTag).show();
354      }, function(){let idTag = '#' + this.getAttribute("title");
355        $(idTag).hide();      
356      $(".hoverToShowBlock").hide();
357    });
358  });
359
360  //Group3
361  //follows group 1 method, but loads all links at the same time by toggling a button.
362  
363$(document).ready(function(){
364    $("#showLinksButton").click(function(){        
365      $(".showLinks").toggle();
366    });
367  });
368
369  $(function(){
370    $("#showLinksButton").click(function () {
371       $(this).text(function(i, text){
372           return text === "Show Links" ? "Hide Links" : "Show Links";
373       })
374    });
375 })
376 //https://stackoverflow.com/questions/13652835/button-text-toggle-in-jquery
377
378 //Group4
379 //https://stackoverflow.com/questions/4511652/looping-through-list-items-with-jquery
380// http://jsfiddle.net/mblase75/wE4S8/
381//from: https://stackoverflow.com/questions/20105762/show-n-number-of-list-elements-at-a-time-jquery
382$(document).ready(function (){
383    var elements =$("#aviationLinks li");
384    var index=0;
385    var showTwo = function (index) {
386        if (index &gt;=elements.length){
387            index = 0
388        }
389        elements.hide().slice(index, index+2).show();
390        setTimeout(function(){
391            showTwo(index +2)
392        }, 5000);
393        }
394        showTwo(0);
395    });
396
397//Make key-value pairs on id and hyperlinks
398const linkIDref = {
399    delphiInfo:"https://delphitechcorp.com/",
400    vrCityInfo:"https://vrcity.ca/",
401    auroraInfo:"https://auroraaerial.aero",
402    virbelaURL:"https://virbela.com",
403    amazonURL:"https://amazon.com",
404    moodleURL:"https://moodle.org",
405    xPlaneURL:"https://x-plane.com",
406    wordpressURL:"https://wordpress.org",
407    gitHub:"https://github.com",
408    googleMeet:"https://meet.google.com",
409    slack:"https://slack.com",
410    wrike:"https://wrike.com",
411    airbus:"https://airbus.com",
412    boeing:"https://boeing.com",
413    lockheedMartin:"https://lockheedmartin.com",
414    rtx:"https://rtx.com",
415    geAviation:"https://geaviation.com",
416    safran:"https://safran-group.com",
417    leonardo:"https://leonardocompany.com",
418    baseSystems:"https://baesystems.com"
419}
420//use key-values to populate the dynamic hyperlink functionality.
421jQuery(".link").click(function(){
422    $linkID = $(this).attr("id");
423    window.location.href=linkIDref[$linkID];
424})
425
426$( function() {
427    $( ".groups" ).draggable();
428  } );
429  
430  $( function() {
431    $( ".groups" ).resizable();
432  } );body{
433    font-family: Arial, Helvetica, sans-serif;
434    font-size:1em;
435    background-color: skyblue;
436}
437h1{
438    text-align:center;
439}
440div:not(.ui-resizable-handle){  /* Added an exception to your generic rule */
441    border: black solid 2px;
442    border-radius:10px;
443}
444#main{
445    width:100%;
446    height: fit-content;
447    border:none;
448}
449#dashboard{
450    margin:auto auto auto auto;
451    display:grid;
452    border:none;
453    grid-template-columns: auto auto;
454    column-gap: 1em;
455    row-gap: 1em;
456    width:100%;
457    height:fit-content;    
458}
459#dateTime{
460    margin:1em auto 1em auto;
461    border: black solid 2px;
462    width:fit-content;
463    height:fit-content;
464    padding:1em;
465    font-size: larger;
466    font-weight: bolder;
467    background-color: snow;
468}
469.groups{
470    position: relative;
471    margin:auto auto auto auto;
472    width:35em;
473    min-width: 32.5em;
474    background-color: snow;
475    padding:0px;
476    overflow: hidden;
477}
478.groups h2{
479    position:relative;
480    top:-0.9em;
481    text-align:center;
482    background-color: blue;
483    color:white;
484    cursor:move;
485}
486ul{
487    list-style-type: none;
488    position:relative;
489    top:-0.5em;
490}
491#group1{
492    height:10em;
493}
494#group2{
495    height:10em;
496}
497.clickToShowBlock{
498    cursor:pointer;
499    display:none;
500    position:absolute;
501    top: 3.5em;
502    left:12em;
503    height:fit-content;
504    width:20em;
505    border:none;
506}
507.hoverToShowBlock{
508    display:none;
509    position:absolute;
510    top: 4em;
511    left:12em;
512    height:fit-content;
513    width:20em;
514    border:none;
515}
516.hoverToShowBlock img{
517    max-height:6em;
518    max-width:19em;
519}
520dd{
521    padding: 0.5em 0em 0.5em 0em;
522}
523.showLinks{
524    display:none;
525}
526#showLinksButton{
527    position:absolute;
528    right:0.5em;
529    top:2em;
530    font-size:2em;
531}
532li:hover{
533    cursor:pointer;
534}
535
536dd:hover{
537    cursor:pointer;
538}
539@media screen and (max-width: 1200px)
540{    
541    #dashboard{
542
543        grid-template-columns: auto;
544    }
545}&lt;!DOCTYPE html&gt;
546&lt;html lang="en"&gt;
547  &lt;head&gt;
548    &lt;script src="https://code.jquery.com/jquery-3.6.0.min.js"&gt;&lt;/script&gt;
549    &lt;script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"&gt;&lt;/script&gt;
550    &lt;link rel="stylesheet" href="//code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css"&gt;&lt;!-- Added the jQuery-ui CSS file --&gt;
551    &lt;link rel="stylesheet" href="stylesheet2.css"&gt;
552    &lt;meta charset="UTF-8" /&gt;
553    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
554    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
555    &lt;title&gt;Delphi Tech Corp Front-End Development Team Coding Test&lt;/title&gt;
556    &lt;script src="script2.js" defer&gt;&lt;/script&gt;
557  &lt;/head&gt;
558  &lt;body&gt;
559    &lt;h1&gt;TASK 2 Dashboard&lt;/h1&gt;
560    &lt;div id="main"&gt;
561      &lt;div id = "dateTime"&gt;&lt;/div&gt;
562      &lt;div id = "dashboard"&gt;
563        &lt;div id="group1" class = "groups"&gt;
564          &lt;h2 id="group1h2"&gt;Group 1 - Alan Zheng's Companys + Products&lt;/h2&gt; 
565          &lt;ul&gt;
566            &lt;li class="clickToShow" title = "vrCityInfo"&gt;VR City&lt;/li&gt;
567            &lt;li class="clickToShow"  title = "delphiInfo"&gt;Delphi Tech Corp&lt;/li&gt;
568            &lt;li class="clickToShow"  title = "auroraInfo"&gt;Aurora Aerial&lt;/li&gt;
569          &lt;/ul&gt;
570          &lt;div id="vrCityInfo" class="clickToShowBlock link"&gt; 
571            VR City is a virtual aviation training company. Our virtual community provides people with the learning tools to learn how to fly. 
572            &lt;br&gt;
573            https://vrcity.ca/
574          &lt;/div&gt;
575          &lt;div id="delphiInfo" class="clickToShowBlock link"&gt; 
576            Delphi Technology Corp is integrating new technologies such as augmented reality and virtuality into the aerospace and aviation industries!
577            &lt;br&gt;
578            https://delphitechcorp.com/
579          &lt;/div&gt;  
580          &lt;div id="auroraInfo" class="clickToShowBlock link"&gt;
581            Aurora Aerial offers custom drone manufacturing. We develop both drone hardware and software.
582            &lt;br&gt;
583            https://auroraaerial.aero
584          &lt;/div&gt;
585          
586        &lt;/div&gt;
587        &lt;div id="group2" class = "groups"&gt;
588          &lt;h2 id="group2h2"&gt;Group 2 - Technology products used at Delphi&lt;/h2&gt;
589          &lt;ul&gt;
590            &lt;li class="hoverToShow link" title= "virbela" id= "virbelaURL"&gt;Virbela&lt;/li&gt;
591            &lt;li class="hoverToShow link" title= "amazon" id= "amazonURL"&gt;Amazon&lt;/li&gt;
592            &lt;li class="hoverToShow link" title= "moodle" id= "moodleURL"&gt;Moodle&lt;/li&gt;
593            &lt;li class="hoverToShow link" title= "xPlane" id= "xPlaneURL"&gt;X-Plane&lt;/li&gt;
594            &lt;li class="hoverToShow link" title= "wordpress" id= "wordpressURL"&gt;Wordpress&lt;/li&gt;
595          &lt;/ul&gt;
596          
597          &lt;div id="virbela" class="hoverToShowBlock"&gt;
598            &lt;img alt="Virbela" src="Logos/5fab9393da4ffe1e20d14cc6_virbela-logo-black-website.png"&gt; 
599          &lt;/div&gt;
600          &lt;div id="amazon" class="hoverToShowBlock"&gt;
601            &lt;img alt="Amazon" src="Logos/NicePng_amazon-png_197561.png"&gt;  
602          &lt;/div&gt;  
603          &lt;div id="moodle" class="hoverToShowBlock"&gt;
604            &lt;img alt="Moodle" src="Logos/moodle_logo_small.svg"&gt;  
605          &lt;/div&gt;
606          &lt;div id="xPlane" class="hoverToShowBlock"&gt; 
607            &lt;img alt="X-Plane" src="Logos/x-plane-logo.svg"&gt; 
608          &lt;/div&gt;  
609          &lt;div id="wordpress" class="hoverToShowBlock"&gt; 
610            &lt;img alt="Virbela" src="Logos/NicePng_wordpress-logo-png_395752.png"&gt; 
611          &lt;/div&gt;
612
613        &lt;/div&gt;
614        &lt;div id="group3" class = "groups"&gt;
615          &lt;h2 id="group3h2"&gt;Group 3 - Websites used at Delphi&lt;/h2&gt;
616          &lt;ul&gt;
617            &lt;dt&gt;GitHub&lt;/dt&gt;
618              &lt;dd class="showLinks link" id="gitHub"&gt;https://github.com&lt;/dd&gt;  
619            &lt;dt&gt;Google Meet&lt;/dt&gt;
620              &lt;dd class="showLinks link" id="googleMeet"&gt;https://meet.google.com&lt;/dd&gt;
621            &lt;dt&gt;Slack&lt;/dt&gt;
622              &lt;dd class="showLinks link" id="slack"&gt;https://slack.com&lt;/dd&gt;
623            &lt;dt&gt;Wrike&lt;/dt&gt;
624              &lt;dd class="showLinks link" id="wrike"&gt;https://wrike.com&lt;/dd&gt;    
625          &lt;/ul&gt;
626          &lt;button id="showLinksButton"&gt;Show Links&lt;/button&gt;
627        &lt;/div&gt;
628        &lt;div id="group4" class = "groups"&gt;
629          &lt;h2 id="group4h2"&gt;Group 4 - Aerospace Companies&lt;/h2&gt;
630
631          &lt;ul id="aviationLinks"&gt;
632            &lt;li class = "cycle link" id="airbus"&gt;airbus.com&lt;/li&gt; 
633            &lt;li class = "cycle link" id="boeing"&gt;boeing.com&lt;/li&gt;
634            &lt;li class = "cycle link" id="lockheedMartin"&gt;lockheedmartin.com&lt;/li&gt;
635            &lt;li class = "cycle link" id="rtx"&gt;rtx.com&lt;/li&gt;
636            &lt;li class = "cycle link" id="geAviation"&gt;geaviation.com&lt;/li&gt;
637            &lt;li class = "cycle link" id="safran"&gt;safran-group.com&lt;/li&gt;
638            &lt;li class = "cycle link" id="leonardo"&gt;leonardocompany.com&lt;/li&gt;
639            &lt;li class = "cycle link" id="baseSystems"&gt;baesystems.com&lt;/li&gt;
640          &lt;/ul&gt;
641        &lt;/div&gt;
642      &lt;/div&gt;
643    &lt;/div&gt;
644  &lt;/body&gt;
645&lt;/html&gt;

Source https://stackoverflow.com/questions/70407246

QUESTION

In which case the SLAM technique is used?

Asked 2022-Jan-04 at 07:26

I am doing a study related to the field of augmented reality, and especially related to Google's ARCore technology. I would like to know if the SLAM method is required for model-based tracking. It seems obvious to me that it is not used in this case, but I could not find any article to confirm this. My second question is similar to the first one and is related to the Azure Spatial Anchors technology. This technology has the ability to recognize a scene that has been visualized during a previous session. In a way, the Azure Spatial Anchors technology reminds me a little bit of the model based tracking technology, knowing that the model based tracking has the ability to recognize a 3D object that has been previously recorded. So, in the same way I was wondering if the use of the Azure Spatial Anchors technology requires the use of the slam method ?

ANSWER

Answered 2022-Jan-04 at 01:42

Have a look at Frequently asked questions about Azure Spatial Anchors

Azure Spatial Anchors depends on mixed reality / augmented reality trackers. These trackers perceive the environment with cameras and track the device in 6-degrees-of-freedom (6DoF) as it moves through the space.

Given a 6DoF tracker as a building block, Azure Spatial Anchors allows you to designate certain points of interest in your real environment as "anchor" points. You might, for example, use an anchor to render content at a specific place in the real-world.

When you create an anchor, the client SDK captures environment information around that point and transmits it to the service. If another device looks for the anchor in that same space, similar data transmits to the service. That data is matched against the environment data previously stored. The position of the anchor relative to the device is then sent back for use in the application.

...

For each point in the sparse point cloud, we transmit and store a hash of the visual characteristics of that point. The hash is derived from, but does not contain, any pixel data.

There is disclosure in Microsoft Research Blog that the same type of visual simultaneous localization and mapping (SLAM) algorithms are being used with Azure Spatial Anchors: Azure Spatial Anchors: How it works

For further details on the algorithm under NDA you can Open a tech support ticket.

Source https://stackoverflow.com/questions/70548210

QUESTION

Why does my video only play sound and no video with ARJS?

Asked 2021-Dec-13 at 14:28

I'm building an Augmented Reality app with ARJS. I'm using an image as a marker and it seems to be working. The goal is to play a video when the image tracker detects the correct image, however, it plays only the audio and not the whole video.

index.html

1&lt;!DOCTYPE html&gt;
2&lt;html lang=&quot;en&quot;&gt;
3
4&lt;head&gt;
5  &lt;meta charset=&quot;UTF-8&quot;&gt;
6  &lt;meta name=&quot;apple-mobile-web-app-capable&quot; content=&quot;yes&quot;&gt;
7  &lt;link rel=&quot;stylesheet&quot; href=&quot;css/styles.css&quot;&gt;
8  &lt;script src=&quot;./js/image-tracker/aframe-master.min.js&quot;&gt;&lt;/script&gt;
9  &lt;script src=&quot;./js/image-tracker/aframe-ar-nft.js&quot;&gt;&lt;/script&gt;
10  &lt;title&gt;Test&lt;/title&gt;
11  &lt;script&gt;
12    AFRAME.registerComponent('controller', {
13        init: function() {
14          this.toggle = false;
15          this.video = document.querySelector('#video');
16          this.video.pause();
17        },
18
19        tick: function() {
20          if (this.el.object3D.visible === true) {
21            if (!this.toggle) {
22              this.toggle = true;
23              this.video.play();
24            }
25          } else {
26            this.toggle = false;
27            this.video.pause();
28          }
29        }
30      })
31  &lt;/script&gt;
32&lt;/head&gt;
33
34&lt;body&gt;
35  &lt;div class=&quot;arjs-loader&quot;&gt;
36    &lt;div&gt;Loading, please wait...&lt;/div&gt;
37  &lt;/div&gt;
38  &lt;a-scene
39    vr-mode-ui=&quot;enabled: false;&quot;
40    renderer=&quot;logarithmicDepthBuffer: true;&quot;
41    embedded
42    arjs=&quot;trackingMethod: best; sourceType: webcam;debugUIEnabled: false;&quot;
43  &gt;
44    &lt;a-assets&gt;
45      &lt;video id=&quot;video&quot; src=&quot;http://localhost:5000/assets/animation.mp4&quot; webkit-playsinline playsinline&gt;&lt;/video&gt;
46    &lt;/a-assets&gt;
47
48    &lt;a-nft
49      controller
50      type=&quot;nft&quot;
51      url=&quot;./image_descriptors/car&quot;
52      smooth=&quot;true&quot;
53      smoothCount=&quot;10&quot;
54      smoothTolerance=&quot;0.01&quot;
55      smoothThreshold=&quot;5&quot;
56    &gt;
57      &lt;a-video
58        width=&quot;1.75&quot;
59        height=&quot;2&quot;
60        position=&quot;200 0 -10&quot;
61        rotation=&quot;0 90 0&quot;
62        src=&quot;#video&quot;
63      &gt;&lt;/a-video&gt;
64    &lt;/a-nft&gt;
65    &lt;a-entity camera&gt;&lt;/a-entity&gt;
66  &lt;/a-scene&gt;
67&lt;/body&gt;
68&lt;/html&gt;
69

ANSWER

Answered 2021-Dec-13 at 14:28

There could be multiple reasons, here are some of them:

  1. Make sure there are no console errors and the scene loads properly (your sandbox gave me out of memory!!! issues, also there were some CORS issues).

  2. Make sure that the video is placed on top of the marker. I'd use an oversized box (or the inspector) to find out where is the item, and adjust the position / scale.

I've made NFT descriptors with your car.jpg resized to 1024x1024, and it seems to be working link to the forked sandbox with new descriptors :

enter image description here

Source https://stackoverflow.com/questions/70113819

QUESTION

How to fix AR connected issue in my device?

Asked 2021-Nov-23 at 13:58

I am developing a website related to Augmented Reality. But my mobile phone (Samsung Galaxy M02S) is not supported AR. When I try to install ARcore, google play store show an error. an error which was show google play store

So I installed ARcore using apk and now this app was installed. After that, I checked my mobile phone AR was supported or not. The below notification was shown when I try to see AR.

After installed ARcore using apk

How I fix this issue and have any other way to install ARcore into my phone?

ANSWER

Answered 2021-Nov-23 at 13:58

AR Core requires some specific hardware to work. You can check the list of supported devices here. No amount of side loading will help because this is a hardware requirement issue. Moreover AR Core is under active development even if you somehow install a version that might work that version will soon be deprecated and you will start getting the popup saying you need to update.

Kindly use a device that is part of supported list or an Emulator that supports this. IMHO it is best to develop using a device that has support from AR Core team.

Source https://stackoverflow.com/questions/70081990

QUESTION

How to place a 3D model on top of a reference image with RealityKit?

Asked 2021-Nov-22 at 09:29

I want to place a 3D Model from the local device on top of the reference image when it's recognized. To achieve this I have tried the following:

  1. Adding the reference image to the session configuration:
1override func viewDidLoad() {
2    super.viewDidLoad()
3        
4    arView.session.delegate = self
5        
6    // Check if the device supports the AR experience
7    if (!ARConfiguration.isSupported) {
8        TLogger.shared.error_objc(&quot;Device does not support Augmented Reality&quot;)
9        return
10    }
11        
12    guard let qrCodeReferenceImage = UIImage(named: &quot;QRCode&quot;) else { return }
13    let detectionImages: Set&lt;ARReferenceImage&gt; = convertToReferenceImages([qrCodeReferenceImage])
14        
15    let configuration = ARWorldTrackingConfiguration()
16    configuration.detectionImages = detectionImages
17        
18    arView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
19}
20
  1. Using the ARSessionDelegate to get notified when the reference image was detected and placing the 3D model at the same position as his ARImageAnchor:
1override func viewDidLoad() {
2    super.viewDidLoad()
3        
4    arView.session.delegate = self
5        
6    // Check if the device supports the AR experience
7    if (!ARConfiguration.isSupported) {
8        TLogger.shared.error_objc(&quot;Device does not support Augmented Reality&quot;)
9        return
10    }
11        
12    guard let qrCodeReferenceImage = UIImage(named: &quot;QRCode&quot;) else { return }
13    let detectionImages: Set&lt;ARReferenceImage&gt; = convertToReferenceImages([qrCodeReferenceImage])
14        
15    let configuration = ARWorldTrackingConfiguration()
16    configuration.detectionImages = detectionImages
17        
18    arView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
19}
20func session(_ session: ARSession, didAdd anchors: [ARAnchor]) {
21    for anchor in anchors {
22        guard let imageAnchor = anchor as? ARImageAnchor else { return }
23        let position = imageAnchor.transform
24
25        addEntity(self.localModelPath!, position)
26    }
27}
28
1override func viewDidLoad() {
2    super.viewDidLoad()
3        
4    arView.session.delegate = self
5        
6    // Check if the device supports the AR experience
7    if (!ARConfiguration.isSupported) {
8        TLogger.shared.error_objc(&quot;Device does not support Augmented Reality&quot;)
9        return
10    }
11        
12    guard let qrCodeReferenceImage = UIImage(named: &quot;QRCode&quot;) else { return }
13    let detectionImages: Set&lt;ARReferenceImage&gt; = convertToReferenceImages([qrCodeReferenceImage])
14        
15    let configuration = ARWorldTrackingConfiguration()
16    configuration.detectionImages = detectionImages
17        
18    arView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
19}
20func session(_ session: ARSession, didAdd anchors: [ARAnchor]) {
21    for anchor in anchors {
22        guard let imageAnchor = anchor as? ARImageAnchor else { return }
23        let position = imageAnchor.transform
24
25        addEntity(self.localModelPath!, position)
26    }
27}
28func addEntity(_ modelPath: URL, _ position: float4x4) {
29    // Load 3D Object as Entity
30    let entity = try! Entity.load(contentsOf: modelPath)
31        
32    // Create the Anchor which gets added to the AR Scene
33    let anchor = AnchorEntity(world: position)
34    anchor.addChild(entity)
35    anchor.transform.matrix = position
36    arView.scene.addAnchor(anchor)
37}
38

However, whenever I try to place the anchor including my 3D model (the entity) at a specific position, it doesn't appear in the arView. It seems like the model is getting loaded though since a few frames are getting lost when executing the addEntity function. When I don't specifically set the anchors position the model appears in front of the camera.

Can anyone lead me in the right direction here?

ANSWER

Answered 2021-Nov-20 at 18:44
Solution I

To make your code work properly, remove this line:

1override func viewDidLoad() {
2    super.viewDidLoad()
3        
4    arView.session.delegate = self
5        
6    // Check if the device supports the AR experience
7    if (!ARConfiguration.isSupported) {
8        TLogger.shared.error_objc(&quot;Device does not support Augmented Reality&quot;)
9        return
10    }
11        
12    guard let qrCodeReferenceImage = UIImage(named: &quot;QRCode&quot;) else { return }
13    let detectionImages: Set&lt;ARReferenceImage&gt; = convertToReferenceImages([qrCodeReferenceImage])
14        
15    let configuration = ARWorldTrackingConfiguration()
16    configuration.detectionImages = detectionImages
17        
18    arView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
19}
20func session(_ session: ARSession, didAdd anchors: [ARAnchor]) {
21    for anchor in anchors {
22        guard let imageAnchor = anchor as? ARImageAnchor else { return }
23        let position = imageAnchor.transform
24
25        addEntity(self.localModelPath!, position)
26    }
27}
28func addEntity(_ modelPath: URL, _ position: float4x4) {
29    // Load 3D Object as Entity
30    let entity = try! Entity.load(contentsOf: modelPath)
31        
32    // Create the Anchor which gets added to the AR Scene
33    let anchor = AnchorEntity(world: position)
34    anchor.addChild(entity)
35    anchor.transform.matrix = position
36    arView.scene.addAnchor(anchor)
37}
38anchor.transform.matrix = position
39

enter image description here

@TimLangner – "...But I want to make the model appear on top of the reference image and not at any other location..."

As you can see, my test sphere has appeared on top of the reference image. When changing its position, remember that the Y-axis of the image anchor is directed towards the camera if the QR is vertical, and is directed up if the QR code is on a horizontal surface.

Make sure, a pivot point is located where it should.

In my case (you can see that I'm using AppClipCode), to move sphere 30 cm up, I have to move along negative Z direction.

1override func viewDidLoad() {
2    super.viewDidLoad()
3        
4    arView.session.delegate = self
5        
6    // Check if the device supports the AR experience
7    if (!ARConfiguration.isSupported) {
8        TLogger.shared.error_objc(&quot;Device does not support Augmented Reality&quot;)
9        return
10    }
11        
12    guard let qrCodeReferenceImage = UIImage(named: &quot;QRCode&quot;) else { return }
13    let detectionImages: Set&lt;ARReferenceImage&gt; = convertToReferenceImages([qrCodeReferenceImage])
14        
15    let configuration = ARWorldTrackingConfiguration()
16    configuration.detectionImages = detectionImages
17        
18    arView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
19}
20func session(_ session: ARSession, didAdd anchors: [ARAnchor]) {
21    for anchor in anchors {
22        guard let imageAnchor = anchor as? ARImageAnchor else { return }
23        let position = imageAnchor.transform
24
25        addEntity(self.localModelPath!, position)
26    }
27}
28func addEntity(_ modelPath: URL, _ position: float4x4) {
29    // Load 3D Object as Entity
30    let entity = try! Entity.load(contentsOf: modelPath)
31        
32    // Create the Anchor which gets added to the AR Scene
33    let anchor = AnchorEntity(world: position)
34    anchor.addChild(entity)
35    anchor.transform.matrix = position
36    arView.scene.addAnchor(anchor)
37}
38anchor.transform.matrix = position
39entity.position.z = anchor.position.z - 0.3
40


Solution II

In my opinion, the most simple and productive solution would be to use the RealityKit's native AnchorEntity(.image(...)), without the need of implementing ARImageAnchor in delegate's method.

1override func viewDidLoad() {
2    super.viewDidLoad()
3        
4    arView.session.delegate = self
5        
6    // Check if the device supports the AR experience
7    if (!ARConfiguration.isSupported) {
8        TLogger.shared.error_objc(&quot;Device does not support Augmented Reality&quot;)
9        return
10    }
11        
12    guard let qrCodeReferenceImage = UIImage(named: &quot;QRCode&quot;) else { return }
13    let detectionImages: Set&lt;ARReferenceImage&gt; = convertToReferenceImages([qrCodeReferenceImage])
14        
15    let configuration = ARWorldTrackingConfiguration()
16    configuration.detectionImages = detectionImages
17        
18    arView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
19}
20func session(_ session: ARSession, didAdd anchors: [ARAnchor]) {
21    for anchor in anchors {
22        guard let imageAnchor = anchor as? ARImageAnchor else { return }
23        let position = imageAnchor.transform
24
25        addEntity(self.localModelPath!, position)
26    }
27}
28func addEntity(_ modelPath: URL, _ position: float4x4) {
29    // Load 3D Object as Entity
30    let entity = try! Entity.load(contentsOf: modelPath)
31        
32    // Create the Anchor which gets added to the AR Scene
33    let anchor = AnchorEntity(world: position)
34    anchor.addChild(entity)
35    anchor.transform.matrix = position
36    arView.scene.addAnchor(anchor)
37}
38anchor.transform.matrix = position
39entity.position.z = anchor.position.z - 0.3
40AnchorEntity(.image(group: &quot;GroupName&quot;, name: &quot;forModel&quot;))
41

Here's a code:

1override func viewDidLoad() {
2    super.viewDidLoad()
3        
4    arView.session.delegate = self
5        
6    // Check if the device supports the AR experience
7    if (!ARConfiguration.isSupported) {
8        TLogger.shared.error_objc(&quot;Device does not support Augmented Reality&quot;)
9        return
10    }
11        
12    guard let qrCodeReferenceImage = UIImage(named: &quot;QRCode&quot;) else { return }
13    let detectionImages: Set&lt;ARReferenceImage&gt; = convertToReferenceImages([qrCodeReferenceImage])
14        
15    let configuration = ARWorldTrackingConfiguration()
16    configuration.detectionImages = detectionImages
17        
18    arView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
19}
20func session(_ session: ARSession, didAdd anchors: [ARAnchor]) {
21    for anchor in anchors {
22        guard let imageAnchor = anchor as? ARImageAnchor else { return }
23        let position = imageAnchor.transform
24
25        addEntity(self.localModelPath!, position)
26    }
27}
28func addEntity(_ modelPath: URL, _ position: float4x4) {
29    // Load 3D Object as Entity
30    let entity = try! Entity.load(contentsOf: modelPath)
31        
32    // Create the Anchor which gets added to the AR Scene
33    let anchor = AnchorEntity(world: position)
34    anchor.addChild(entity)
35    anchor.transform.matrix = position
36    arView.scene.addAnchor(anchor)
37}
38anchor.transform.matrix = position
39entity.position.z = anchor.position.z - 0.3
40AnchorEntity(.image(group: &quot;GroupName&quot;, name: &quot;forModel&quot;))
41import UIKit
42import RealityKit
43
44class ViewController: UIViewController {
45    
46    @IBOutlet var arView: ARView!
47    
48    override func viewDidLoad() {
49        super.viewDidLoad()
50        
51        let entity = ModelEntity(mesh: .generateSphere(radius: 0.1))
52        let anchor = AnchorEntity(.image(group: &quot;AR Resources&quot;, 
53                                          name: &quot;appClipCode&quot;))
54        anchor.addChild(entity)
55        
56        entity.position.z = anchor.position.z - 0.3
57        arView.scene.anchors.append(anchor)
58    }
59}
60

Source https://stackoverflow.com/questions/69991814

QUESTION

ARKit does not recognize reference images

Asked 2021-Nov-16 at 09:58

I'm trying to place a 3D model on top of a recognized image with ARKit and RealityKit - all programmatically. Before I start the ARView I'm downloading the model I want to show when the reference image is detected.

This is my current setup:

1override func viewDidLoad() {
2    super.viewDidLoad()
3    
4    arView.session.delegate = self
5    
6    // Check if the device supports the AR experience
7    if (!ARConfiguration.isSupported) {
8        TLogger.shared.error_objc(&quot;Device does not support Augmented Reality&quot;)
9        return
10    }
11    
12    guard let qrCodeReferenceImage = UIImage(named: &quot;QRCode&quot;) else { return }
13    let detectionImages: Set&lt;ARReferenceImage&gt; = convertToReferenceImages([qrCodeReferenceImage])
14    
15    let configuration = ARWorldTrackingConfiguration()
16    configuration.detectionImages = detectionImages
17    
18    arView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
19}
20

I use the ARSessionDelegate to get notified when a new image anchor was added which means the reference image got detected:

1override func viewDidLoad() {
2    super.viewDidLoad()
3    
4    arView.session.delegate = self
5    
6    // Check if the device supports the AR experience
7    if (!ARConfiguration.isSupported) {
8        TLogger.shared.error_objc(&quot;Device does not support Augmented Reality&quot;)
9        return
10    }
11    
12    guard let qrCodeReferenceImage = UIImage(named: &quot;QRCode&quot;) else { return }
13    let detectionImages: Set&lt;ARReferenceImage&gt; = convertToReferenceImages([qrCodeReferenceImage])
14    
15    let configuration = ARWorldTrackingConfiguration()
16    configuration.detectionImages = detectionImages
17    
18    arView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
19}
20func session(_ session: ARSession, didAdd anchors: [ARAnchor]) {
21    print(&quot;Hello&quot;)
22    for anchor in anchors {
23        guard let imageAnchor = anchor as? ARImageAnchor else { return }
24        let referenceImage = imageAnchor.referenceImage
25        
26        addEntity(self.localModelPath!)
27    }
28}
29

However, the delegate method never gets called while other delegate functions like func session(ARSession, didUpdate: ARFrame) are getting called so I assume that the session just doesn't detect the image. The image resolution is good and the printed image the big so it should definitely get recognized by the ARSession. I also checked that the image has been found before adding it to the configuration.

Can anyone lead me in the right direction here?

ANSWER

Answered 2021-Nov-16 at 09:58

It looks like you have your configuration set up correctly. Your delegate-function should be called when the reference image is recognized. Make sure your configuration isn't overwritten at any point in your code.

Source https://stackoverflow.com/questions/69973471

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Augmented Reality

Tutorials and Learning Resources are not available at this moment for Augmented Reality

Share this Page

share link

Get latest updates on Augmented Reality