why is the moving particulas not being shown : <?php sessionstart(); if…
- User
why is the moving particulas not being shown : <?php session_start();
if (!isset($_SESSION['user_id'])) { header("Location: register.php"); exit; } ?>
<a href="efeedback.html" aria-label="ارسال بازخورد" style=" position: fixed; bottom: 30px; left: 30px; background: #6366f1; color: white; padding: 14px 20px; border-radius: 40px; font-weight: 700; font-family: Tahoma, Arial, sans-serif; box-shadow: 0 6px 15px rgba(99,102,241,0.6); text-decoration: none; z-index: 1000; transition: background-color 0.3s ease; " onmouseover="this.style.background='#7c3aed'" onmouseout="this.style.background='#6366f1'"
💬 بازخورد دهید
<div class="welcome-message" aria-live="polite" aria-atomic="true"> خوش آمدید، <span class="username"><?php echo htmlspecialchars($_SESSION['full_name']); ?></span>! </div> <div> <a href="logout.php" class="logout-link" aria-label="خارج شدن از حساب کاربری"> <button type="button" class="logout-btn"> <svg viewBox="0 0 512 512" aria-hidden="true" focusable="false"> <path d="M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"></path> </svg> خروج </button> </a> </div><!-- Upload Section --> <section class="card no-print" aria-label="آپلود فایل اکسل"> <label for="excelFile" class="file-upload-label" aria-describedby="upload-instructions" tabindex="0"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" aria-hidden="true" focusable="false"> <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> <polyline points="17 8 12 3 7 8"/> <line x1="12" y1="3" x2="12" y2="15"/> </svg> <span id="upload-instructions">فایل اکسل دانش آموزان را انتخاب کنید</span> <input type="file" id="excelFile" accept=".xlsx, .xls" aria-label="انتخاب فایل اکسل" /> </label> <div class="action-buttons" role="group" aria-label="دکمههای عملیات فایل"> <button onclick="handleFile()" class="primary-button" id="processBtn" aria-live="polite" aria-busy="false"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true"> <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> <polyline points="7 10 12 15 17 10"/> <line x1="12" y1="15" x2="12" y2="3"/> </svg> پردازش اطلاعات </button> <button onclick="window.print()" id="printBtn" class="secondary-button" style="display:none;"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true"> <polyline points="6 9 6 2 18 2 18 9"/> <path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/> <rect x="6" y="14" width="12" height="8"/> </svg> چاپ گزارشات </button> </div> </section> <!-- Loading --> <div id="loadingIndicator" class="fixed z-50 flex hidden inset-0 flex-col items-center justify-center bg-white bg-opacity-95" role="alert" aria-live="assertive" aria-busy="true" aria-label="در حال پردازش اطلاعات"> <div class="loading-spinner"></div> <p>در حال پردازش اطلاعات...</p> </div> <!-- Search Section --><!-- Print Header --> <section class="print-only" style="display:none;"> <div class="print-header text-center py-5"> <div class="print-title">فرم هدایت تحصیلی دانش آموزان</div> <div class="print-subtitle mt-2">امیرارسلان ملکی</div> <div class="divider-indigo" style="margin: 12px auto 0;"></div> </div> </section> - Assistant
The reason the moving particles are not being shown is that the particles.js library itself is missing from your code.
In your code, you call the
particlesJS()function, which belongs to the particles.js library, but you never included it via a<script>tag. Without the library being loaded, theparticlesJS()function is undefined and no particles appear.
How to fix
Add the particles.js library CDN script before your script that calls
particlesJS():Add this inside your
<head>or just before your inline<script>that initializes particles:<script src="https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js"></script>
Example placement in your
<body>or<head>:<body> <div id="particles-js" style="position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: -1;"></div> <!-- Load particles.js library --> <script src="https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js"></script> <script> particlesJS('particles-js', { "particles": { "number": { "value": 60, "density": { "enable": true, "value_area": 800 } }, "color": { "value": "#ffffff" }, "shape": { "type": "circle" }, "opacity": { "value": 0.5, "random": false }, "size": { "value": 3, "random": true }, "line_linked": { "enable": true, "distance": 150, "color": "#ffffff", "opacity": 0.4, "width": 1 }, "move": { "enable": true, "speed": 2, "direction": "none", "random": false, "straight": false, "out_mode": "out" } }, "interactivity": { "detect_on": "canvas", "events": { "onhover": { "enable": true, "mode": "grab" }, "onclick": { "enable": true, "mode": "push" }, "resize": true }, "modes": { "grab": { "distance": 200, "line_linked": { "opacity": 1 } }, "push": { "particles_nb": 4 } } }, "retina_detect": true }); </script> ... </body>
Why this is necessary
- The
particlesJS()function is defined by the particles.js library. - Without including the library, you get an error (check your browser console for errors like
particlesJS is not defined). - Adding the script ensures the function is loaded and your particles effect will work.
Bonus: Check browser console
Open your browser devtools console and you may see errors like:Uncaught ReferenceError: particlesJS is not definedThis confirms the missing library problem.
Summary:
Add this script:<script src="https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js"></script>before the script block where you call
particlesJS()to make the moving particles appear. - The