update
Browse files- src/components/FontMap/FontMap.js +1 -1
- src/components/FontMap/components/AboutModal.js +1 -4
- src/components/FontMap/components/ActiveFont.js +0 -1
- src/components/FontMap/hooks/useTooltipOptimized.js +6 -1
- src/components/FontMap/hooks/useZoom.js +1 -1
- src/components/FontMap/styles/font-details.css +7 -3
src/components/FontMap/FontMap.js
CHANGED
|
@@ -30,7 +30,7 @@ const FontMap = ({ darkMode = false }) => {
|
|
| 30 |
const [filter, setFilter] = useState('all');
|
| 31 |
const [searchTerm, setSearchTerm] = useState('');
|
| 32 |
const [dilationFactor, setDilationFactor] = useState(0.055);
|
| 33 |
-
const [characterSize, setCharacterSize] = useState(1); // 1.5 / 5 = 0.3
|
| 34 |
const [variantSizeImpact, setVariantSizeImpact] = useState(false);
|
| 35 |
const [selectedFont, setSelectedFont] = useState(null);
|
| 36 |
const [hoveredFont, setHoveredFont] = useState(null);
|
|
|
|
| 30 |
const [filter, setFilter] = useState('all');
|
| 31 |
const [searchTerm, setSearchTerm] = useState('');
|
| 32 |
const [dilationFactor, setDilationFactor] = useState(0.055);
|
| 33 |
+
const [characterSize, setCharacterSize] = useState(1.5); // 1.5 / 5 = 0.3
|
| 34 |
const [variantSizeImpact, setVariantSizeImpact] = useState(false);
|
| 35 |
const [selectedFont, setSelectedFont] = useState(null);
|
| 36 |
const [hoveredFont, setHoveredFont] = useState(null);
|
src/components/FontMap/components/AboutModal.js
CHANGED
|
@@ -125,7 +125,7 @@ const AboutModal = ({ onClose, darkMode }) => {
|
|
| 125 |
This project is <strong>completely open source</strong> - you can explore the code, modify the parameters, or run it on your own font collection.
|
| 126 |
</p>
|
| 127 |
<p className="about-section-text">
|
| 128 |
-
The <strong>complete dataset</strong> is also open source, including all font metadata and positioning data.
|
| 129 |
</p>
|
| 130 |
<a href="https://huggingface.co/spaces/huggingface/fontmap" target="_blank" rel="noopener noreferrer" className="code-link">
|
| 131 |
View Source on Hugging Face →
|
|
@@ -135,9 +135,6 @@ const AboutModal = ({ onClose, darkMode }) => {
|
|
| 135 |
<p className="about-section-text">
|
| 136 |
This is a recreation of the original <strong>IDEO Font Map</strong> using modern machine learning techniques.
|
| 137 |
</p>
|
| 138 |
-
<p className="about-section-text">
|
| 139 |
-
All fonts are sourced from <a href="https://fonts.google.com" target="_blank" rel="noopener noreferrer" className="google-fonts-link">Google Fonts</a> and are also <strong>open source</strong>.
|
| 140 |
-
</p>
|
| 141 |
</div>
|
| 142 |
</div>
|
| 143 |
</div>
|
|
|
|
| 125 |
This project is <strong>completely open source</strong> - you can explore the code, modify the parameters, or run it on your own font collection.
|
| 126 |
</p>
|
| 127 |
<p className="about-section-text">
|
| 128 |
+
The <strong>complete dataset</strong> is also open source, including all font metadata and positioning data from <a href="https://fonts.google.com" target="_blank" rel="noopener noreferrer" className="google-fonts-link">Google Fonts</a>.
|
| 129 |
</p>
|
| 130 |
<a href="https://huggingface.co/spaces/huggingface/fontmap" target="_blank" rel="noopener noreferrer" className="code-link">
|
| 131 |
View Source on Hugging Face →
|
|
|
|
| 135 |
<p className="about-section-text">
|
| 136 |
This is a recreation of the original <strong>IDEO Font Map</strong> using modern machine learning techniques.
|
| 137 |
</p>
|
|
|
|
|
|
|
|
|
|
| 138 |
</div>
|
| 139 |
</div>
|
| 140 |
</div>
|
src/components/FontMap/components/ActiveFont.js
CHANGED
|
@@ -327,7 +327,6 @@ const ActiveFont = ({ selectedFont, fonts, darkMode, onClose, onFontSelect }) =>
|
|
| 327 |
height="32"
|
| 328 |
viewBox="0 0 24 24"
|
| 329 |
className="font-glyph-small"
|
| 330 |
-
style={{ transform: 'scale(1.5)' }}
|
| 331 |
>
|
| 332 |
<use
|
| 333 |
href={`#${getFontSymbolId(font.imageName || font.name)}`}
|
|
|
|
| 327 |
height="32"
|
| 328 |
viewBox="0 0 24 24"
|
| 329 |
className="font-glyph-small"
|
|
|
|
| 330 |
>
|
| 331 |
<use
|
| 332 |
href={`#${getFontSymbolId(font.imageName || font.name)}`}
|
src/components/FontMap/hooks/useTooltipOptimized.js
CHANGED
|
@@ -115,9 +115,14 @@ export const useTooltipOptimized = (darkMode) => {
|
|
| 115 |
const centerX = elementRect.left + (elementRect.width / 2);
|
| 116 |
const centerY = elementRect.top + (elementRect.height / 2);
|
| 117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
// Positionner le tooltip
|
| 119 |
let x = centerX - (tooltipRect.width / 2);
|
| 120 |
-
let y = centerY - tooltipRect.height -
|
| 121 |
|
| 122 |
// Ajuster si le tooltip sort de l'écran
|
| 123 |
const margin = 10;
|
|
|
|
| 115 |
const centerX = elementRect.left + (elementRect.width / 2);
|
| 116 |
const centerY = elementRect.top + (elementRect.height / 2);
|
| 117 |
|
| 118 |
+
// Calculer la distance proportionnelle au zoom
|
| 119 |
+
const currentScale = currentTransformRef.current.k || 1;
|
| 120 |
+
const baseDistance = 20;
|
| 121 |
+
const zoomAdjustedDistance = baseDistance * currentScale;
|
| 122 |
+
|
| 123 |
// Positionner le tooltip
|
| 124 |
let x = centerX - (tooltipRect.width / 2);
|
| 125 |
+
let y = centerY - tooltipRect.height - zoomAdjustedDistance;
|
| 126 |
|
| 127 |
// Ajuster si le tooltip sort de l'écran
|
| 128 |
const margin = 10;
|
src/components/FontMap/hooks/useZoom.js
CHANGED
|
@@ -133,7 +133,7 @@ export const useZoom = (svgRef, darkMode, useCSSTransform = false) => {
|
|
| 133 |
setIsTransitioning(true);
|
| 134 |
visualStateRef.current.isTransitioning = true;
|
| 135 |
|
| 136 |
-
const scale =
|
| 137 |
const centerX = width / 2;
|
| 138 |
const centerY = height / 2;
|
| 139 |
|
|
|
|
| 133 |
setIsTransitioning(true);
|
| 134 |
visualStateRef.current.isTransitioning = true;
|
| 135 |
|
| 136 |
+
const scale = 2.5;
|
| 137 |
const centerX = width / 2;
|
| 138 |
const centerY = height / 2;
|
| 139 |
|
src/components/FontMap/styles/font-details.css
CHANGED
|
@@ -521,10 +521,12 @@
|
|
| 521 |
align-items: center;
|
| 522 |
gap: var(--spacing-md);
|
| 523 |
padding: var(--spacing-md);
|
|
|
|
| 524 |
border-bottom: 1px solid var(--color-border-primary);
|
| 525 |
}
|
| 526 |
|
| 527 |
.dark-mode .active-font-content {
|
|
|
|
| 528 |
border-bottom-color: var(--color-border-primary-dark);
|
| 529 |
}
|
| 530 |
|
|
@@ -536,12 +538,14 @@
|
|
| 536 |
justify-content: center;
|
| 537 |
width: 120px;
|
| 538 |
height: 120px;
|
| 539 |
-
|
| 540 |
border-radius: var(--border-radius-sm);
|
|
|
|
| 541 |
}
|
| 542 |
|
| 543 |
.dark-mode .font-letter-preview {
|
| 544 |
-
background: var(--color-bg-
|
|
|
|
| 545 |
}
|
| 546 |
|
| 547 |
.font-letter-preview svg {
|
|
@@ -616,7 +620,7 @@
|
|
| 616 |
justify-content: center;
|
| 617 |
background: var(--color-bg-primary);
|
| 618 |
position: relative;
|
| 619 |
-
height:
|
| 620 |
}
|
| 621 |
|
| 622 |
.dark-mode .font-sentence-compact {
|
|
|
|
| 521 |
align-items: center;
|
| 522 |
gap: var(--spacing-md);
|
| 523 |
padding: var(--spacing-md);
|
| 524 |
+
background: var(--color-bg-secondary);
|
| 525 |
border-bottom: 1px solid var(--color-border-primary);
|
| 526 |
}
|
| 527 |
|
| 528 |
.dark-mode .active-font-content {
|
| 529 |
+
background: var(--color-bg-secondary-dark);
|
| 530 |
border-bottom-color: var(--color-border-primary-dark);
|
| 531 |
}
|
| 532 |
|
|
|
|
| 538 |
justify-content: center;
|
| 539 |
width: 120px;
|
| 540 |
height: 120px;
|
| 541 |
+
border: 1px solid var(--color-border-primary);
|
| 542 |
border-radius: var(--border-radius-sm);
|
| 543 |
+
background: var(--color-bg-primary);
|
| 544 |
}
|
| 545 |
|
| 546 |
.dark-mode .font-letter-preview {
|
| 547 |
+
background: var(--color-bg-primary-dark);
|
| 548 |
+
border: 1px solid var(--color-border-primary-dark);
|
| 549 |
}
|
| 550 |
|
| 551 |
.font-letter-preview svg {
|
|
|
|
| 620 |
justify-content: center;
|
| 621 |
background: var(--color-bg-primary);
|
| 622 |
position: relative;
|
| 623 |
+
height: 100px; /* Hauteur fixe des images SVG de sentence (165x49) */
|
| 624 |
}
|
| 625 |
|
| 626 |
.dark-mode .font-sentence-compact {
|